currentPage="";
var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseX
count=0
PU_Width=new Array(120,140,140,120,120)
About_Us=new Array("About Dexlau","Our Team", "About the Logo")
About_Us_Links=new Array("/dexlau/about/index.html","/dexlau/team/index.html", "/dexlau/about/logo.html")
Services=new Array("Overview", "Knowledge Management", "Workplace Transformation")
Services_Links=new Array("/dexlau/consulting/index.html", "/dexlau/knowledgemanagement/index.html", "/dexlau/workplacetransformation/index.html")
Home=new Array()
Partners=new Array()
Contact_Us=new Array()

lsgap = 62
screenWidth=0
function getBrowserSettings()
{
	if(navigator.appName.toLowerCase()=="microsoft internet explorer")
	{
		lsgap=0
		screenWidth = document.body.clientWidth;
			lsgap = ((screenWidth - 900) / 2)
	}
	else
	{
		lsgap=-0
		screenWidth = window.innerWidth;
			lsgap = ((screenWidth - 900) / 2)+20
	}
}
getBrowserSettings()
mfwidth=0
if(!IE)
	mfwidth=2
menuwidth=122

function ShowMenu(itm, pos)
{
 ID=itm.id
 selectedParent=ID
 Lid=ID+"_clr"
 if(currentPage+"_clr"!=Lid)
 	document.getElementById(Lid).className=""
 eval('document.getElementById("'+ID+'").className=""')
 showPopup(ID,itm,pos) 
}
function ShowMenu_IKMP(itm, pos)
{
 ID=itm.id
 selectedParent=ID
 Lid=ID+"_clr"
 if(currentPage+"_clr"!=Lid)
 	document.getElementById(Lid).className=""
 eval('document.getElementById("'+ID+'").className=""') 
}
function HideMenu(itm,pos)
{
 ID=itm.id
 Lid=ID+"_clr"
 if(currentPage+"_clr"!=Lid)
 	document.getElementById(Lid).className=""+pos
else
	document.getElementById(Lid).className=""
 if(currentPage!=null)
 {
	 if(ID!=currentPage)
		eval('document.getElementById("'+ID+'").className=""')
 }		
}
function LoadSRC(itm)
{
 ID=itm.id
 len=eval(ID+'.length')

 if(len==0)
 {
 //  if(index==true)
     URL="/dexlau/html/"+ID+".html"+"?"+selectedParent
 //  else if(index==false)
 //    URL=ID+".html"
   window.open(URL,"_self")
   
 }
}
function LoadSRC_IKMP(itm)
{
 ID=itm.id
 URL="/dexlau/ikmp/"+ID+".html"+"?"+selectedParent
 window.open(URL,"_self")
}

