//Javascript

function SymError()
{
  return true;
}

window.onerror = SymError;


var ScriptEnable=false;

if(document)
{
	var browser=navigator.appName.indexOf("Microsoft")!=-1;
	//var version=navigator.appVersion.charAt(0)-0;
	if(jsVersion==1.3&&browser)
		ScriptEnable=true;
	else
		NavError();
}
else
	NavError();

function NavError()
{
	window.status="您的浏览器版本过低或不支持本页面的脚本,当前脚本已被禁用"
}


if(ScriptEnable)
{
	window.onerror="";
	
	String.prototype.getBitLength=function()
	{
		var ret=0;
		var len=this.length;
		for(var i=0;i<len;i++)
			if(this.charCodeAt(i)>128)
				ret+=2;
			else
				ret++;
		return ret;
	};
	var xmlDocObject = new ActiveXObject("Microsoft.XMLDOM");
	document.onclick=new Function("doClick(event);return true;");
}

function doClick(Event)
{
	if(!ScriptEnable)return false;
	
	if(Event.srcElement.tagName=="A"||Event.srcElement.tagName=="IMG")
	{
		Event.srcElement.blur();
		document.body.focus();
	}
	return true;
}

function doSelectStart(Event)
{
	if(!ScriptEnable)return false;
	
	if(Event.srcElement.tagName=="A"||Event.srcElement.tagName=="IMG")
		return false
	else
		return false;
}

function MVhrefTD(srcElement)
{
	if(!ScriptEnable)return false;
	srcElement.bgColor="white";
}

function MOhrefTD(srcElement)
{
	if(!ScriptEnable)return false;
	srcElement.bgColor=navMenuBgColor;
}

var headMenuArray=new Array();

function headMenu(Event)
{
	if(!ScriptEnable)return false;
	var index=Event.srcElement.innerText;
	var posLeft=0;
	var items=new Array();
	switch(index)
	{
		case "企业简介":
			index=0;
			posLeft=6;
			if(!headMenuArray[index])
			{
				items.push(new menuItem("公司简介","company.asp"));
				items.push(new menuItem("联系方式","contact.asp"));
			}
		break;
		case "新闻公告":
			index=1;
			posLeft=5;
			if(!headMenuArray[index])
			{
				items.push(new menuItem("恒协动态","ENP.asp?area=1"));
				items.push(new menuItem("媒体宣传","ENP.asp?area=23"));
				items.push(new menuItem("行业新闻","ENP.asp?area=4"));
			}
		break;
		case "加盟连锁":
			index=2;
			posLeft=4;
			if(!headMenuArray[index])
			{
				items.push(new menuItem("加盟体系","league.asp?page=1"));
				items.push(new menuItem("加盟支持","league.asp?page=2"));
				items.push(new menuItem("经营ABC","league.asp?page=3"));
				items.push(new menuItem("投资分析","league.asp?page=4"));
				items.push(new menuItem("加盟恒协","league.asp?page=5"));
				items.push(new menuItem("设备配制","equipment.asp"));
			}
		break;
		case "洗涤设备":
			index=3;
			posLeft=3;
			if(!headMenuArray[index])
			{
				/*
				items.push(new menuItem("石 油 干 洗 机","equipment.asp?page=1"));
				items.push(new menuItem("四氯乙稀干洗机","equipment.asp?page=2"));
				items.push(new menuItem("自吸风熨烫台","equipment.asp?page=3"));
				items.push(new menuItem("蒸 汽 发 生 器","equipment.asp?page=4"));
				items.push(new menuItem("真空抽湿去渍台","equipment.asp?page=5"));
				items.push(new menuItem("空　压　机","equipment.asp?page=6"));
				items.push(new menuItem("自动人像烫机","equipment.asp?page=7"));
				items.push(new menuItem("熨　烫　斗","equipment.asp?page=8"));
				items.push(new menuItem("成衣立体包装机","equipment.asp?page=9"));
				items.push(new menuItem("电子衣物消毒机","equipment.asp?page=10"));
				items.push(new menuItem("",""));
				items.push(new menuItem("洗脱两用水洗机","equipment.asp?page=11"));
				items.push(new menuItem("自 动 烘 干 机","equipment.asp?page=12"));
				items.push(new menuItem("工 业 洗 衣 机","equipment.asp?page=13"));
				items.push(new menuItem("工 业 脱 水 机","equipment.asp?page=14"));
				items.push(new menuItem("熨　平　机","equipment.asp?page=15"));
						*/
				items.push(new menuItem("石油干洗机","equipment.asp?page=1"));
				items.push(new menuItem("干 洗 机","equipment.asp?page=2"));
				items.push(new menuItem("吸风熨烫台","equipment.asp?page=3"));
				items.push(new menuItem("蒸汽发生器","equipment.asp?page=4"));
				items.push(new menuItem("抽湿去渍台","equipment.asp?page=5"));
				items.push(new menuItem("空 压 机","equipment.asp?page=6"));
				items.push(new menuItem("人像烫机","equipment.asp?page=7"));
				items.push(new menuItem("熨 烫 斗","equipment.asp?page=8"));
				items.push(new menuItem("立体包装机","equipment.asp?page=9"));
				items.push(new menuItem("衣物消毒机","equipment.asp?page=10"));
				items.push(new menuItem("",""));
				items.push(new menuItem("两用水洗机","equipment.asp?page=11"));
				items.push(new menuItem("自动烘干机","equipment.asp?page=12"));
				items.push(new menuItem("工业洗衣机","equipment.asp?page=13"));
				items.push(new menuItem("工业脱水机","equipment.asp?page=14"));
				items.push(new menuItem("熨 平 机","equipment.asp?page=15"));			


			}
		break;
		case "媒体宣传":
			index=4;
			posLeft=2;
			if(!headMenuArray[index])
			{
				items.push(new menuItem("期刊宣传","ENP.asp?area=2"));
				items.push(new menuItem("报刊传播","ENP.asp?area=3"));
			}
		break;
	}
	
	if(isNaN(index))return false;
	
	if(!headMenuArray[index])
	{
		headMenuArray[index]=new headMenuObject(posLeft,index,Event.srcElement,items)
	}
	
	
	if(Event.type=="mouseover")
	{
		headMenuArray[index].Show();
	}
	else
	{
		headMenuArray[index].Hide(Event);
	}
}

