// JavaScript Document
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


//-------------------variable initialization------------------------//

var numSMenu = 3;
var pathname = window.location +"";
var s1 = pathname.lastIndexOf("/");
var s2 = pathname.substring(0, s1).lastIndexOf("/");

var smenu_width = new Array(146, 235, 146);
var smenu_x = new Array(40, 160, 390);
//var smenu_x = new Array(157, 277, 507);
var smenu_overcolor = new Array("#FFF6F6", "#FFF8EE", "#F6FEF6");

var smenu_name1 = new Array("About Win Hanverky","Professional Management","Corporate Video");
var smenu_link1 = new Array("../about/about.html","../about/prof.html","../about/cv.html");

var smenu_name2 = new Array("Our Business","Sportswear Manufacturing Business","Sportswear Distribution and Retail Business");
var smenu_link2 = new Array("../busi/busi.html","../busi/sman.html","../busi/sdis.html");


var smenu_name3 = new Array("Investor Relations","Releases &amp; Presentations", "Interim Reports/Annual Reports/Prospectus", "Announcements", "Circulars/General Meeting Notices/Proxy Forms", "Monthly Returns", "Financial Calendar");
var smenu_link3 = new Array("../invest/invest.html","../invest/rnp.html", "../invest/prospectus.html", "../invest/ann.html", "../invest/circulars.html", "../invest/monthlyreturns.html", "../invest/fc.html");

//-------------------end of variable initialization------------------------//

//-------------------list of function ------------------------//

function changeLang(toLang)
{
	var curLangPos = pathname.indexOf("/chi/");
	var curLang = "chi";
	if (curLangPos < 0) {curLangPos = pathname.indexOf("/eng/"); curLang = "eng";}

	window.location = pathname.substring(0, curLangPos+1) + toLang + pathname.substring(curLangPos+4, pathname.length)+"";
}

function getOverHit()
{
	MM_showHideLayers('getOut','','hide');
	for (var j = 1; j<= numSMenu; j++)
	{
    MM_showHideLayers('subMenu'+j,'','hide');
	}

}

function showSubMenu(smenu)
{
	for (var j = 1; j<= numSMenu; j++)
	{
    if (j != smenu)
	{
		MM_showHideLayers('subMenu'+j,'','hide');
	}
	}
	MM_showHideLayers('subMenu'+smenu,'','show');	
	MM_showHideLayers('getOut','','show');	
}

function writeLink(linkItem)
{
	if (pathname.substring(s2+1, s1) != "zh" && pathname.substring(s2+1, s1) != "en" && pathname.substring(s2+1, s1) != "gb")
	{
		return tmenu_link[linkItem]+"";
	}
	else{
		return tmenu_link[linkItem].substring(tmenu_link[linkItem].indexOf("/")+1, tmenu_link[linkItem].length)+"";
	}
}

function writeSMenu(Layerid)
{
	document.write('<div id="subMenu'+ Layerid +'" style="position:absolute; z-index:10; visibility:hidden; top:91px; left:'+ smenu_x[eval(Layerid-1)] +'px;">');
	document.write('<table border="0" cellspacing="1" bgcolor="#e3e3e3" width="'+ smenu_width[eval(Layerid-1)] +'">');
	
	var menuToWrite = eval("smenu_name"+Layerid);
	var menuToLInk = eval("smenu_link"+Layerid);
	
	for(var i = 0; i <=menuToWrite.length-1; i++ ){
	document.write('<tr>');
	document.write('<td bgcolor="#FFFFFF" height="19" onmouseover="this.style.backgroundColor=\''+ smenu_overcolor[eval(Layerid-1)] +'\';this.style.color=\'#333333\';" onmouseout="this.style.backgroundColor=\'#FFFFFF\';this.style.color=\'#333333\'" ');
	document.write('onclick="window.location=\''+ menuToLInk[i] +'\';');
	document.write('" style=" cursor:pointer; padding-top:4px;padding-left:10px;padding-right:10px;padding-bottom:4px;font-family:arial; color:#333333; font-size:11px;">');
	document.write(menuToWrite[i]);
	document.write('</td>');
	document.write('</tr>');
	}
	
	document.write('</table>');
	document.write('</div>');
}

//-------------------end of list of function ------------------------//
var wlocation = window.location+"";
var temp = wlocation.substring(0,wlocation.lastIndexOf('/'));
var section_name = wlocation.substring(temp.lastIndexOf('/')+1,wlocation.lastIndexOf('/'));

