//创建全局变量
var strArrayImage;
//用户注册时建议填写的项目
function ShowAdvice()
{
	if (document.all["objShow"].checked==true)
	{
		Advice.style.display="";
	}else{
		Advice.style.display="none";
	}
	document.all["objShow"].blur();
}
//用户注册时选择形象的JavaScript代码
function ChangeVisualize()
{
	with (document.all["objVisualizeID"])
	{
		document.all["Visualize"].src="/images/Visualize/"+options[selectedIndex].value + ".gif";
	}
}
//用户登录时的JavaScript代码
function CheckLogin()
{
	with (document.forms[0])
	{
		if (tbxUserName.value.length<2)
		{
			tbxUserName.focus();
			alert("用户名错误　");
			return false;
		}
		if (tbxPassword.value.length<6)
		{
			tbxPassword.focus();
			alert("密码有错误　");
			return false;
		}
		return true;
	}
}
//在用户修改注册信息时，为文本框赋值
function Modify_Evaluate(aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll)
{
	with (document.forms[0])
	{
		tbxPassword.value=aa;
		tbxPhone.value=bb;
		tbxEmail.value=dd;
		tbxRealName.value=ee;
		tbxBirthday.value=ff;
		tbxFax.value=gg;
		tbxAddress.value=hh;
		tbxPostalCode.value=ii;
		tbxCompany.value=jj;
		tbxURL.value=kk;
		tbxOtherContact.value=ll;
		for (iSelectIndex=0;iSelectIndex<objVisualizeID.options.length;iSelectIndex++)
			{
				if (objVisualizeID.options[iSelectIndex].value==cc)
				objVisualizeID.options[iSelectIndex].selected=true;
			}
	}
}
//为留言板中的详细信息部分添加留言
function SetValueGuest(aa)
{
	if (aa!="")
	{
		document.forms[0].tbxDescription.value="我预咨询的产品类别为：" + aa + "，请尽快与我联系，我的联系方式见上！";
	}
}
//切换图片
function ReplaceImage(src,obj)
{
	obj.src=src;
}
//切换网址
function SwitchURL(url)
{
	location.href=url;
}
//弹出模态窗体
function showDialog(url,Name,Param)
{
	showModalDialog(url,Name,Param);
}
//弹出新窗体
function OpenWin(url,Name,Param)
{
	window.open(url,Name,Param);
}
//弹出找回密码的窗口
function FindMyPassword()
{
	OpenWin('/register/find.aspx','Find','width=360,height=180');
}
//代理商登录时的检测代码
function CheckAgentLogin(strValidate)
{
	with (document.forms[0])
	{
		if (tbxUserName.value.length<2 || tbxUserName.value.length>10)
		{
			alert("用户名不正确　　");
			tbxUserName.focus();
			return false;
		}
		if (tbxPassword.value.length<6 || tbxPassword.value.length>20)
		{
			alert("密码不正确　　");
			tbxPassword.focus();
			return false;
		}
			return true;
	}
}
//代理商留言时的检测代码
function CheckAgentGuest()
{
	with (document.forms[0])
	{
		if (tbxTitle.value=="")
		{
			alert("留言不能为空　　");
			tbxTitle.focus();
			return false;
		}
		if (tbxDescription.value="")
		{
			alert("留言内容不能为空　　");
			return false;
		}
			return true;
	}
}
//主菜单的鼠标滑过的代码
function MainmenuMouseover(obj,k)
{
	if (k!=1 || k!=17)
	{
		var objW=obj.offsetWidth;
		var objH=obj.offsetHeight;
		var t=obj.offsetTop;
		var l=obj.offsetLeft;
		while(obj=obj.offsetParent)
		{
			t+=obj.offsetTop;
			l+=obj.offsetLeft;
		}
		Menu.innerHTML=eval('Menu' + k);
		Menu.style.left=l+objW;
		Menu.style.top=t;
		with (Mask.style)
		{
			left=l;
			top=t+1;
			height=objH-1;
			width=parseInt(height)/3;
			Mask.filters.Alpha.opacity=60;
			display='';
		}
	}
	Menu.style.display='';
}
//二级菜单鼠标滑过的代码
function ThirdMenuMouseover(obj,k)
{
	var objW=obj.offsetWidth;
	var objH=obj.offsetHeight;
	var t=obj.offsetTop;
	var l=obj.offsetLeft;
	while(obj=obj.offsetParent)
	{
		t+=obj.offsetTop;
		l+=obj.offsetLeft;
	}
	Menu.style.display='';
	with (ThirdMenu)
	{
		innerHTML=eval('ThirdMenu' + k);
		style.left=(Menu.offsetLeft)+(Menu.offsetWidth)-1;
		style.top=t;
		style.display='';
	}
}
//三级菜单鼠标滑过的代码
function FourMenuMouseover(obj,k)
{
	var objW=obj.offsetWidth;
	var objH=obj.offsetHeight;
	var t=obj.offsetTop;
	var l=obj.offsetLeft;
	while (obj=obj.offsetParent)
	{
		t+=obj.offsetTop;
		l+=obj.offsetLeft;
	}
	ThirdMenu.style.display='';
	with (FourMenu)
	{
		innerHTML=eval('FourMenu' + k);
		style.left=(ThirdMenu.offsetLeft)+(ThirdMenu.offsetWidth)-1;
		style.display='';
		if (t+offsetHeight<document.body.clientHeight)
		{
			style.top=t;
		}
		else if (t-offsetHeight>0)
		{
			style.top = t - offsetHeight + 25;
		}
		else
		{
			style.top=document.body.scrollTop;
		}
	}
}
//主菜单的鼠标滑出的代码
function MainmenuMouseout(obj)
{
	obj.style.backgroundColor='';
	Menu.style.display='none';
	Mask.style.display='none';
}
//二级菜单的鼠标滑出的代码
function ThirdMenuMouseout(obj)
{
	obj.style.backgroundColor='';
	if (FourMenu.style.display=='none')
	{
		ThirdMenu.style.display='none';
	}
}
//三级菜间鼠标滑出的代码
function FourMenuMouseout(obj)
{
	obj.style.backgroundColor='';
	FourMenu.style.display='none';
}
//定义弹出提示
tPopWait=50;
tPopShow=5000;
showPopStep=20;
popOpacity=99;
sPop=null;
curShow=null;
tFadeOut=null;
tFadeIn=null;
tFadeWaiting=null;

