function rdyAjax(){
	with(ajx){
		if(readyState==4){
			if(status==200){
				if(progres)progres.style.visibility="hidden";
				if(RDY.toString()!="true")RDY();
			}
		}
	}
}
function ajax(fil,prm,rdy){
	progres=document.getElementById("progress");if(progres)progres.style.visibility="visible";
	ajx=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")
    with(ajx){
		if(rdy){RDY=rdy;onreadystatechange=rdyAjax}
		open("POST", fil, rdy?true:false);
		setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
		if(prm)setRequestHeader("Content-length", prm.length);else prm=null
		send(prm);
	    if(rdy);else {if(progres)progres.style.visibility="hidden";return responseText}
	}
}
function jsAjax(fil){return eval(ajax(fil))}

