<!--// 

	/* master roll over code								 
	 Author : Daniel Nolan
	 http://www.bleedingego.co.uk/webdev.php
	 add the attribute class="imgover" to images that requires a mouseover 
     this image must be named exactly the same as the original image,      
	 but it needs _o on the end of the name in the same directory as the   
	 original. 															 
	*/

/* code for supplements drop down */

function gotosite(site) {
                  if (site != "") {
             parent.location=site; }
}
             

function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');
	
	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_over'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_over'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

window.onload = initRollovers;


/* Cookie: Get, Set*/
 
function getCookie(NameOfCookie) { 
	if (document.cookie.length > 0) {
		begin = document.cookie.indexOf(NameOfCookie+"="); 
		if (begin != -1) {
			begin += NameOfCookie.length+1;
			end = document.cookie.indexOf(";", begin);
			if (end == -1) {
				end = document.cookie.length; }
			return unescape(document.cookie.substring(begin, end));
		} 
	}
	return null; 
}



function setCookie(NameOfCookie, value, expiredays) {
	var ExpireDate = new Date ();
	ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
	document.cookie = NameOfCookie + "=" + escape(value) + 
		((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}
	
	//-->