function getMouseX(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollLeft
  } else
   {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
   }  
   return tempX
}
function showPopup(ID,e,pos)
{
//alert("ID="+ID+",e="+e+",pos="+pos)
 //xpos=getMouseX()
 //menuPosition=xpos/131.5
    getBrowserSettings()
  	Rows=eval(ID)
   	menuPosition=pos+2
	maxMouseX=(parseInt(menuPosition)*menuwidth)+lsgap+mfwidth
  	checkMousePosition()
  if(Rows.length>0)
  {
//alert (lsgap)
	 if(menuPosition<1)
  		document.getElementById("popup").style.left=0
	 else{
 		 document.getElementById("popup").style.left=(parseInt(menuPosition)*menuwidth)-1+lsgap+mfwidth
	//alert("popup left:"+document.getElementById("popup").style.left)	 
	}
 	tableStart="<table width=100% border=0 cellspacing=0 cellpadding=0 class=Popup_Border ><tr><td><table width=100% border=0 cellspacing=0 cellpadding=0>"
 	tableEnd="</table></td></tr></table>"
	 tableRows=""
 	document.getElementById("popup").style.height=(Rows.length)*22
 	document.getElementById("popup").style.width=Number(PU_Width[pos-1])
 	//document.getElementById("popup").style.top=90-((Rows.length)*22)
 	document.getElementById("popup").style.top=102
 	for(i=0;i<Rows.length;i++)
 	{
  		eval('tableRows=tableRows+"<tr><td id='+i+' class=Menu_PU_Constant onMouseOver=PopupOver(this) onMouseOut=PopupOut(this) onMouseDown=PopupDown(this) height=60 valign=bottom>&nbsp;'+Rows[i]+' </td></tr>"')
 	}
 	document.getElementById("popup").innerHTML=tableStart+tableRows+tableEnd
 	slideDown()
 }
 else
 {
   slideUp()
 }
}
function slideDown()
 {
 
 // menuTop=document.getElementById("popup").style.top
  document.getElementById("popup").style.visibility='visible'
 }
 function slideDownOld()
 {
 
  menuTop=document.getElementById("popup").style.top
  document.getElementById("popup").style.top=parseInt(menuTop)+5
  TimerId=setTimeout("slideDown()",15) 
  if(parseInt(menuTop)>= 100)
  {
    clearTimeout(TimerId)
  }
 }
 function slideUp()
 {
  document.getElementById("popup").style.visibility='hidden'
 }
  function slideUpOld()
 {
 
  var menuTop=document.getElementById("popup").style.top
  var menuH=document.getElementById("popup").style.height
  //alert(menuH)
  document.getElementById("popup").style.top=parseInt(menuTop)-5
  slideUpId=setTimeout("slideUp()",15) 
  if(parseInt(menuTop)<= (100-parseInt(menuH)))
  {
    clearTimeout(slideUpId)
  }
 }
function checkMousePosition()
{
	try{
	 var maxX=maxMouseX+120
	 var minX=maxMouseX
	 var menuHeight=(eval(selectedParent).length)*50
	 var maxY=menuHeight+95-47
	 var minY=0
	 //alert(maxX+" "+tempX+" "+minX+" "+maxY)
	 traceMouse=setTimeout("checkMousePosition()",15)
	 if(tempX<minX || tempX>maxX || tempY>maxY)
	 {
	   count=count+1
	   if(count>25)
	   {
		count=0
		clearTimeout(traceMouse)
		slideUp()
	   }
	 }
	 }catch(e){}
}

function PopupOver(itm)
{
 ID=itm.id
 eval('document.getElementById("'+ID+'").className="Menu_PU_Rollover"')
}
function PopupDown(itm)
{
 document.getElementById("popup").style.visibility="hidden"
 ID=itm.id
 //alert(selectedParent+" "+ID)
 eval('fName='+selectedParent+'_Links[ID]')
 //if(index==true)
 //alert(selectedParent)
  URL=fName+"?"+selectedParent
 //else if(index==false)
 // URL=fName+".html"
 window.open(URL,"_self")
}
function PopupOut(itm)
{
 ID=itm.id
 eval('document.getElementById("'+ID+'").className="Menu_PU_Constant"')
}
function goTop()
{
	urls=document.location.href.split("#")
	var url=urls[0]+"#Top"
	window.open(url,"_self")
}
function HighLight_Cur_Button()
{
	Parameters=document.location.href.split("?")
	if(Parameters.length>1)
	{
		pm = Parameters[1].split("#")
		currentPage=pm[0]
		document.getElementById(currentPage+"_clr").className=""
	}	
}
//HighLight_Cur_Button()
function linkControle()
{
HighLight_Cur_Button()
if(TopLink .toLowerCase()=="yes")
	document.getElementById("topLink").style.display="block"
}
function GoToThere(obj)
{
	var nm=obj.value
	//alert(nm)
	var urls=document.location.href.split("#")
	var url=urls[0]+"#"+nm
	window.open(url,"_self")
}
// for dexlau main menu
function MM_HighLight(id,cls)
{
	document.getElementById(id).className=cls
}
function loadURL(url)
{
	window.open(url,"_self");
}