/* http request javascript code
 * based on	dynlite dhtml dom api
 * @author:  Peter Assenov- AIP Solutions Ltd.' 2001-2006
 * @version: 2.2.0.1/2006-11-21
 * @requires: dynlite.1.0.js
 */
 
/* global HTTP Request object */ 
var xhttp=null;
/* probing for HTTP Request functionality */	
	if (window.XMLHttpRequest)	/* DOM 3 code */
  		xhttp=new XMLHttpRequest();
	else if(window.ActiveXObject) /* IE odd code */
  	{	try{xhttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){xhttp=null;}/* you never know with IE ActiveX*/
	}
/* request method */
readySt='';
xOpen=function(url)
{	if (xhttp!=null)
  	{	log.push('#http request: openining '+url+' ...');
  		xhttp.open("GET",url,true);/* asynchonous get request */
  		xhttp.onreadystatechange=function()
  		{	if(xhttp.readyState!=4){obj(sBox).innerHTML='';}/* Transfer not completed */
  			if(xhttp.readyState==4)/* Transfer completed */
  			{ 	log.push('#http request: data retrieved from '+url);
  				/* calling result handler */
  				xResult(xhttp.responseText,xhttp.readyState);
  				//alert(obj(sBox).innerHTML);
  			}
  		}
  		xhttp.send(null)
  	}
 	else /* good old iframe */
	{	/* to be implemented */
		error('no valid http request functionality','http.js','xOpen()','Runtime');	
	}
}
xResult=function(xRes,readySt){}/* result handler; should be ovewritten */	 