var menulistover=false; var menutabover=false;

function menuover(status) {
 	if (status==true) {
 		menulistover=true;
	 } else {
 		menulistover=false;
 		setTimeout('if (menulistover==false && menutabover==false) {menuclear();}',500);
 	}
 }

function menuon(item,status) {



 menutabover=true;


 if (status == 1) {
 	document.getElementById('menu' + item + 'left').src='images/menu_on_left.jpg';
 	document.getElementById('menu' + item + 'right').src='images/menu_on_right.jpg';
 	document.getElementById('menu' + item + 'bg').style.background='url(images/menu_on_bg.jpg)';
 }
 menulist(item);

}

function menuoff(item,status) {
 menutabover=true;
 setTimeout('if (menulistover==false && menutabover==false) {menuclear();}',500);
 if (status == 1) {
 	document.getElementById('menu' + item + 'left').src='images/menu_off_left.jpg';
 	document.getElementById('menu' + item + 'right').src='images/menu_off_right.jpg';
 	document.getElementById('menu' + item + 'bg').style.background='url(images/menu_off_bg.jpg)';
 }
}

function menulist(item){
 var h='';
	h+='<table border="0" cellpadding="0" cellspacing="0" bgcolor="#312E7B" bordercolor="#000000" style="border-collapse:collapse"><tr><td><table border="0" cellpadding="3" cellspacing="0">';


	 if (item=='10'){;}
	 else if (item=='20'){h+=menuhtml('m1','About_Us_Company_Profile.aspx','Company&nbsp;Profile');h+=menugap();h+=menuhtml('m2','About_Us_Company_Honour.aspx','Company&nbsp;Honour');h+=menugap();h+=menuhtml('m3','About_Us_Company_Customer.aspx','Company&nbsp;Customer');h+=menugap();h+=menuhtml('m4','About_Us_Australian_Office.aspx','Australian&nbsp;Office');}
	 else if (item=='30'){h+=menuhtml('m1','Capability_Moulding_RandD_Centre.aspx','Moulding&nbsp;R&D&nbsp;Centre');h+=menugap();h+=menuhtml('m2','Capability_Professional_Team.aspx','Professional&nbsp;Team');h+=menugap();h+=menuhtml('m3','Capability_Equipment.aspx','Equipment');}
	 else if (item=='40'){h+=menuhtml('m1','Products_showroom.aspx','Showroom');h+=menugap();h+=menuhtml('m2','Products_circulation_container.aspx','Circulation&nbsp;Container');}
	 else if (item=='50'){;}
	 else if (item=='60'){;}
	
	h+='</table></td></tr></table>';



document.getElementById("divmenu").style.top='126px';



var menuleft=0;
objParent=document.getElementById('menu' + item).offsetParent;
while(objParent && objParent.tagName.toUpperCase() != 'BODY') {menuleft+=objParent.offsetLeft; objParent=objParent.offsetParent;}
menuleft+=document.getElementById('menu' + item).offsetLeft
document.getElementById("divmenu").style.left=menuleft+'px';



 document.getElementById("divmenu").innerHTML=h;
 document.getElementById("divmenu").style.visibility='visible';


 var IfrRef = document.getElementById('shimpopup');
IfrRef.style.width = document.getElementById("divmenu").offsetWidth;
IfrRef.style.height = document.getElementById("divmenu").offsetHeight;
IfrRef.style.top = document.getElementById("divmenu").style.top;
IfrRef.style.left = document.getElementById("divmenu").style.left;
IfrRef.style.zIndex = document.getElementById("divmenu").style.zIndex - 1;
IfrRef.style.display = "block";
IfrRef.style.visibility='visible';


}
 function menuhtml(id, url, display) {
 return '<td onMouseOver="this.bgColor=\'#312E7B\';' + id + '.style.color=\'#ffffff\'" onMouseOut="this.bgColor=\'#312E7B\';' + id + '.style.color=\'#ffffff\'"><a id=' + id + ' href="' + url + '" class="menu">' + display + '</a></td>';
}



 function menugap() {
 return '<td><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td><img src="images/spacer.gif" border="0" width="10" height="1"></td></tr></table></td>';
 }
 function menuclear() {
 document.getElementById("divmenu").style.visibility='hidden';
 document.getElementById("shimpopup").style.visibility='hidden';
 } 

var popup_displayed=0;
var mDivMOver=false;document.onclick=function(){if (popup_displayed==1) {popup_displayed=0;}else{if(document.getElementById("divpopup") != null){if (mDivMOver == false) {popup_close();}}}}

function popup_position(txtname, height, width) {

	if (navigator.appName == 'Microsoft Internet Explorer')
	{
		document.getElementById("divpopup").setAttribute('onmouseover',function anonymous(){mDivMOver=true});
		document.getElementById("divpopup").setAttribute('onmouseout',function anonymous(){mDivMOver=false});
	}
		else
	{
		document.getElementById("divpopup").setAttribute('onMouseOver','mDivMOver=true');
		document.getElementById("divpopup").setAttribute('onMouseout','mDivMOver=false');
	}

	var popupleft=0;
	var popuptop=0;

 	objParent=document.getElementById(txtname).offsetParent;
         
        while(objParent && objParent.tagName.toUpperCase() != "BODY")
        {
        	popupleft+=objParent.offsetLeft;
            	popuptop+=objParent.offsetTop;
		objParent=objParent.offsetParent;
	}

	popupleft+=document.getElementById(txtname).offsetLeft
	popuptop+=document.getElementById(txtname).offsetTop + document.getElementById(txtname).offsetHeight + 2;


	if (popuptop+height > document.body.clientHeight)
	{
		popuptop=document.body.clientHeight-height;
	}

	if (popupleft+width > document.body.clientWidth)
	{
		popupleft=document.body.clientWidth-width;
	}

	document.getElementById("divpopup").style.left=popupleft+'px';
	document.getElementById("divpopup").style.top=popuptop+'px';

	popup_displayed=1;
}



function popup_show(html) {

	document.getElementById("divpopup").innerHTML=html;
	document.getElementById("divpopup").style.visibility='visible';	var IfrRef=document.getElementById('shimpopup');	IfrRef.style.width=document.getElementById("divpopup").offsetWidth;    	IfrRef.style.height=document.getElementById("divpopup").offsetHeight;    	IfrRef.style.top=document.getElementById("divpopup").style.top;    	IfrRef.style.left=document.getElementById("divpopup").style.left;    	IfrRef.style.zIndex=document.getElementById("divpopup").style.zIndex-1;    	IfrRef.style.display="block";	IfrRef.style.visibility='visible';
}



function popup_close()
{
	document.getElementById("divpopup").style.visibility='hidden';
	document.getElementById('shimpopup').style.visibility='hidden';
}




function flagshow() {

	var popupleft=0;

 	objParent=document.getElementById("flag").offsetParent;
         
        while(objParent && objParent.tagName.toUpperCase() != "BODY")
        {
        	popupleft+=objParent.offsetLeft;
		objParent=objParent.offsetParent;
	}

	popupleft+=document.getElementById("flag").offsetLeft;

	popupleft=popupleft-156;

	//alert(popupleft);
	document.getElementById("divflag").style.top='170px';
	document.getElementById("divflag").style.left=popupleft+'px';
	document.getElementById("divflag").style.display='inline';

	document.getElementById("txtFlagComment").focus();

}



function autoIframe(frameId){
frame = document.getElementById(frameId);
innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
objToResize = (frame.style) ? frame.style : frame;
objToResize.height = innerDoc.body.scrollHeight + 10;
}