//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="#" onclick=javascript:window.open("pgcominfo.aspx","","width=675,height=520"); class="topmenu">Person Info</a>'
menu1[1]='<a href="#" onclick=javascript:window.open("home.aspx","","width=675,height=520"); class="topmenu">Company Info</a>'

var menu2=new Array()
/*menu2[0]='<a href="pgcominfo.aspx?filter=1" class="topmenu">Company Information</a>'
menu2[1]='<a href="pgPerInfo.aspx" class="topmenu">Person Information</a>'
menu2[2]='<a href="pgcominfo.aspx?filter=2" class="topmenu">Owner Role Information</a>'
menu2[3]='<a href="pgProInfo.aspx" class="topmenu">PRO Details</a>'
menu2[4]='<a href="pgLcInfo.aspx" class="topmenu">Labour Card Information</a>'
menu2[5]='<a href="pgcominfo.aspx?filter=3" class="topmenu">Expired Labour Card List</a>'
menu2[6]='<a href="pgcominfo.aspx?filter=7" class="topmenu">National Labour Card List</a>'
menu2[7]='<a href="pgcominfo.aspx?filter=4" class="topmenu">Nawakas Report</a>'
menu2[8]='<a href="pgAppStatus.aspx" class="topmenu">Electronic Visa Status</a>'
menu2[9]='<a href="pgcominfo.aspx?filter=5" class="topmenu">Transaction List</a>'
menu2[10]='<a href="pgcominfo.aspx?filter=6" class="topmenu">Company Category Info</a>'
*/

menu2[0]='<a href="pgcominfo.aspx?filter=1" class="topmenu">Company Information</a>'
menu2[1]='<a href="pgcominfo.aspx?filter=2" class="topmenu">Owner Role Information</a>'
menu2[2]='<a href="pgProInfo.aspx" class="topmenu">PRO Details</a>'
menu2[3]='<a href="pgLcInfo.aspx" class="topmenu">Labour Card Information</a>'
menu2[4]='<a href="pgcominfo.aspx?filter=3" class="topmenu">Expired Labour Card List</a>'
menu2[5]='<a href="pgcominfo.aspx?filter=7" class="topmenu">National Labour Card List</a>'
menu2[6]='<a href="pgcominfo.aspx?filter=4" class="topmenu">Incomplete Transaction</a>'
menu2[7]='<a href="pgAppStatus.aspx" class="topmenu">Electronic Visa Status</a>'
menu2[8]='<a href="pgcominfo.aspx?filter=5" class="topmenu">Transaction List</a>'
menu2[9]='<a href="pgcominfo.aspx?filter=6" class="topmenu">Company Category Info</a>'
menu2[10]='<a href="pgcominfo.aspx?filter=9" class="topmenu">GCC Labour Cards</a>'
menu2[11]='<a href="pgcominfo.aspx?filter=10" class="topmenu">Expired Cards (Date)</a>'
menu2[12]='<a href="pgcominfo.aspx?filter=11" class="topmenu">Work Permit Receipt</a>'
menu2[13]='<a href="OwnerCompanyStatisitcs.aspx" class="topmenu">Company Statistics</a>'
menu2[14]='<a href="PaymentDetailsEntry.aspx" class="topmenu">Payment Receipt Details</a>'
menu2[15]='<a href="pgcominfo.aspx?filter=13" class="topmenu">Employees List Request</a>'
menu2[16]='<a href="pgcominfo.aspx?filter=14" class="topmenu">WPS Employees File</a>'
menu2[17]='<a href="pgcominfo.aspx?filter=15" class="topmenu">Category Change Request</a>'
menu2[18]='<a href="ExemptESignMachine.aspx" class="topmenu">Exemption for eSign Device</a>'
menu2[19]='<a href="SignTransactions.aspx" class="topmenu">Sign Transactions</a>'
menu2[20]='<a href="PrintTransactions.aspx" class="topmenu">Print Transactions</a>'

var MenuTrans=new Array()
MenuTrans[0]='<a href="InspectionsInfo.aspx" class="topmenu">Request</a>'
MenuTrans[1]='<a href="InspectionsStatus.aspx" class="topmenu">Status</a>'
MenuTrans[2]='<a href="SelfEvaluationList.aspx" class="topmenu">Self Evaluation</a>'

