/*
Author: Thanh Hu*ng
Phone: 0978893678
*/
loadstatustext = '<img src="images/loading.gif"/>';
function ajaxLoad(url,id)
   {
       if (document.getElementById) {
           var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
           }
           if (x)
               {
           x.onreadystatechange = function()
                   {
                      var el = document.getElementById(id);
					  if(el!=null)
					  {
							el.innerHTML = loadstatustext;
					   if (x.readyState == 4 && x.status == 200)
						   {
						   el.innerHTML = x.responseText;
							}
					  }
                   }
               x.open("GET", url, true);
               x.send(null);
               }
       }	
function loadcat(x)       
{
ajaxLoad('ajservices.php?id='+x,'showlist');
}

function loadcus()       
{
ajaxLoad('ajcus.php','showlist');
}
function loadpagecus(page)       
{
ajaxLoad('ajcus.php?page='+page,'showlist');
}
function domain(dm)       
{
ajaxLoad('ajwhois.php?domain='+dm,'dmresult');
}
function lookupdomain(dm)       
{
	document.getElementById('dmresult').innerHTML='';
	var frm = document['ftmwhois'];
	var t=1;
	for (i = 0; i < frm.length; i++)
		if (frm[i].type == "checkbox" && frm[i].name == "ext[]" && frm[i].checked)
		{
			t++;
			if(t%2==0)
			document.getElementById('dmresult').innerHTML +="<div class=\"dms\" id=\"check"+i+"\"></div>";
			else document.getElementById('dmresult').innerHTML +="<div class=\"dmr\" id=\"check"+i+"\"></div>";
			ajaxLoad('ajwhois.php?domain='+dm +"."+ frm[i].value,"check"+i+"");
		}
}
function whois_info(domainname)
{
	var displaycenter = GetCenteredXY(document.getElementById("whois_info").style.width,document.getElementById("whois_content").style.height+60);
	document.getElementById("whois_info").style.display = "block";
	document.getElementById("whois_domain_name").innerHTML = domainname;
	document.getElementById("whois_info").style.marginLeft = 10+"px";
	document.getElementById("whois_info").style.top = (displaycenter[1]-180)+"px";
	ajaxLoad('ajwhoiscontent.php?domain='+domainname,'whois_content');
}
function whois_info_close()
{
	document.getElementById("whois_info").style.display = "none";
	document.getElementById("whois_domain_name").innerHTML = "";
	document.getElementById("whois_content").innerHTML = "";
}
