<!--  Contact Form Validation
function validateform(){
if (document.Contact.Name.value == ''){
alert('Please enter your name');
document.Contact.Name.focus();
document.Contact.Name.style.background = 'Yellow';
return false;
}
if (document.Contact.Email.value == '' || document.Contact.Email.value == null){
alert("Please enter your Email Address");
document.Contact.Email.focus();
document.Contact.Email.style.background = 'Yellow';
return false;
}
if (!emailcheck(document.Contact.Email.value)){
alert("Please enter a valid Email Address");
document.Contact.Email.focus();
document.Contact.Email.style.background = 'Yellow';
return false;
}
if (document.Contact.Message.value == ''){
alert('Please type a massage');
document.Contact.Message.focus();
document.Contact.Message.style.background = 'Yellow';
return false;
}
if (document.Contact.code.value == ''){
alert("Please enter to security code");
document.Contact.code.focus();
document.Contact.code.style.background = 'Yellow';
return false;
}
return true;
}
function emailcheck(str){
accept = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
for (h=0; h < str.length ;h++){
if (accept.indexOf(str.charAt(h))<0){
return (false);
}
}
if (document.images){
pat = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
pat_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
if (!str.match(pat) && str.match(pat_two)){
return (-1);
}
}
}
//-->

