function startList() {	if (document.all&&document.getElementById) {		navRoot = document.getElementById("nav");		for (i=0; i<navRoot.childNodes.length; i++) {			node = navRoot.childNodes[i];			if (node.nodeName=="LI") {				node.onmouseover=function() {					this.className+=" over";				}				node.onmouseout=function() {					this.className=this.className.replace(" over", "");				}			}		}	}}function popWindow(where,which) {	if (which == 1) {		window.open(where,"tacwin","menubar=no,status=no,toolbar=no,scrollbars=no,height=380,width=618");	} else if (which == 2) {		window.open(where,"mountwin","menubar=no,status=no,toolbar=no,scrollbars=no,height=100,width=180,top=200,left=200");	}	else if (which == 3) {		window.open(where,"vidwin","menubar=no,status=no,toolbar=no,scrollbars=no,height=357,width=600");	}	else {		window.open(where,"galwin","menubar=no,status=no,toolbar=no,scrollbars=no,height=400,width=550");	}}function popTimeline() {	window.open("timeline.php","timewin","menubar=no,status=no,toolbar=no,scrollbars=yes,height=617,width=780,top=200,left=200");}function validate(form) {	var f = form;	var missing = new Array();	var msg = "Please be sure to fill out all of the fields marked in red.";	if(f.id == "distributorform") {		if(checkButton(f.elements['agree']) == null) {			missing.push("agree");			missing.push("agree2");		}	}	for(i=0;i<f.elements.length;i++) {		if(f.elements[i].value.length < 1 && f.elements[i].className == "required") {			missing.push(f.elements[i].name);		}		if(f.elements[i].name == "email" && f.elements[i].className == "required") {			if(!validateEmail(f.elements[i].value)) {				missing.push(f.elements[i].name);				missing.length > 1 ? msg += " Also, please make sure you have entered a valid email address." : msg = "Please make sure you have entered a valid email address.";			}		}	}	if (missing.length > 0) {		labels = document.getElementsByTagName("LABEL");		for(h=0;h<labels.length;h++) {			labels[h].className = "";		}		for(j=0;j<missing.length;j++) {			document.getElementById(missing[j]).className = "required";		}		alert(msg);		return false;	}	else {		return true;	}}function checkButton(btn) {	var cnt = -1;    for (var i=btn.length-1; i > -1; i--) {        if (btn[i].checked) {cnt = i; i = -1;}    }    if (cnt > -1) return btn[cnt].value;    else return null;}function validateEmail(str) {	return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);}function popPicture(who) {	if (document.getElementById) {		for (i=0;i<document.getElementById(who).childNodes.length;i++) {			if (document.getElementById(who).childNodes[i].nodeName == "IMG") {				var st = new String(document.getElementById(who).childNodes[i].src);				var newpic = st.replace(".gif",".jpg");				window.open(newpic,"picwin","menubar=no,status=no,scrollbars=yes,toolbar=no,width=620,height=340");			}		}	}}function showProductImg(who) {	if(document.getElementById("productmain") && document.getElementById("thumbs")) {		document.getElementById("productmain").src = who.href;		var x = document.getElementById("thumbs").getElementsByTagName("LI");		for(i=0;i<x.length;i++) {			x[i].className = "";		}		who.parentNode.className = "current";	}}function setPane(who,where) {	if(document.getElementById("productspecs")) {				var x = document.getElementById("tabs").getElementsByTagName("LI");		for(i=0;i<x.length;i++) {			x[i].className = "";		}				document.getElementById("productimages").style.display = "none";		document.getElementById("productspecs").style.display = "none"				document.getElementById(who).style.display = "block";		where.parentNode.className = "lit";	}}function checkSecondary(who,how) {	if(document.getElementById(who)) {		if(how.checked == true && who == how.value) {			document.getElementById(who).style.display = "block";		} else {			document.getElementById(who).style.display = "none";		}	}}function checkAnswers(who) {	var x = who;	var y = who.getElementsByTagName("input");	var missing = 0;		for(i=0;i<y.length;i++) {		if(y[i].type == "radio" && y[i].value == "-1" && y[i].checked == true) {			missing++;		}	}		if(missing > 0) {		alert("Please make a selection.");		return false;	} else {		return true;	}}function valButton(btn) {    var cnt = -1;    for (var i=btn.length-1; i > -1; i--) {        if (btn[i].checked) {cnt = i; i = -1;}    }    if (cnt > -1) return btn[cnt].value;    else return null;}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 setReticle(who) {	var reticles = document.getElementById("reticles").getElementsByTagName("LI");	for(i=0;i < reticles.length;i++) {		if(who != "allreticles" && who != reticles[i].id) {			reticles[i].className = "dim";		} else {			reticles[i].className = "";		}	}	if(who) {		document.getElementById("reticle").value = who;		document.getElementById(who).className = "";	} else {		document.getElementById("reticle").value = "";	}	return false;}/* on document ready */$(document).ready(function() {	startList();	var productimg,productcaption;	if($('p#notice').length > 0) {		setTimeout(function() { $('p#notice').fadeOut('slow'); },3000);	}	$("ul#thumbs li a").hover(		function() {			productimg = $("img#productmain").attr("src");			$("img#productmain").attr("src",$(this).attr("href"));		},		function() {			$("img#productmain").attr("src",productimg);		}	).click(function() { 				productimg = $("img#productmain").attr("src");		$("img#productmain").attr("src",$(this).attr("href"));		$("ul#thumbs li").removeClass("current");		$(this).parent().addClass("current");		return false; 	});});
