function Trim(TRIM_VALUE){
	if(TRIM_VALUE.length < 1){
		return"";
	}
	TRIM_VALUE = RTrim(TRIM_VALUE);
	TRIM_VALUE = LTrim(TRIM_VALUE);
	if(TRIM_VALUE==""){
	return "";
	}
	else{
	return TRIM_VALUE;
	}
} //End Function

function RTrim(VALUE){
	var w_space = String.fromCharCode(32);
	var s_r = String.fromCharCode(13);
	var s_n = String.fromCharCode(10);
	var s_t = String.fromCharCode(9);
	var v_length = VALUE.length;
	var strTemp = "";
	if(v_length < 0){
		return"";
	}
	var iTemp = v_length -1;

	while(iTemp > -1){
		if(VALUE.charAt(iTemp) == w_space || VALUE.charAt(iTemp) == s_r || VALUE.charAt(iTemp) == s_n || VALUE.charAt(iTemp) == s_t){
		}
		else{
			strTemp = VALUE.substring(0,iTemp +1);
			break;
		}
		iTemp = iTemp-1;

	} //End While
	return strTemp;

	} //End Function

function LTrim(VALUE){
	var w_space = String.fromCharCode(32);
	var s_r = String.fromCharCode(13);
	var s_n = String.fromCharCode(10);
	var s_t = String.fromCharCode(9);
	if(v_length < 1){
	return"";
	}
	var v_length = VALUE.length;
	var strTemp = "";

	var iTemp = 0;

	while(iTemp < v_length){
	if(VALUE.charAt(iTemp) == w_space || VALUE.charAt(iTemp) == s_r || VALUE.charAt(iTemp) == s_n || VALUE.charAt(iTemp) == s_t){
	}
	else{
		strTemp = VALUE.substring(iTemp,v_length);
		break;
	}
	iTemp = iTemp + 1;
	} //End While
	return strTemp;
} //End Function
function emailValidator(elem){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
	if(elem.match(emailExp)){
		return true;
	}else{
		return false;
	}
}
