﻿isNav = false;
isIE = false;

if (navigator.appName.indexOf("Microsoft") != -1)
{
	isIE = true;
}
else
{
	if (parseInt(navigator.appVersion) >= 5)
	{
		isIE = true;
	}
	else
	{
		isNav = true;
	}
}
if (isNav)
{
	setxs="show";
	setxh="hide";
}
else
{
	setxs="visible";
	setxh="hidden";
}

function getWidth()
{
	if (isNav)
	{
		return window.innerWidth
	} 
	else
	{
		return document.body.clientWidth
	}
}

function getScale()
{
	var scale;	
	scale = getWidth()
	if (scale <= 1004)
	{
		scale=1004;
	}
	centx = (scale - 1004)/2
	centx = Math.floor(centx) 
	return centx;
}

function givecenter()
{
	var scale0 = getScale() + 149;
	var scale1 = getScale() + 230;
	var scale2 = getScale() + 311;
	var scale3 = getScale() + 392;
	var scale4 = getScale() + 453;
	var scale5 = getScale() + 534;
	var scale6 = getScale() + 615

	if(isNav)
	{
		document.layer00.moveTo(scale0,65)
		document.layer01.moveTo(scale1,65);
		document.layer02.moveTo(scale2,65);
		document.layer03.moveTo(scale3,65);
		document.layer04.moveTo(scale4,65);
		document.layer05.moveTo(scale5,65);
		document.layer06.moveTo(scale6,65);
	}
	else
	{
		document.all.layer00.style.pixelLeft =scale0;
		document.all.layer01.style.pixelLeft =scale1;
		document.all.layer02.style.pixelLeft =scale2;
		document.all.layer03.style.pixelLeft =scale3;
		document.all.layer04.style.pixelLeft =scale4;
		document.all.layer05.style.pixelLeft =scale5;
		document.all.layer06.style.pixelLeft =scale6;
	}
}

/* color change code begin */

function changeto(highlightcolor){
source=event.srcElement
if (source.tagName=="TR"||source.tagName=="TABLE")
return
while(source.tagName!="TD")
source=source.parentElement
if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
source.style.backgroundColor=highlightcolor
}

function changeback(originalcolor){
if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")
return
if (event.toElement!=source)
source.style.backgroundColor=originalcolor
}

/* color change code end */

