	/************************************************************************************************************************
	Function : alphaCharWithSpace 
	Params   : String
	Logic	  : If string contains only A-Z or a-z or space character then it will return true. Else it will return false.
	**************************************************************************************************************************/
	function alphaCharWithSpace(str){
		var reg=/^([A-Za-z ])+$/;
		return reg.test(str);
	}
	
	/************************************************************************************************************************
	Function : alphaCharWithoutSpace 
	Params   : String
	Logic	  : If string contains only A-Z or a-z character then it will return true. Else it will return false.
	**************************************************************************************************************************/
	function alphaCharWithoutSpace(str){
		var reg=/^([A-Za-z])+$/;
		return reg.test(str);
	}


	/************************************************************************************************************************
	Function : numericCharWithoutSpace
	Params   : String
	Logic	  : If string contains only 0-9 numeric character then it will return true. Else it will return false.
	**************************************************************************************************************************/
	function numericCharWithoutSpace(str){
		var reg=/^([0-9])+$/;
		return reg.test(str);
	}
	
	
	/************************************************************************************************************************
	Function : alphaNumericCharWithoutSpace
	Params   : String
	Logic	  : If string contains only A-Z or a-z or 0-9 alpha-character then it will return true. Else it will return false.
	**************************************************************************************************************************/
	function alphaNumericCharWithoutSpace(str){
		var reg=/^([A-Za-z0-9])+$/;
		return reg.test(str);
	}
	
	
	/************************************************************************************************************************
	Function : checkEmail
	Params   : String
	Logic	  : If string contains email id like (kk@kk.kk) format then it will return true. Else it will return false.
	**************************************************************************************************************************/
	function checkEmail(str){
		var reg =/^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;
		return reg.test(str);
	}

	/************************************************************************************************************************
	Function : trimValue
	Params   : String
	Logic	  : Right and left spaces of string will get trimed / removed.
	**************************************************************************************************************************/

	function trimValue(str){
		return LTrim(RTrim(str));
	}
	function LTrim( value ) {
		var re = /\s*((\S+\s*)*)/;
		return value.replace(re, "$1");
	}    
	function RTrim( value ) {
		var re = /((\s*\S+)*)\s*/;
		return value.replace(re, "$1");
	}

	
	/************************************************************************************************************************
	Function : chkPassword
	Params   : String
	Logic	  : Password shd be small caps without spaces with length greater that 6 and less than 20
	**************************************************************************************************************************/
	function chkPassword(password){
		if(password.length==0){
			alert('Please Enter Password.');
			return false;
		}	

		if(password.length<6 || password.length>20){
			alert('Password Require Minimum 6 Characters And Less Than 20 Characters.');
			return false;
		} 
		if (password.indexOf(' ')!=-1){
			alert ('Please Do Not Use Space In Password');
			return false;
		}

		if(password.length!=0){
			for(var m=0;m<password.length;m++){
				var A = parseInt("65");
				var code = parseInt(password.charCodeAt(m));
				var Z = parseInt("90");
				if( code>=A  && code <= Z){
					alert ('Please Do Not Use Capital Letters In Password.');
					return false;						
				}
			}						
		}
		return true;
	}
	

	/************************************************************************************************************************
	Function : checkCapsLock
	Params   : String
	Logic	  : If caps lock is on then it will return false else it will return true.
	Ref:	: http://www.techiegyan.com/?p=83
	**************************************************************************************************************************/

	function checkCapsLock( e ) {
		var keyCode=0;
		var shiftKey=false;
		// Internet Explorer 4+ AND Mozilla
		if ( document.all ) {
			keyCode=e.keyCode;
			shiftKey=e.shiftKey;
	 	// Netscape 4
		} else if ( document.layers ) {
			keyCode=e.which;
			shiftKey=( keyCode == 16 ) ? true : false;
	 	// Netscape 6
		} else if ( document.getElementById ) {
			keyCode=e.which;
			shiftKey=( keyCode == 16 ) ? true : false;
	 	}
	 	// Upper case letters are seen without depressing the Shift key, therefore Caps Lock is on
		if ( ( keyCode >= 65 && keyCode <= 90 ) && !shiftKey ) {
			return false;
	 	}
		// Lower case letters are seen while depressing the Shift key, therefore Caps Lock is on
		else if ( ( keyCode >= 97 && keyCode <= 122 ) && shiftKey ) {
			return false;
		}
		return true;
	}