var xmlhttp;
var inwork = false;


function ajax(ajxurl, nume , sectiune)
{
   if (inwork) return true;
   xmlhttp=GetXmlHttpObject();
   if (xmlhttp==null)
   {
      alert ("Your browser does not support AJAX!");
       return;
     }
   
   xmlhttp.onreadystatechange=function(){
	   	if (xmlhttp.readyState==4 || xmlhttp.readyState=="complete")
		 {
		if (sectiune == "input") { 
			document.getElementById(nume).value=xmlhttp.responseText;
		} else {
			document.getElementById(nume).innerHTML=xmlhttp.responseText;
		}
		   inwork = false;
		 }
     }; 
	
   xmlhttp.open("GET",ajxurl,true);
   xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 1980 00:00:00 GMT"); 
   xmlhttp.send(null)
}


function GetXmlHttpObject()
{
   var xmlHttp = null;
   try
   {
      xmlHttp=new XMLHttpRequest();
   }
   catch (e)
   {
       try
       {
          xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
         }
         catch (e)
         {
         xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
         }
    }
    return xmlHttp;
} 