 function changeDisp(){
    var obj1=document.all.Normal;
	var obj2=document.all.Member;
	var tem;
	for(i=0;i<document.theForm.IsMember.length;i++){   //
	 if(document.theForm.IsMember[i].checked){
		 tem=document.theForm.IsMember[i].value;
		 break;
	 }
	}
	if(parseInt(tem)==0){
	   obj1.style.display="";
	   obj2.style.display="none";
	}else{
	   obj1.style.display="none";
	   obj2.style.display="";
	}
 }
function same(tt)
{
     tt.BillingName_EN.value = tt.TechName_EN.value;
     tt.BillingTel.value=tt.TechTel.value;
	 tt.BillingFax.value=tt.TechFax.value;
     tt.BillingEmail.value=tt.TechEmail.value;
	 tt.BillingMobile.value=tt.TechMobile.value;
	 
}
function same_s(tt){
	 tt.TechName_EN.value = tt.AdminName_EN.value;
     tt.TechTel.value = tt.AdminTel.value;
     tt.TechFax.value = tt.AdminFax.value;
     tt.TechEmail.value = tt.AdminEmail.value;
	 tt.TechMobile.value = tt.AdminMobile.value;

	 tt.TechCC.value = tt.AdminCC.value;
	 tt.TechSP_EN.value = tt.AdminSP_EN.value;
	 tt.TechSP_EN_SEL.value = tt.AdminSP_EN_SEL.value;
	 tt.TechCity_EN.value = tt.AdminCity_EN.value;
	 tt.TechAddr_EN.value = tt.AdminAddr_EN.value;
	 tt.TechPC.value = tt.AdminPC.value;
	 tt.TechRTX.value = tt.AdminRTX.value;
}
function checkchinese(theelement)
{//如果含有中文字符返回 true
   text="abcdefghijklmnopqrstuvwxyz1234567890 ABCDEFGHIJKLMNOPQRSTUVWXYZ,/()?=!:@$%&\#*~.;'_-";
   for(i=0;i<=theelement.length-1;i++)
   {
      char1=theelement.charAt(i);
      index=text.indexOf(char1);
      if(index==-1)
      { return true;//有中文
      }  
     //没有中文
   }
   return false;
}
function haveEnglish(theelement)
{// 如果含有英文字符返回 true 
   text="abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ";
   for(i=0;i<=theelement.length-1;i++)
   {
      char1=theelement.charAt(i);
      index=text.indexOf(char1);
      if(index>=0){ return true; }
   }   return false;
}
function havenoEnglish(theelement)
{// 如果含有英文字符返回 true 
   text="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
   for(i=0;i<=theelement.length-1;i++)
   {
      char1=theelement.charAt(i);
      index=text.indexOf(char1);
      if(index==-1){ return true; }
   }   return false;
}
function havenonlicet(theelement)
{ text="&#*()<>";
  for(i=0;i<=theelement.length-1;i++)
   {
      char1=theelement.charAt(i);
      index=text.indexOf(char1);
      if(index>=0){return true; }
   }
   return false;
}

function havenoNumber(theelement)
{//含有非数字字符 返回 true
   text="1234567890";
   for(i=0;i<=theelement.length-1;i++)
   {
      char1=theelement.charAt(i);
      index=text.indexOf(char1);
      if(index==-1)
      {return true; }
   }
   return false;
}

 function checkEmal(theelement){
   var emal="@";
   for(i=0;i<=   theelement.length-1;i++){
     char1=theelement.charAt(i);
     if(char1==emal) 
      {return  true;}
      }  return false;
  }
 function specialchar(theelement){
// 特殊字付 ' ;
   text = "';"
  for(i=0;i<=theelement.length-1;i++)
   {  char1=theelement.charAt(i); index=text.indexOf(char1); if(index>=0){ return true;} }
   return false;
}
function numinput()  //不输入字母
{  
	temp=event.keyCode;  
	if(temp<48 || temp>57)  
		event.keyCode=null;
}
function LTrim(str){
  str=str.replace(/^ {1,}/g,"");
  //alert("\""+str+"\"");
  return str;
 }
function RTrim(str){
  str=str.replace(/ {1,}$/g,"");
  //alert("\""+str+"\"");
  return str;
 }