document.write('<div id="getOut2" style="position:absolute; left:0px; z-index:20;" width=\'40px\'><img src="../images/share/spacer.gif" onmouseover="getOverHit();" width="40" height="200"/></div>');
document.write('<div id="getOut" style="position:absolute; left:-1px; z-index:0;" width=\'100%\'><img src="../images/share/spacer.gif" onmouseover="getOverHit();" width="100%" height="65"/></div>');
document.write('<div id="getOut3" style="position:absolute; left:-1px; top:92px; z-index:0;" width=\'100%\'><img src="../images/share/spacer.gif" onmouseover="getOverHit();" width="100%" height="130"/></div>');

document.write('<table width="100%" height="93"  border="0" cellpadding="0" cellspacing="0">');
document.write('<tr>');
document.write('<td height="1">');
document.write('<img src="../images/share/spacer.gif" width="1" height="1">');
writeSMenu("1");
writeSMenu("2");
writeSMenu("3");
document.write('</tr>');
document.write('</td>');
document.write('<tr>');
document.write('<td>');
document.write('<table width="100%"  border="0" cellspacing="0" cellpadding="0">');
document.write('<tr valign="top">');
document.write('<td width="10">');
document.write('<img src="../images/share/spacer.gif" width="1" height="1">');
document.write('</td>');
document.write('<td height="64">');
document.write('<table width="100%"  border="0" cellspacing="0" cellpadding="0">');
document.write('<tr>');
document.write('<td height="12">');
document.write('<img src="../images/share/spacer.gif" width="1" height="1">');
document.write('</td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td>');
document.write('<img src="../images/share/img_logo.gif" width="70" height="40">');
document.write('</td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td height="12">');
document.write('<img src="../images/share/spacer.gif" width="1" height="1">');
document.write('</td>');
document.write('</tr>');
document.write('</table>'); 
document.write('</td>');
document.write('<td height="64" align="right">');
document.write('<table  border="0" cellspacing="0" cellpadding="0">');
document.write('<tr>');
document.write('<td height="40" align="right" valign="top">');
document.write('<img src="../images/share/spacer.gif" width="1" height="1">');
document.write('</td>');
document.write('<td height="40" align="right" valign="top">');
document.write('<img src="../images/share/spacer.gif" width="1" height="1">');
document.write('</td>');
document.write('<td height="40" align="right" valign="top">');
document.write('<img src="../images/share/spacer.gif" width="1" height="1">');
document.write('</td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td width="40" align="right" valign="top">');
document.write('<a href="../front/front.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image41\',\'\',\'../images/topmenu/btn_home_on.gif\',1)">');
document.write('<img src="../images/topmenu/btn_home_off.gif" name="Image41" width="27" height="10" border="0" id="Image41">');
document.write('</a>');
document.write('</td>');
document.write('<td width="53" align="right" valign="top">');
document.write('<a href="../about/sitemap.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image31\',\'\',\'../images/topmenu/btn_sitemap_on.gif\',1)">');
document.write('<img src="../images/topmenu/btn_sitemap_off.gif" name="Image31" width="40" height="11" border="0" id="Image31">');
document.write('</a>');
document.write('</td>');
document.write('<td width="33" align="right" valign="top">');
document.write('<a href="javascript:changeLang(\'chi\')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image21\',\'\',\'../images/topmenu/btn_lang_on.gif\',1)">');
document.write('<img src="../images/topmenu/btn_lang_off.gif" name="Image21" width="20" height="11" border="0" id="Image21">');
document.write('</a>');
document.write('</td>');
document.write('<td width="12" align="right" valign="top">');
document.write('<img src="../images/share/spacer.gif" width="12" height="11">');
document.write('</td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td height="13" align="right" valign="top">');
document.write('<img src="../images/share/spacer.gif" width="1" height="1">');
document.write('</td>');
document.write('<td height="13" align="right" valign="top">');
document.write('<img src="../images/share/spacer.gif" width="1" height="1">');
document.write('</td>');
document.write('<td height="13" align="right" valign="top">');
document.write('<img src="../images/share/spacer.gif" width="1" height="1">');
document.write('</td>');
document.write('</tr>');
document.write('</table>');
document.write('</td>');
document.write('</tr>');
document.write('</table>');
document.write('</td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td height="29" align="right">');
document.write('<table  border="0" cellpadding="0" cellspacing="0">');
document.write('<tr align="right">');
document.write('<td width="28">');
document.write('<img src="../images/topmenu/img_topmenu_1.gif" width="28" height="29">');
document.write('</td>');
document.write('<td width="110" background="../images/topmenu/bg_topmenu.gif">');
document.write('<a href="../about/about.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image9\',\'\',\'../images/topmenu/btn_about_on.gif\',1);showSubMenu(\'1\');">');
document.write('<img src="../images/topmenu/btn_about_off.gif" name="Image9" width="110" height="11" border="0">');
document.write('</a>');
document.write('</td>');
document.write('<td width="19" background="../images/topmenu/bg_topmenu.gif">');
document.write('<img src="../images/topmenu/img_sep.gif" width="2" height="29" hspace="8">');
document.write('</td>');
document.write('<td width="74" background="../images/topmenu/bg_topmenu.gif">');
document.write('<a href="../busi/busi.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image17\',\'\',\'../images/topmenu/btn_business_on.gif\',1);showSubMenu(\'2\');">');
document.write('<img src="../images/topmenu/btn_business_off.gif" name="Image17" width="74" height="11" border="0">');
document.write('</a>');
document.write('</td>');
document.write('<td width="19" background="../images/topmenu/bg_topmenu.gif">');
document.write('<img src="../images/topmenu/img_sep.gif" width="2" height="29" hspace="8">');
document.write('</td>');
document.write('<td width="119" background="../images/topmenu/bg_topmenu.gif">');
document.write('<a href="../corp/corp.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image18\',\'\',\'../images/topmenu/btn_corp_on.gif\',1);getOverHit();">');
document.write('<img src="../images/topmenu/btn_corp_off.gif" name="Image18" width="119" height="11" border="0">');
document.write('</a>');
document.write('</td>');

