function check_email(e) {
 ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
 for(i=0; i < e.length ;i++){
        if(ok.indexOf(e.charAt(i))<0){
        return (false);
        }
 }
 if (document.images) {
 re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
 re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
        if (!e.match(re) && e.match(re_two)) {
        return (-1);
        }
 } }

function formValidation(f) {
if(f.txtName.value.length < 1){
        alert("Name is mandatory");
        if(document.all || document.getElementByID){
        f.txtName.style.background = "#ffdddd";
        }
         f.txtName.focus();
        return false;
}
if(!check_email(f.email1.value)){
        alert("Invalid email detected.");
        f.email1.focus();
        if(document.all || document.getElementByID){
        f.email1.style.background = "#ffdddd";
        }
        return false;
}

/*if(f.txtBody.value.length < 1){
        alert("Comments is mandatory");
        if(document.all || document.getElementByID){
        f.txtBody.style.background = "#ffdddd";
        }
         f.txtBody.focus();
        return false;
}*/

if(f.phone.value.length <= 3){
        alert("Enter the number");
        if(document.all || document.getElementByID){
        f.phone.style.background = "#ffdddd";
        }
         f.phone.focus();
        return false;
}

/*
if(!f.checkbox.checked){
	alert("Please check the Join Mailing list");
 	f.checkbox.focus();
	return false;
}
*/
}
