/*
*/
var count = 0;

function doDropDown()
{
   count = count+1;
   setTimeout("dropDownGo("+count+")",1000);
}

function dropDownGo(currCount)
{
   if(currCount == count)
   {
      count = 0;
      ajaxFunction();
   }
} 

function ajaxFunction()
{
    var domain_2th  = document.preventivoForm.elements["domain_2th"].value;
    var dot_it  = document.preventivoForm.elements["dot_it"].checked;
    var dot_com  = document.preventivoForm.elements["dot_com"].checked;
    var dot_org  = document.preventivoForm.elements["dot_org"].checked;
    var dot_net  = document.preventivoForm.elements["dot_net"].checked;
    var dot_eu  = document.preventivoForm.elements["dot_eu"].checked;
    var dot_biz  = document.preventivoForm.elements["dot_biz"].checked;
    var dot_info  = document.preventivoForm.elements["dot_info"].checked;
    var dot_tv  = document.preventivoForm.elements["dot_tv"].checked;
    var dot_tel  = document.preventivoForm.elements["dot_tel"].checked;
    var dot_name  = document.preventivoForm.elements["dot_name"].checked;

var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
  xmlHttp.onreadystatechange=function()
    {
      if(xmlHttp.readyState==0 || xmlHttp.readyState==1 || xmlHttp.readyState==2|| xmlHttp.readyState==3)
      {
	var imgTag = '<img src="/img/globe.gif" alt="" />';
	
	document.getElementById('searcing').innerHTML = imgTag;

	/* if (typeof(dot_it) != "undefined") {
	document.getElementById('r_dot_0').innerHTML = imgTag;
	}
	if (typeof(dot_com) != "undefined") {
	document.getElementById('r_dot_1').innerHTML = imgTag;
	}
	if (typeof(dot_org) != "undefined") {
	document.getElementById('r_dot_2').innerHTML = imgTag;
	}
	if (typeof(dot_net) != "undefined") {
	document.getElementById('r_dot_3').innerHTML = imgTag;
	}
	if (typeof(dot_eu) != "undefined") {
	document.getElementById('r_dot_4').innerHTML = imgTag;
	}
	if (typeof(dot_biz) != "undefined") {
	document.getElementById('r_dot_5').innerHTML = imgTag;
	}
	if (typeof(dot_info) != "undefined") {
	document.getElementById('r_dot_6').innerHTML = imgTag;
	}
	if (typeof(dot_tv) != "undefined") {
	document.getElementById('r_dot_7').innerHTML = imgTag;
	}
	if (typeof(dot_tel) != "undefined") {
	document.getElementById('r_dot_8').innerHTML = imgTag;
	}
	if (typeof(dot_name) != "undefined") {
	document.getElementById('r_dot_9').innerHTML = imgTag;
	} */
      }

      if(xmlHttp.readyState==4)
      {
	/* document.preventivoForm.totale.innerHTML=xmlHttp.responseText; */

	var rString = xmlHttp.responseText;
	var rArray  = rString.split("^");
	
	document.getElementById('searcing').innerHTML = null;
	
    	if (rArray[0]) {
	document.getElementById('r_dot_0').innerHTML = rArray[0];
	}
    	if (rArray[1]) {
	document.getElementById('r_dot_1').innerHTML = rArray[1];
	}
    	if (rArray[2]) {
	document.getElementById('r_dot_2').innerHTML = rArray[2];
	}
    	if (rArray[3]) {
	document.getElementById('r_dot_3').innerHTML = rArray[3];
	}
    	if (rArray[4]) {
	document.getElementById('r_dot_4').innerHTML = rArray[4];
	}
    	if (rArray[5]) {
	document.getElementById('r_dot_5').innerHTML = rArray[5];
	}
    	if (rArray[6]) {
	document.getElementById('r_dot_6').innerHTML = rArray[6];
	}
    	if (rArray[7]) {
	document.getElementById('r_dot_7').innerHTML = rArray[7];
	}
    	if (rArray[8]) {
	document.getElementById('r_dot_8').innerHTML = rArray[8];
	}
    	if (rArray[9]) {
	document.getElementById('r_dot_9').innerHTML = rArray[9];
	}
      }
    }

    var url="/ajax_responce/domain_search.php"
    url=url+"?domain_2th="+domain_2th
    url=url+"&dot_it="+dot_it
    url=url+"&dot_com="+dot_com
    url=url+"&dot_org="+dot_org
    url=url+"&dot_net="+dot_net
    url=url+"&dot_eu="+dot_eu
    url=url+"&dot_biz="+dot_biz
    url=url+"&dot_info="+dot_info
    url=url+"&dot_tv="+dot_tv
    url=url+"&dot_tel="+dot_tel
    url=url+"&dot_name="+dot_name

  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }

