// JavaScript Document

/*
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

*/
// this is the  Rollover Script 

	
	
	
/*
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

*/
// this is the Function for linking to outside sites
//   Gives required warning when link is clicked
		
		function OutsideLink(URL)	
		{
		   var siteName = "TibotecTherapeutic";
		   var writeURL = URL
		   if (URL.length > 60)
		   {
			   writeURL = URL.substr(0, 60) + "...";
		   }
		   if (confirm("\nThank you for visiting www." + siteName + ".com.\n\nBy clicking 'OK' you will be taken to: \n\n" + writeURL +"\n\nA Web site to which our Privacy Policy \ndoes not apply.\n\nYou are solely responsible for your \ninteractions with such Web sites.\n\n"))
		   {
			   window.open(URL,"_blank");
		   }
				
		}
	/***********************************************/
	//	Function for preloading images
	
	function preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.p) d.p=new Array();
		var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
	}
	
/*
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

*/
// this is the COOKIE CHECKING / WRITING / CLEARING  SCRIPT
//	


		function checkCookie(cookName)
		{  // THIS WILL RETURN THE COOKIE VALUE OR the String "NoSuchCookie"
			var allcookies = document.cookie;
			//alert("cookie is: " + allcookies);
			var pos = allcookies.indexOf(cookName + "=");
			if(pos != -1)
			{
				var start = pos + cookName.length + 1;
				var end = allcookies.indexOf(";",start);	
				if(end == -1)
				{ 
					end = allcookies.length;
				}
				var value = allcookies.substring(start, end);
				//alert(cookName +  " cookie value is: " + value);
				return value;
				
			}
			else
			{
				//alert("no such cookie as " + cookName);
				return "NoSuchCookie";
			}

		}


		function setCook(name, value, days)
		{
			var nextYear = new Date();
			nextYear.setUTCDate( parseInt( nextYear.getDate() ) + parseInt(days) );
			document.cookie = name + "=" + value + ";expires=" + nextYear.toGMTString() + ";path=/;";
		}



		function deleteCookie(cookName)
		{
			if (checkCookie(cookName) != "NoSuchCookie")
			{
				var xmas = new Date(2001, 11, 25)
				document.cookie= cookName + "=0;expires=" + xmas.toGMTString() + ";path=/;";
				alert("Cookie " + cookName + " deleted succesfully.");
			}
			else
			{
				alert("Could not find cookie " + cookName + ".");
			}

		}







/*
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

*/
// these are the basic WINDOW SCRIPTS, Print, Open Browser
//	

		
		function printWindow() 
		{
		   bV = parseInt(navigator.appVersion)
		   if (bV >= 4) window.print()
		}
		
		function openBrWindow(theURL,winName,scrollable,sizable,menus,width,height) 
		{
		  var features  = "fullscreen=no,";
		  features += "toolbar="+menus+",";
		  features += "location="+menus+",";
		  features += "directories=no,";
		  features += "status="+menus+",";
		  features += "menubar="+menus+",";
		  features += "scrollbars=" + scrollable +",";
		  features += "resizable=" + sizable + ",";
		  features += "width=" + width + ",";
		  features += "height=" + height ;
		  openPopUp2(theURL,winName,features);
		}
		
		function openPopUp2(url,name,features)
		{
			var popup;
			popup = window.open(url,name,features); 
		}
		
		

		
		
		
/*
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
*/