var isNav, isIE, isN6;
var coll = "";
var styleObj = "";
var currSub = "none"
var name = "none"

if( navigator.appName == "Netscape"){
	if ( parseInt( navigator.appVersion ) >= 5 ){
		isN6 = true;
		//styleObj = ".style";
		//coll = "getElementById(";
		//styleObj = ").style";
	}
	else
		isNav = true;
	
}
else{
	isIE = true;
	coll = "all.";
	styleObj = ".style";
}


function menuOver ( name, src ){
	sm = "sub" + name
	if( currSub != "none")
			hide( currSub );
	show( sm );
	currSub = sm;
	page = name;
	//hide if onMouseOut detected
	if ( src.indexOf( "On") < 0 ){
		if( currSub != "none")
			hide( currSub );
	}
	src = "../images/navigation/" + src;
	rollOver( name, src, "" )


}

function getObject( obj ){
	var theObj, temp;
	//if( isN6 ){
		//theObj = document.getElementById( obj )
		//alert( theObj );
	//}
	if(typeof obj == "string"){
		if( isN6 ){
			theObj = document.getElementById( obj ).style;
			//theObj = eval("document."+obj+".style");
			//alert( theObj );
		}
		else
			theObj = eval("document."+coll+obj+styleObj);
	}else{
		theObj = obj;
	}
	return theObj;
}


function rollOver( imageName, imageSrc, layer ){
	
		if( isNav ){
			if( layer != "" ){
				var obj = eval("document."+layer+".document");
				obj.images[imageName].src = imageSrc;
			}
			else
				document.images[imageName].src = imageSrc;
		}
		else{
			document[imageName].src = imageSrc;
		}
}


function hide( obj ){
		var theObj = getObject(obj);
		theObj.visibility = "hidden";

}

function hide2( obj ){
		var theObj = getObject(obj);
		theObj.visibility = "hidden";
		tourStop(0);
}

function show( obj ){
		var theObj = getObject(obj);
		theObj.visibility = "visible";
}


function openmailingList() { 
  var newWin = window.open("mailinglist.php","newWin","width=490,height=350");
  newWin.focus();
}

function openlensmenu() { 
  var newWin2 = window.open("lensmenu.htm","newWin2","width=620,height=420,toolbar,scrollbars,status");
  newWin2.focus();
}

function preloadImg(){
	
	allpics1 = new Image();
	allpics1.src = "images/menu/aboutoff.gif"
	
	allpics2 = new Image();
	allpics2.src = "images/menu/abouton.gif"
	
	allpics3 = new Image();
	allpics3.src = "images/menu/contactoff.gif"
	
	allpics4 = new Image();
	allpics4.src = "images/menu/contacton.gif"
	
	allpics5 = new Image();
	allpics5.src = "images/menu/faqoff.gif"
	
	allpics6 = new Image();
	allpics6.src = "images/menu/faqon.gif"
	
	allpics7 = new Image();
	allpics7.src = "images/menu/homeoff.gif"
	
	allpics8 = new Image();
	allpics8.src = "images/menu/homeon.gif"
	
	allpics9 = new Image();
	allpics9.src = "images/menu/productsoff.gif"
	
	allpics10 = new Image();
	allpics10.src = "images/menu/productson.gif"
	
	allpics11 = new Image();
	allpics11.src = "images/menu/specialsoff.gif"
	
	allpics12 = new Image();
	allpics12.src = "images/menu/specialson.gif"
}
