function showlayer(ly,ord,topnav){
  L_Position(topnav,ly)
  var xwlyn = document.all(ly)
  var dd=document.all(topnav)
  //xwlyn.filters.blendTrans.apply();
  if(ord==1){
       dd.className="boldtextb"
       xwlyn.style.visibility="visible"
    }else{
       dd.className="boldtext"
       xwlyn.style.visibility="hidden"
    }
 // xwlyn.filters.blendTrans.play(); 
}
  
function gohomeclass(idd,e){
  var dd=document.all(idd);
  if(e==1){
       dd.className="boldtextb"
     }else{
       dd.className="boldtext"
     }
}
  
function returnhome(url){
  //document.location="../index.html";
  document.location=url;
}
	 
function L_Position(LY_ID,aw_lyname) {
  var el = document.all(LY_ID);
  h_local=el.offsetLeft;
  var xwlyn = document.all(aw_lyname)
  xwlyn.style.left=h_local + 140;
}

  var vs_menu=new Array(); 
  vs_menu[0]="Home||56||../index.php";
  vs_menu[1]="About us||73||isdrop";
  vs_menu[2]="News||53||isdrop"; 
  vs_menu[3]="Products||70||isdrop";
  vs_menu[4]="Supports||70||isdrop";  
  vs_menu[5]="Services||70||isdrop"; 
  vs_menu[6]="Careers||70||../careers/careers.htm";

//How many menus to be shown;
showmenucount=6;

function dotopmenu(){
   var menustr=''                                                                        + '\n' +
  '<table width="100%" border="0" cellspacing="0" cellpadding="0" height="20">'         + '\n' +   
  '  <tr>'                                                                              + '\n' +
  '    <td align="center">&nbsp;</td>' ;
       document.write(menustr);

       for(var i=0; i < showmenucount; i++){
			var M_strarray=vs_menu[i].split("||");  
			var idspace=M_strarray[0];
			if(idspace=="About us") idspace="About";
			if(M_strarray[2]=="isdrop"){
				var strms=' onmouseover=showlayer("menu' + idspace + '",1,' + '"' + idspace +'")';
				strms+=' onmouseout=showlayer("menu' + idspace + '",0,' + '"' + idspace +'")';
				var str='<td id="' + idspace + '"' + 'class="boldtext" align="center" width="' + M_strarray[1] + '"';
				str+=strms + '>' + M_strarray[0] +'</td>';
			}else{
				var msstr= ' onmouseover=gohomeclass("'+idspace+'",1) onmouseout=gohomeclass("'+idspace+'",0) ' ;
				    msstr+= ' onclick=returnhome("'+M_strarray[2]+'")';
				var str='<td id="' + idspace + '"' + 'class="boldtext" align="center" width="' + M_strarray[1]  + '"';
					str+=msstr+'>' + M_strarray[0] +'</td>';
			}

         document.write(str);
       }

  var str=''                                                                           + '\n' +
  '    <td width="5"></td>'                                                     + '\n' +
  '  </tr>'                                                                            + '\n' +
  '</table>';
  document.write(str);
}

