var reqasync=null;

function ahah_async(url,divid) {
    document.body.style.cursor='wait';
	if(reqasync==null || reqasync.readyState==4){
    	if (window.XMLHttpRequest) {
        	reqasync = new XMLHttpRequest();
      	} 
      	else if (window.ActiveXObject) {
//			reqasync = new ActiveXObject("MSXML2.XMLHTTP.4.0");
			reqasync = new ActiveXObject("Microsoft.XMLHTTP");
      	}
    	if (reqasync != undefined) {
			try{
				reqasync.xxx=divid;
		    	reqasync.onreadystatechange=async_done_getlist;
			    reqasync.open("GET", url, true);
			    reqasync.send("null");
			    
			}
			catch(error){
    	    	reqasync.abort();
			}
    	}
  	}
	
}

function async_done_getlist(){
	if(reqasync && reqasync.readyState==4){
		if(reqasync.status==200){
	        document.body.style.cursor='default';				
			var result=reqasync.responseText;
			if (document.getElementById(reqasync.xxx)){
				document.getElementById(reqasync.xxx).innerHTML=result;
			}
			//result-al azt csinálsz amit akarsz, ebben van a php scriptkimenete
		    reqasync=null;
		}
    }
}

function PutLoad(divid){
	var top;
	top=document.getElementById(divid).offsetHeight;
	//alert(top);
	document.getElementById(divid).innerHTML=document.getElementById(divid).innerHTML+"<center><img src='images/load.gif' class='load_img' style='position:absolute;margin-top:-"+Math.round(top/2)+"px;'/></center>";
}
