//The browser detection code below is courtesy of
//Harald Hope, Tapio Markula, Websites: http://techpatterns.com/
//It is released under the terms of the LGPL
var d, dom, ie, ie4, ie5x, moz, mac, win, lin, old, ie5mac, ie5xwin, op;
d = document;
n = navigator;
na = n.appVersion;
nua = n.userAgent;
win = ( na.indexOf( 'Win' ) != -1 );
mac = ( na.indexOf( 'Mac' ) != -1 );
lin = ( nua.indexOf( 'Linux' ) != -1 );

if ( !d.layers ){
  dom = ( d.getElementById );
  op = ( nua.indexOf( 'Opera' ) != -1 );
  konq = ( nua.indexOf( 'Konqueror' ) != -1 );
  saf = ( nua.indexOf( 'Safari' ) != -1 );
  moz = ( nua.indexOf( 'Gecko' ) != -1 && !saf && !konq);
  ie = ( d.all && !op );
  ie4 = ( ie && !dom );
  /*ie5x tests only for functionality. ( dom||ie5x ) would be default settings. 
  Opera will register true in this test if set to identify as IE 5*/
  ie5x = ( d.all && dom );
  ie5mac = ( mac && ie5x );
  ie5xwin = ( win && ie5x );
}
    
function hidify_showify(e_table, e_img, alt_less, alt_more) {
  if(document.getElementById) {
     var id_table = document.getElementById(e_table).style;
     var id_img = document.getElementById(e_img);

     //Set the object to table-cell if the browser is
     //moz (see above) and block if it's anything else.
     if(moz){
        if(id_table.display == "table-cell") {
           id_table.display = "none";
           id_img.src = "imatges/arrow_down.gif";
           id_img.alt = alt_more;
        }
        else {
           id_table.display = "table-cell";
           id_img.src = "imatges/arrow_up.gif";
           id_img.alt = alt_less;
        }
     }
     else {
        if(id_table.display == "block") {
           id_table.display = "none";
           id_img.src = "imatges/arrow_down.gif";
           id_img.alt = alt_more;
        }
        else {
           id_table.display = "block";
           id_img.src = "imatges/arrow_up.gif";
           id_img.alt = alt_less;
        }
     }
     return false;
  }
  else {
     return true;
  }
}