function dodropmenu(){
  var vs_menu_sub=new Array();
  vs_menu_sub[0]="";
  vs_menu_sub[1]="Mission Statment|Company Profile|Factory Tour|President Address|Quality Stystem|R & D|History";
  vs_menu_sub[2]="Events|Fair Message";
  vs_menu_sub[3]="6-FMJ Series|GFMJ Series|GFX Series|CTA Series|HP&HF Series|AGM Battery CP Series|AGM Battery FM Series|AGM Battery CL Series|Gel Battery CG Series|Communication Battery|Eurobattery series|Deep Cycle Battery Series|Li-ion Battery";
  vs_menu_sub[4]="MSDS|Technical Manual|SLA Battery FAQ|Certifications";
  vs_menu_sub[5]="Contact us|Global Sales|Download|Site map";  
  vs_menu_sub[6]="";
 
  var vs_menu_url=new Array();
  vs_menu_url[0]="";
  vs_menu_url[1]="../vision/mission.htm|../vision/profile.htm|../vision/factory.htm|../vision/president.htm|../vision/qc.htm|../vision/rd.htm|../vision/history.htm";
  vs_menu_url[2]="../news/events.php|../news/fair.php";
  vs_menu_url[3]="../products/6_fmjind.html|";
  vs_menu_url[3]+="../products/gfmjind.html|";
  vs_menu_url[3]+="../products/gfxind.html|";
  vs_menu_url[3]+="../products/ctaind.html|";
  vs_menu_url[3]+="../products/hphfind.html|";
  vs_menu_url[3]+="../products/cpind.html|";
  vs_menu_url[3]+="../products/fmind.html|";
  vs_menu_url[3]+="../products/clind.html|";
  vs_menu_url[3]+="../products/cgind.html|";
  vs_menu_url[3]+="../products/ctind.html|";
  vs_menu_url[3]+="../products/ebind.html|";
  vs_menu_url[3]+="../products/deepind.html|";
  vs_menu_url[3]+="../li-ion/li-ion-index.htm";

  vs_menu_url[4]="../supports/msds.htm|../supports/manual.htm|../supports/faq.htm|../supports/certifications.htm";
  vs_menu_url[5]="../service/contact.htm|../service/globalsales.htm|../service/download.htm|../service/sitemap.htm";
  vs_menu_url[6]="";
  
  var vs_menu_with=new Array();
  vs_menu_with[0]="";
  vs_menu_with[1]=112
  vs_menu_with[2]=112
  vs_menu_with[3]=152
  vs_menu_with[4]=135
  vs_menu_with[5]=110
  vs_menu_with[6]="";

 
  for(i=0;i<showmenucount;i++){  
		var M_strarray=vs_menu[i].split("||");  
		var idspace=M_strarray[0];
		//var idspace=vs_menu[i];
		 if(idspace=="About us") idspace="About";
		var strarray=vs_menu_sub[i].split("|");  
		 var strurlarray=vs_menu_url[i].split("|"); 
		if(M_strarray[2]=="isdrop"){
			 var layoutstr=''                                                                                                  + '\n' + 
			  '<div id="menu'+idspace + '"'                                                                                          + '\n' + 
			 ' style="position:absolute; left:568px; top:65px; width:'+ vs_menu_with[i] +'px; '                                + '\n' + 
			 ' height:50px; z-index:100; background-color: #000000;'                                                           + '\n' + 
			' layer-background-color: #000000; border: 1px none #000000; visibility: hidden" class="zsmenuind" '             + '\n' + 
			' onmouseover=showlayer("menu' + idspace + '",1,' + '"' + idspace +'") '                                              + '\n' + 
			' onmouseout=showlayer("menu' + idspace + '",0,' + '"' + idspace +'")>'                                               + '\n' + 
			 '  <table width="100%" border="0" cellspacing="0" cellpadding="0" >'; 
			 document.write(layoutstr);

			 for(k=0;k<strarray.length;k++){  
				var menutablestr=''                                                                                           + '\n' + 
				 '    <tr>'                                                                                                        + '\n' + 
				'      <td width="10"> </td>'                                                                                         + '\n' +
				  '      <td height="20"> '                                                                                         + '\n' +
				'      <a class="menu" '                                                                                          + '\n' +
				'        href="' + strurlarray[k] + '" >' + strarray[k] +'</a> '                                                             + '\n' +
				'      </td>'                                                                                                     + '\n' +
				'    <tr>';
				document.write(menutablestr);
			}
			var layoutstr=''                                                                                                  + '\n' + 
			'    </tr> <tr> <td height="5">'                                                                                 + '\n' +
			 '      </td>'                                                                                                     + '\n' +
			 '    </tr>'                                                                                                       + '\n' +
			 '  </table>'                                                                                                      + '\n' +
			 '</div>';
			document.write(layoutstr);
		}
  }
}