

function ajaxsearch(mod) {
	if($('search-field').value != ""){
		$('navresults').style.display = "block";
		$('search-activity').style.display = 'inline';
		value = $('search-field').value;
//		new Ajax.Updater('navresults', './ajax.php?mod='+mod+'&pag=search&sub='+value, {asynchronous:true, evalScripts:true});



		var opt = {
			// Use POST
			method: 'post',
			// Send this lovely data
//			postBody: 'thisvar=true&thatvar=Howdy&theothervar=2112',
			// Handle successful response
			onSuccess: function(t) {
//				alert(t.responseText);
				$('navresults').innerHTML = t.responseText;
				$('search-activity').style.display = 'none';
			},
			// Handle 404
			on404: function(t) {
//				alert('Error 404: location "' + t.statusText + '" was not found.');
			},
			// Handle other errors
			onFailure: function(t) {
//				alert('Error ' + t.status + ' -- ' + t.statusText);
			}
		}

// KAN DEZE LOCATIE NIET UIT DE ACTION="" VAR VAN HET FORM GEHAALD WORDEN? waar dan alleen index.php met ajax.php wordt vervangen
		new Ajax.Request('./ajax.php?mod='+mod+'&pag=search&sub='+value, opt);


	}
	if($('search-field').value == ""){
		$('navresults').style.display = "none";
	}
}
