// JavaScript Document
function ValidateContact()
{
    var name = document.Contact.name;
	var email = document.Contact.email;
    var phone = document.Contact.phone;
    var best_time = document.Contact.best_time;
    var comments = document.Contact.comments;
	var captcha_code = document.Contact.captcha_code;

    if (name.value == "")
    {
        window.alert("Please enter your name.");
        name.focus();
        return false;
    }
     
	 if (email.value == "")
    {
        window.alert("Please enter a valid e-mail address.");
        email.focus();
        return false;
    }
	
    if (email.value.indexOf("@", 0) < 0)
    {
        window.alert("Please enter a valid e-mail address.");
        email.focus();
        return false;
    }
	
    if (email.value.indexOf(".", 0) < 0)
    {
        window.alert("Please enter a valid e-mail address.");
        email.focus();
        return false;
    }

if ((phone.checked == false) && (phone.value == ""))
    {
        window.alert("Please enter your phone number.");
        phone.focus();
        return false;
    }

    if(phone.value.search("[^0-9 ,/+-]")!=-1)
	{
        alert("Please enter only digits in phone no");
		phone.focus();
		return false;
	}

   if(phone.value.length < 10)
	{
        alert("Please enter a valid phone no");
		phone.focus();
		return false;
	}
  
  if (best_time.selectedIndex == 0)
  {
    window.alert("Please tell us the best time to talk");
    best_time.focus();
    return false;
  }

    if (comments.value == "")
    {
        window.alert("Please provide a detailed description or comment.");
        comments.focus();
        return false;
    }

    if (captcha_code.value == "")
    {
        window.alert("Please enter image verification code.");
        captcha_code.focus();
        return false;
    }
	
    return true;
}
