function CheckAndSubmit(){	
	if(fnStringTrim(document.frm_search.keywords.value)=="")
	{
		
		alert("Please enter your keyword");
		document.frm_search.keywords.focus();
		return false;
	}
	
	var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?";
	for (var i = 0; i < document.frm_search.keywords.value.length; i++) 
	{
  		if (iChars.indexOf(document.frm_search.keywords.value.charAt(i)) != -1) 
		{
  			alert ("Your keyword has special characters. \nThese are not allowed.\n Please remove them and try again.");
			document.frm_search.keywords.focus();
  			return false;
  		}
  	}
	return	true;
}

function CheckSplChar()
{	
	var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?";
	for (var i = 0; i < document.frm_search.keywords.value.length; i++) 
	{
  		if (iChars.indexOf(document.frm_search.keywords.value.charAt(i)) != -1) 
		{
  			alert ("Your keyword has special characters. \nThese are not allowed.\n Please remove them and try again.");
			document.frm_search.keywords.value="";
			document.frm_search.keywords.focus();
			return false;
  		}
  	}
}




//Trim The String
function fnStringTrim(inputString)
{
     var retValue = inputString;
     // Check for spaces at the beginning of the string
     var ch = retValue.substring(0,1);
     while (ch == " ")
     {                                                  
           retValue = retValue.substring(1, retValue.length);
           ch = retValue.substring(0, 1);
     }
     // Check for spaces at the end of the string
     ch = retValue.substring(retValue.length-1, retValue.length); 
     while (ch == " ")                                           
     { 
           retValue = retValue.substring(0, retValue.length-1);
           ch = retValue.substring(retValue.length-1, retValue.length);
     }
     return retValue; // Return the trimmed string back to the user
}

