//js 
//****************FUNCTION TO REMOVE WHITESPACES***************************
// Removes leading whitespaces
function LTrim( value ){
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
}

// Removes ending whitespaces
function RTrim( value ) {
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
}

// Removes leading and ending whitespaces
function trim( value ) {
	return LTrim(RTrim(value));
}
// leap Year Begin  (To check if year is Leap or not)
function echeck(str) {
	var at="@";
	var dot="." ;
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	if (str.indexOf(at)==-1){
		//alert("Invalid E-mail ID")
		return false;
	 }
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	 	//alert("Invalid E-mail ID")
	 	return false;
	}
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
	 	//alert("Invalid E-mail ID")
	 	return false;
	}
	if (str.indexOf(at,(lat+1))!=-1){
		//alert("Invalid E-mail ID")
		return false;
	}
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		//alert("Invalid E-mail ID")
		return false;
	}
	if (str.indexOf(dot,(lat+2))==-1){
		//alert("Invalid E-mail ID")
		return false;
	}
	if (str.indexOf(" ")!=-1){
		//alert("Invalid E-mail ID")
		return false;
	}
	return true;
}

function isDigit(c){
	var test = "" + c;
	if (test == "0" || test == "1" || test == "2" || test == "3" || test == "4"|| test == "5" || test == "6" || test == "7" || test == "8" || test == "9" ){
		return true;
	}
	return false;
}

function isDigitDecimal(c){
	var test = "" + c;
	if (test == "0" || test == "1" || test == "2" || test == "3" || test == "4"|| test == "5" || test == "6" || test == "7" || test == "8" || test == "9" ){
		return true;
	}
	return false;
}
/* Function accept numerice and decimal values*/
function isDigitNumericsDecimal(c){
	var test = "" + c;
	if (test == "0" || test == "1" || test == "2" || test == "3" || test == "4"|| test == "5" || test == "6" || test == "7" || test == "8" || test == "9" || test == "." ){
		return true;
	}
	return false;
}
/* End Function accept numerice and decimal values*/
//***********************************************************************


