//dependencies : none var kAjax = {	request : function(p){		/*p = {		url : '', //url of xml document		onSuccess : function(xmlNode,xmlText){}, //event called when document loaded successfully		onError : function(errCode, responseStatus){}, //event called when document loaded erroneously		eventContext : [object], //object to run onSuccess and onError functions in the context of		postType : '', //GET or POST		postData : '' //post data as a string (ex: &name=escapedvalue&name2=escapedvalue2)		}*/		if(!p)return;				if(typeof p['url'] != "string")p.url = '';		if(typeof p['postType'] != 'string')p.postType="GET";		if(typeof p['postData'] != 'string')p.postData = "";		if(typeof p['eventContext'] != 'object')p.eventContext = window;		if(typeof p['onSuccess'] != "function")p.onSuccess = function(){};		if(typeof p['onError'] != "function")p.onError = function(){};		var r = null; //the xml request object		var ok = false; //xml request object instanstiated		if(!ok){try{r=new XMLHttpRequest();ok=true;}catch(e){ok=false;}}		if(!ok){try{r=new ActiveXObject("Msxml2.XMLHTTP");ok=true;}catch(e){ok=false;}}		if(!ok){try{r=new ActiveXObject("Microsoft.XMLHTTP");ok=true;}catch(e){ok=false;}}		if(ok){			r.onreadystatechange = function(){				if(r.readyState==4){					if(r.status==200){						p.onSuccess.call(p.eventContext, r.responseXML, r.responseText);					}else{						p.onError.call(p.eventContext, kAjax.ERROR_RESPONSE_STATUS, r.status);					}					p = null;					r = null;				}			};			try{				r.open(p.postType,p.url,true);				r.send(p.postData);			}catch(e){				p.onError.call(p.eventContext, this.ERROR_URL_UNAVAILABLE,0);				p = null;				r = null;			}		}else{			p.onError.call(p.eventContext, this.ERROR_FEATURE_UNAVAILABLE,0);			p = null;			r = null;		}		ok = null;	},	ERROR_FEATURE_UNAVAILABLE : 1, //unable to create the XMLHTTPRequest object	ERROR_RESPONSE_STATUS : 2, //response status of page != 200	ERROR_URL_UNAVAILABLE : 3 //XMLHTTPRequest.open failed};