function check()
{
frm=document.forms.contactForm;

	if(frm.info_list.value == "")
	{
		alert("Por favor, elija un asunto.");
		return false;
	}
	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_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.'","Por favor, ingrese su número telefónico aquí.");
		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 = "";
  }
} 

function get_radiobutton(rd) {
	for (i=rd.length-1; i > -1; i--) {		
		if (rd[i].checked == true) {		
			return rd[i].value;
			break;			
		}
	}
	return false;
}

function get_myelement(obj) {
  if(document.getElementById){ //DOM
    css = document.getElementById(obj).style;
  } else {
    if(document.all){// IE
    	css = document.all[obj].style;
    }
    if(document.layers){//NS
      css = document.layers[obj];
    }
  }
   return css;
}
