function ValidateContactForm(frm)
{
    if(isStringEmpty(frm.name.value))
    {
        Popup.showAlertPopup('Please enter your name');
        return false;
    }
    else if(!isValidEmail(frm.fielde.value))
    {
        Popup.showAlertPopup('Please enter a valid email address');
        return false;
    }
    else if(isStringEmpty(frm.message.value))
    {
        Popup.showAlertPopup('Please enter your message');
        return false;
    }
    return true;
}
//Validate email
function isValidEmail(email){
    var ck_email = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; //Standard email address 
    
    return ck_email.test(email);
}

//empty string
function isStringEmpty(str){

    var regex = /\s/g;
    var strNew = str.replace(regex, '');//replace whitespaces with empty string
    return strNew == '' ? true : false;
}