function validEmailAddress(str){
	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);

	//"@" symbol not found
	if (str.indexOf(at)==-1){	   
	   return false;
	}

	//"@" symbol not found or at the beginning of the string str or the end
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){	   
	   return false;
	}

	//"." not found or at the beginning of the string str or the end
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){	  
	   return false;
	}

	//"@" symbol occurs more than once in the string
	if (str.indexOf(at,(lat+1))!=-1){	    
	    return false;
	}

	//"." just before the "@" symbol or just after the "@" symbol
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){	    
	    return false;
	}

	//there is no occurance of the "." at least two characters after the "@" symbol 
	if (str.indexOf(dot,(lat+2))==-1){	   
	    return false;
	}
	
	//there is at least on space or blank in the email address
	 if (str.indexOf(" ")!=-1){	   
	   return false;
	}

    return true;
}

function containsAlphabetsOnly(pStr) {
    var i;
    for(i=0;i<pStr.length;i++){
        if ((pStr.charCodeAt(i) >= 'a'.charCodeAt(0)) && (pStr.charCodeAt(i) <= 'z'.charCodeAt(0))
            || (pStr.charCodeAt(i) >= 'A'.charCodeAt(0)) && (pStr.charCodeAt(i) <= 'Z'.charCodeAt(0)) ) {
            
        }else{
	        return (false);
        }
    }
    return(true);
}

function checkRequired(str) {
	if (str.length == 0) {
		return(false);
	}else {
		return(true);
	}
}

function containsNumericCharacter(str) {
	var i;
	for(i=0;i<str.length;i++)
	{
		if( ((str.charAt(i) <= '9') && (str.charAt(i) >= '0')) ){
			return (true);
		}
	}
	
	return (false);	
}

function checkNumeric(str) {
	var i;
	for(i=0;i<str.length;i++)
	{
		if( ((str.charAt(i) <= '9') && (str.charAt(i) >= '0')) ){
			
		}
		else
			return (false);
	}
	
	return (true);	
}

function checkMinLen(str,len) {
	if (str.length < parseInt(len))
		return(false);
	else
		return(true);
}

function checkMaxLen(str,len) {
	if (str.length > parseInt(len))
		return(false);
	else
		return(true);
}

function checkMinValue(str,value) {
	if (parseFloat(str) < parseFloat(value))
		return(false);
	else
		return(true);
}

function checkMaxValue(str,value) {
	if (parseFloat(str) > parseFloat(value))
		return(false);
	else
		return(true);
}

function checkNoSpace(str) {
	var i;
	for(i=0;i<str.length;i++)
	{
		if (str.charAt(i) == ' ')
			return(false);
	}
	return(true);
}

function checkNoQuote(str) {
	var i;
	for(i=0;i<str.length;i++)
	{
		if (str.charCodeAt(i) == 34 || str.charCodeAt(i) == 39 || str.charCodeAt(i) == 126 || str.charCodeAt(i) == 38|| str.charCodeAt(i) == 13)
			return(false);
	}
	return(true);
}

