var searchStatus = 0;

function searchForm ( x , y , z ){
	if(searchStatus == 0){
		searchStatus = 1;
		$.ajax({
			type: "POST",
			url: z+"/mvc/utils/util.php?app=viewNews&amp;app_type=application&action=SiteSearch",
			data: "siteSearchField="+$('#siteSearchField').val(),
			success: function(msg){
				if(msg.match("No Documents Found")){
					$('#col'+y+'Content').prepend("<div id='searchMessage"+y+"'><p>Sorry, There were no documents found matching your search terms.</p></div>");
					$("#searchMessage"+y).slideDown("slow", function(){
						pausecomp('2000');
						$("#searchMessage"+y).slideUp("slow", function(){
							$("#searchMessage"+y).remove();
							searchStatus = 0;
						});
					});
				} else {
					window.location=z+"/search/?siteSearchField="+escape($('#siteSearchField').val());
				}
			}
		});
	}
}

function pausecomp(msecs){
	var date = new Date();
	var curDate = null;
	do {
		curDate = new Date(); 
	} 
	while(curDate-date < msecs);
}
