// JavaScript Document
function ValidateContact(frmLN,frmObj){ 
    var fm = document.getElementById(frmObj); 
    if(fm.selContWith.value== ""){ 
        alert("Please select the Contact Department");
        fm.selContWith.focus();
        return false;
    }
    if(fm.txtName.value== "Name" || fm.txtName.value== ""){ 
        alert("Please enter the Name");
        fm.txtName.focus();
        return false;
    }
    if(fm.txtEmail.value== "Email Address" || fm.txtEmail.value== ""){ 
        alert("Please enter the Email Address");
        fm.txtEmail.focus();
        return false;
    }
	if (EmailValidate(fm.txtEmail.value) == false){
		alert("Please input a valid Email Address !")
		fm.txtEmail.focus();
		return false;
	}
	if(fm.txtPhone){
		if(fm.txtPhone.value== "Telephone" || fm.txtPhone.value== ""){ 
			alert("Please enter the Phone");
			fm.txtPhone.focus();
			return false;
		}    
	}
    fm.action = frmLN;
    fm.submit();
    return true;
}

function EmailValidate(strVal){
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	return filter.test(strVal);
}
