function blank()
        {
            if(document.getElementById("q").value=="Search 7,650,583 Presentations")
            {
            document.getElementById("q").value="";
            }

        }

        function blank2()
        {
            document.getElementById("q").style.color="black";
            if(document.getElementById("q").value=="Search 7,650,583 Presentations")
            {
            document.getElementById("q").value="";
            }
        }

        function blank1()
        {
            if(document.getElementById("q").value=="")
            {
            document.getElementById("q").style.color="gray";
            document.getElementById("q").value="Search 7,650,583 Presentations";
            }

        }

function checksearch(a,b,c,e)
{
//alert(a);
document.getElementById(a).style.color="#AEAEAE";
document.getElementById(b).style.color="#FFFFFF";
document.getElementById(c).style.color="#FFFFFF";
document.forms[0].HiddenField1.value=e;
//alert(document.getElementById("HiddenField1").Value)ctl00_header_HiddenField1;
}
function checksearchm(a,b,c,e)
{
//alert(a);
document.getElementById(a).style.color="#DEDFE2";
document.getElementById(b).style.color="#FFFFFF";
document.getElementById(c).style.color="#FFFFFF";
document.getElementById("ctl00_Header_HiddenField1").value=e;
return false;
}
function checksearchm1(a,b,c,e)
{
//alert(a);
document.getElementById(a).style.color="#DEDFE2";
document.getElementById(b).style.color="#FFFFFF";
document.getElementById(c).style.color="#FFFFFF";
document.getElementById("ctl00_HiddenField1").value=e;
createCookie("search_type",e,1);
return false;

}
function $(id)
{
return document.getElementById(id);
}
function Visits(ArticleID,URL){
       //alert(ArticleID);
      //str='ajaxpage_get('DownloadCount_ajax.aspx?CHECKED=1&ArticleID='+ArticleID, 'sp_Enabledisablemember', '')';
       ajaxpage_get('DownloadCount_ajax.aspx?ArticleID='+ArticleID, 'sp_Enabledisablemember', '','');
      if(ArticleID==2451 )
       {
       window.open('ViewSlide1.aspx/'+URL,'slidesonline','status=no,width=550,height=530,scrollbars=yes,menubar=yes,resizable=yes,toolbar=yes');        
       }
        else if(ArticleID==5940 || ArticleID==197028)
       {
       window.open('Pathology Library.aspx?url='+URL,'slidesonline','status=no,width=550,height=530,scrollbars=yes,menubar=yes,resizable=yes,toolbar=yes');        
       }
       else
       {
       window.open('ViewSlides.aspx/'+URL,'slidesonline','status=no,width=550,height=530,scrollbars=yes,menubar=yes,resizable=yes,toolbar=yes');        
   }
   }
    
     function setRating(ArticleID,Rating, bit){
       for(i=0;i<5;i++)
        {
           var loop=i+1;
           var a=document.getElementById(ArticleID + "RatingIcon-" + loop );
           if(i<Rating){            
               a.className="icncuteon";             
             }else{
              a.className="icncuteoff";
            }
        }        
      ajaxpage_get('DownloadCount_ajax.aspx?Rating='+ Rating +'&ArticleID='+ArticleID, 'sp_Enabledisablemember', '','');
  } 
    function ViewInfo(Info)
    {                         
                          
//               
             
               div_ShowInfo.style.left = event.x + document.body.scrollLeft;
           	   var y=event.y;
           	   
           	   ScrollMonitor(y);         	           	   
               div_ShowInfo.innerHTML  =Info ;
               div_ShowInfo.style.display='block';  
               
    }
         
      function hidediv()
       {
            div_ShowInfo.style.display='none';  
            //alert('Info');
       }
       
        function ScrollMonitor( y)
        {
         // Find out how far the user has scrolled (method varies...)
                 var ScrollAmount;
                if (document.documentElement && document.documentElement.scrollTop){
                 // PC IE6 strict, Mac IE 5, Mac Firefox strict
                  ScrollAmount = document.documentElement.scrollTop;
                 }else if (document.body && document.body.scrollTop){
                  // Safari, PC IE6 trans, Mac Firefox trans                            
                  ScrollAmount = document.body.scrollTop;
                  //alert("safari");
                  //alert(ScrollAmount);
                  }else if (window.scrollY){ 
                    // Mozilla browsers (incl. Firefox and Safari) understand this one,
                    // though they've probably already got the value.
                    ScrollAmount = window.scrollY;
                    }
           
            div_ShowInfo.style.top = y;
        }
        
function createCookie(name,value,days) 
{
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) 
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) 
{
	createCookie(name,"",-1);
}

function checksearchtype()
{
    var search_type=readCookie('search_type');
    if(search_type=='All')
    {
         document.getElementById('div_journal').style.color="#aeaeae";
         document.getElementById('div_slide').style.color="#ffffff";
         document.getElementById('div_ebook').style.color="#ffffff";
         document.getElementById("ctl00_HiddenField1").value=search_type;
         
    }else if(search_type=='Slides')
    {
         document.getElementById('div_slide').style.color="#aeaeae";
         document.getElementById('div_journal').style.color="#ffffff";
         document.getElementById('div_ebook').style.color="#ffffff";
         document.getElementById("ctl00_HiddenField1").value=search_type;
         
    }else if(search_type=='ebooks')
    {
         document.getElementById('div_ebook').style.color="#aeaeae";
         document.getElementById('div_slide').style.color="#ffffff";
         document.getElementById('div_journal').style.color="#ffffff";
         document.getElementById("ctl00_HiddenField1").value=search_type;
    }
}

function clear()
        {
            if(document.getElementById("ctl00_q").value="Template Search")
            {
            document.getElementById("ctl00_q").value="";
            }

        }

        function clear2()
        {
            document.getElementById("ctl00_q").style.color="gray";
            if(document.getElementById("ctl00_q").value="Template Search")
            {
            document.getElementById("ctl00_q").value="";
            }
        }

        function clear1()
        {
            if(document.getElementById("ctl00_q").value="")
            {
            document.getElementById("ctl00_q").style.color="gray";
            document.getElementById("ctl00_q").value="Template Search";
            }

        }