function intellisearchcall(args) {
	var i, x, n, uri, post_data, target_id;
    var msxmlhttp = new Array('Msxml2.XMLHTTP.5.0','Msxml2.XMLHTTP.4.0','Msxml2.XMLHTTP.3.0','Msxml2.XMLHTTP','Microsoft.XMLHTTP');
    func_name = "find_matches";
	target_id = "";
	uri = "index.php";
    post_data = "rs=" + escape(func_name);
    post_data += "&rst=" + escape(target_id);
    post_data += "&rsrnd=" + new Date().getTime();
    for (i = 0; i < args.length-1; i++)
	    post_data = post_data + "&rsargs[]=" + escape(args[i]);
	for (var i = 0; i < msxmlhttp.length; i++) {
        try {
        	x = new ActiveXObject(msxmlhttp[i]);
        } catch (e) {
        	x = null;
        }
	}
	if(!x && typeof XMLHttpRequest != "undefined")
        x = new XMLHttpRequest();
	if (x == null) {
    	return false;
	} else {
        x.open("POST", uri, true);
       	x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1");
    	x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        x.onreadystatechange = function() {
        	if (x.readyState != 4)
                return;
        	var status, data;
        	var txt = x.responseText.replace(/^\s*|\s*$/g,"");
        	status = txt.charAt(0);
        	data = txt.substring(2);
        	if (status == "") {
        	} else if (status == "-") {
        	} else {
                if (target_id != "") {
                	document.getElementById(target_id).innerHTML = eval(data);
                } else {
                	try {
                        var callback;
                        var extra_data = false;
                        if (typeof args[args.length-1] == "object") {
                        	callback = args[args.length-1].callback;
                        	extra_data = args[args.length-1].extra_data;
                        } else {
                        	callback = args[args.length-1];
                        }
                        callback(eval(data), extra_data);
                	} catch (e) {
                	}
                }
        	}
        }
	}
	x.send(post_data);
	delete x;
	return true;
}
function intellisearch() { intellisearchcall(intellisearch.arguments); }
function intellisearchresults() { var x; x = document.getElementById("intellisearchval").value; intellisearch(x, intellisearchresultscb); }
function intellisearchresultscb(result) { eval(result); }
