	function chsel()
	{
		with (document.uform)
		{
			if(province.value) 
			{
				city.options.length=0;
				for(var i=0;i<selects[province.value].length;i++)
				{
					city.add(selects[province.value][i]);
				}
			}
		}
	}

function confirmdel(id)
{
	if(confirm("确定删除吗?"))
	{
	window.location.href("UserOrder.asp?orderid="+id+"&act=del");
	}
}

function CheckBuy()
{
	if (document.buyform.proname.value =="" ){
		alert ("提示：\n\n订购的产品名称不能为空！");
		document.buyform.proname.focus();
		return false;
	}
	if (document.buyform.buynum.value.length <1){
		alert ("提示：\n\n定购数量不能空！");
		document.buyform.buynum.focus();
		return false;
	}
	if (document.buyform.name.value.length < 2 || document.buyform.name.value.length > 16){
		alert ("提示：\n\n姓名必须在2-16字之间！");
		document.buyform.name.focus();
		return false;
	}

	if (document.buyform.tel.value == ""|| document.buyform.tel.value.length < 8){
		alert ("提示：\n\n联系电话必须在8个字符以上！");
		document.buyform.tel.focus();
		return false;
	}

	if (document.buyform.address.value == ""|| document.buyform.address.value.length < 8){
		alert ("提示：\n\n联系地址不能少于8个字符！");
		document.buyform.address.focus();
		return false;
	}

    if(document.buyform.email.value.length!=0)
     {
       if (document.buyform.email.value.charAt(0)=="." ||        
            document.buyform.email.value.charAt(0)=="@"||       
            document.buyform.email.value.indexOf('@', 0) == -1 || 
            document.buyform.email.value.indexOf('.', 0) == -1 || 
            document.buyform.email.value.lastIndexOf("@")==document.buyform.email.value.length-1 || 
            document.buyform.email.value.lastIndexOf(".")==document.buyform.email.value.length-1)
        {
         alert("Email地址格式不正确！");
         document.buyform.email.focus();
         return false;
         }
      }
    else
     {
      alert("Email不能为空！");
      document.buyform.email.focus();
      return false;
      }
 }

function mycheck()
{
if (document.form2.uname.value.length==0)
{
alert("请填写您的昵称");
document.form2.uname.focus();
return false;
}

if (document.form2.title1.value.length==0)
{
alert("请填写留言主题");
document.form2.title1.focus();
return false;
}
if (document.form2.comtont.value.length==0)
{
alert("请填写反馈内容");
document.form2.comtont.focus();
return false;
}
}


function resizeimg(ImgD,iwidth,iheight) {
     var image=new Image();
     image.src=ImgD.src;
     if(image.width>0 && image.height>0){
        if(image.width/image.height>= iwidth/iheight){
           if(image.width>iwidth){
               ImgD.width=iwidth;
               ImgD.height=(image.height*iwidth)/image.width;
           }else{
                  ImgD.width=image.width;
                  ImgD.height=image.height;
                }
               ImgD.alt=image.width+"×"+image.height;
        }
        else{
                if(image.height>iheight){
                       ImgD.height=iheight;
                       ImgD.width=(image.width*iheight)/image.height;
                }else{
                        ImgD.width=image.width;
                        ImgD.height=image.height;
                     }
                ImgD.alt=image.width+"×"+image.height;
            }
　　　　　ImgD.style.cursor= "pointer"; //改变鼠标指针
　　　　　ImgD.onclick = function() {} //点击打开大图片
　　　　if (navigator.userAgent.toLowerCase().indexOf("ie") > -1) { //判断浏览器，如果是IE
　　　　　　ImgD.title = "点击查看大图...";
　　　　　　ImgD.onmousewheel = function img_zoom() //滚轮缩放
　　　　　 {
　　　　　　　　　　var zoom = parseInt(this.style.zoom, 10) || 100;
　　　　　　　　　　zoom += event.wheelDelta / 12;
　　　　　　　　　　if (zoom= 0)　this.style.zoom = zoom + "%";
　　　　　　　　　　//'如要鼠标滚动缩放反上面的转换这句
　　　　　　　　　　//if (zoom> 0)　this.style.zoom = zoom + "%";
　　　　　　　　　　return false;
　　　　　 }
　　　  } else { //如果不是IE
　　　　　　　     ImgD.title = "点击查看大图...";
　　　　　　   }
    }
}

function shchk()
{
if(document.sh.pname.value=="")
{
	alert("please enter the keyword");
	sh.pname.focus();
	return false;
}
}

//function searchchk()
//{
//if(document.form1.mykind.value=="")
//{
//	alert("请选择您的产品类别");
//	form1.mykind.focus();
//	return false;
//}
//if(document.form1.mykeywords.value=="请输入产品货号")
//{
//	alert("请输入产品货号");
//	form1.mykeywords.focus();
//	return false;
//}
//
//}



