// JavaScript Document
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_validateForm1() { //v4.0
  var i,p,q,nm,test,nom,num,min,max,errors='',args=MM_validateForm1.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; nom=args[i+1];val=MM_findObj(args[i]);
    if (val) { nm=nom; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' debe ser un e-mail valido.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' debe se un número.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' debe ser un numero mayor a cero.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' requerido.\n'; }
  } if (errors) alert('Los siguientes errores ocurrieron:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function MM_validateForm2() { //v4.0
  var i,p,q,nm,test,nom,num,min,max,errors='',args=MM_validateForm2.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; nom=args[i+1];val=MM_findObj(args[i]);
    if (val) { nm=nom; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must be valid email.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must be number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must be greater than zero.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' required.\n'; }
  } if (errors) alert('Follow errors ocurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function printWindow() {
bV = parseInt(navigator.appVersion);
if (bV >= 4) 
   this.print();
}

var animales,pr,sexo,meses,dias,anios;
animales=new Array;
/*animales[0] = new Array(3);
animales[0][0]="";
animales[0][1]="Elegir uno";
animales[0][2]="Select one";*/
animales[1]=Array(2);
animales[1][1]="caballo";
animales[1][2]="horse";
animales[2] =Array(2);
animales[2][1]="perro/gato";
animales[2][2]="dog/cat";
animales[3] = new Array(2);
animales[3][1]="otro";
animales[3][2]="other";

pr = new Array;

pr[0] = new Array;
pr[0][0]=new Array(3);
pr[0][0][0]="";
pr[0][0][1]="Seleccione uno";
pr[0][0][2]="Select one";

pr[1] = new Array;
pr[1][0]=new Array(3);
pr[1][0][0]="";
pr[1][0][1]="Seleccione uno";
pr[1][0][2]="Select one";

pr[1][1]=new Array(2);
pr[1][1][1]="exposición";
pr[1][1][2]="exhibition";

pr[1][2]=new Array(2);
pr[1][2][1]="deporte";
pr[1][2][2]="sports";

pr[1][3]=new Array(2);
pr[1][3][1]="reproducción";
pr[1][3][2]="reproduction";

pr[1][4]=new Array(2);
pr[1][4][1]="otro";
pr[1][4][2]="other";

pr[2] = new Array;
pr[2][0]=new Array(3);
pr[2][0][0]="";
pr[2][0][1]="Seleccione uno";
pr[2][0][2]="Select one";

pr[2][1]=new Array(2);
pr[2][1][1]="Mascota";
pr[2][1][2]="Pet";

pr[2][2]=new Array(2);
pr[2][2][1]="Exhibición";
pr[2][2][2]="Exhibition";

pr[2][3]=new Array(2);
pr[2][3][1]="Reproducción";
pr[2][3][2]="Reproduction";

pr[2][4]=new Array(2);
pr[2][4][1]="otro";
pr[2][4][2]="other";

pr[3] = new Array;
pr[3][0]=new Array(3);
pr[3][0][0]="Otro";
pr[3][0][1]="Escriba uno en el recuadro";
pr[3][0][2]="Fill the textfield below";

/*pr[3][1]=new Array(2);
pr[3][1][0]="otro";
pr[3][1][1]="otro";

pr[3][2]=new Array(2);
pr[3][2][0]="otro";
pr[3][2][1]="otro";

pr[3][3]=new Array(2);
pr[3][3][0]="otro";
pr[3][3][1]="otro";
*/



sx= new Array;
sx[0] = new Array;
sx[0][0]= new Array(3);
sx[0][0][0]="";
sx[0][0][1]="Elegir uno";
sx[0][0][2]="Select one";

sx[1] = new Array;
sx[1][0] = new Array(3);
sx[1][0][0]="";
sx[1][0][1]="Elegir uno";
sx[1][0][2]="Select one";

sx[1][1] = new Array(2);
sx[1][1][1]="macho entero";
sx[1][1][2]="stallion";

sx[1][2] = new Array(2);
sx[1][2][1]="macho castrado";
sx[1][2][2]="gelding";

sx[1][3] = new Array(2);
sx[1][3][1]="yegua";
sx[1][3][2]="mare";

sx[2]=new Array;
sx[2][0] = new Array(3);
sx[2][0][0]="";
sx[2][0][1]="Elegir uno";
sx[2][0][2]="Select one";

sx[2][1] = new Array(2);
sx[2][1][1]="macho";
sx[2][1][2]="male";

sx[2][2] = new Array(2);
sx[2][2][1]="hembra";
sx[2][2][2]="female";

sx[3]=new Array;
sx[3][0] = new Array(3);
sx[3][0][0]="";
sx[3][0][1]="Elegir uno";
sx[3][0][2]="Select one";

sx[3][1] = new Array(2);
sx[3][1][1]="macho";
sx[3][1][2]="male";

sx[3][2] = new Array(2);
sx[3][2][1]="hembra";
sx[3][2][2]="female";

var MaxProfesiones =25;

function cambiarSelectProfesiones(SelectProf, SelectSel,idioma)
{

  var numeroP = SelectProf.selectedIndex;

  var contP = SelectSel.length;
//document.write("este"+numeroP+"otro"+contP);
 
  while(contP > 0) 
    SelectSel.options[contP--] = null;

  for (jP = 0; numeroP <= MaxProfesiones && jP < pr[numeroP].length; jP++) {
    if(jP == 0) {
      var auxP =  new Option(pr[numeroP][jP][idioma], pr[numeroP][jP][0], 0, 1);
    }
    else {
      var auxP =  new Option(pr[numeroP][jP][idioma], pr[numeroP][jP][idioma]);
    }
    SelectSel.options[jP] = auxP;
  }
}
function cambiarSelectGenero(SelectProf, SelectSel,idioma)
{

  var numeroP = SelectProf.selectedIndex;

  var contP = SelectSel.length;
//document.write("este"+numeroP+"otro"+contP);
 
  while(contP > 0) 
    SelectSel.options[contP--] = null;

  for (jP = 0; numeroP <= MaxProfesiones && jP < sx[numeroP].length; jP++) {
    if(jP == 0) {
      var auxP =  new Option(sx[numeroP][jP][idioma], sx[numeroP][jP][0], 0, 1);
    }
    else {
      var auxP =  new Option(sx[numeroP][jP][idioma], sx[numeroP][jP][idioma]);
    }
    SelectSel.options[jP] = auxP;
  }
}