function glos(kw, mfid) {
	glossary = window.open('glossary.asp?manID=' + mfid + '&kw=' + kw, '', "status=1,scrollbars=1,resizable=1,screenX=50,screenY=50,top=50,left=50,toolbar=0,location=0,width=715,height=500");
}

function charglos(kw) {
	charglossary = newwin('charglossary.asp?kw=' + kw, '', 715, 500);
}

function popImage(imgID) {
	popimage = window.open('glossaryImage.asp?imgID=' + imgID, '', "status=1,scrollbars=1,resizable=1,screenX=75,screenY=75,top=75,left=75,toolbar=0,location=0,width=715,height=450");
	//popimage.focus();
}

function popPricing() {
	newwin('pop_pricing.asp','pricing',700,400);
}

//menu rollover functions
function mOn(tagName) {
	var tmpSrc = tagName.src;
	tagName.src = tmpSrc.substring(0,tmpSrc.length-4) + 'On.' + tmpSrc.substring(tmpSrc.length-3,tmpSrc.length);
}

function mOff(tagName) {
	var tmpSrc = tagName.src;
	tagName.src = tmpSrc.substring(0,tmpSrc.length-6) + tmpSrc.substring(tmpSrc.length-4,tmpSrc.length);
}

function addToCart(pID,qty) {
	if (qty=='') alert('Please enter the quantity you wish to purchase.');
	else location.href = 'cart.asp?action=add%20to%20cart&id=' + pID + '&qty=' + qty;
}

function popRebate(rebateID) {
	start = newwin('rebate.asp?id=' + rebateID, 'rebate', 715, 450);
}

// Mouseover menu for product button navigation.
	var isDOM = (document.getElementById != null);
	var agt=navigator.userAgent.toLowerCase();
	var isIE = (agt.indexOf("msie") != -1);
	var activeLayer = '';
	var tmOut = '';
	
	function showLayer(layerID, wID){
		if (activeLayer != '' && activeLayer != layerID) hideLayer();
		if (isDOM) {
			document.getElementById(layerID).style.visibility = 'visible';
			document.getElementById('m' + layerID).className = 'menuBoxOn';
			document.getElementById('m' + layerID).style.cursor = 'hand';
			// position the menu based on browser
			if (wID==1){ 
				if (isIE) {
					document.getElementById(layerID).style.left = ((((document.body.offsetWidth)-762)/2)-11)+'px';
				}
				else {
					document.getElementById(layerID).style.left = ((((window.outerWidth)-762)/2)-12)+'px';
				}
			}
			else {
				if (isIE) {
					document.getElementById(layerID).style.left = ((((document.body.offsetWidth)-762)/2)+205)+'px';
				}
				else {
					document.getElementById(layerID).style.left = ((((window.outerWidth)-762)/2)+205)+'px';
				}
			}
		}
		
		activeLayer = layerID;
		cTm();
	}
	
	function hideLayer(){
		
		if(isDOM) {
			document.getElementById(activeLayer).style.visibility = 'hidden';
			document.getElementById('m' + activeLayer).className = 'menuBox';
		}
		
		activeLayer='';
		cTm();
	}
	
	function tmHide(){
		cTm();
		tmOut = setTimeout('hideLayer()', 500);
	}
	
	function cTm() {clearTimeout(tmOut);}
	
function newwin(url,pop_name,w,h) {
   	if((w==0) && (h==0))
    {
       window.open(url,pop_name,"status=1,scrollbars=1,resizable=1,screenX=100,screenY=100,top=100,left=100,toolbar=0,location=0,width="+self.outerWidth+",height="+self.outerHeight);
    }
    else
    {
		window.open(url,pop_name,"status=0,scrollbars=1,resizable=1,screenX=100,screenY=100,top=100,left=100,toolbar=0,location=0,width="+w+",height="+h);
    }
}	

ns4 = (document.layers)? true:false;
ie4 = (document.all)? true:false;

function showPreview(imagePath, description) {
	var version=navigator.appVersion;
	
	if (ns4) {
		obj = document.layers.previewLayer;
		
		//obj.xpos = window.pageXOffset;
		obj.xpos = 10;			
		obj.ypos = window.pageYOffset;
		
		obj.document.open();
		if (imagePath != '') obj.document.write('<img src="' + imagePath + '"><br><br>' + description);
		else obj.document.write(description);
		obj.document.close();
		
		document.layers.previewLayer.visibility = "show";
	}
	else if (ie4) {
		obj = document.all.previewLayer.style;
		
		//obj.xpos = document.body.scrollLeft;
		obj.xpos = (((document.body.offsetWidth)-800)/2)-40;
		
		obj.ypos = document.body.scrollTop;
		if (imagePath != '') document.all.previewLayer.innerHTML = '<img src="' + imagePath + '" border="1"><br><br>' + description;
		else document.all.previewLayer.innerHTML = description;
		document.all.previewLayer.style.visibility = "visible";
	
	}
	else
	{
		// 01.30.2006
		// Stephen Paul Adams
		// This adds support for Firefox as Firefox does not follow the document.layers nor the document.all
		// approach. W3C standards dictate that one should use the getElementById method.
		obj = document.getElementById("previewLayer").style;
	
		obj.xpos = (((document.body.offsetWidth)-800)/2)-18;

		obj.ypos = document.body.scrollTop;
		if (imagePath != '') document.getElementById("previewLayer").innerHTML = '<img src="' + imagePath + '" border="1"><br><br>' + description;
		else document.getElementById("previewLayer").innerHTML = description;
		document.getElementById("previewLayer").style.visibility = "visible";
	} 
	
	if (obj.ypos >= 0 && obj.ypos <= 325) obj.ypos = 325;
	else obj.ypos = obj.ypos + 30;
	
	obj.left = obj.xpos;
	obj.top = obj.ypos;
}

function hidePreview() {
	//if (ns4) document.layers.previewLayer.visibility = "hide";
	//else if (ie4) document.all.previewLayer.style.visibility = "hidden";
}