﻿function Cx(str,domain){

	if(domain==""){
		alert("域名不能为空！");
		return false;
	}

	var xmlhttp;
	try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}
	catch(e){
		try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
		catch (e){ 
			try{xmlhttp=new XMLHttpRequest();}
			catch (e){}		}
	}
	var Posthttp="domain="+domain;
	xmlhttp.open("post","Domain_Search.asp?t=" + new Date().getTime());
	xmlhttp.onreadystatechange=function()
	{
		if(4==xmlhttp.readyState)
		{
			if(200==xmlhttp.status)
			{
			aa=xmlhttp.responseText;
				if(aa=="1"){
					document.getElementById("domain_"+str).innerHTML="(<font>可以注册</font>)";
					return false;
				}
				if(aa=="2"){
					document.getElementById("domain_"+str).innerHTML="(<b>已被注册</b>) <a href='?domains="+domain+"' target='_blank'>[详细]</a>";
					return false;
				}
				if(aa=="0"){
					document.getElementById("domain_"+str).innerHTML="(查询出错)";
					return false;
				}
				return false;
			}
			else
			{ alert("网络链接失败！");;
			return false;}	
		}
	}
	xmlhttp.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded");
	xmlhttp.send(Posthttp);
	return false;

}

function Cx1(domain){

	if(domain==""){
		alert("域名不能为空！");
		return false;
	}

	var xmlhttp;
	try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}
	catch(e){
		try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
		catch (e){ 
			try{xmlhttp=new XMLHttpRequest();}
			catch (e){}		}
	}
	var Posthttp="zt=1&domain="+domain;
	xmlhttp.open("post","Domain_Search.asp?t=" + new Date().getTime());
	xmlhttp.onreadystatechange=function()
	{
		if(4==xmlhttp.readyState)
		{
			if(200==xmlhttp.status)
			{
			aa=xmlhttp.responseText;
				if(aa=="1"){
					document.getElementById("Domain_Out").innerHTML="(<b>查询出错</b>)";
					return false;
				}else{
					document.getElementById("Domain_Out").innerHTML=aa+"<div style='margin-top:10px; color:#666666'>以上信息由 CHINAZ.COM 提供</div>";
					return false;
				}
				return false;
			}
			else
			{ alert("网络链接失败！");;
			return false;}	
		}
	}
	xmlhttp.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded");
	xmlhttp.send(Posthttp);
	return false;

}

