function cambiarProvincia(provinciaId,idSelectCiudad){
    try{
        ciudad_selec=$(idSelectCiudad).options[$(idSelectCiudad).selectedIndex].value;
    }catch(ex){
        ciudad_selec=false;
    }
    xmlhttp=new XML();
    if (xmlhttp){
         rellenarSelect($(idSelectCiudad),[{texto:"Cargando...",valor:""}]);
         xmlhttp.onreadystatechange=function() {
              if (xmlhttp.readyState==4) {
                  eval('var vector='+xmlhttp.responseText);
                  rellenarSelect($(idSelectCiudad),vector);
                  if (ciudad_selec){
                    seleccionarSelect($(idSelectCiudad),ciudad_selec);
                  }
              }
         }
         if(idSelectCiudad=='ciudad'){
            xmlhttp.open("GET", "/php_lib/ajax.php?funcion=ciudades&provincia="+provinciaId,true);
         }
          xmlhttp.send(null);
    }
}
function solicitarInformacionEnviar(idioma,tipo){
  if (tipo == 'escuela'){
    if ( $('nombre').value == "" || $('apellidos').value == "" || $('tratamiento').value == ""|| 
         $('direccion').value == "" || $('form_ciudad').value == "" || 
         $('cp').value == "" || $('pais').value == "" || $('email').value == "" ){
    	switch (idioma){
        case 'es' : alert('Por favor, complete todos los datos obligatorios.');
    		break;
        case 'en' : alert('Please, fill in all required fields.');
    		break;
      }
      $('nombre').focus();
      return false;
    }
    idiomaFolleto = '';
  }else{
    if ( $('nombre').value == "" || $('apellidos').value == "" || 
         $('direccion').value == "" || $('form_ciudad').value == "" || 
         $('cp').value == "" || $('pais').value == "" || 
         $('email').value == "" || $('condicion').checked == false || $('tratamiento').value == ""){
    	switch (idioma){
        case 'es' : alert('Por favor, complete todos los datos obligatorios y acepte las condiciones.');
    		break;
        case 'en' : alert('Please, fill in all required fields and accept the conditions.');
    		break;
      }
      $('nombre').focus();
      return false;
    }
    idiomaFolleto = $('idiomaFolleto').options[$('idiomaFolleto').selectedIndex].value;
  }
  url = '?escuela='+$('escuela').value+'&nombre='+$('nombre').value+'&apellidos='+$('apellidos').value+'&edad='+$('edad').value+'&direccion='+$('direccion').value+'&ciudad='+$('form_ciudad').value+'&cp='+$('cp').value+'&pais='+$('pais').value+'&empresa='+$('empresa').value+'&telefono='+$('telefono').value+'&email='+$('email').value+'&comentarios='+$('comentarios').value+'&tratamiento='+$('tratamiento').value+'&idiomaFolleto='+idiomaFolleto+'';
  xmlhttp=new XML();
  if (xmlhttp){
    xmlhttp.onreadystatechange=function() {
      if (xmlhttp.readyState==4) {
        document.getElementById('formulariocontacto').innerHTML=xmlhttp.responseText;
      }
    }
    xmlhttp.open("GET", "/solicitarInformacion.php"+url,true);
    xmlhttp.send(null);
    return false;
  }
}
function escuelaValidar(idioma){
  if ( $('esc_login').value == "" || $('esc_password').value == "" ){
  	switch (idioma){
      case 'es' : alert('Por favor, introduzca su usuario y contraseņa.');
  		break;
      case 'en' : alert('Please, enter your login and password.');
  		break;
    }
    $('esc_login').focus();
    return false;
  }
  url = '?esc_login='+$('esc_login').value+'&esc_password='+$('esc_password').value+'';
  xmlhttp=new XML();
  if (xmlhttp){
    xmlhttp.onreadystatechange=function() {
      if (xmlhttp.readyState==4) {
        document.getElementById('sobreCabecera').innerHTML=xmlhttp.responseText;
      }
    }
    xmlhttp.open("GET", "/php_lib/escuelaValidar.php"+url,true);
    xmlhttp.send(null);
    return false;
  }
}