function ShowMenu(TB)
{  whichTB = eval("Menu" + TB);
   if (whichTB.style.display == "none")
   {
     eval("Menu" + TB + ".style.display=\"\";");
   }
   else
   {
     eval("Menu" + TB + ".style.display=\"none\";");
   }
}


	
	function CheckJob()
{
	if (document.form2.jobname.value.length < 3 || document.form2.jobname.value.length > 30){
		alert ("提示：\n\n职位必须在3-30字之间！");
		document.form2.jobname.focus();
		return false;
	}
	if (document.form2.name.value.length < 2 || document.form2.name.value.length > 16){
		alert ("提示：\n\n姓名必须在2-16字之间！");
		document.form2.name.focus();
		return false;
	}
	if (document.form2.date.value.length!=10){
		alert ("提示：\n\n出生日期格式不对！");
		document.form2.date.focus();
		return false;
	}
	if (document.form2.stature.value.length != 3){
		alert ("提示：\n\n身高格式不对！");
		document.form2.stature.focus();
		return false;
	}
	if (document.form2.residence.value.length < 4 ||document.form2.residence.value.length > 30 ){
		alert ("提示：\n\n户籍所在地在4-30个符之间！");
		document.form2.residence.focus();
		return false;
	}
	if (document.form2.edu_level.value.length < 20 ){
		alert ("提示：\n\n教育经历必须在20字以上！");
		document.form2.edu_level.focus();
		return false;
	}
	if (document.form2.job_level.value.length < 20 ){
		alert ("提示：\n\n工作经历必须在20字以上！");
		document.form2.job_level.focus();
		return false;
	}
	if (document.form2.tel.value == ""|| document.form2.tel.value.length < 8){
		alert ("提示：\n\n联系电话必须在8个字符以上！");
		document.form2.tel.focus();
		return false;
	}

    if(document.form2.email.value.length!=0)
     {
       if (document.form2.email.value.charAt(0)=="." ||        
            document.form2.email.value.charAt(0)=="@"||       
            document.form2.email.value.indexOf('@', 0) == -1 || 
            document.form2.email.value.indexOf('.', 0) == -1 || 
            document.form2.email.value.lastIndexOf("@")==document.form2.email.value.length-1 || 
            document.form2.email.value.lastIndexOf(".")==document.form2.email.value.length-1)
        {
         alert("Email地址格式不正确！");
         document.form2.email.focus();
         return false;
         }
      }
    else
     {
      alert("Email不能为空！");
      document.form2.email.focus();
      return false;
      }
 }
 
 function userlogin()
{
	if(document.uform.myname.value=="")
	{
		alert("请输入您注册的用户名");
		document.uform.myname.focus();
		return false;
	}
		if(document.uform.mypwd.value==""|| document.uform.mypwd.value.length<6)
	{
		alert("请输入正确的密码");
		document.uform.mypwd.focus();
		return false;
	}
}

function userreg()
{
	if(document.uform.uname.value=="")
	{
		alert("请输入用户名！");
		document.uform.uname.focus();
		return false;
	}
	if(document.uform.upwd.value=="" || document.uform.upwd.value.length<6 )
	{
		alert("请输入密码\n\n密码在6位以上");
		document.uform.upwd.focus();
		return false;
	}
		if(document.uform.reupwd.value=="" || document.uform.reupwd.value.length<6 )
	{
		alert("请输入确认密码\n\n确认密码在6位以上！");
		document.uform.reupwd.focus();
		return false;
	}
	if(document.uform.upwd.value!=document.uform.reupwd.value)
	{
		alert("二次密码输入不一致，请重新输入");
		document.uform.reupwd.focus();
		return false;
	}
	
	if(document.uform.utruename.value==""|| document.uform.utel.value==""|| document.uform.ufax.value==""|| document.uform.ucom.value==""|| document.uform.uadd.value==""||document.uform.uhye.value==""||document.uform.uway.value=="" || document.uform.ucomdate.value=="")
	{
	alert("请认真填写带*号的项目!");
	return false;
	}

	if(document.uform.Codes.value==""|| document.uform.Codes.value.length!=4||isNaN(document.uform.Codes.value))
	{
		alert("请输入正确的验证码！");
		document.uform.Codes.focus();
		return false;
	}
}


function openScript(url, width, height)
{
	var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes,resizable=no' );
}
function mycar(pid,memprice)
{
	openScript("Mycar.asp?addcart="+pid+"&act=mycar&mempric="+memprice,660,300);
}

function winclose()
{
	if(confirm("确认要清空购物车"))
	{
		openScript("nothing.asp");
	}
}

function GetPwd()
{
openScript('GetPwd.asp',500,300); 
}
