/**
 * This function will trim leading and trailing spaces
 * in the fields
 */
function trim(strText) 
 { 
    // this will get rid of leading spaces 
    while (strText.substring(0,1) == ' ') 
       strText = strText.substring(1, strText.length);
 
    // this will get rid of trailing spaces 
    while (strText.substring(strText.length-1,strText.length) == ' ')
       strText = strText.substring(0, strText.length-1);
 
    return strText;
 } 
 
/**
* Desc : 	Checks if the given text is alphabetic 
* @params 	text to be validated
* @return 	boolean
**/
function isAlpha(frmFld,frmFieldName){
	var fldVal = trim(frmFld.value);	
	var alphaTest = /^[a-zA-Z0-9, ]+$/;
	var retAlpha = (alphaTest.test(fldVal))?true:false;
			
	if (!retAlpha){
		alert(frmFieldName + " value should be alphabetic.");
		frmFld.focus();
		return retAlpha;
	}

	if(fldVal.length > 25){
		alert(frmFieldName + " value should be less than 25 characters ");
		frmFld.focus();
		retAlpha = false;				
	}		
	return retAlpha;
} 

function showLoader() {

	document.getElementById("divProcessingMsg").innerHTML = "<img src='/RailMiles/images/processing.gif'>&nbsp;<font color=red><b>Processing is in progress...   Please wait...</b></font>";
	
}
