function ajax(){	

	this.xml = false;
	this.response = function(val){};	
	var laclass = this;
	try{
		this.base =  document.getElementsByTagName('base')[0].href;
	}catch(e){
		this.base = ''; 	
	}

	
	this.createXhrObject = function(){
		if (window.XMLHttpRequest)
			return new XMLHttpRequest();	 
		if (window.ActiveXObject){
			var names = new Array("Msxml2.XMLHTTP.6.0", "Msxml2.XMLHTTP.3.0", "Msxml2.XMLHTTP", "Microsoft.XMLHTTP");
			for(var i in names){
				try{ return new ActiveXObject(names[i]); }
				catch(e){}
			}
		}
		return null;
	}
	
	this.xmlHttp=this.createXhrObject();
	
	this.loadvar = function(url){

	   this.xmlHttp.open("GET",this.base+url,true);
	   this.xmlHttp.send(null);  
	}
	
	 this.xmlHttp.onreadystatechange=function(){
		
		if(laclass.xmlHttp.readyState==4){
			
			 if(laclass.xml){
				 laclass.response(laclass.xmlHttp.responseXML.documentElement);
			 }else{
			 	laclass.response(laclass.xmlHttp.responseText);
			 }
		}
	}
}
