var sURL = unescape(window.location.pathname);

function initialize(){
	InitMenu("Marquee",213);
	WinInit()
	eval('doButtons("PictureBox",Picture[jss]);');
	runSlideShow(); 
	ShowMenu2("Marquee");
	ShowMenu2("mainmenu");
}

function resize(){
    window.location.href = sURL;
}

function WinInit()
{
	JSFX.MakeFloatingLayer("mainmenu", getwidth(),230);
	JSFX.MakeFloatingLayer("menu3", (getwidth()+144),249);
	JSFX.MakeFloatingLayer("menu31", (getwidth()+244),249);
	JSFX.MakeFloatingLayer("menu32", (getwidth()+244),268);
}

function getwidth(){
	offset = 386;
	if(document.layers){
		vwidth = (window.innerWidth/2)-offset;
		if(vwidth<5){vwidth = 5;}
	}
	if(document.all){
		vwidth = (document.body.clientWidth/2)-offset;
		if(vwidth<5){vwidth = 5;}
	}
	if(!document.all && document.getElementById){
		vwidth = (innerWidth/2)-offset-8;
		if(vwidth<5){vwidth = 5;}
	}
	return vwidth;
}

function InitMenu(LayerName,offset){
	if(document.layers){
		docwidth = (window.innerWidth/2)-offset;
		if (docwidth<180) {docwidth = 180} 
		eval('document.layers["'+LayerName+'"].left = docwidth;')
	}
	if(document.all){
		docwidth = (document.body.clientWidth/2)-offset;
		if (docwidth<180) {docwidth = 180} 
		eval('document.all["'+LayerName+'"].style.left = docwidth ;')
	}
	if(!document.all && document.getElementById){
		docwidth = (innerWidth/2)-offset-8;
		if (docwidth<180) {docwidth = 180} 
		document.getElementById(LayerName).style.left = docwidth;
	}
}

// Misc Variables
	Menu_XOffset = 144	// 180
	Menu_YOffset = 0	// -2
	Menu_Over = null	// Menu currently highlighted

function ShowMenu(elem,LayerName,Level){
	//if (LayerName != "Search") {HideDiv();}

	if(document.layers){
		if (Level==0){
			eval('document.layers["'+LayerName+'"].left = findPosX(elem) + Menu_XOffset')
			eval('document.layers["'+LayerName+'"].top = findPosY(elem) + Menu_YOffset')
		}
		eval('document.layers["'+layerName+'"].visibility="visible"')
	}
	if(document.all){
		if (Level==0){
			eval('document.all["'+LayerName+'"].style.left = findPosX(elem) + Menu_XOffset')
			eval('document.all["'+LayerName+'"].style.top = findPosY(elem) + Menu_YOffset')
		}
		eval('document.all["'+LayerName+'"].style.visibility = "visible"')
	}
	if(!document.all && document.getElementById){
		if (Level==0){
			document.getElementById(LayerName).style.left = findPosX(elem) + Menu_XOffset
			document.getElementById(LayerName).style.top = findPosY(elem) + Menu_YOffset - 23
		}
		document.getElementById(LayerName).style.visibility = "visible"
	}
}

function ShowMenu2(LayerName){
	if(document.layers){
		eval('document.layers["'+layerName+'"].visibility="visible"')
	}
	if(document.all){
		eval('document.all["'+LayerName+'"].style.visibility = "visible"')
	}
	if(!document.all && document.getElementById){
		document.getElementById(LayerName).style.visibility = "visible"
	}
}

function HideMenu(elem,LayerName,Level){
	if(document.layers){
		eval('document.layers["'+layerName+'"].visibility="hidden"')
	}
	if(document.all){
		eval('document.all["'+LayerName+'"].style.visibility = "hidden"')
	}
	if(!document.all && document.getElementById){
		document.getElementById(LayerName).style.visibility = "hidden"
	}
}


function findPosX(obj){
	var curleft=0;
		if(document.getElementById||document.all){while(obj.offsetParent){curleft+=obj.offsetLeft;obj=obj.offsetParent;}}
		else if(document.layers){curleft+=obj.x;}
	return curleft;}

function findPosY(obj){
	var curtop=0;
		if(document.getElementById||document.all){while(obj.offsetParent){curtop+=obj.offsetTop;obj=obj.offsetParent;}}
		else if(document.layers){curtop+=obj.y;}
	return curtop;}


//if(document.layers)document.captureEvents(Event.MOUSEMOVE);document.onmouseup=HideDiv;
function HideDiv(){
	if(document.layers){document.Search.top = -999}
	if(document.all){Search.style.top = -999}
	if(!document.all && document.getElementById){document.getElementById('Search').style.top = -999}
	//changeImage("img5","img51");
}

function checkString(){
	var srchString = "";
	srchString = document.frmSearch.srchstring.value;
	if(srchString.length == 0)
	{
		alert("Please enter atleast one word for the search");
		document.frmSearch.srchstring.focus();
		return false;
	}
	else
		return true;
}

function ColorTD(elem,color){
	eval('document.all["'+elem+'"].style.backgroundColor="'+color+'"')
}

function doButtons(name,pic) {
	document[name].src=pic;
}

function linkTo(str){ 
	window.location=str;
}

function bigger_map(url,w,h){
	window.open('../content/bigimage.asp?ImageName='+url,'','height='+h+', width='+w+', resizable=yes, scrollbars=yes');
}