var MenuGQuota=new Array()
MenuGQuota[0]='<a href="pgcominfo.aspx?filter=12" class="topmenu">Request</a>'
MenuGQuota[1]='<a href="pgQuotaInfo.aspx?filter=13" class="topmenu">Extension</a>'
MenuGQuota[2]='<a href="pgQuotaReprint.aspx?filter=14" class="topmenu">Reprint</a>'
MenuGQuota[3]='<a href="pgQuotaInfo.aspx?filter=15" class="topmenu">Cancel Request</a>'
MenuGQuota[4]='<a href="pgQuotaAppPrint.aspx?filter=16" class="topmenu">Print Approved Receipt</a>'
MenuGQuota[5]='<a href="pgQuotaPayments.aspx?filter=16" class="topmenu">Payments</a>'
MenuGQuota[6]='<a href="pgQuotaInfo.aspx?filter=16" class="topmenu">Update</a>'
MenuGQuota[7]='<a href="consumedWpList.aspx?filter=17" class="topmenu">Work Permit Issued</a>'
MenuGQuota[8]='<a href="qAppStatus.aspx?filter=18" class="topmenu">Application Status</a>'
MenuGQuota[9]='<a href="rollbackwp.aspx?filter=19" class="topmenu">Roll Back</a>'
MenuGQuota[10]='<a href="Template.xls" class="topmenu">Download Project Templates</a>'



var MenuOther=new Array()
MenuOther[0]='<a href="http://admin.ecomplain.dubai.ae/login.aspx?lang=AR&Orgcode=SYP16D6M" class="topmenu">eComplain Administration services</a>'

var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var horizontaloffset=2 //horizontal offset of menu from default location. (0-5 is a good value)

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden; width: 300px" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function getAbsolutePos(el)
{
	var r = { x: el.offsetLeft, y: el.offsetTop };
	if (el.offsetParent)
	{
		var tmp = getAbsolutePos(el.offsetParent);
		r.x += tmp.x;
		r.y += tmp.y;
	}
	return r;
}

function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-400
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-20 : window.pageXOffset+window.innerWidth-20
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x-obj.offsetWidth < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-20 : window.pageYOffset+window.innerHeight-20
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move menu up?
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either? (position at top of viewable window then)
edgeoffset=dropmenuobj.y
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
var pos=getAbsolutePos(obj)
dropmenuobj.x=pos.x
dropmenuobj.y=pos.y
/*dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")*/
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+5+obj.offsetWidth+horizontaloffset+"px"
dropmenuobj.style.top=dropmenuobj.y-5-clearbrowseredge(obj, "bottomedge")+"px"
}

return clickreturnvalue()
}

function dropdownmenuTrans(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
var pos=getAbsolutePos(obj)
dropmenuobj.x=pos.x
dropmenuobj.y=pos.y
/*dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")*/
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+5+obj.offsetWidth+horizontaloffset+"px"
dropmenuobj.style.top=dropmenuobj.y-5-clearbrowseredge(obj, "bottomedge")+"px"
}

return clickreturnvalue()
}

function dropdownmenuGQuota(obj, e, menucontents, menuwidth){
	if (window.event) event.cancelBubble=true
		else if (e.stopPropagation) e.stopPropagation()
	clearhidemenu()
	dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
	populatemenu(menucontents)

	if (ie4||ns6){
		showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
		var pos=getAbsolutePos(obj)
		dropmenuobj.x=pos.x
		dropmenuobj.y=pos.y
		/*dropmenuobj.x=getposOffset(obj, "left")
		dropmenuobj.y=getposOffset(obj, "top")*/
		dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+5+obj.offsetWidth+horizontaloffset+"px"
		dropmenuobj.style.top=dropmenuobj.y-5-clearbrowseredge(obj, "bottomedge")+"px"
	}

	return clickreturnvalue()
}

function dropdownmenuOther(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
var pos=getAbsolutePos(obj)
dropmenuobj.x=pos.x
dropmenuobj.y=pos.y
/*dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")*/
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+5+obj.offsetWidth+horizontaloffset+"px"
dropmenuobj.style.top=dropmenuobj.y-5-clearbrowseredge(obj, "bottomedge")+"px"
}

return clickreturnvalue()
}



function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}
