// JavaScript Document

var xmlHttp;
var destination;

function executeAjax(url, objectID){
	xmlHttp=getHttpObject();
	if (xmlHttp==null){
		alert ("Your browser does not support AJAX!");
		return;
	} 
	
	destination = objectID;
	var date = new Date();
	var milli = date.getTime();
	var rand = (Math.random()) + milli;

	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url+'&rand='+rand,true);
	xmlHttp.send(null);
	return true;
}

function stateChanged(){
	if (xmlHttp.readyState==4){
		if(destination != ''){
			document.getElementById(destination).innerHTML=xmlHttp.responseText;
		}
	}
}
	
function getHttpObject(){
	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;
}