function CheckAccount(TheForm)
        {
		 if (TheForm.user.value == "")
        {
        alert("Please specify your ID.");
		TheForm.user.focus();
        return (false);
        }

        var filter=/^\s*[.A-Za-z0-9_-]{3,20}\s*$/;
        if (!filter.test(TheForm.user.value)) { 
                alert("For your Member ID only use A-Z, a-z, 0-9, without spaces."); 
                TheForm.user.focus();
                TheForm.user.select();
                return (false); 
                } 
				
          if ( TheForm.email.value =="" || TheForm.email.value !="" &&  ! /^[_\.\d\w\-]+@([\d\w][\d\w\-]+\.)+[\w]{2,3}$/.test(TheForm.email.value)) 
            { 
              alert("Email address error! Please check your Email again."); 
              TheForm.email.focus();
              return (false); 
            } 

          if ((TheForm.password1.value != TheForm.password2.value) ||
               TheForm.password1.value =='' ||
               TheForm.password2.value =='')
            {
              alert ("Your password and confirm password are not the same.");
              return(false);
            }
          else
            {
              return(true);
            }
        }

function CheckMyEmail(TheForm)
        {
          if ( TheForm.email.value =="" || TheForm.email.value !="" &&  ! /^[_\.\d\w\-]+@([\d\w][\d\w\-]+\.)+[\w]{2,3}$/.test(TheForm.email.value)) 
            { 
              alert("Email address error! Please check your Email again."); 
              TheForm.email.focus();
              return (false); 
            } 
          else
            {
              return(true);
            }
        }


function CheckPassword1(TheForm)
        {
          if (TheForm.email.value =='')
            {
              alert ("Please Input your email !");
              return(false);
            }

          if (TheForm.password.value =='')
            {
              alert ("Please Input your password !");
              return(false);
            }
          else
            {
              return(true);
            }

         
        }

function Checklogin(TheForm)
        {
          if (TheForm.username.value =='')
            {
              alert ("Please enter your Member ID !");
			  TheForm.username.focus();
              return(false);
            }

          if (TheForm.password.value =='')
            {
              alert ("Please enter your password !");
			  TheForm.password.focus();
              return(false);
            }
          else
            {
              return(true);
            }

         
        }


function CheckInfo(TheForm)
        {
          if ((TheForm.password1.value != TheForm.password2.value) ||
               TheForm.password1.value =='' ||
               TheForm.password1.value =='')
            {
              alert ("Recheck your Password.");
              return(false);
            }
          if (TheForm.first_name.value=='' || TheForm.last_name.value=='')
            {
              alert ("Recheck your Name.");
              TheForm.first_name.focus();
              return(false);
            }

          if (! TheForm.company.value)
            {
              alert("Recheck your company name.");
              TheForm.company.focus();
              return(false);
            }
         
          if (! TheForm.tel_country.value)
            {
              alert("Recheck your phone numnber.");
              TheForm.tel_country.focus();
              return(false);
            }

          if (! TheForm.fax_country.value)
            {
              alert("Recheck your fax numnber.");
              TheForm.fax_country.focus(); 
              return(false);
            }
         
          if (! TheForm.address.value)
            {
              alert("Recheck your address.");
              TheForm.address.focus();
              return(false);
            }
  
          if (! TheForm.zip.value)
            {
              alert("Recheck your zip code.");
              TheForm.zip.focus();
              return(false);
            } 

          if (! TheForm.city.value)
            {
              alert("Recheck your city.");
              TheForm.city.focus();
              return(false);
            }

          if (! TheForm.country.value)
            {
              alert("Recheck your country.");
              TheForm.country.focus();
              return(false);
            }
			
				  var  check=true;
      for(var i=0;i<TheForm.btype.length;i++){

 if (TheForm.btype[i].checked) {
		 check=false;
		break;
        }	
       }
              if (check){
          alert("Please choose Buyer or Seller.");
          TheForm.btype[1].focus();
          return (false);
       }
	   
            if (! TheForm.biztype.value)
            {
              alert("Recheck your Business Type.");
              TheForm.biztype.focus();
              return(false);
            }
	   
       if (! TheForm.cat_sel_name.value)
          {        
            alert("Please choose Product Category.");        
              return (false);        
           } 
		   


       }

  function PopupCatSel()
  {
   var selProdWnd=window.open("/user/select_sort.asp","new","resizable=yes,width=580,height=320,top=0,scrollbars=yes");
   if(selProdWnd.opener== null) 
   selProdWnd.opener = self;
   return (false);
  }
  function check_id_window(value){
    var memberId = value;
	if (memberId.length == 0 || memberId == " ") {
		alert("Please specify your ID."); return false;
	}
	
        var filter=/^\s*[.A-Za-z0-9_-]{3,20}\s*$/;
        if (!filter.test(memberId)) { 
                alert("For your Member ID only use A-Z, a-z, 0-9, without spaces."); 
                return (false); 
                } 
	
	popupWindow = window.open("check_id.asp?user="+value,"",'toolbar=no,directories=no,scrollbars=0,resizable=1,status=no,menubar=0,width=300,height=150');

	if(popupWindow)
	    popupWindow.focus();
	
	
}

