function enviar_login() {
   txt_tipo_socio = document.getElementById("codigo").value;
   txt_num_socio = document.getElementById("socio").value;
   txt_password = document.getElementById("password").value;   

   if ((txt_tipo_socio != "") && ((txt_tipo_socio == "DC")||(txt_tipo_socio == "dc"))) {
       document.getElementById("socio").value = "PR";
       txt_tipo_socio="PR";
   }

   if ((txt_num_socio != "complejo") && (txt_num_socio != "portal")) {
      if ((txt_tipo_socio == "") || (txt_tipo_socio == "--")) {
         alert("Por favor, introduzca su tipo de socio");
         return;
      }
      if ((txt_num_socio == "") || (txt_num_socio == "Nº socio")) {
         alert("Por favor, introduzca su número de socio");
         return;
      }
      if (txt_num_socio.length < 8) {
         items_to_fill = 8-txt_num_socio.length;
         for (i=0; i<items_to_fill; i++) {
            txt_num_socio = "0"+txt_num_socio;
         }
      }
      document.getElementById("aNumSocio").value = txt_tipo_socio.toUpperCase() + txt_num_socio;
   } else {
      document.getElementById("aNumSocio").value = txt_num_socio;
   }
   if ((txt_password == "") || (txt_password == "Contrase")) {
      alert("Por favor, introduzca su contraseña");
      return;
   }
   if (txt_password.length != 8) {
      alert("La contraseña debe tener 8 caracteres");
      return;
   }
   document.form1.submit();
}