
function page_load (port, ruri) {
   document.getElementById ('cercBoto').disabled = true;
   if ( port ) {
      $('.PortadaFade').each ( function (i) {
         eval ("setTimeout ('"+$(this).attr('id')+".setting.ismouseover = true;', 200);");
      });
   }
   $('.Href').each ( function (i) {
      if ( $(this).attr ('href') == ruri ) {
         $(this).toggleClass ('HrefAct');
      }
   });
}


function valida_alta (err2, err3, err4) {

   with (document.getElementById ('formalta') ) {

      if ( /^\s*$/.test (email.value) ) {
         email.focus ();
         alert (err2);
         return false;
      } else {
         if ( ! /^[A-Za-z0-9\.+_-]+@[A-Za-z0-9\.-]+\.[A-Za-z]{2,6}$/.test (email.value) ) {
            email.focus ();
            alert (err3);
            return false;
         }
      }

      if ( /^\s*$/.test (email2.value) ) {
         email2.focus ();
         alert (err2);
         return false;
      } else {
         if ( ! /^[A-Za-z0-9\.+_-]+@[A-Za-z0-9\.-]+\.[A-Za-z]{2,6}$/.test (email2.value) ) {
            email2.focus ();
            alert (err3);
            return false;
         }
      }

      if ( email.value != email2.value ) {
         email2.focus ();
         alert (err4);
         return false;
      }

      return true;

   }

}


$(document).ready (function () {
   $('#menuLnk1').click (function () {
      if ( document.getElementById ('menuFamilies').style.display == 'block' ) {
         $('#menuFamilies').hide ('slow');
         document.getElementById ('menuImg1').src = '/img/menu.png';
      } else {
         $('#menuFamilies').show ('slow');
         document.getElementById ('menuImg1').src = '/img/menu_act.png';
      }
   });

   $('#menuLnk2').click (function () {
      if ( document.getElementById ('menuConsultoria').style.display == 'block' ) {
         $('#menuConsultoria').hide ('slow');
         document.getElementById ('menuImg2').src = '/img/menu.png';
      } else {
         $('#menuConsultoria').show ('slow');
         document.getElementById ('menuImg2').src = '/img/menu_act.png';
      }
   });




   $('#menuLnk3').click (function () {
      if ( document.getElementById ('menuReports').style.display == 'block' ) {
         $('#menuReports').hide ('slow');
         document.getElementById ('menuImg3').src = '/img/menu.png';
      } else {
         $('#menuReports').show ('slow');
         document.getElementById ('menuImg3').src = '/img/menu_act.png';
      }
   });
/*
   $('#menuLnk3').click (function () {
      if ( document.getElementById ('menuBioseccions').style.display == 'block' ) {
         $('#menuBioseccions').hide ('slow');
         document.getElementById ('menuImg3').src = '/img/menu.png';
      } else {
         $('#menuBioseccions').show ('slow');
         document.getElementById ('menuImg3').src = '/img/menu_act.png';
      }
   });
*/
   $('#menuLnk5').click (function () {
      if ( document.getElementById ('menuTecniques').style.display == 'block' ) {
         $('#menuTecniques').hide ('slow');
         document.getElementById ('menuImg5').src = '/img/menu.png';
      } else {
         $('#menuTecniques').show ('slow');
         document.getElementById ('menuImg5').src = '/img/menu_act.png';
      }
   });
   $('.PortadaTxt').click (function () {
      var txt = new String ();
      txt = $(this).attr('id');
      vel = txt.replace (/Txt/, 'Vel');
      tpo = txt.replace (/Txt/, 'Top');
      pnt = txt.replace (/Txt/, 'Pnt');
      esq = txt.replace (/Txt/, 'Fad') + 'Esq';
      dre = txt.replace (/Txt/, 'Fad') + 'Dre';
      if ( document.getElementById (tpo).style.display == 'block' ) {
         if ( eval ('typeof '+esq) != 'undefined' ) {
            eval (esq+'.setting.ismouseover = true;');
         }
         if ( eval ('typeof '+dre) != 'undefined' ) {
            eval (dre+'.setting.ismouseover = true;');
         }
         $('#'+vel).show (0);
         $('#'+vel).fadeTo (700, 0.4);
         $('#'+tpo).hide (700);
         $('#'+pnt).attr ('src', '/img/open.png');
      } else {
         $('.PortadaFade').each ( function (i) {
            eval ($(this).attr('id')+'.setting.ismouseover = true;');
         });
         $('.PortadaVel').show (0);
         $('.PortadaVel').fadeTo (700, 0.4);
         $('.PortadaTop').hide (700);
         $('.PortadaPnt').attr ('src', '/img/open.png');
         $('#'+tpo).show (700);
         $('#'+vel).fadeTo (700, 0);
         $('#'+vel).hide (700);
         $('#'+pnt).attr ('src', '/img/clos.png');
         if ( eval ('typeof '+esq) != 'undefined' ) {
            eval (esq+'.setting.ismouseover = false;');
         }
         if ( eval ('typeof '+dre) != 'undefined' ) {
            eval (dre+'.setting.ismouseover = false;');
         }
      }
   });
   $('.BotigaAltsHead').click (function () {
      var txt = new String ();
      txt = $(this).attr('id');
      bod = txt.replace (/Head/, 'Body');
      img = txt.replace (/Head/, 'Imag');
      if ( document.getElementById (bod).style.display == 'block' ) {
         $('#'+bod).slideUp (600);
         $('#'+img).attr ('src', '/img/open.png');
      } else {
         /*
         $('.BotigaAltsBody').each ( function (i) {
            $(this).slideUp (400);
            var itxt = new String ();
            itxt = $(this).attr('id');
            ibod = itxt.replace (/Head/, 'Body');
            iimg = itxt.replace (/Head/, 'Imag');
            $('#'+iimg).attr ('src', '/img/open.png');
         });
         */
         $('#'+bod).slideDown (600);
         $('#'+img).attr ('src', '/img/clos.png');
      }
   });
});

