function getRequestObject()
{
	//create a XMLHttpRequest Object.
	if(window.XMLHttpRequest)
	{ 
		return new XMLHttpRequest();
	}
	else
	{
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
}

function getRandomRange(a,b)
{
	return a+ (Math.floor(Math.random()*b+1));
}

//call this function with url of document to open as attribute
function requestContent(containerId,url)
{
	var xmlhttp = getRequestObject();
	if(xmlhttp != null) {
		xmlhttp.open("GET",url,true);
		xmlhttp.onreadystatechange = function() {
//						if (xmlhttp.readyState == 1)
//						{
//							document.getElementById(containerId).innerHTML="...";
//						}
						
						if (xmlhttp.readyState == 4 && xmlhttp.status == 200 && xmlhttp.responseText != '')
						{
							//xmlhttp.responseText is the content of document requested
							document.getElementById(containerId).innerHTML=xmlhttp.responseText;
						}
		}
		xmlhttp.send(null);
	}
}