var xmlhttp;

function showFile(str)
{
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp == null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}

	var url="getFile.php";
	url=url+"?q="+str;
	xmlhttp.onreadystatechange=stateChanged;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
}

function stateChanged()
{
	if (xmlhttp.readyState==4)
	{
		document.getElementById("results").innerHTML=xmlhttp.responseText;
	}
}

function GetXmlHttpObject()
{
	if (window.XMLHttpRequest)
	  {
	  	// code for good browsers
	 	return new XMLHttpRequest();
	  }
	if (window.ActiveXObject)
	  {
		  // code for IE6, IE5
		  return new ActiveXObject("Microsoft.XMLHTTP");
	  }
	return null;
}

function changeColour(col)
{
	document.body.style.background= col;
	
	var expire = new Date();
	expire.setDate(expire.getDate() + 3650);
	document.cookie = "colour =" + col + "; expires = Sat, 1 Jan 2039 00:00:00 UTC";

}