﻿var G = new Object();

G = 
{
	
 	GetEvent:function(obj)
	{
		if(document.getElementById)
		{
			return document.getElementById(obj);
		}
		else if(document.all)
		{
			return document.all[obj];
		}
		else if(document.layers)
		{
			return document.layers[obj];
		}
	}
}
function showtop(li_num)
{
 for(i=1;i<4;i++)  
	 {
	  	GetEvent("od2d3u2_li"+i).className ="od2d3u2_li1"; 
	  	
	 }
	 GetEvent(li_num).className ="od2d3u2_li";
}
function sendurl()
{
 var UserLogin = document.getElementById("searchfrom");    
 var commend = UserLogin.check.value;
 for(var i=0;i<UserLogin.check.length;i++)
       {
       if(UserLogin.check[i].checked==true)
           {
                  commend = UserLogin.check[i].value;
                  break;
           }
       }
       
       var domain=UserLogin.domain.value;
       window.open("/domain/searchdns.asp?domain="+domain+"&ext="+commend+"","Derek","height=400,width=480,status=no,toolbar=no,menubar=no,location=no")

}
 function getsearchvalue()
    {
     var UserLogin = document.getElementById("searchfrom");    
     var commend = UserLogin.check.value;
     var url;
       for(var i=0;i<UserLogin.check.length;i++)
       {
       if(UserLogin.check[i].checked==true)
           {
                  commend = UserLogin.check[i].value;
                  break;
           }
       }
     var domain=UserLogin.domain.value+commend;
    
     if (commend !='')
      { 
       if(commend==".com"|commend==".net"|commend==".org"|commend==".biz"|commend==".info")
       {
         url='http://www-whois.internic.net/cgi/whois?type=domain&whois_nic='+domain;
       }
       else if(commend.indexOf('.cn')>1)
       {
        url=' http://ewhois.cnnic.net.cn/whois?entity=domain&value='+domain;
       }
       else
       {
       url='http://seal.cnnic.net.cn/queryserver?nameInfo='+domain+'&entityName=keyword'
       }
      }
      
    
     send_request("GET",url,null,"text",populateClass3);
      
       return false;
    }
    
  function  populateClass3(){  		
		if(http_request.readyState==4)
		{
			 if(http_request.status==200)
			 {
				var list=http_request.responseText;
			    var s = list.indexOf('No match');
			    var b = list.indexOf('Register system prompt');
                var t = list.indexOf('not been registered yet');
           if((s>1)|(b>1)|(t>1))
           {
             alert("此域名还没注册"); 
           }
		  else
		  {
		     alert("此域名已经注册");
		  }		
								
			 }
			else
			{
			    alert("您所请求的页面有异常01。");
			}
	     }
}
function openwindow( url, winName, width, height)
{
xposition=0; yposition=0;
if ((parseInt(navigator.appVersion) >= 4 ))
{
xposition = (screen.width - width) / 2;
yposition = (screen.height - height) / 2;
}
theproperty= "width=" + width + "," 
+ "height=" + height + "," 
+ "location=0," 
+ "menubar=0,"
+ "resizable=1,"
+ "scrollbars=0,"
+ "status=0," 
+ "titlebar=0,"
+ "toolbar=0,"
+ "hotkeys=0,"
+ "screenx=" + xposition + "," //for Netscape
+ "screeny=" + yposition + "," //for Netscape
+ "left=" + xposition + "," //for IE
+ "top=" + yposition; //for IE 
window.open( url,winName,theproperty );
}
