function ajaxObject(layer, url)
{                                    
	var that = this;					//we need this for calling the callback function
	var updating = false;			// Set to true if this object is already working on a request  
	this.callback = function() {} // A post-processing call -- a stub you overwrite.  
	this.update = function()
	{
		if (updating==true) 
		{ 
			return false; 						// Abort if we're already processing a call.  
		}                           
		updating=true;              			// Set the updating flag.     
		var AJAX = null;            			// Initialize the AJAX variable.   
		if (window.XMLHttpRequest) 
		{                         				// Are we working with FireFox or Eplorer 7?     
			AJAX=new XMLHttpRequest(); 			//  Yes.    
		}
		else	
		{                               		// Checking if this is Explorer 6 
			AJAX=new ActiveXObject("Microsoft.XMLHTTP");             		  
		}                                                              		    
		if (AJAX==null)
		{                                       // If we couldn't initialize Ajax...      
			alert("Your browser doesn't support AJAX.");                		                                     
			return false                                                	     
		} 
		else 
		{
			AJAX.onreadystatechange = function()// When the browser has the request info.. 
			{                             
				if (AJAX.readyState==4 || AJAX.readyState=="complete")		//   see if the complete flag is set. 4 also means complete
				{
					//alert(AJAX.responseText);
					LayerID.innerHTML=AJAX.responseText;			      
					delete AJAX;                                              
					updating=false;						//Set the updating flag to false so we can do a new request  
					that.callback();					//Calling the callback function after the page is ready
				}                                                            
			}                                                       
			AJAX.open("GET", urlCall, true);			// Open the url this object was set-up with.  
			AJAX.send(null);							// Send the request.        
			return true;								// Everything went a-ok.  
		}
	}
	var LayerID = document.getElementById(layer);        		   
	var urlCall = url;  
}       





