//子菜单1
var SubMenuA = [
["AminoGrow 40","products/amino-grow40.htm"],
["AminoGrow 50","products/amino-grow50.htm"],
["AminoUp","products/amino-up.htm"],
["AminoZym","products/amino-zym.htm"],
["AminoPlus","products/amino-plus.htm"]
];

//子菜单2
var SubMenuB = [
["HumiTop","products/humitop.htm"],
["HumiBase","products/humibase.htm"],
["Humiliq","products/humiliq.htm"],
["FulviTop","products/fulvitop.htm"],
["Humix","products/humix.htm"],
["HumiBoron","products/HumiBoron.htm"]
/*["Magnesium Humate","products/magnesium-humate.htm"],
["Magnesium Nitro-Humate","products/magnesium-nitro-humate.htm"],
["Ammonium Humate","products/ammonium-humate.htm"],
["Sodium Humate","products/sodium-humate.htm"]*/
];

//子菜单3
var SubMenuC = [
["Seaweed Extract","products/SeaTop.html"],
["Chitosan Oligosaccharide","products/biohope.htm"],
["Bio Fulvic Acid","products/BioFulvic.htm"],
/*["SeaLiq","products/SeaLiq.html"],
["Seamino","products/Seamino.html"],*/
["Bamboo Vinegar","products/bamboo-vinegar.htm"],
["Wood Vinegar","products/wood-vinegar.htm"]

];

//子菜单4
var SubMenuD = [
["EDDHA-Fe-6","products/edta-1.htm"],
["EDTA-Fe-13","products/edta-1.htm#EDTA-Fe-13"],
["EDTA-Mn-13","products/edta-1.htm#EDTA-Mn-13"],
["EDTA-Cu-15","products/edta-1.htm#EDTA-Cu-15"],
["EDTA-Zn-15","products/edta-1.htm#EDTA-Zn-15"],
["EDTA-Mg-6","products/edta-1.htm#EDTA-Mg-6"],
["EDTA-Ca-10","products/edta-1.htm#EDTA-Ca-10"]
];

//子菜单5
var SubMenuE = [
["BioStar","products/biostar.htm"],
["MSG&nbsp;&nbsp;( Mg-S )","products/msg.htm"],
/*["MPG&nbsp;&nbsp;(Mg-P)","products/mpg.htm"],*/
["MPS&nbsp;&nbsp;( Mg-K-S )","products/mps.htm"],
/*["MBS&nbsp;&nbsp;(Mg-B-S)","products/msg.htm"],*/
["TaGra","products/tagra.htm"],
["TaGra II ( For Turf )","products/tagra2.htm"],
["TaGra III ( Controlled Release )","products/tagra3.htm"]
];


//主菜单
var Menu = [
["Amino Acid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;","products/amino-grow40.htm",SubMenuA],
["Humic Acid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;","products/humitop.htm",SubMenuB],
["Natural Extract&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;","products/SeaTop.html",SubMenuC],
["EDTA Microelements&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;","products/edta-1.htm",SubMenuD],
["Granular Fertilizer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;","products/biostar.htm",SubMenuE],
["Soluble NPK+TE","products/growsol.htm",""],
["Raw Material","products/Raw Material.htm",""]
];

//=========以下内容不要修改==========//

function onColor(td)
{
	td.style.color='#ffffff';
}

function offColor(td)
{
	td.style.color='#000000';
}


function WriteMenu() {
	document.write ("<div id='ProdMenu' onmouseover=\"this.style.visibility = 'visible'\" onmouseout=\"this.style.visibility = 'hidden'\" style='visibility:hidden;position:absolute;'>");
	document.write ("<table border=0 cellspacing=0 cellpadding=0>");
	document.write("<tr><td height='1'>");
	document.write("</td></tr>");
	for (var i = 0;i<Menu.length;i++) {
		document.write ("<tr><td width='160' class='MenuOut'");
		if (Menu[i][2].length > 0) {
			document.write (" onmouseover=\"ShowSubMenu(this,'SubMenu"+ i +"')\" onmouseout=\"HideSubMenu(this,'SubMenu"+ i +"')\">");
		}
		else {
			document.write (" onmouseover='MenuOver(this)' onmouseout='MenuOut(this)'>");
		}
		if (Menu[i][1].length > 0) {
			document.write ("<a class='meu' href=\"" + Menu[i][1] + "\">");
		}
		if (Menu[i][2].length > 0)
		{
		document.write (Menu[i][0]+"<img src='images/x1.gif' width='14' height='14' border='0' />");
		}
		else
		{
		document.write (Menu[i][0]);
		}
		if (Menu[i][1].length > 0) {
			document.write ("</a>");
		}
		if (Menu[i][2].length > 0) {
			document.write ("<div id='SubMenu" + i + "' style='visibility:hidden;position:absolute;'>");
			document.write ("<table border=0 cellspacing=0 cellpadding=0 width='210'>");
			document.write("<tr><td height='2'>");
			document.write("</td></tr>");
			for (var j = 0;j < Menu[i][2].length;j++) {
				document.write ("<tr><td class='SubMenuOut'");
				document.write (" onmouseover='SubMenuOver(this)' onmouseout='SubMenuOut(this)'");
				document.write (" onclick=\"GetUrl('" + Menu[i][2][j][1] + "')\"");
				document.write (">" + Menu[i][2][j][0]);
				document.write ("</td></tr>");
			}
			document.write ("</table>");
			document.write ("</div>");
		}
		document.write ("</td></tr>");
	}
	document.write ("</table>");
	document.write ("</div>");
}

function ShowMenu(src,MenuID){
	var h = src.offsetHeight + 0;
	var l = src.offsetLeft + 0;
  var t = src.offsetTop + h;
	var vParent = src.offsetParent;
	while (vParent.tagName.toUpperCase() != "BODY")
  {
      l += vParent.offsetLeft;
      t += vParent.offsetTop;
      vParent = vParent.offsetParent;
  }
	document.getElementById(MenuID).style.top = t;
  document.getElementById(MenuID).style.left = l;
	if (document.layers)
		document.layers[MenuID].visibility = 'visible';
	else if (document.all)
		document.getElementById(MenuID).style.visibility = 'visible'
}

function HideMenu(MenuID){
	if (document.layers)
		document.layers[MenuID].visibility = 'hidden';
	else if (document.all)
		document.getElementById(MenuID).style.visibility = 'hidden'
}

function ShowSubMenu(src,MenuID) {
	src.className = "MenuOver";
  var l = src.offsetLeft + Number(src.width) + 31;
  var t = src.offsetTop - 1;
	//var vParent = src.offsetParent;
	//while (vParent.tagName.toUpperCase() != "BODY")
  //{
  //   l += vParent.offsetLeft;
  //   t += vParent.offsetTop;
  //   vParent = vParent.offsetParent;
  //}
	document.getElementById(MenuID).style.top = t;
  document.getElementById(MenuID).style.left = l;
	if (document.layers)
		document.layers[MenuID].visibility = 'visible';
	else if (document.all)
		document.getElementById(MenuID).style.visibility = 'visible'
}

function HideSubMenu(src,MenuID) {
	src.className = "MenuOut";
	HideMenu(MenuID);
}

function MenuOut(src) {
	src.className = "MenuOut";
}

function MenuOver(src) {
	src.className = "MenuOver";
}

function SubMenuOut(src) {
	src.className = "SubMenuOut";
}

function SubMenuOver(src) {
	src.className = "SubMenuOver";
}

function GetUrl(Url) {
	document.location = Url;
}

WriteMenu();