function hideResults(){
	document.getElementById("resultArea").style.display = "none";
}

function showResults(){
	if(document.getElementById("searchInput").value.length > 0){
		document.getElementById("resultArea").style.display = "block";
	}
}


var myRequest = getXMLHTTPRequest();

function searchAlbum(zoekStr){
	var myRandom = parseInt(Math.random() * 99999999);
	
	// build the URL of the server script we wish to call
	var url = "/classes/home/js/search.php";
	// ask our XMLHTTPRequest object to open a
	// server connection
	myRequest.open("GET", url + "?zoekStr=" + zoekStr + "&rand=" + myRandom, true);
	// prepare a function responseAjax() to run when
	// the response has arrived
	myRequest.onreadystatechange = function(){
		// we are only interested in readyState of 4,
	    // i.e. "loaded"
	    if(myRequest.readyState == 4) {
	        // if server HTTP response is "OK"
	        if(myRequest.status == 200) {
	        	//alert(myRequest.responseText);
	        	//document.getElementById("chat").value = myRequest.responseText;
	        	if(myRequest.responseText != ""){
	        		document.getElementById("resultArea").style.display = "block";
	        		document.getElementById("zoekResults").innerHTML = myRequest.responseText;
	        	}
	        	else {
	        		document.getElementById("resultArea").style.display = "none";
	        	}
	        }
	    }
	};
	
	myRequest.send(null);
	// and finally send the request
}

