// JavaScript Document
var base =  document.getElementsByTagName('base')[0].href;

var x = 150;
function ajax(){
	
	this.response = function(val){alert(val)};
	this.xmlHttp;
	if(!(this.xmlHttp = get_xmlhttp())){
			return;	
	}
	/*//////////////////////////////////////////////////////////////////////////////////////////
	
					I N I T
	
	//////////////////////////////////////////////////////////////////////////////////////////*/
	
	laclass = this;
	
	this.loadvar = function(url){	  
	   laclass.xmlHttp.open("GET",base+url+'?i='+x++,true);
	   laclass.xmlHttp.send(null);
	  
	}
	
	 this.xmlHttp.onreadystatechange=function(){
		if(laclass.xmlHttp.readyState==4){
			 laclass.response(laclass.xmlHttp.responseText);
		}
		
	}
}


function get_xmlhttp(){
	var xmlHttp;
	try{
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }catch (e){
	  // Internet Explorer
	  try{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e){
		try{
		  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }	catch (e){
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	 return(xmlHttp);
}
