function check()
{
frm=document.forms.contactForm;

	if(frm.firstname.value == "")
	{
		alert("Por favor, ingrese su nombre.");
		return false;
	}
	if(frm.lastname.value == "")
	{
		alert("Por favor, ingrese su apellido.");
		return false;
	}
	if(frm.contact_email.value == "")
	{
		alert("Por favor, escriba su dirección electrónica.");
		return false;
	}
	if(frm.contact_country.selectedIndex == 0)
	{
		alert("Por favor, seleccione su país.");
		return false;
	}

	if(document.getElementById('contact_country').selectedIndex == 1)
	{
		if(frm.mystate.selectedIndex == 0)
		{
			alert("Por favor, seleccione su estado.");
			return false;
		}
	}
	if(document.getElementById('contact_country').selectedIndex == 2)
	{
		if(frm.companyprovince.selectedIndex == 0)
		{
			alert("Por favor, seleccione su provincia.");
			return false;
		}
	}
	if(frm.contact_org.value == "")
	{
		alert("Por favor, ingrese el nombre de su Organización/Compañía.");
		return false;
	}
	
	
	
	if (frm.info_list[0].checked)
                {
                
                                if(frm.numberofinterviews.value == "")
                                {
                                                alert("Por favor, ingrese el número de entrevistas completas, por país, que necesitará.");
                                                return false;
                                }
                                if(frm.countriesneeded.value == "")
                                {
                                                alert("Por favor, ingrese los países específicos que necesita para el proyecto.");
                                                return false;
                                }
                                if(frm.targetpopulation.value == "")
                                {
                                                alert("Por favor, escriba la población estimada que le gustaría abarcar en el objetivo.");
                                                return false;
                                }
                                if(frm.estimatedincidence.value == "")
                                {
                                                alert("Por favor, ingrese la incidencia estimada.");
                                                return false;
                                }
                                if(frm.numberofquestions.value == "")
                                {
                                                alert("Por favor, ingrese el número de preguntas que le parece que necesitará su estudio.");
                                                return false;
                                }
                                if(frm.timing.value == "")
                                {
                                                alert("Por favor, ingrese el plazo estimado en el cual se debe completar el proyecto.");
                                                return false;
                                }
                }

	
	if(frm.contact_workphone.value == "")
	{
		var answer = prompt("Tal vez nos comuniquemos con usted por teléfono con referencia a esta solicitud. Por favor, le aseguramos que no nos pondremos en contacto con usted por ninguna otra razón. Si no desea que nos comuniquemos con usted por teléfono, por favor, presione 'Cancelar.'","Please enter your phone number here");
		if(answer != "Por favor, ingrese su número telefónico aquí.")
		{
		   frm.contact_workphone.value = answer;
		}
	}

	return true;

}




function toggleState()
{
frm=document.forms.contactForm;
thisField=document.getElementById('contact_country');
thisstateforeign=document.getElementById('stateforeign');
thisstateusa=document.getElementById('stateusa');
thisstatecanada=document.getElementById('statecanada');
  if(thisField.options[thisField.selectedIndex].value == "UNITED STATES")
  {
	
	thisstateforeign.style.display = "none";
	thisstatecanada.style.display = "none";
	thisstateusa.style.display = "";
  }
  else if(thisField.options[thisField.selectedIndex].value == "CANADA")
  {
	thisstatecanada.style.display = "";
	thisstateforeign.style.display = "none";
	thisstateusa.style.display = "none";
  }
  else
  {
	thisstateusa.style.display = "none";
	thisstatecanada.style.display = "none";
	thisstateforeign.style.display = "";
  }
} 