function Trim(str){
  str=LTrim(str);
  str=RTrim(str);
  return str;
}
function TelorFax(str){
   if(/^\+{1,1}[0-9]{1,3}\.{1,1}[0-9]{1,12}-{0,}[0-9]{0,}$/.test(str)==true)return true;
   else     return false;
}
function checkDomain(domain){
	 var reg=/^(([a-zA-Z0-9]+\.)|([a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.))+[a-zA-Z]{2,6}$/;
	 return reg.test(domain);
}
function checkDomainList(domain){
	 var DomainList=new Array("com.cn","net.cn","org.cn","gov.cn","now.net.cn","www.now.net.cn","todayisp.com","www.todayisp.com","fjt.todayisp.com","todaynic.com","www.todaynic.com","makercn.com","www.makercn.com","biznet.cn","www.biznet.cn","diy.biznet.cn","cnonline.biz","www.cnonline.biz","greencn.com","www.greencn.com","top.sh","www.top.sh","01isp.com","www.01isp.com","001isp.com","www.001isp.com","bytescn.com","www.bytescn.com","pro.net.cn","www.pro.net.cn");
	 for(k=0;k<DomainList.length;k++){
		 if(domain==DomainList[k]) return false;
	 }
	 return true
}
function CheckForm(theForm)
{
	if (theForm.isShowTech.checked)
	{
      same_s(theForm);
	}
  theForm.AdminName_EN.value = Trim(theForm.AdminName_EN.value);
  theForm.AdminOrg_EN.vlaue  = Trim(theForm.AdminOrg_EN.value);
  //alert(theForm.AdminTel.value);
  theForm.AdminTel.value     = Trim(theForm.AdminTel.value);
  theForm.AdminFax.value     = Trim(theForm.AdminFax.value);
  theForm.AdminEmail.value   = Trim(theForm.AdminEmail.value);
  theForm.AdminMobile.value  = Trim(theForm.AdminMobile.value);
  theForm.AdminAddr_EN.value = Trim(theForm.AdminAddr_EN.value);
  theForm.AdminCity_EN.value = Trim(theForm.AdminCity_EN.value);
  theForm.AdminSP_EN.value   = Trim(theForm.AdminSP_EN.value);
  theForm.AdminCC.value      = Trim(theForm.AdminCC.value);
  theForm.AdminPC.value      = Trim(theForm.AdminPC.value);
  theForm.TechName_EN.value  = Trim(theForm.TechName_EN.value);
  theForm.TechTel.value      = Trim(theForm.TechTel.value);
  theForm.TechFax.value      = Trim(theForm.TechFax.value);
  theForm.TechEmail.value    = Trim(theForm.TechEmail.value);
  //theForm.BillingName_EN.value = Trim(theForm.BillingName_EN.value);
 // theForm.BillingTel.value   = Trim(theForm.BillingTel.value);
  //theForm.BillingFax.value   = Trim(theForm.BillingFax.value);
  //theForm.BillingEmail.value = Trim(theForm.BillingEmail.value);
  if (theForm.AdminRTX.value == "MSN:") { theForm.AdminRTX.value == "";}
  if (theForm.AdminName_EN.value == "")  {    alert("Please enter the agent name(English) of your Operation Location.");    theForm.AdminName_EN.focus();    return (false);  }
  if (specialchar(theForm.AdminName_EN.value))  {    alert("In your Operation Location's agent name(English) including the character ' or ; that is unacceptable by the system.");       theForm.AdminName_EN.focus(); return (false);   }
  if (checkchinese(theForm.AdminName_EN.value))  {    alert("The agent name(English) title of your Operation Location can not include Chinese.");       theForm.AdminName_EN.focus();    return (false);   }
  if (!havenoNumber(theForm.AdminName_EN.value))  {    alert("The agent name(English) title of your Operation Location can not include Number.");       theForm.AdminName_EN.focus();    return (false);   }
  if (theForm.AdminOrg_EN.value == "")  {    alert("Please enter the company name(English) of your Operation Location.");    theForm.AdminOrg_EN.focus();    return (false);  }
  if (specialchar(theForm.AdminOrg_EN.value))  {    alert("In your Operation Location's company name(English) including the character ' or ; that is unacceptable by the system.");       theForm.AdminOrg_EN.focus(); return (false);   }
  if (checkchinese(theForm.AdminOrg_EN.value))  {    alert("The company name(English) title of your Operation Location can not include Chinese.");       theForm.AdminOrg_EN.focus();    return (false);   }

  if (theForm.AdminTel.value == "")  {    alert("Incorrect telephone number .");    theForm.AdminTel.focus();    return (false);  }
  if (!TelorFax(theForm.AdminTel.value)) {    alert("Telephone number incorrect."); theForm.AdminTel.focus(); return (false);  }
  
  if (theForm.AdminFax.value == ""||!TelorFax(theForm.AdminFax.value))  {    alert("Incorrect fax number.");    theForm.AdminFax.focus();    return (false); }
  
  if (theForm.AdminEmail.value == ""||!checkEmal(theForm.AdminEmail.value))  {    alert("Incorrect e-mail.");    theForm.AdminEmail.focus();    return (false); }
  
  if (theForm.AdminAddr_EN.value == "")  {    alert("Please enter the address (English) of your Operation Location.");    theForm.AdminAddr_EN.focus();    return (false);  }
  if (checkchinese(theForm.AdminAddr_EN.value))  {    alert("The English address of your Operation Location that you entered can not include Chinese.");    theForm.AdminAddr_EN.focus();    return (false);  }
  
  if (theForm.AdminCity_EN.value == "")  {    alert("Please enter the city name (English) of your Operation Location.");    theForm.AdminCity_EN.focus();    return (false);  }
  if (specialchar(theForm.AdminCity_EN.value))  {    alert("The city name (English) of your Operation Location including the character ' or ; that is unacceptable by the system. ");       theForm.AdminCity_EN.focus(); return (false);   }
  if (checkchinese(theForm.AdminCity_EN.value))  {    alert("The English city name of your Operation Location that you entered can not include Chinese.");       theForm.AdminCity_EN.focus();    return (false);   }
    
  if (theForm.AdminSP_EN.value==""){alert("Please enter the province name (English) of your Operation Location.");theForm.AdminSP_EN.focus();return (false);}
  if (!haveEnglish(theForm.AdminSP_EN.value)){alert("The province name (English) of your Operation Location can not include Chinese.");theForm.AdminSP_EN.focus();return (false);}

  if (theForm.AdminCC.value == ""){alert("Please enter the country code of your Operation Location.");theForm.AdminCC.focus();return (false);}
  if (/^[A-Z,a-z]{2,2}$/.test(theForm.AdminCC.value)==false){alert("Please enter the correct country code of your Operation Location with two capital English characters.");theForm.AdminCC.focus();return (false);}
  
 // if (theForm.AdminPC.value == "")  {    alert("Please enter the postal code.");    theForm.AdminPC.focus();    return (false);  }
  /*if (/^[0-9]{6,6}$/.test(theForm.AdminPC.value)==false) { alert("Please enter the correct post postal code.");theForm.AdminPC.focus();return (false);}
 */ 
  if (theForm.TechName_EN.value == ""){ alert("Please enter Technical Location's name.");  theForm.TechName_EN.focus(); return false;}
  if (!haveEnglish(theForm.TechName_EN.value))  {    alert("Please enter the Technical Location's name.");    theForm.TechName_EN.focus();    return (false);  }
  if (!TelorFax(theForm.TechTel.value)) {    alert("Incorrecttelephone number of Technical contact."); theForm.TechTel.focus(); return (false);  }
  if (!TelorFax(theForm.TechFax.value)) {    alert("Incorrect fax number of Technical contact ."); theForm.TechFax.focus(); return (false);  }
  if (!checkEmal(theForm.TechEmail.value)){  alert("Incorrect e-mail of Technical Location."); theForm.TechEmail.focus(); return (false);   }
  if(theForm.agreement.checked!=true){alert('Please read and agree the Agreement!');theForm.agreement.focus();return false;}
  // if (theForm.TechSP_EN.value==""){alert("Please enter the Technical's province name (English) of your Technical Location.");theForm.TechSP_EN.focus();return (false);}
  //if (theForm.BillingName_EN.value == ""){ alert("Please enter Finance Location's name.");  theForm.BillingName_EN.focus(); return false;}
  //if (!haveEnglish(theForm.BillingName_EN.value))  {    alert("Please enter the Finance Location's name.");    theForm.BillingName_EN.focus();    return (false);  }
  //if (!TelorFax(theForm.BillingTel.value)) {    alert("telephone number incorrect of your Finance Location."); theForm.BillingTel.focus(); return (false);  }
  //if (!TelorFax(theForm.BillingFax.value)) {    alert("fax number incorrect of your Finance Location."); theForm.BillingFax.focus(); return (false);  }
 // if (!checkEmal(theForm.BillingEmail.value)){  alert("e-mail incorrect of your Finance Location."); theForm.BillingEmail.focus(); return (false);   }
   return  (true);
}