var PlatformStr1="T_";
var PlatformStr2="C_";
var PlatformStr=PlatformStr1;
var PlatformURL1="http://www1.5778.com";
var PlatformURL2="http://www3.5778.com";
var PlatformURL=PlatformURL1;

function changeProvince()
{
	document.add_cust.Province.value=document.add_cust.AProvince.value.substring(0,document.add_cust.AProvince.value.indexOf("|"));
	document.add_cust.EProvince.value=document.add_cust.AProvince.value.substring(document.add_cust.AProvince.value.indexOf("|")+1,document.add_cust.AProvince.value.length);
}

function Check()
{
  if (document.add_cust.LoginName.value!="" && (document.add_cust.LoginName.value.length < 4 || document.add_cust.LoginName.value.length > 20 || document.add_cust.LoginName.value.substr(0,2).toUpperCase()!=PlatformStr))
  {
    alert("登录名必须为以“"+PlatformStr+"”开头的4-20位字母与数字组合！");
    document.add_cust.LoginName.focus();
    return false;
  }

  if (document.add_cust.UserName.value == "")
  {
    alert("公司名称（中文）或者个人姓名不能为空，要填写！");
    document.add_cust.UserName.focus();
    return false;
  }
  
  if (document.add_cust.Province.value == "")
  {
    alert("省份中文名不能为空，请填写！");
    document.add_cust.Province.focus();
    return false;
  }
    
  if (document.add_cust.City.value == "")
  {
    alert("城市中文名不能为空，请填写！");
    document.add_cust.City.focus();
    return false;
  }

  if (document.add_cust.Addr.value == "")
  {
    alert("地址中文不能为空，请填写！");
    document.add_cust.Addr.focus();
    return false;
  }
  
  if (document.add_cust.Tel.value == "")
  {
    alert("固定电话不能为空，请填写！");
    document.add_cust.Tel.focus();
    return false;
  }
  
  if (document.add_cust.Fax.value == "")
  {
    alert("传真号码不能为空，请填写！");
    document.add_cust.Fax.focus();
    return false;
  }
  
  if (document.add_cust.mobile.value == "")
  {
    alert("移动电话不能为空，请填写！");
    document.add_cust.mobile.focus();
    return false;
  }
  
  if (document.add_cust.Email.value.indexOf("@") == -1 )
  {
    alert("请填写正确的电子邮件地址！");
    document.add_cust.Email.focus();
    return false;
  }

  if (document.add_cust.Status[0].checked)
  {
	document.add_cust.Status.value = "企业";
  }
  else
  {
	document.add_cust.Status.value = "个人";
  }

  add_cust.action=PlatformURL+"/SimpleOrder/simorderdo.asp";

  document.getElementById("DataForm").style.display = "none";
  document.getElementById("PlanBar").style.display = "block";
  return true;
}

function CHKLoginName(LoginName)
{
  if (document.add_cust.LoginName.value.length < 4 || document.add_cust.LoginName.value.length > 20 || document.add_cust.LoginName.value.substr(0,2).toUpperCase()!=PlatformStr)
  {
    LoginNameTips.innerHTML="<font color=red>登录名必须为以“"+PlatformStr+"”开头的4-20位字母与数字组合！</font>";
    add_cust.LoginName.focus();
  }
  else
  {
    document.getElementById("CHKLoginNames").src=PlatformURL+"/Scripts/Register/CHKLoginName.asp?LoginName="+LoginName+"&p="+Math.round(Math.random()*100);
  }
}

function CHKPlatform()
{
  if (add_cust.netchoice[0].checked)
  {
    PlatformStr=PlatformStr1;
    PlatformURL=PlatformURL1;
  }
  else
  {
    PlatformStr=PlatformStr2;
    PlatformURL=PlatformURL2;
  }
  LoginNameText.innerHTML="&nbsp;以“"+PlatformStr+"”开头的4-20位字母与数字组合&nbsp;&nbsp;";
}