function headMenuObject(index,arrayIndex,srcElement,items)
{
	this.index=index;
	this.arrayIndex=arrayIndex;
	this.srcElement=srcElement;
	this.items=items.concat();
	this.headWidth=760;
	this.menuWidth=80;
	this.headTop=90;
	this.topIndex=100;
	this.shadowDeep=5;
	this.shadowAlpha=20;
	this.Init=function()
	{
		this.menu=document.createElement("DIV");
		
		with(this.menu)
		{
			style.position="absolute";
			style.top=this.headTop-1;
			style.left=this.headWidth-(this.index+1)*(this.menuWidth+1)-2;
			style.width=this.menuWidth+2;
			var ii=0;
			var ei=0;
			for(var i=0;i<this.items.length;i++)
				if(this.items[i].title)ii++;
				else ei++;
			style.height=ii*23+ei*2;
			style.border="0 solid #9a9a9a";
			style.backgroundColor="white";
			style.zIndex=this.topIndex;
			onmouseout=new Function("headMenuArray["+arrayIndex+"].Hide(event)");
			/*
			if(this.arrayIndex==3)
			{
				style.width=this.menuWidth+14;
				style.left=this.headWidth-(this.index+1)*(this.menuWidth+1)-6;
			}
			*/
		}
		
		document.body.appendChild(this.menu);


		var buf="<table cellspacing=1 cellpadding=4 bgcolor=#9a9a9a width=100%>";
		for(var i=0;i<this.items.length;i++)
			buf+="<tr><a href='"+this.items[i].href+"'><td bgcolor=white "+(this.arrayIndex==3?"style='letter-spacing:normal;' ":"")+"onmouseover=\"this.bgColor='#DEF2FF';this.style.color='black';\" onmouseout=\"this.bgColor='white';this.style.color='black';\" class=hrefTD>"+this.items[i].title+"</td></a>";
		buf+="</table>"
		this.menu.innerHTML=buf;
		
		this.shadowItem=new Array();
		for(var i=0;i<this.shadowDeep;i++)
		{
			this.shadowItem[i]=document.createElement("DIV");
			with(this.shadowItem[i])
			{
				style.position="absolute";
				style.top=i+1;
				//style.left=i+1
				style.width=this.menu.style.width;
				style.height=this.menu.style.height;
				style.backgroundColor="#000000";
				style.zIndex=-1-i;
				style.filter="alpha(opacity="+(this.shadowAlpha-(i+1)*(this.shadowAlpha/this.shadowDeep))+")"
			}
			this.menu.appendChild(this.shadowItem[i]);
			
		}
	}
	this.Init();
	this.Show=function()
	{
		this.menu.style.display="";
		this.srcElement.bgColor="#FFffff";
		//this.srcElement.style.color="white";
	}
	this.Hide=function(Event)
	{
		var srcElement=Event.toElement;
		while(srcElement)
		{
			if(srcElement==this.menu)
			{
				return false;
			}
			srcElement=srcElement.parentNode;
		}
		this.menu.style.display="none";
		this.srcElement.bgColor="";
		this.srcElement.style.color="black";
	}
}

function menuItem(title,href)
{
	this.title=title;
	this.href=href;
}

function deleteConfirm(message)
{
	return confirm("是否删除"+message);
}
