function searchChk()
{
	if(document.sh.keywords.value=="")
	{
		alert("Please Input the Keywords!");
		document.sh.keywords.focus();
		return false;
	}
}

function Guestbookchk()
{
    if(document.form1.yemail.value.length!=0)
     {
       if (document.form1.yemail.value.charAt(0)=="." ||        
            document.form1.yemail.value.charAt(0)=="@"||       
            document.form1.yemail.value.indexOf('@', 0) == -1 || 
            document.form1.yemail.value.indexOf('.', 0) == -1 || 
            document.form1.yemail.value.lastIndexOf("@")==document.form1.yemail.value.length-1 || 
            document.form1.yemail.value.lastIndexOf(".")==document.form1.yemail.value.length-1)
        {
         alert("Email is wrong！");
         document.form1.yemail.focus();
         return false;
         }
      }
    else
     {
      alert("Email not be blank！");
      document.form1.yemail.focus();
      return false;
      }	
	  
	  if(document.form1.ysubject.value=="")
	  {
		  alert("Please input your subject");
		  document.form1.ysubject.focus();
		  return false;
	   }
	  if(document.form1.ymess.value.length<5)
	  {
		  alert("Please input your Message");
		  document.form1.ymess.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 userlogin()
{
	if(document.uform.myname.value=="")
	{
		alert("Please input your name");
		document.uform.myname.focus();
		return false;
	}
		if(document.uform.mypwd.value==""|| document.uform.mypwd.value.length<6)
	{
		alert("Please input your password");
		document.uform.mypwd.focus();
		return false;
	}
}

function userreg()
{
 if(document.form2.Uemail.value.length!=0)
  {
    if (document.form2.Uemail.value.charAt(0)=="." ||        
         document.form2.Uemail.value.charAt(0)=="@"||       
         document.form2.Uemail.value.indexOf('@', 0) == -1 || 
         document.form2.Uemail.value.indexOf('.', 0) == -1 || 
         document.form2.Uemail.value.lastIndexOf("@")==document.form2.Uemail.value.length-1 || 
         document.form2.Uemail.value.lastIndexOf(".")==document.form2.Uemail.value.length-1)
     {
      alert("Email is wrong！");
      document.form2.Uemail.focus();
      return false;
      }
   }
 else
  {
   alert("Email not be blank！");
   document.form2.Uemail.focus();
   return false;
   }


	if(document.form2.upwd.value=="" || document.form2.upwd.value.length<6 )
	{
		alert("Please besure the password");
		document.form2.upwd.focus();
		return false;
	}
		if(document.form2.reupwd.value=="" || document.form2.reupwd.value.length<6 )
	{
		alert("Please besure the Repassword！");
		document.form2.reupwd.focus();
		return false;
	}
	if(document.form2.upwd.value!=document.form2.reupwd.value)
	{
		alert("The password is wrong");
		document.form2.reupwd.focus();
		return false;
	}
	if(document.form2.UpassS1.value=="")
	{
		alert("Please input the question");
		document.form2.UpassS1.focus();
		return false;
	}
	if(document.form2.UpassS2.value=="")
	{
		alert("Please input the answer");
		document.form2.UpassS2.focus();
		return false;
	}
	
	if(document.form2.vCodes.value==""|| document.form2.vCodes.value.length!=4||isNaN(document.form2.vCodes.value))
	{
		alert("Please input the right checkcode！");
		document.form2.vCodes.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' );
}
function mycar(pid,memprice)
{
	openScript("Mycar.asp?addcart="+pid+"&act=mycar&mempric="+memprice,620,400)
}

function winclose()
{
	if(confirm("Besure Clear the shopping car?"))
	{
		openScript("nothing.asp");
	}
}

function GetPwd()
{
openScript('GetPwd.asp',500,300); 
}
