

var xmlhttp = false;


function imageLoad(url, result){
	

	if (window.XMLHttpRequest)
	xmlhttp = new XMLHttpRequest()
	
		else if (window.ActiveXObject){ 
		
			try {
				xmlHttp = new XMLHttpRequest();
			}
			catch (e){
						var XmlHttpVersions = new Array("MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP","Microsoft.XMLHTTP");
			   
						for (var i=0; i<XmlHttpVersions.length && !xmlhttp; i++) {
							  try { 
									xmlhttp = new ActiveXObject(XmlHttpVersions[i]);
							  } 
							  catch (e) {} 
						}
			}
		}
		else
		return false
		
		xmlhttp.onreadystatechange=function(){
			loadpage(xmlhttp, result)
		}
		document.getElementById(result).innerHTML = "Searching...";
		xmlhttp.open('GET', url, true);
		xmlhttp.send(null);
}

function loadpage(xmlhttp, result){
	if (xmlhttp.readyState == 4 && (xmlhttp.status==200 ))
		document.getElementById(result).innerHTML=xmlhttp.responseText;
}

var xmlhttp = false;
        
// If the user is using Mozilla/Firefox/Safari/etc
if (window.XMLHttpRequest) {
        //Intiate the object
        xmlhttp = new XMLHttpRequest();
        //Set the mime type
        xmlhttp.overrideMimeType('text/xml');
} else if (window.ActiveXObject) {
        //Intiate the object
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}


function preSearch(theQuery) {

    //Put the form data into a variable

	var theQuery ;
	

    //If the form data is *not* blank, query the DB and return the results

	if(theQuery != "") {

        //Change the content of the "result" DIV to "Searching..."

        //This gives our user confidence that the script is working if it takes a moment for the result to be returned. However the user will likely never see this...

		document.getElementById('XXX').innerHTML = "Searching. . . ";

        //This sets a variable with the URL (and query strings) to our PHP script

		var url = 'literatuurDetails2.php?q='+theQuery;

        //Open the URL above "asynchronously" (that's what the "true" is for) using the GET method

		xmlhttp.open('GET', url, true);

        //Check that the PHP script has finished sending us the result

		xmlhttp.onreadystatechange = function() {

			if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {

                //Replace the content of the "result" DIV with the result returned by the PHP script

				document.getElementById('XXX').innerHTML = xmlhttp.responseText + ' ';

				document.getElementById('XXX').style.visibility = "visible";

			} else {

                //If the PHP script fails to send a response, or sends back an error, display a simple user-friendly notification

				//document.getElementById('XXX').innerHTML = 'Error: preSearch Failed!';
				document.getElementById('XXX').innerHTML = 'Searching. . .';
				document.getElementById('XXX').style.visibility = "visible";

			}

		};

		xmlhttp.send(null);  

	}

}


// <![CDATA[
/*
var glbInc, glbDec;

function decreaseSizeImage(image) // will get back to its normal default size
{
	var id = image;
	if(glbInc != null) {clearTimeout(glbInc); glbInc = null;};
	if (document.getElementById(id).height > 100)
	{
	document.getElementById(id).height -= 30;
	document.getElementById(id).width -= 40;
	glbDec = setTimeout("decreaseSizeImage('"+id+"')", 32);
	};
	}
	
	function increaseSizeImage(image)
	{
	var id = image;
	if(glbDec != null) {clearTimeout(glbDec); glbDec = null;};
	if (document.getElementById(id).height < 216)
	{
	document.getElementById(id).height += 30;
	document.getElementById(id).width += 40;
	document.getElementById(id).style.zIndex += 1;
	glbInc = setTimeout("increaseSizeImage('"+id+"')", 32);
	};
}

function mouseOver(){
	document.image.src ="images/logo2.jpg"
}

function mouseOut(){
	document.image.src ="images/logo.jpg"
}
*/