function givelayer()
{	
	var scale0 = getScale() + 195;
	var scale1 = getScale() + 456;
	var scale2 = getScale() + 590;
	var scale3 = getScale() + 722;	

	morex=" onmouseover=this.style.visibility="+"'"+setxs+"'"+" onmouseout=this.style.visibility="+"'"+setxh+"'"

	document.write("<span id=layer00 style=position:absolute;left:"+scale0+";top:119px;width:216;visibility:"+setxh+morex+">");
	
	document.write("<table id=ignore width=200 cellpadding=2 cellspacing=1 border=0 bgcolor=#666666 onMouseover=changeto('0066FF') onMouseout=changeback('333333')>");
	document.write("<tr><td bgcolor=222222 height=18>　<a target=_self class=menu_title href=aboutus.asp?infoid=2>◆  　公司简介</a></td></tr>");	
	document.write("<tr><td bgcolor=222222 height=18>　<a target=_self class=menu_title href=certify.asp?infoid=22>◆  　荣誉证书</a></td></tr>");
	document.write("<tr><td bgcolor=222222 height=18>　<a target=_self class=menu_title href=course.asp?infoid=22>◆  　发展历程</a></td></tr>");
	document.write("<tr><td bgcolor=222222 height=18>　<a target=_self class=menu_title href=world.asp?sortid=1>◆  　社会责任</a></td></tr>");
	
	document.write("</table></span>");	
	

	document.write("<span id=layer01 style=position:absolute;left:"+scale1+";top:119px;width:215;visibility:"+setxh+morex+">");
	
	document.write("<table id=ignore width=200 cellpadding=2 cellspacing=1 border=0 bgcolor=#616662 onMouseover=changeto('0066FF') onMouseout=changeback('333333')>");
	document.write("<tr><td bgcolor=222222 height=18>　<a target=_self  class=menu_title href=carfilm.asp?infoid=14>◆　 汽车膜</a></td></tr>");
	document.write("<tr><td bgcolor=222222 height=18>　<a target=_self  class=menu_title href=jzfilm.asp?infoid=15>◆ 　建筑居家膜</a></td></tr>");
	document.write("<tr><td bgcolor=222222 height=18>　<a target=_self  class=menu_title href=technics.asp?infoid=16>◆ 　生产工艺</a></td></tr>");	
	document.write("<tr><td bgcolor=222222 height=18>　<a target=_self  class=menu_title href=superiority.asp?infoid=17>◆ 　产品优势</a></td></tr>");	
	document.write("<tr><td bgcolor=222222 height=18>　<a target=_self  class=menu_title href=qa.asp>◆ 　贴膜知多少</a></td></tr>");
	
	document.write("</table></span>");


	document.write("<span id=layer02 style=position:absolute;left:"+scale2+";top:119px;width:215;visibility:"+setxh+morex+">");
	
	document.write("<table id=ignore width=180 cellpadding=2 cellspacing=1 border=0 bgcolor=#616662 onMouseover=changeto('0066FF') onMouseout=changeback('222222')>");
        document.write("<tr><td bgcolor=222222  height=18>　<a target=_self href=agent-a.asp?id=4 class=menu_title>◆  　加盟商招募</a></td></tr>");
	document.write("<tr><td bgcolor=222222  height=18>　<a target=_self href=vii.asp?id=5 class=menu_title>◆  　加盟店形象</a></td></tr>");
	document.write("<tr><td bgcolor=222222  height=18>　<a target=_self href=tech.asp?id=6 class=menu_title>◆  　技术培训</a></td></tr>");
        document.write("<tr><td bgcolor=222222  height=18>　<a target=_self href=agenttable.asp?id=3 class=menu_title>◆  　申请加盟</a></td></tr>");
document.write("<tr><td bgcolor=222222 height=18>　<a target=_self  class=menu_title href=dealerInd.asp?infoid=16>◆ 　加盟商网络</a></td></tr>");
		document.write("<tr><td bgcolor=222222  height=18>　<a target=_self href=jobs.asp?id=6 class=menu_title>◆  　人才交流中心</a></td></tr>");

	document.write("</table></span>");	
	
	document.write("<span id=layer03 style=position:absolute;left:"+scale3+";top:119px;width:215;visibility:"+setxh+morex+">");
	
        document.write("<table id=ignore width=180 cellpadding=2 cellspacing=1 border=0 bgcolor=#616662 onMouseover=changeto('0066FF') onMouseout=changeback('222222')>");
        document.write("<tr><td bgcolor=222222  height=18>　<a target=_self href=UserCheck.aspx?id=4 class=menu_title>◆  　电子质保查询</a></td></tr>");
	document.write("<tr><td bgcolor=222222  height=18>　<a target=_self href=/card/check.aspx?id=5 class=menu_title>◆  　质保卡认证</a></td></tr>");
	document.write("<tr><td bgcolor=222222  height=18>　<a target=_self href=../manage/agentLogin.aspx?id=5 class=menu_title>◆  　加盟商操作系统</a></td></tr>");
	        document.write("<tr><td bgcolor=222222  height=18>　<a target=_self href=qa.asp?id=3 class=menu_title>◆  　贴膜知多少</a></td></tr>");
	document.write("<tr><td bgcolor=222222  height=18>　<a target=_self href=leaveword.asp?id=6 class=menu_title>◆  　用户反馈</a></td></tr>");
        document.write("<tr><td bgcolor=222222  height=18>　<a target=_self href=contactus.asp?id=3 class=menu_title>◆  　联系我们</a></td></tr>");

	document.write("</table></span>");	
}
