function getSuggestions(val){
	var xmlHttp;
	if(val!=""){
		  try
		    {
		    // Firefox, Opera 8.0+, Safari
		    xmlHttp=new XMLHttpRequest();
		    }
		  catch (e)
		    {
		    // Internet Explorer
		    try
		      {
		      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		      }
		    catch (e)
		      {
		      try
			{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
		      catch (e)
			{
			alert("Your browser does not support AJAX!");
			return false;
			}
		      }
		    }
		    xmlHttp.onreadystatechange=function()
		      {
		      if(xmlHttp.readyState==4)
			{
			    document.getElementById("suggestions").style.display='inline';
			    document.getElementById("suggestions").innerHTML=xmlHttp.responseText;
			}
		      }
			url="getsuggestions.php?val="+val;
		    xmlHttp.open("GET",url,true);
		    xmlHttp.send(null);
	}
	else document.getElementById("suggestions").style.display='none';
}
//Hides the span when title loses focus
function hideSuggestions(){
	document.getElementById("suggestions").style.display='none';
}
function checkSearch(){
	if(document.search.title.value==""){
		alert("Please fill in the \"Author/Title\" Field");
		return false;
	}
}
