﻿<!--//
/*Javascript File for Menus
Created on 1st Feb 2010
*///------------------------------------------------------------------------------------------
//Capture Events
//Top Menu Image Swap Function
function swap_topMenu(e){
	if(e==null){e=window.event;}if(e.srcElement){var o=e.srcElement;}if(e.currentTarget){var o=e.currentTarget;}if(e.target){var o=e.target;}
	if(o.src){if(o.src.toString().indexOf('_f2.gif')==-1){o.src=o.src.toString().replace('.gif','_f2.gif');}else{o.src=o.src.toString().replace('_f2.gif','.gif');}}
}
//------------------------------------------------------------------------------------------
//Top Menu Change Lang Function
function changelang(from, to){
	var o=window.location.href;
	var d=o.toString().replace('l-'+from,'l-'+to);
	var s=document.frmPrjSearhPage;
	if(!s){s=document.frmEqSearhPage;}
	if(s){s.action=d;s.submit();}else{window.location.href=d;}
}
//------------------------------------------------------------------------------------------
//Graphical / Text Mode Switch
function toGraphicMode(){
if(window.location.search.substring(1).indexOf("textmode=1")==-1){
	if(window.location.href.toString().indexOf("?")==-1){window.location.href=window.location.href.toString().replace(window.location.pathname,window.location.pathname+"?textmode=0");}
	else{window.location.href=window.location.href.toString().replace("?","?textmode=0&");}
}
else{window.location.href=window.location.href.toString().replace("textmode=1","textmode=0");}
}
function toTextMode(){
if(window.location.search.substring(1).indexOf("textmode=0")==-1){
	if(window.location.href.toString().indexOf("?")==-1){window.location.href=window.location.href.toString().replace(window.location.pathname,window.location.pathname+"?textmode=1");}
	else{window.location.href=window.location.href.toString().replace("?","?textmode=1&");}
}
else{window.location.href=window.location.href.toString().replace("textmode=0","textmode=1");}
}
//------------------------------------------------------------------------------------------
//Left Menu function
function init_LeftMenu(){
	var menuLayer="menu_left_layer";
	if(document.getElementById(menuLayer)){var menulst=document.getElementById(menuLayer).getElementsByTagName("ul")[0];}
	//var strSubString="<div style='position:absolute;display:inline;float:right;text-align:right;background-color:transparent;'>&nbsp;&gt;</div>";
	//var strSubString="<span style='float:right;text-align:right;display:inline;visibility=visible;'>&#9658;</span>";
	var strSubString="<span style='float:right;text-align:right;display:inline;'>&gt;</span>";
	if(menulst){var m_item=menulst.getElementsByTagName("ul");}
	if(m_item){
	for (var t=m_item.length-1; t>-1; t--){
		m_item[t].parentNode.getElementsByTagName("a")[0].innerHTML+=strSubString;
		//first level menu
		if (m_item[t].parentNode.parentNode.parentNode.id==menuLayer){m_item[t].style.left=m_item[t].parentNode.offsetWidth+"px";} //Position submenus to be width of main menu item
		//other level menu (ul)	
		else{m_item[t].style.left=m_item[t-1].getElementsByTagName("a")[0].offsetWidth+"px";}//position menu to the menu item that activated
		//Attach Events, Styles
		m_item[t].parentNode.onmouseover=function(){this.getElementsByTagName("ul")[0].style.display="block";}		
		m_item[t].parentNode.onmouseout=function(){this.getElementsByTagName("ul")[0].style.display="none";}
		m_item[t].style.visibility="visible";m_item[t].style.display="none";//Hide Menus
	}
	}
}
//------------------------------------------------------------------------------------------
function reLoad(){window.location.reload();}
//-->