//--域名查询js判断文件
function CheckIfEnglish( String )
{ 
    var Letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890-";
     var i;
     var c;
      if(String.charAt( 0 )=='-')
	return false;
      if( String.charAt( String.length - 1 ) == '-' )
          return false;
     for( i = 0; i < String.length; i ++ )
     {
          c = String.charAt( i );
	  if (Letters.indexOf( c ) < 0)
	     return false;
     }
     return true;
}

function submitchecken2() {

	if (document.checkcnaddr.domain.value == "") {
		alert("请输入您要查询的通用网址!");
		document.checkcnaddr.domain.focus();
		return false;
	}
	return true;
}

function ChkEDomain(theForm)
{

	if (theForm.domain.value == "") {
		alert("请输入您要查询的英文域名!");
		theForm.domain.focus();
		return false;
	}

	if (!CheckIfEnglish(theForm.domain.value )) {
		alert("查询英文域名不能输入中文及非法字符！");
		theForm.domain.focus();
		return false;
	}
    var flag=false; 
    for(i=0;i<theForm.suffix.length;i++)
    if(theForm.suffix[i].checked&&theForm.suffix[i].value)
    { 
      flag=true; 
      break;
    }
    if(!flag)
    {
    alert("请选择您要查询的域名结尾！");
    return false;
	}
	return true;
}

function ChkCDomain(theForm)
{

	if (theForm.domain.value == "") {
		alert("请输入您要查询的中文域名!");
		theForm.domain.focus();
		return false;
	}
    var flag=false; 
    for(i=0;i<theForm.suffix.length;i++)
    if(theForm.suffix[i].checked&&theForm.suffix[i].value)
    { 
      flag=true; 
      break;
    }
    if(!flag)
    {
    alert("请选择您要查询的域名结尾！");
    return false;
	}
	return true;
}