var xmlHttp = createXmlHttpRequestObject(); 
function createXmlHttpRequestObject() 
{	
  // will store the reference to the XMLHttpRequest object
  var xmlHttp;
  // if running Internet Explorer
  if(window.ActiveXObject)
  {
    try
    {
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch (e) 
    {
      xmlHttp = false;
    }
  }
  // if running Mozilla or other browsers
  else
  {
    try 
    {
      xmlHttp = new XMLHttpRequest();
    }
    catch (e) 
    {
      xmlHttp = false;
    }
  }
  if (!xmlHttp)
  alert("Error creating the XMLHttpRequest object.");
  else 
  return xmlHttp;
}


function clickcount(ip,id) 
{ 

//var dept=form.dept.options[form.dept.options.selectedIndex].value;
//alert(site);
//var dep=form.dept.options[form.dept.options.selectedIndex].value;
if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
  {
	 
   xmlHttp.open("GET", "click.php?ip="+ip+"&id="+id, true);
   // define the method to handle server responses
    xmlHttp.onreadystatechange = handleSiteResponse;
    // make the server request
    xmlHttp.send(null);
  }
 
}
function handleSiteResponse() 
{
	//alert(xmlHttp.status);
  if (xmlHttp.readyState == 4) 
  { 
  if (xmlHttp.status == 200) 
    {
		xmlResponse = xmlHttp.responseText;
		 //document.getElementById("divMessage").innerHTML='';
//	 document.getElementById("divMessage").innerHTML =xmlHttp.responseText;
	 //setTimeout('selectuser()', 2000);
    } 
    else 
    {
		alert("There was a problem accessing the server: " + xmlHttp.statusText);
    }
  }
}

