 //会员登录弹出框
 function locking3(){          
   document.getElementById("ly3").style.display="block";   
   //document.getElementById("ly3").style.width=document.body.clientWidth;   
   //document.getElementById("ly3").style.height=document.body.clientHeight;  
   //如果高度不对就用这句
  // document.getElementById("ly3").style.height=window.document.body.scrollHeight;
   document.getElementById("Layer23").style.display='block';  
   var fadeBg = document.getElementById('ly3');
	//************************************************************
	//***** FIND AND SET USER WINDOW HEIGHT/WIDTH ****************
	//************************************************************
	var height;
	var winHeight = (typeof window.innerHeight != 'undefined' ? window.innerHeight : document.body.offsetHeight);
	var scrollHeight = window.document.body.scrollHeight;
	var winWidth = window.document.body.scrollWidth;
	if(winHeight > scrollHeight){
		height = winHeight;
	}else{
		height = scrollHeight;
	}
	//************************************************************
	//*********** DISPLAY FADE BG AND CONTENT DIV ****************
	//************************************************************
	fadeBg.style.height = height + 'px';
	fadeBg.style.width = winWidth + 'px';
   }
  function Lock_CheckForm3(theForm){   
   document.getElementById("ly3").style.display='none';document.getElementById("Layer23").style.display='none';
  return false;   
   } 


function locking2(){    
   document.getElementById("ly2").style.display="block";   
   document.getElementById("ly2").style.width=document.body.clientWidth;   
   document.getElementById("ly2").style.height=document.body.clientHeight;   
   document.getElementById("Layer22").style.display='block';   
   }
  function Lock_CheckForm2(theForm){   
   document.getElementById("ly2").style.display='none';document.getElementById("Layer22").style.display='none';
  return false;   
   } 



function checkuserinfo(){
 

	if(checkspace(document.prForm.rating.value)) {
    alert("Please rate this item.");
	return false;
}
   if(checkspace(document.prForm.name.value)) {
	document.prForm.name.focus();
    alert("Please enter your name.");
	return false;
  }
  if(document.prForm.email.value.length!=0)
  {
    if (document.prForm.email.value.charAt(0)=="." ||        
         document.prForm.email.value.charAt(0)=="@"||       
         document.prForm.email.value.indexOf('@', 0) == -1 || 
         document.prForm.email.value.indexOf('.', 0) == -1 || 
         document.prForm.email.value.lastIndexOf("@")==document.prForm.email.value.length-1 || 
         document.prForm.email.value.lastIndexOf(".")==document.prForm.email.value.length-1)
     {
      alert("Please enter a correctly formatted email address.");
      document.prForm.email.focus();
      return false;
      }
   }
 else
  {
   alert("Please enter your email address.");
   document.prForm.email.focus();
   return false;
   }
if(checkspace(document.prForm.location.value)) {
	document.prForm.location.focus();
    alert("Please enter your location.");
	return false;
}
if(checkspace(document.prForm.verifycode.value)) {
	document.prForm.verifycode.focus();
    alert("Please enter your verifycode.");
	return false;
}
if (document.prForm.reviewBody.value=="You may wish to spell check your comments on MS  word  and then pasting here, to ensure its read as intended"){ 
      document.prForm.reviewBody.value=""; 
   } 
   
if(checkspace(document.prForm.reviewBody.value)) {
    alert("Please enter your Comments");
	return false;
}
if(document.prForm.reviewBody.value.indexOf("http") > 0 )   
	{   
		alert('This feature is for people who have purchased a product to leave a REVIEW of their purchase only');  
		document.prForm.reviewBody.focus();
		return false;
	}
	if(document.prForm.reviewBody.value.indexOf("www.") > 0 )   
	{   
		alert('This feature is for people who have purchased a product to leave a REVIEW of their purchase only');  
		document.prForm.reviewBody.focus();
		return false;
	}
	if(document.prForm.reviewBody.value.indexOf("href") > 0 )   
	{   
		alert('This feature is for people who have purchased a product to leave a REVIEW of their purchase only');  
		document.prForm.reviewBody.focus();
		return false;
	}
	if(document.prForm.reviewBody.value.indexOf("script") > 0 )   
	{   
		alert('This feature is for people who have purchased a product to leave a REVIEW of their purchase only');  
		document.prForm.reviewBody.focus();
		return false;
	}
	if(document.prForm.reviewBody.value.indexOf(".com") > 0 )   
	{   
		alert('This feature is for people who have purchased a product to leave a REVIEW of their purchase only');  
		document.prForm.reviewBody.focus();
		return false;
	}
	
}
function checkuserinfoa()
{
   
  if(document.getElementById("usrEmailA").value.length!=0)
  {
    if (document.getElementById("usrEmailA").value.charAt(0)=="." ||        
         document.getElementById("usrEmailA").value.charAt(0)=="@"||       
         document.getElementById("usrEmailA").value.indexOf('@', 0) == -1 || 
         document.getElementById("usrEmailA").value.indexOf('.', 0) == -1 || 
         document.getElementById("usrEmailA").value.lastIndexOf("@")==document.getElementById("usrEmailA").value.length-1 || 
         document.getElementById("usrEmailA").value.lastIndexOf(".")==document.getElementById("usrEmailA").value.length-1)
     {
		 document.getElementById("whole_info").innerHTML="Please enter a correctly formatted email";
      document.getElementById("usrEmailA").focus();
      return false;
      }
   }
 else
  {
	  document.getElementById("whole_info").innerHTML="Please Enter Your Email";
   document.getElementById("usrEmailA").focus();
   return false;
   }
if(checkspace(document.getElementById("usrPwdA").value)) {
	 document.getElementById("whole_info").innerHTML="Please enter your password.";
	document.getElementById("usrPwdA").focus();
    
	return false;
  }
var xmlHttp
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
  {
  alert ("Your browser does not support ajax");
  return;
  } 
var urlaa="../product/sub_productloginw.asp?usrPwd="+escape(document.getElementById("usrPwdA").value)+"&usrEmail="+escape(document.getElementById("usrEmailA").value)+"&product_rpound="+escape(document.getElementById("product_rpound").value)+"&dollarcu="+document.getElementById("dollarcu").value+"&eurocu="+document.getElementById("eurocu").value;
urlaa=urlaa+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("POST",urlaa,true);
xmlHttp.send(null);
function stateChanged()
{ 

			if(xmlHttp.readyState==4){
				
                if(xmlHttp.status==200){
						if (xmlHttp.responseText=="a1"){
						whole_info.innerHTML="Wholesale User Does Not Exist.";
						}else{
							if (xmlHttp.responseText=="b1"){
						whole_info.innerHTML="Invalid Password.";
						}else{
							document.getElementById("massage_box").style.visibility='hidden';
							document.getElementById("mask").style.visibility='hidden';
							document.getElementById("vieww").style.display='none';
							document.getElementById("lkkk").style.display='';
							var response = xmlHttp.responseText;
							whole_html.innerHTML=response;
							}
						}
                }else{
                    whole_info.innerHTML="error...";
                }
            }else{
                whole_info.innerHTML="reading...";
            }
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}
}
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str==checkstr);
}

