function checkKeywordSearch(){
	//$("form[@action*='index.cfm']").submit(function(event){
		var returnerror = true;	
		if($("#formkeyword").val() == 'Keyword' || $("#formkeyword").val() == ''){
			alert('Please enter a keyword before performing a search.');
			return false;
		}
		// *** If nothing is selected, dont bother checking for results ***
		if ($("#formkeyword").val() != '' || $("#formkeyword").val() != 'Keyword') {
			$.ajax({
				async: false,
				url: '/ajax/sitesearch_check.cfm',
				data: 'formkeyword=' + $("#formkeyword").val() + '&ajaxcheck=true',
				type: 'GET',
				dataType: 'xml',
				timeout: 5000,
				error: function(){
					alert('Error loading XML document');
				},
				success: function(xml){
					var searchresults = $(xml).find('searchresults').text();
					if (searchresults == 0)
					{
						// event.preventDefault();
						$('#nomatches').modal({
							position: ["30%"],
							minHeight:210,
							minWidth: 270
						});	
						returnerror = false;
					}
				}
			});
		} 
		return returnerror;
	// });
};
function checkAttorneySearch(){
	//$("form[@action*='index.cfm']").submit(function(event){
		var returnerror = true;	
		if($("#attorneysearch").val() == 'First or Last Name' || $("#attorneysearch").val() == ''){
			alert('Please enter a keyword before performing a search.');
			return false;
		}
		// *** If nothing is selected, dont bother checking for results ***
		if ($("#attorneysearch").val() != '' || $("#attorneysearch").val() != 'First or Last Name') {
			$.ajax({
				async: false,
				url: '/ajax/attorneysearch_check.cfm',
				data: 'formkeyword=' + $("#attorneysearch").val() + '&formProfType=1&formTopBarSearch=1&ajaxcheck=true',
				type: 'GET',
				dataType: 'xml',
				timeout: 5000,
				error: function(){
					alert('Error loading XML document');
				},
				success: function(xml){
					var searchresults = $(xml).find('searchresults').text();
					if (searchresults == 0)
					{
						$('#nomatches').modal({
							position: ["30%"],
							minHeight:210,
							minWidth: 270
						});			
						returnerror = false;
					}
				}
			});
		} 
		return returnerror;
	// });
};
function showError() {
	$.nyroModalManual({
		content: '<div class="noresults"><strong style="color:red">No Matches Found</strong><br />No results match your intended search.<br><a href="#" class="nyroModalClose">Click here</a> to modify your query.</div>',							width: 250,height: 150});	
}
