var itemselected = "";
var newitem = false;
		
function mainimgOn(imgName) {	
	
	if (document.images) {
	    document.images[imgName].src = eval(imgName + "on.src");
	}
	if(itemselected != imgName){newitem = true;}

	if(newitem && itemselected != ""){		
		mainOldimgOff(itemselected);
	}
	newitem = false;
	itemselected = imgName;
}

function mainimgOff(imgName) {
	if(newitem){
		if (document.images) {
			document.images[imgName].src = eval(imgName + "off.src");
		}		
	}
}

function mainOldimgOff(imgName) {
	
		if (document.images) {
			document.images[imgName].src = eval(imgName + "off.src");
		}
				
}


function imgOn(imgName) {	
	
	if (document.images) {
	    document.images[imgName].src = eval(imgName + "on.src");
	}
}

function imgOff(imgName) {
		
	if (document.images) {
	    document.images[imgName].src = eval(imgName + "off.src");
	}

}

function showproduct(){
		var path = "";

		path = document.getElementById("products_details_main_path").value;
		window.location.href = path + document.getElementById("products_details_SectionItems").options[document.getElementById("products_details_SectionItems").selectedIndex].value;
	}
	
function Subscribe(){
var str = document.getElementById("email").value
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
	window.location.href = '/blank.aspx?id=945&email=' + str;
else{
	if (document.getElementById("language") == "english")
		alert("Please input a valid email address!")
		else
		alert("Please input a valid email address fr!")
	}
}

function Switch(imgName,imgName1,imgName2, arg) {	
	
	if (document.images) {
	    document.images[imgName].src = btn_switchon.src;
	    document.images[imgName1].src = btn_switchoff.src;
	    document.images[imgName2].src = btn_switchoff.src;
	    document.getElementById("search_doc").value = arg;	    
	}	
}
function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

function keyPress(e) {

if (document.getElementById("product").value == ""){

       
	alert("Please enter keyword.");
	document.getElementById("product").focus();
		
	}else{
		window.location.href = "http://ecat.fishersci.ca/ECatalogue.aspx?keyword=" + document.getElementById("product").value + "&operation="+document.getElementById("operation").value;
	
}

}
function keyPress1() {

    
 document.forms['Form1'].action = "https://fishercommerce.fishersci.ca/shop/Home.html";    
 document.forms['Form1'].submit();

}

var detect = navigator.userAgent.toLowerCase();
function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}
var detect = navigator.userAgent.toLowerCase();
function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}
 version = navigator.appVersion;

var isDOM=document.getElementById?1:0,
 isIE=document.all?1:0,
 isNS4=navigator.appName=='Netscape'&&!isDOM?1:0,
 isIE4=isIE&&!isDOM?1:0,
 isOp=self.opera?1:0,
 isDyn=isDOM||isIE||isNS4,
 isSafari = checkIt('safari')?1:0,
 isNS=checkIt('netscape')?1:0, 
 isFF=checkIt('firefox')?1:0, 
 isMac=version.toLowerCase().indexOf("mac")?0:1;
