var popWindow = null;

function popwindow(url,width,height) {
	var midX = (screen.width/2)-(width/2);
	var midY = (screen.height/2)-(height/2);
	popWindow = window.open (''+[url]+'','popwin', "width="+[width]+",height="+[height]+",toolbar=no,menubar=no,scrollbars=yes,resizable=yes,top="+midY+",left="+midX+",screenX="+midX+",screenY="+midY+"");
	popWindow.focus();

}


var popWindow2 = null;

function popwindow2(url,width,height) {
	var midX = (screen.width/2)-(width/2);
	var midY = (screen.height/2)-(height/2);
	popWindow2 = window.open (''+[url]+'','popwin2', "width="+[width]+",height="+[height]+",toolbar=no,menubar=no,scrollbars=yes,resizable=yes,top="+midY+",left="+midX+",screenX="+midX+",screenY="+midY+"");
	popWindow2.focus();

}



var menuoverplus = new Image();
    menuoverplus.src = "/images/menuover_plus.gif";
var menuoverminus = new Image();
    menuoverminus.src = "/images/menuover_minus.gif";
var menuoutplus = new Image();
    menuoutplus.src = "/images/menuout_plus.gif";

var tfoamWin = null;

function tfoamInfo() {
	tfoamWin = window.open("/tfoampop.html","tfoam","width=400,height=300,menu=no,status=no,location=no,toolbar=no,scrollbars=yes,resizable=yes");
}
var returnWin = null;

function returnPolicyInfo() {
	returnWin = window.open("/return_policy.asp","returnpolicy","width=300,height=250,menu=no,status=no,location=no,toolbar=no,scrollbars=yes,resizable=yes");
}


function setBG(id,b) {

	var o = null;

	if(document.all) { o=document.all("m"+id); }
	else if(document.getElementById) { o=document.getElementById("m"+id); }

	if(o!=null && o.style) {
		if(o.style.display!="block") {
			if(b) {
				document.images["I"+id].src = menuoverplus.src;
			} else {
				document.images["I"+id].src = menuoutplus.src;	
			}
		}
	} else {
		//netscape support
		if(b) {
			document.images["I"+id].src = menuoverplus.src;
		} else {
			document.images["I"+id].src = menuoutplus.src;	
		}
	}
}


function closeAllSubs(id) {

	var o;
	var aObj;

	for(i=0;i<3;i++) {

		o = null;
		aObj = null;

		if(document.all) {
			o=document.all("m"+i);
			aObj=document.all("A"+i);
		}
		else if(document.getElementById) {
			o=document.getElementById("m"+i);
			aObj=document.getElementById("A"+i);
		}

		if(o!=null && o.style && aObj!=null) {

			if(("m"+i)!=id) {
				aObj.className = "M1";
				document.images["I"+i].src = menuoutplus.src;
				o.style.display="none";
			}
		}
	}
}


function showSub(aObj,id) {

	closeAllSubs("m"+id);

	var o = null;

	if(document.all) { o=document.all("m"+id); }
	else if(document.getElementById) { o=document.getElementById("m"+id); }

	if(o!=null && o.style) {
		if(o.style.display=="none" || o.style.display=="") {
			o.style.display="block";
			aObj.className = "M3";
			aObj.blur();
			document.images["I"+id].src = menuoverminus.src;
		} else {
			o.style.display="none";
			aObj.className = "M1";
			aObj.blur();
			document.images["I"+id].src = menuoverplus.src;
		} 
	}
}