document.write('<td width="19" background="../images/topmenu/bg_topmenu.gif">');
document.write('<img src="../images/topmenu/img_sep.gif" width="2" height="29" hspace="8">');
document.write('</td>');
document.write('<td width="98" background="../images/topmenu/bg_topmenu.gif">');
document.write('<a href="../invest/invest.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image19\',\'\',\'../images/topmenu/btn_invest_on.gif\',1);showSubMenu(\'3\');">');
document.write('<img src="../images/topmenu/btn_invest_off.gif" name="Image19" width="98" height="11" border="0">');
document.write('</a>');
document.write('</td>');

document.write('<td width="19" background="../images/topmenu/bg_topmenu.gif">');
document.write('<img src="../images/topmenu/img_sep.gif" width="2" height="29" hspace="8">');
document.write('</td>');
document.write('<td width="114" background="../images/topmenu/bg_topmenu.gif">');
document.write('<a href="../sr/sr.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image20\',\'\',\'../images/topmenu/btn_soc_on.gif\',1);getOverHit();">');
document.write('<img src="../images/topmenu/btn_soc_off.gif" name="Image20" width="114" height="11" border="0">');
document.write('</a>');
document.write('</td>');
document.write('<td width="19" background="../images/topmenu/bg_topmenu.gif">');
document.write('<img src="../images/topmenu/img_sep.gif" width="2" height="29" hspace="8">');
document.write('</td>');
document.write('<td width="36" background="../images/topmenu/bg_topmenu.gif">');
document.write('<a href="../career/index.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image22\',\'\',\'../images/topmenu/btn_career_on.gif\',1);getOverHit();">');
document.write('<img src="../images/topmenu/btn_career_off.gif" name="Image22" width="36" height="11" border="0">');
document.write('</a>');
document.write('</td>');
document.write('<td width="19" background="../images/topmenu/bg_topmenu.gif">');
document.write('<img src="../images/topmenu/img_sep.gif" width="2" height="29" hspace="8">');
document.write('</td>');
document.write('<td width="59" background="../images/topmenu/bg_topmenu.gif">');
document.write('<a href="../contact/contact.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\'Image23\',\'\',\'../images/topmenu/btn_contact_on.gif\',1);getOverHit();">');
document.write('<img src="../images/topmenu/btn_contact_off.gif" name="Image23" width="59" height="11" border="0">');
document.write('</a>');
document.write('</td>');
document.write('<td background="../images/topmenu/bg_topmenu.gif">');
document.write('<img src="../images/share/spacer.gif" width="12" height="8">');
document.write('</td>');
document.write('</tr>');
document.write('</table>');
document.write('</td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td>');
/*document.write('<script language="javascript" type="text/javascript" src="../js/submenu.js"></script>');*/
document.write('</td>');
document.write('</tr>');
document.write('</table>');

//9, 17-20, 22,23
if(section_name == 'about')
{Image9.src = '../images/topmenu/btn_about_on.gif';}
else if(section_name == 'busi')
{Image17.src = '../images/topmenu/btn_business_on.gif';}
else if(section_name == 'corp')
{Image18.src = '../images/topmenu/btn_corp_on.gif';}
else if(section_name == 'invest')
{Image19.src = '../images/topmenu/btn_invest_on.gif';}
else if(section_name == 'sr')
{Image20.src = '../images/topmenu/btn_soc_on.gif';}
else if(section_name == 'career')
{Image22.src = '../images/topmenu/btn_career_on.gif';}
else if(section_name == 'contact')
{Image23.src = '../images/topmenu/btn_contact_on.gif';}