document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText {  background-color: #F8F8F5;color:#000000; border: 1px #000000 solid;font-color: font-size: 12px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0)}");
document.write("</style>");
document.write("<div id='dypopLayer' style='position:absolute;z-index:9999;' class='cPopText'></div>");

function showPopupText(){
var o=event.srcElement;
	MouseX=event.x;
	MouseY=event.y;
	if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
        if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
	if(o.dypop!=sPop) {
			sPop=o.dypop;
			clearTimeout(curShow);
			clearTimeout(tFadeOut);
			clearTimeout(tFadeIn);
			clearTimeout(tFadeWaiting);	
			if(sPop==null || sPop=="") {
				dypopLayer.innerHTML="";
				dypopLayer.style.filter="Alpha()";
				dypopLayer.filters.Alpha.opacity=0;	
				}
			else {
				if(o.dyclass!=null) popStyle=o.dyclass 
					else popStyle="cPopText";
				curShow=setTimeout("showIt()",tPopWait);
			}
			
	}
}

function showIt(){
		dypopLayer.className=popStyle;
		dypopLayer.innerHTML=sPop;
		popWidth=dypopLayer.clientWidth;
		popHeight=dypopLayer.clientHeight;
		if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust =-popWidth - 24
			else popLeftAdjust = 0;
		if(MouseY + 12 + popHeight > document.body.clientHeight) popTopAdjust =- popHeight - 24
			else popTopAdjust=0;
		dypopLayer.style.left = MouseX + 12 + document.body.scrollLeft + popLeftAdjust;
		dypopLayer.style.top = MouseY + 12 + document.body.scrollTop + popTopAdjust;
		dypopLayer.style.filter = "Alpha(Opacity = 0)";
		fadeOut();
}

function fadeOut(){
	if(dypopLayer.filters.Alpha.opacity < popOpacity) {
		dypopLayer.filters.Alpha.opacity += showPopStep;
		tFadeOut=setTimeout("fadeOut()",1);
		}
		else {
			dypopLayer.filters.Alpha.opacity = popOpacity;
			tFadeWaiting=setTimeout("fadeIn()",tPopShow);
			}
}

function fadeIn(){
	if(dypopLayer.filters.Alpha.opacity>0) {
		dypopLayer.filters.Alpha.opacity -= 1;
		tFadeIn=setTimeout("fadeIn()",1);
		}
}
document.onmouseover=showPopupText;
function HiddenMenu()
{
	if (ThirdMenu.style.display='none')
	{
		Menu.style.display='none';
	}
}
function HiddenThirdMenu()
{
	ThirdMenu.style.display='none';
	Menu.style.display='none';
	HiddenMenu();
}
function HiddenFourMenu()
{
	FourMenu.style.display='none';
	ThirdMenu.style.displaly='none';
	HiddenThirdMenu();
}
function CloseLeft()
{
	Left.style.display='none';
	Right.style.display='none';
	blnShow=false;
}
//使打开的IE窗口最大化
function MaxIE()
{
	with (window)
	{
		var a = screen.width + 8;
		var b = screen.height - 22 ;
		window.moveTo(-4,-4)
		window.resizeTo(a,b)
	}
}//打开导购窗口
function OpenGuide()
{
	var W = document.body.clientWidth;
	var H = document.body.clientHeight;
	OpenWin("/guide/XLEBuy2/client/C_main.html","Guide","");
}