var request = false;
   try {
     request = new XMLHttpRequest();
   } catch (trymicrosoft) {
     try {
       request = new ActiveXObject("Msxml2.XMLHTTP");
     } catch (othermicrosoft) {
       try {
         request = new ActiveXObject("Microsoft.XMLHTTP");
       } catch (failed) {
         request = false;
       }  
     }
   }

   if (!request)
     {alert("Error initializing XMLHttpRequest!");}

   function getDomainInfo() {
   	 $('whoisRow').style.display = 'none';
     var domain = document.getElementById('dsearch').value;
     if (domain != '' & domain.length > 2)
     {
     	 $('responseRow').style.display = 'none';
	     $('loading').style.display = '';
	     var dext = document.getElementById('EXT').value;
	     //var url = "/scripts/php/lookupdomain.php?domain=" + escape(domain);
	     var url = "/domains/search/indexfile.php?domain=" + escape(domain) + escape(dext);
	     //alert(url);
	     request.open("get", url, true);
	     request.onreadystatechange = updatePage;
	     request.send(null);
     }
     else
     {
     alert('Please Specify A Domain Name..');
     $('dsearch').style.backgroundColor = '#333333';
     $('dsearch').focus();
     }
   }

   function updatePage() {
     if (request.readyState == 4) {
       if (request.status == 200) {
       	 $('loading').style.display = 'none';
         var response = request.responseText.split("|||");
         //alert(response);
         $('responseRow').style.display = '';
         $('availability').innerHTML = response[0];
         $('whoisRowHTML').innerHTML = response[1];
       } else
       	 {
           alert('status is ' + request.status);
         }
     }
   }
   
   function showWhoIs(){
   	$('whoisRow').style.display = ($(('whoisRow')).style.display == ('')) ? ('none') : ('');
   	if ($('whoisRow').style.display != 'none')
   	{$('whoisRow').focus();}
   
   }