// JavaScript Document

/*function ValidateForm()
{  
  for(i=1;i<=7;i++)
  {
    txtfield='textField'+i;
    if(document.getElementById(txtfield).value=='')
    {
      alert("Enter txtfield= "+ txtfield);
      document.getElementById(txtfield).focus();
      return false;
    }
  }
  return true;
}*/
function ValidateForm()
{
	iChars_general = "!@#$%^*+=-[]\\\'/{}|\":<>?~_";
	iChars_email_text = "!#$%^*+=-[]\\\'/{}|\":<>?~";//no @ _ char here
	iChars_phone = "!@#$%^*+=[]\\\'/{}|\":<>?~_";//no hiphen here.
	iChars_timezone = "!@#$%^*=[]\\\'/{}|\"<>?~_";//- + : are allowed
	//validating for textname
  if(document.form1.txtname.value=='')
  {
    alert("Enter Name");
    document.form1.txtname.focus();
    return false;
  }
    //to check for the special characters in the txt box.
	else if(check_special_chars(document.form1.txtname.value, iChars_general)==false)
	{
		document.form1.txtname.focus();
		return false;
	}
	//validating the title.
  if(document.form1.txttitle.value=='')
  {
    alert("Enter Title");
    document.form1.txttitle.focus();
    return false;
  }
  //to check for the special characters in the txt box.
	else if(check_special_chars(document.form1.txttitle.value, iChars_general)==false)
	{
		document.form1.txttitle.focus();
		return false;
	}
  //validating the phone number
  if(document.form1.txtphone.value=='')
  {
    alert("Enter Phone number");
    document.form1.txtphone.focus();
    return false;
  }
  //to check for the special characters in the txt box.
	else if(check_special_chars(document.form1.txtphone.value, iChars_phone)==false)
	{
		document.form1.txtphone.focus();
		return false;
	}
  //validating the country name
  if(document.form1.txtCountry.value=='')
  {
    alert("Enter Country");
    document.form1.txtCountry.focus();
    return false;
  }
  //to check for the special characters in the txt box.
	else if(check_special_chars(document.form1.txtCountry.value, iChars_general)==false)
	{
		document.form1.txtCountry.focus();
		return false;
	}
  //validating the time zone.
  if(document.form1.txttimezone.value=='')
  {
    alert("Enter Time Zone");
    document.form1.txttimezone.focus();
    return false;
  }
  //to check for the special characters in the txt box.
	else if(check_special_chars(document.form1.txttimezone.value, iChars_timezone)==false)
	{
		document.form1.txttimezone.focus();
		return false;
	}
  //validating the preferred time.
  if(document.form1.txtPreferredTime.value=='')
  {
    alert("Enter Preferred time to call");
    document.form1.txtPreferredTime.focus();
    return false;
  }
  //to check for the special characters in the txt box.
	else if(check_special_chars(document.form1.txtPreferredTime.value, iChars_general)==false)
	{
		document.form1.txtPreferredTime.focus();
		return false;
	}
  //validating the email.
  if(document.form1.txtemail.value=='')
  {
    alert("Enter Email");
    document.form1.txtemail.focus();
    return false;
  }
  //to check for the special characters in the txt box.
	else if(check_special_chars(document.form1.txtPreferredTime.value, iChars_general)==false)
	{
		document.form1.txtPreferredTime.focus();
		return false;
	}
  //validating the company name.
  if(document.form1.txtcompanyname.value=='')
  {
    alert("Enter Company Name");
    document.form1.txtcompanyname.focus();
    return false;
  }
  //to check for the special characters in the txt box.
	else if(check_special_chars(document.form1.txtcompanyname.value, iChars_general)==false)
	{
		document.form1.txtcompanyname.focus();
		return false;
	}
	//validating for special chars in web url.
	if(check_special_chars(document.form1.txtweb.value,iChars_general)==false)
	{
		document.form1.txtweb.focus();
		return false;
	}
  //validating the number of employees
  if(document.form1.txtemployees.value=='')
  {
    alert("Enter Number of Employees");
    document.form1.txtemployees.focus();
    return false;
  }
  //to check for the special characters in the txt box.
	else if(check_special_chars(document.form1.txtemployees.value, iChars_general)==false)
	{
		document.form1.txtemployees.focus();
		return false;
	}
  //validating the years.
  if(document.form1.txtyears.value=='')
  {
    alert("Enter Years in Business");
    document.form1.txtyears.focus();
    return false;
  }
  //to check for the special characters in the txt box.
	else if(check_special_chars(document.form1.txtyears.value, iChars_general)==false)
	{
		document.form1.txtyears.focus();
		return false;
	}
  //validating the description
  if(document.form1.txtdescription.value=='')
  {
    alert("Project Information should not be empty");
    document.form1.txtdescription.focus();
    return false;
  }
  //to check for the special characters in the txt box.
	else if(check_special_chars(document.form1.txtdescription.value, iChars_general)==false)
	{
		document.form1.txtdescription.focus();
		return false;
	}
  //validating the budget.
  if(document.getElementById('budget').value=='0')
  {
    alert("Project Budget should not be empty");
    document.getElementById('budget').focus();
    return false;
  }
  //to check for special characters in message.txtmessage
  if(check_special_chars(document.form1.txtmessage.value, iChars_general)==false)
	{
		document.form1.txtmessage.focus();
		return false;
	}
   return true;
}
