oAjax = new AjaxRequest();


function doSearch(string,url,key){
	if(string!=""){
		oP = document.createElement("p");
		oP.appendChild(document.createTextNode("Please wait while we gather your results..."));
		drawSimple(oP);
		oAjax.open("GET","/_components/search/model/actBuildSearch.php?query="+string+"&strKey="+key+"&time"+Math.random());
		oAjax.onreadystatechange = function(){handleSearchResult(url)};
		oAjax.send(null);	
	}
}
function handleSearchResult(url){
	if(oAjax.readyState == 4){
		_closedraw();
		if(parseInt(oAjax.responseText) == 0){
			oP = document.createElement("p");
			oP.appendChild(document.createTextNode('There was no content found matching your criteria.'));
			drawSimple(oP);
		}
		else{
			window.location.href = url+"/?action=show&lid=Y7TG3-3VFWL-CHS6Q&act=results&id="+oAjax.responseText;
		}
	}
}
function generalSearch(oForm,url,key){
	query = (typeof(oForm.childNodes[0].value) == "undefined") ? oForm.childNodes[1].value : oForm.childNodes[0].value;
	doSearch(query,url,key);
}// JavaScript Document