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 roll( src ){

	temp = src.split("O");
	src = "images/menu/" + temp[0] + "O" + temp[1] + ".gif";
	name = temp[0];
	rollOver( name, src, "" )
	


}

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 openWin( URL ) { 
  var newWin = window.open(URL,"newWin","toolbar,scrollbars,width=450,height=470");
  newWin.focus();
}

function enlarge( n ) { 
URL = "../images/photos/index.asp?photo=" + n;
  var newWin2 = window.open(URL,"newWin","toolbar,scrollbars,width=575,height=470,location=yes");
  newWin2.focus();
}

function longterm() { 
URL = "longterm.htm"
  var newWin2 = window.open(URL,"newWin","toolbar,scrollbars,width=575,height=470,location=yes");
  newWin2.focus();
}

function musjump(){
	d = document.musform.muscat;
	
	if( d.selectedIndex != "" ){
		document.location = d.value;
	}
	
}
