<!-- // Start of AdSubtract JavaScript block; you can ignore this.
     // It is used when AdSubtract blocks cookies or pop-up windows.
document.iMokie = "cookie blocked by AdSubtract";
document.iMferrer = "referrer blocked by AdSubtract";
function iMwin() {
	this.location = "";
	this.frames = new Array(9);
	this.frames[0] = this;
	this.frames[1] = this;
	this.frames[2] = this;
	this.frames[3] = this;
	this.frames[4] = this;
	this.frames[5] = this;
	this.frames[6] = this;
	this.frames[7] = this;
	this.frames[8] = this;
	this.length = 0;
}
// End of AdSubtract JavaScript block. -->
function SetHomePage(obj,url)
{
	obj.style.behavior='url(#default#homepage)';
	obj.setHomePage(url);
}

// str: output string
// priority: 0 is normal, 1 is important
function OutputAnnounce(str,priority) 
{
	if (priority==1) 
		document.write('<p class="important_anno">?');
	else
		document.write('<p>?');
	document.write(str)
	document.write('</p>');
}

// Construct menuitems
// subid1, subid2: the index of array of submenuitem which the menuitem contains (from-to)
// visible: if the submenu is visible, true is 1, false is 0
function MenuItem(name,lnk,subid1,subid2)
{
	this.name=name;
	this.lnk=lnk;
	this.subid1=subid1;
	this.subid2=subid2;
}

function SubMenuItem(name,lnk)
{
	this.name=name;
	this.lnk=lnk;
}

var Menu = new Array();
Menu[0] = new MenuItem("首页","big5.htm",0,-1);
Menu[1] = new MenuItem("公司简介","brief.htm",0,-1);
Menu[2] = new MenuItem("产品介绍","products.htm",0,-1);
Menu[3] = new MenuItem("常用化学品","occupation.htm",0,-1);
Menu[4] = new MenuItem("相关连结","links.htm",0,-1);
Menu[5] = new MenuItem("与我们联络","contact.htm",0,-1);

var SubMenu = new Array();
//
SubMenu[0]= new SubMenuItem("EMPTY","empty.htm");



function ShowMenu(m)
{
	var a=document.all.tags("div");
	for (i=0; i<a.length; i++)
	{			
		if (a[i].id==("menu"+m.toString()))
		{
			if (a[i].style.display != "none")
				a[i].style.display= "none";
			else
				a[i].style.display= "block";
		}
	}
}

function HideAllMenu()
{
	var a=document.all.tags("div");
	for (i=0; i<a.length; i++)
	{
		if (a[i].id.substr(0,4)=="menu")
		{
			a[i].style.display = "none"
		}
	}
}

function ConstructMenu()
{
	document.write('<br><br>');
	for (i=0; i<Menu.length; i++)
	{
		document.write('<p align="center" onclick="ShowMenu(',i,')">');
		document.write('<a href=',Menu[i].lnk,' class=menu>');
		document.write(Menu[i].name);
		document.write("</a>");
		
		document.write('<div align="center" id=menu',i,'>');

					
		for (j=Menu[i].subid1; j<=Menu[i].subid2; j++)
		{
			document.write("<a href=",SubMenu[j].lnk," class=submenu>",SubMenu[j].name,"</a><br>");
		}
		document.write('</div></p>');
	}
	HideAllMenu();
}
