function getXMLHTTPRequest() {
try {
req = new XMLHttpRequest();
} catch(err1) {
  try {
  req = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (err2) {
    try {
    req = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (err3) {
      req = false;
    }
  }
}
return req;
}

var http = getXMLHTTPRequest();
var http1 = getXMLHTTPRequest();
var http2 = getXMLHTTPRequest();

function domainlinkcreate(){
	myRand = parseInt(Math.random()*999999999999999);
	arg01="domain="+document.domaincheck.domain.value;
	arg02="submit=OK";
	lienket="multi_whois_list.php?rand="+myRand+"&"+arg01+"&"+arg02;
	return lienket;
}

function getServerText(option,myurl) {
  
  myRand = parseInt(Math.random()*999999999999999);
  if (myurl=="domaincheck"){
	var modurl = "modules/whois/"+domainlinkcreate();
  }else{
  	var modurl = "modules/home/"+myurl+"?rand="+myRand;
  }
  
  document.getElementById('content').innerHTML = 'Loading ...';
  //alert(modurl);
  http1.open("GET", modurl, true);
  http1.onreadystatechange = useHttpResponse;
  http1.send(null);
}

function useHttpResponse() {
   if (http1.readyState == 4) {
    if(http1.status == 200) {
      var mytext = http1.responseText;
      document.getElementById('content').innerHTML = mytext;
    }
  } else {
  document. getElementById('content').innerHTML = "";
  }
}

function gettab02content(option,myurl) {
	document.getElementById('tab02content').innerHTML = 'Loading ...';
	//var myurl = 'modules/home/tab0201.php';
	document.getElementById('tab0201').src = "images/tabselectedbottombg.gif";
	document.getElementById('tab0204').src = "images/tabunselectedbottombg.gif";
	
	document.getElementById('tab02011').src = "images/tabselectedleftfirst.gif";
	document.getElementById('tab02013').src =  "images/tabselectedright.gif";
	document.getElementById('tab02041').src = "images/tabunselectedleft.gif";
	document.getElementById('tab02043').src =  "images/tabunselectedrightlast.gif";

	if (option==2){
  		//var myurl = 'modules/home/tab0202.php';
		document.getElementById('tab0201').src ="images/tabunselectedbottombg.gif";
		document.getElementById('tab0204').src ="images/tabselectedbottombg.gif";
		
		document.getElementById('tab02041').src = "images/tabselectedleft.gif";
		document.getElementById('tab02043').src =  "images/tabselectedrightlast.gif";
		document.getElementById('tab02011').src = "images/tabunselectedleftfirst.gif";
		document.getElementById('tab02013').src =  "images/tabunselectedright.gif";
  	}
	
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"&rand="+myRand;
  http2.open("GET", modurl, true);
  http2.onreadystatechange = useHttpResponse1;
  http2.send(null);
}

function useHttpResponse1() {
   if (http2.readyState == 4) {
    if(http2.status == 200) {
      var mytext = http2.responseText;
      document.getElementById('tab02content').innerHTML = mytext;
    }
  } else {
  document. getElementById('tab02content').innerHTML = "";
  }
}

function getmaincontentfirst(myurl) {
  document.getElementById('maincontent').innerHTML = 'Loading ...';
  myRand = parseInt(Math.random()*999999999999999);
  var modurl = myurl+"?rand="+myRand;
  http.open("GET", modurl, true);
  http.onreadystatechange = useHttpResponseMaincontent;
  http.send(null);
}

function getmaincontent(myurl) {
  document.getElementById('maincontent').innerHTML = 'Loading ...';
  myRand = parseInt(Math.random()*999999999999999);
  if (myurl.indexOf('?')>0){
	  var modurl = myurl+"&rand="+myRand;
  }else{
	  var modurl = myurl+"?rand="+myRand;
  }
  
  http.open("GET", modurl, true);
  http.onreadystatechange = useHttpResponseMaincontent;
  http.send(null);
}

function useHttpResponseMaincontent() {
   if (http.readyState == 4) {
    if(http.status == 200) {
      var mytext = http.responseText;
      document.getElementById('maincontent').innerHTML = mytext;
    }
  } else {
  document. getElementById('maincontent').innerHTML = "";
  }
}