ns = (document.layers)? true:false
ie = (document.all)? true:false
ns6 = (navigator.appName == "Netscape" && document.getElementById)? true:false
winIE5 = false;
var browserString = navigator.appVersion;
if (navigator.userAgent.indexOf("Win") > -1 && navigator.appName == "Microsoft Internet Explorer"){
	if (parseInt(browserString.charAt(22)) < 6){
		winIE5 = true;
	}
}


//preload images
productTop=new Image()
productTop.src="/images/inside/product_box/top.gif"
grid=new Image()
grid.src="/images/inside/product_box/grid.gif"
grid_highlight=new Image()
grid_highlight.src="/images/inside/product_box/grid_highlight.gif"

//bOff = new Image; bOff.src = "/images/nav/bOff.gif";
//bOn = new Image; bOn.src = "/images/nav/bOn.gif";
/*bOff = new Image; bOff.src = "/images/spacer.gif";
bOn = new Image; bOn.src = "/images/spacer.gif";*/
function swap(theName,theIMG){
	theIMG = eval(theIMG);
	document[theName].src = theIMG.src;
}

function menuItem(displayText,theLink){
	this.displayText= displayText;
	this.theLink	= theLink;
}

function mainNavWidth(){
	mainWidth = 0;
	for(w = 0; w < mainNav.length; w ++){
		mainWidth += mainNav[w].theWidth;
	}
	return mainWidth;
}

outHTML = "";
function writeNav(){
	outHTML += "<table bgcolor=\"#000000\" background=\"/images/nav.gif\" valign=\"bottom\" cellpadding=0 cellspacing=0 border=0><tr><td bgcolor=\"#ffffff\"><img src=\"/images/spacer.gif\" width=1 border=0 height=17 align=\"bottom\">";
	for( i = 0; i < mainNav.length; i ++ ){
		if( mainNav[i].theTarget > 0 ){
			theTarget = " target=\"" + mainNav[i].displayText.replace(" ", "") + "\"";
		}else{
			theTarget = "";
		}
		if( mainNavHighlight == i ){
			theClass = "nav";
			//theSQ = "bOn";
		}else{
			theClass = "nav";
			//theSQ = "bOff";
		}
		outHTML += "<td nowrap class=\"" + theClass + "\" id=\"theBase" + i + "\" onmouseover=\"this.style.backgroundColor='#cdcdcd'\" onmouseout=\"this.style.backgroundColor='';hide('lastMenu');\"><ilayer name=\"theBaseNS\"><layer>";
		outHTML += "<a href=\"" + mainNav[i].theLink + "\" " + theTarget + " onMouseOver=\"dropMenu.showMenu('" + mainNav[i].displayText.replace(" ","") + "')\" onMouseOut=\"dropMenu.hideMenu('" + mainNav[i].displayText.replace(" ","") + "');\"><img src=\"/images/spacer.gif\" width=1 height=1 name=\"i" + i + "\" border=0>" + mainNav[i].displayText.replace("_","/") + "</a>"
		outHTML += "</layer></ilayer></td><td bgcolor=\"#ededee\"><img src=\"/images/spacer.gif\" width=1 border=0 height=0></td>";
	}
	outHTML += "</tr></table>";
	document.write(outHTML);
}
function subNavTitle(){
	document.write(mainNav[mainNavHighlight].displayText);
}

theWidth = 135;
theLeft = 144;
theTop = 73;
lastMenuX = 0;


function checkLogin(f){
	if( isStringWhitespace(f.username.value) ){
		alert("Please enter your Username.");
		f.username.focus();
		return false;
	}
	if( isStringWhitespace(f.password.value) ){
		alert("Please enter your Password.");
		f.password.focus();
		return false;
	}
	return true;
}

function highlight(id){
	var idArray = id.split(":");
	for (var i=0; i < idArray.length; i++)
	{
		document.getElementById(idArray[i]).style.backgroundColor='#8C034E';
	}
}

function removehighlight(id){
	var idArray = id.split(":");
	for (var i=0; i < idArray.length; i++)
	{
		document.getElementById(idArray[i]).style.backgroundColor='';
	}
}

function darkenimage(image){
	var imageArray = image.split(":");
	for (var i=0; i < imageArray.length; i++)
	{
		newimage=new Image(); newimage.src ="/images/products/" + imageArray[i].replace('_','/') + "_h.jpg";
		document.images[imageArray[i]].src=newimage.src;
	}
}

function lightenimage(image){
	var imageArray = image.split(":");
	for (var i=0; i < imageArray.length; i++)
	{
		newimage=new Image(); newimage.src ="/images/products/" + imageArray[i].replace('_','/') + ".jpg";
		document.images[imageArray[i]].src=newimage.src;
	}
}

function openwindow(url){
	//alert (url)
	window.open(url,'enlarge','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=699, height=" + screen.height + ", top=0, left=0');
}

function win(fileName) {
     myFloater = window.open('','myWindow','scrollbars=yes,resizable=yes,status=no,width=766,height=600,left=10,top=0')
     myFloater.location.href = fileName;
}

image1= new Image();
image1.src="/images/home/cypherH.gif";