function validateEmailAddress(elemValue){

    var atPos
    var dotafterAtPos
    var dotnotlastchar
        
    dotlastchar = false;
    
            
    // check if there is an @ symbol           
    atPos = elemValue.indexOf("@",1);
            
    // check that there is at least one dot after the @
    dotafterAtPos = elemValue.indexOf(".", (atPos + 2));
            
    // check that the last character is not a dot
    if(elemValue.indexOf(".") == (elemValue.length - 1)) {
        dotlastchar = true;
    }
        
    if ((atPos == -1) || (dotafterAtPos == -1) || (dotlastchar)){
        return false;
    }else{
    
        return true;
    }
            
    

}

function checkMandatoryField(elem, minLength){

    if(elem.length >= minLength){
        return true;
    }else{
        return false;
    }
    

}

function isNumberKey(evt)
{
    var charCode = (evt.which) ? evt.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57))
    {
        return false;
    }
    else
    {
         return true;
    }
}
