function ltrim(s){return s.replace(/^\s+/, "");}

function rtrim(s){return s.replace(/\s+$/, "");}

function trim(s){return rtrim(ltrim(s));}

/*************************************************************************************/

function validateEmail(strEmail){
	var regex = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	if(regex.test(strEmail) == false){
		//alert('Invalid email address. Please check');
		//field.focus();

		return 0;
	}

	return 1;
}

/*************************************************************************************/

function clearSpaceInPassword(UserEvent){
    //alert(UserEvent.keyCode);
    if(UserEvent.keyCode == 32){
        UserEvent.returnValue = false;
    }
    return UserEvent.returnValue;
}

/*************************************************************************************/

function textCounter(field, maxlimit) {
	if (field.value.length > maxlimit){
		//alert('Character limit exceed');
		field.value = field.value.substring(0, maxlimit);
	}
}

/*************************************************************************************/

function validateInputForm(strValue){
	var illegalChars = /[\W_]/; // allow only letters and numbers

	if(illegalChars.test(strValue)){
		return false;
	}else{
		return true;
	}
}

/*************************************************************************************/

function disableChr(evt, chrCode){
	var charCode = (evt.which) ? evt.which : event.keyCode;
	if(chrCode=='*'){return false;}
	if(charCode==chrCode){return false;}
}

/*************************************************************************************/

function resizeBody(){
      var myHeight = 0;
      if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myHeight = window.innerHeight;
      } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myHeight = document.documentElement.clientHeight;
      } 
    document.getElementById("Content").style.height = (myHeight-110)+'px';
    //document.getElementById("ContentTable").style.height = (myHeight-165)+'px';
    document.getElementById("menuLeft").style.height = (myHeight-110)+'px';
}

/*************************************************************************************/

function resizeBodyLog(){
      var myHeight = 0;
      if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myHeight = window.innerHeight;
      } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myHeight = document.documentElement.clientHeight;
      } 
    document.getElementById("mainContent").style.height = (myHeight-125)+'px';
	/*document.getElementById("mainContent").style.height = (myHeight-165)+'px';*/
}

/*************************************************************************************/

function headerTitle(optionText){document.title = optionText}
