function withChinese(argStr)
{
	return argStr.match(/[^\x00-\x7f]+/);
}
function checkFormEn(theForm)
{
	if (theForm.domain.value.match(/^\s*$/))
	{
		alert("您必须先输入域名！");
		theForm.domain.focus();
		return false;
	}

	if (theForm.domain.value.match(/\s/))
	{
		alert("对不起，您输入的域名中包含空格，请检查后重新输入！");
		theForm.domain.focus();
		return false;
	}

	if (!theForm.domain.value.match(/^[\w\d\-]+$/))
	{
		alert("对不起，您输入的域名无效，请检查后重新输入!");
		theForm.domain.focus();
		return false;
	}

	var domain = theForm.domain.value;
	var root = findRoot(theForm);

	if (root == "tv" && domain.length < 4)
	{
		alert("抱歉，tv 域名长度不能少于4个字符！");
		theForm.domain.focus();
		return false;
	}

	setWait(theForm); 
	
	return true;
}

function checkFormCn(theForm)
{
	if (theForm.domain.value.match(/^\s*$/))
	{
		alert("您必须先输入域名！");
		theForm.domain.focus();
		return false;
	}

	if (theForm.domain.value.match(/\s/))
	{
		alert("对不起，您输入的域名中包含空格，请检查后重新输入！");
		theForm.domain.focus();
		return false;
	}

	if (!theForm.domain.value.match(/^([\w\d\-]|[^\x00-\x7f])+$/))
	{
		alert("对不起，您输入的域名无效，请检查后重新输入!");
		theForm.domain.focus();
		return false;
	}

	var domain = theForm.domain.value;
	var root = findRoot(theForm);

    	var foundChinese = withChinese(domain);
	var verifyOK = true;
	
	root = root.toLowerCase();
	
	if (foundChinese || root == "中国" || root == "公司" || root == "网络")
	{
		if (!(root == "com" || root == "net" || root == "org" 
	    			|| root == "中国" || root == "公司" || root == "网络" || root == "cn" || root == "cc"))
		{
			alert("对不起，现在我们只支持以 \" .com .net .org .中国 .公司 .网络 .cn .cc \" 为后缀的中文域名。请您重新选择！");
			verifyOK = false;
		} else if (!foundChinese) {
			alert("对不起，对于 \" .中国 .公司 .网络 \" 后缀，只能注册中文域名。请您重新选择！");
			verifyOK = false;
    		}
    	}
	if (!verifyOK)
	{
		theForm.domain.focus();
		return false;
	}
	
	setWait(theForm); 
	
	return true;
}

function findRoot(theForm)
{
	for (var i = 0, n = theForm.root.length ; i < n ; i++)
	{
		var e = theForm.root[i];
		if (e.checked) return e.value;
	}
	return "";
}

function setNeedCheck(theForm,checkvalue)
{
    theForm.needCheck.value=checkvalue;
	return true;
}

function setWait(theForm)
{
	return true;
}
