function attic(elem,url,waitelem){
	if ((waitelem!=null)&&(waitelem.style.visibility=='visible')) return false;

	var xmlHttp = null;
	try {
		xmlHttp = new XMLHttpRequest();
	} catch (e) {
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}	
	xmlHttp.open("GET", url, true);
	xmlHttp.element = elem;
	if (waitelem!=null){
		xmlHttp.waitelem = waitelem;
		waitelem.style.visibility = 'visible';
	}
	// Add a ready state handler to the XML HTTP object:
	xmlHttp.onreadystatechange = function(){
									if (this.readyState == 4){
									
									
											this.element.innerHTML = this.responseText;
											this.waitelem.style.visibility = 'hidden';
										
									}
	}
	
	// Send the request:
	xmlHttp.send(null);	
}
var Ajax = new function() {
	/**
	 * Create an XML HTTP object.
	 * 
	 * @return					The XML HTTP object.
	 **/
	this.createXmlHttpObject = function() {
		var xmlHttp = null;
		
		try {
			// Firefox, Opera 8.0+, Safari:
			xmlHttp = new XMLHttpRequest();
		} catch (e) {
			// Internet Explorer:
			try {
				xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
		
		return xmlHttp;
	}
	
	/**
	 * The default response handler that is used for AJAX responses.
	 * 
	 * @param element			The element to parse the response text into.
	 * @param responseText		The responseText from the AJAX request.
	 **/
	this.defaultResponseHandler = function(element, responseText,callBack) {
		if (element!=null){
			element.innerHTML = responseText;
		}else{
		}
		if (callBack!=null)
			callBack();
	}
	
	/**
	 * The default ready state handler for AJAX requests.
	 * 
	 * @param xmlHttp			The XML HTTP object to use.
	 * @param element			The element to use the response on.
	 * @param callBack			The callback function to process after the request has finished.
	 * @param responseHandler	The response handler that handles the AJAX response text.
	 * 
	 * @return					A onreadystatechange handler for an AJAX request.
	 **/
	this.getDefaultReadyStateHandler = function(xmlHttp, element, callBack, responseHandler) {
		return function() {
			if (xmlHttp.readyState == 0) {
				// The request is uninitialized (before you've called open()):
			} else if (xmlHttp.readyState == 1) {
				// The request is set up, but hasn't been sent (before you've called send()):
			} else if (xmlHttp.readyState == 2) {
				// The request was sent and is being processed (you can usually get content headers from the response at this point):
			} else if (xmlHttp.readyState == 3) {
				// The request is being processed; often some partial data is available from the response, but the server hasn't finished with its response":
			} else if (xmlHttp.readyState == 4) {
				if (xmlHttp.status == 200) {
					responseHandler(element, xmlHttp.responseText,callBack);
					// If a callback is set use it:

				} else if (xmlHttp.status == 404) {
//					alert("AJAX error: Page not found!");
				} else {
	//				alert("AJAX error: Unknown error " + xmlHttp.status + "!");
				}
			}
		}
	}
	
	/**
	 * Send an AJAX request and use the response on an element.
	 * 
	 * @param element			The element to load the content into.
	 * @param url				The URL to the page to load.
	 * @param callBack			The callback function to process after the request has finished.
	 * @param handler			The onreadystatechange handler to use with the AJAX request.
	 **/
	this.request = function(element, url, callBack, handler) {
		// Retrieve a new XML HTTP object:
		var xmlHttp = this.createXmlHttpObject();
//		alert(element);
		// If AJAX is not supported:
		if (xmlHttp == null) {
			element.innerHTML = "Couldn't load content '" + url + "'!";
			
			alert ("Your browser does not support AJAX!");
			
			return;
		}
		
		// Load the default handler if necessery:
		if (handler == null) {
			handler = this.defaultResponseHandler;
		}
		
		// Load the stated page by it's URL:
		if (url.indexOf("?", 0) == -1) {
			url = url + "?";
		} else {
			url = url + "&amp;";
		}
		
		// Add a SID to the url:
		url = url + "sid=" + Math.random();
		
		// Retrieve the page:
		xmlHttp.open("GET", url, true);
		
		// Add a ready state handler to the XML HTTP object:
		xmlHttp.onreadystatechange = this.getDefaultReadyStateHandler(xmlHttp, element, callBack, handler);
		
		// Send the request:
		xmlHttp.send(null);
	}
}