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 preloadImg(){
	
	allpics1 = new Image();
	allpics1.src = "images/menu/aboutoff.gif"
	
	allpics2 = new Image();
	allpics2.src = "images/menu/abouton.gif"
	

}


function openTourCentre(){
	linkbase="http://www.myexplorica.ca/TourCenter.aspx?mode=tourCenter&username=&languageId=12&tourCenterCode=";
	//SummerAcademy-8527
	d = document.TCIDForm.TourCentreID.value;
	URL = linkbase + d;
	if(d != ""){
		var newWin2 = window.open(URL,"newWin2","toolbar,location,scrollbars,status");
	}
	return false;
}

function zoompic( n ){
	//alert(tournumber);
	var URL = "imgzoom" + n + ".htm";
	var features = "dependent=yes,width=500,height=400";
  	picwin = window.open( URL, "picZoom", features );

}