<!--

// AJAX AUTOSUGGEST SCRIPT

// XMLHTTPRequest Enable
function createObject() {
    var request_type;
    var browser = navigator.appName;

    if (browser == "Microsoft Internet Explorer") {
	request_type = new ActiveXObject("Microsoft.XMLHTTP");
    } else {
	request_type = new XMLHttpRequest();
    }

    return request_type;
}

var http = createObject();

// SEARCH
function autosuggest(url) {
    q = document.getElementById('search-q').value;

    // Set te random number to add to URL request
    nocache = Math.random();

    //var url = "http://www.bladefxserver2.be/axo-industries/products/result";
    var params = "q="+ q;
    
    http.open('POST', url, true);//.php?q=' + q + '&nocache = ' + nocache

    //Send the proper header information along with the request
    http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    http.setRequestHeader("Content-length", params.length);
    http.setRequestHeader("Connection", "close");

    http.onreadystatechange = autosuggestReply;
    http.send(params);
    //http.send(null);
}

function autosuggestReply() {
    if(http.readyState == 4 && http.status == 200) {
	var response = http.responseText;

	e = document.getElementById('search_results');

	if(response != "") {
	    e.innerHTML = response;
	    e.style.display = "block";
	} else {
	    e.style.display = "none";
	}
    }
}

function clickclear(thisfield, Zoeken) {
    if(thisfield.value == Zoeken) {
	thisfield.value = "";
    }
}

//-->
