var Ajax = {
	connection:null,
 /***
	* 0 = uninitialized
  * 1 = loading
  * 2 = loaded
  * 3 = interactive
  * 4 = complete
  **/
	readyState:null,  
	status:null,
	statusText:null,
	/**
	 * 0 = XMLHttpRequest
	 * 1 = ActiveXObject.Microsoft.XMLHTTP
	 **/
	connectionType:null,
	responseText:null,
	
	Init: function(){
		//Non Internet Explorer
		if (window.XMLHttpRequest){
			connection = new XMLHttpRequest();
			connectionType = 0;
  	}	else if (window.ActiveXObject) {
  		connection = new ActiveXObject("Microsoft.XMLHTTP");
  		connectionType = 1;
		}
		
		if(connection){
			connection.onreadystatechange = this.StateChange
		} else {
			;//alert("Ajax->Init: Unable to make connection");
			return;
		}
		
	},
	
	Send: function(request){
		this.Init();
		connection.open("GET",request,true);
		if(connectionType == 0){
			connection.send(null);
		} else if(connectionType == 1){
			connection.send();
		}
	},
	
	StateChange: function(){
		readyState 	= connection.readyState;
		status 			= connection.state;
		//statusText 	= connection.statusText;
		if (connection.readyState == 4){
			if (connection.status==200) {
				this.responseText = connection.responseText;  
				}	else {
    	  ;//alert("Ajax->StateChange: Unable to retrieve data. code="+this.connection.status);
    	}
		}
	}
}

function Tick(){
	var url = location.href;
  Ajax.Init();
  
  var tickstring = 'http://'+window.location.host+'/tick.php?currentPage=';
	Ajax.Send(tickstring+url);
  window.setTimeout('Tick()', 300000); 
}

