
function Is () {
	// convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase();

    this.win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
    // NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all
    // Win32, so you can't distinguish between Win95 and WinNT.
    this.win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));

    // is this a 16 bit compiled version?
    this.win16 = ((agt.indexOf("win16")!=-1) ||
                  (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) ||
                  (agt.indexOf("windows 16-bit")!=-1) );

    this.win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
                  (agt.indexOf("windows 16-bit")!=-1));

    // NOTE: Reliable detection of Win98 may not be possible. It appears that:
    // - On Nav 4.x and before you'll get plain "Windows" in userAgent.
    // - On Mercury client, the 32-bit version will return "Win98", but
    // the 16-bit version running on Win98 will still return "Win95".
    this.win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
    this.winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
    this.win32 = ( this.win95 || this.winnt || this.win98 ||
                   ((this.major >= 4) && (navigator.platform == "Win32")) ||
                   (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1) );

    this.os2   = ((agt.indexOf("os/2")!=-1) ||
                  (navigator.appVersion.indexOf("OS/2")!=-1) ||
                  (agt.indexOf("ibm-webexplorer")!=-1));

    this.mac    = (agt.indexOf("mac")!=-1);
    this.mac68k = (this.mac && ((agt.indexOf("68k")!=-1) ||
                                (agt.indexOf("68000")!=-1)));
    this.macppc = (this.mac && ((agt.indexOf("ppc")!=-1) ||
                                (agt.indexOf("powerpc")!=-1)));

    this.sun   = (agt.indexOf("sunos")!=-1);
    this.sun4  = (agt.indexOf("sunos 4")!=-1);
    this.sun5  = (agt.indexOf("sunos 5")!=-1);
    this.suni86= (this.sun && (agt.indexOf("i86")!=-1));
    this.irix  = (agt.indexOf("irix") !=-1);    // SGI
    this.irix5 = (agt.indexOf("irix 5") !=-1);
    this.irix6 = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
    this.hpux  = (agt.indexOf("hp-ux")!=-1);
    this.hpux9 = (this.hpux && (agt.indexOf("09.")!=-1));
    this.hpux10= (this.hpux && (agt.indexOf("10.")!=-1));
    this.aix   = (agt.indexOf("aix") !=-1);      // IBM
    this.aix1  = (agt.indexOf("aix 1") !=-1);
    this.aix2  = (agt.indexOf("aix 2") !=-1);
    this.aix3  = (agt.indexOf("aix 3") !=-1);
    this.aix4  = (agt.indexOf("aix 4") !=-1);
    this.linux = (agt.indexOf("inux")!=-1);
    this.sco   = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
    this.unixware = (agt.indexOf("unix_system_v")!=-1);
    this.mpras    = (agt.indexOf("ncr")!=-1);
    this.reliant  = (agt.indexOf("reliantunix")!=-1);
    this.dec   = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) ||
                  (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) ||
                  (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1));
    this.sinix = (agt.indexOf("sinix")!=-1);
    this.freebsd = (agt.indexOf("freebsd")!=-1);
    this.bsd = (agt.indexOf("bsd")!=-1);
    this.unix  = ((agt.indexOf("x11")!=-1) || this.sun || this.irix || this.hpux ||
                  this.sco ||this.unixware || this.mpras || this.reliant ||
                  this.dec || this.sinix || this.aix || this.linux || this.bsd ||
                  this.freebsd);

    this.vms   = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));
}

is = new Is();



var nmpExpanded = 'el1';

var isDOM      = (typeof(document.getElementsByTagName) != 'undefined'
                  && typeof(document.createElement) != 'undefined')
? 1 : 0;
var isIE4      = (typeof(document.all) != 'undefined'
                  && parseInt(navigator.appVersion) >= 4
                  && typeof(window.opera) == 'undefined')
? 1 : 0;
var isNS4      = (typeof(document.layers) != 'undefined')
? 1 : 0;
var capable    = (isDOM || isIE4 || isNS4)
? 1 : 0;
// Uggly fix for Konqueror 2.2 that is half DOM compliant
if (capable && typeof(navigator.userAgent) != 'undefined') {
    var browserName = ' ' + navigator.userAgent.toLowerCase();
    if (browserName.indexOf('konqueror') > 0) {
        capable = 0;
    }
}    

var fontSize   = '12px';
var fontBig    = '13px';
var fontSmall  = '11px';
var fontFamily = 'sans-serif';
var isServer   = true;




/* $Id: menu.js,v 1.3 2002/01/10 21:04:59 diego Exp $ */


// These scripts were originally found on cooltype.com.
// Modified 01/01/1999 by Tobias Ratschiller for linuxapps.com

// Modified 7th June 2000 by Brian Birtles for Mozilla 5.0
// compatibility for phpMyAdmin

// Rewritten and put in a libray 2nd May 2001 by Loïc Chapeaux

// Test passed with:
// - Mozilla 0.8.1-0.9.6 for Windows (js enabled & disabled)
// - IE5, 5.01, 5.5, 6.0 for Windows
// - Netscape 4.75 for Windows

// Test failed (crappy DOM implementations) with:
// - Opera 5.02 for windows: 'getElementsByTagName' is unsupported
// - Opera 5.10 to 5.12 for windows, Opera 5+ for Linux: 'style.display' can't
//   be changed
// - Konqueror 2+: 'style.display' can't be changed


var isExpanded   = false;

// var imgOpened    = new Image(9,9);
// imgOpened.src    = '/web/es/bricolaje/images/minus.gif';
// var imgClosed    = new Image(9,9);
// imgClosed.src    = '/web/es/bricolaje/images/plus.gif';


/**
 * Do reloads the frame if the window has been resized under Netscape4+
 *
 * @access  private
 */
function reDo() {
    if (innerWidth != origWidth || innerHeight != origHeight)
        location.reload(true);
} // end of the 'reDo()' function

/**
 * Positioned element resize bug under NS4+
 */
if (isNS4) {
    var origWidth  = innerWidth;
    var origHeight = innerHeight;
    onresize       = reDo;
}


/**
 * Gets the id of the first collapsible room
 *
 * @param  string  the name of the first collapsible room
 *
 * @return  integer  the index number corresponding to this room
 *
 * @access  public
 */
function nsGetIndex(el) {
    var ind       = null;
    var theLayers = document.layers;
    var layersCnt = theLayers.length;
    for (var i = 0; i < layersCnt; i++) {
        if (theLayers[i].id == el) {
            ind = i;
            break;
        }
    }
    return ind;
} // end of the 'nsGetIndex()' function


/**
 * Positions layers under NS4+
 *
 * @access  public
 */
function nsArrangeList() {
    if (firstInd != null) {
        var theLayers = document.layers;
        var layersCnt = theLayers.length;
        var nextY     = theLayers[firstInd].pageY + theLayers[firstInd].document.height;
        for (var i = firstInd + 1; i < layersCnt; i++) {
            if (theLayers[i].visibility != 'hide') {
                theLayers[i].pageY = nextY;
                nextY              += theLayers[i].document.height;
            }
        }
    }
} // end of the 'nsArrangeList()' function


/**
 * Expand databases at startup
 *
 * @access  public
 */
function nsShowAll() {
    var theLayers = document.layers;
    var layersCnt = theLayers.length;
    for (i = firstInd; i < layersCnt; i++) {
        theLayers[i].visibility = 'show';
    }
} // end of the 'nsShowAll()' function


/**
 * Collapses databases at startup
 *
 * @access  public
 */
function initIt()
{
    if (!capable || !isServer)
        return;

    if (isDOM) {
        var tempColl    = document.getElementsByTagName('DIV');
        var tempCollCnt = tempColl.length;
        for (var i = 0; i < tempCollCnt; i++) {
            if (tempColl[i].id == expandedDb)
                tempColl[i].style.display = 'block';
            else if (tempColl[i].className == 'child')
                tempColl[i].style.display = 'none';
        }
    } // end of the DOM case
    else if (isIE4) {
        tempColl        = document.all.tags('DIV');
        var tempCollCnt = tempColl.length;
        for (var i = 0; i < tempCollCnt; i++) {
            if (tempColl(i).id == expandedDb)
                tempColl(i).style.display = 'block';
            else if (tempColl(i).className == 'child')
                tempColl(i).style.display = 'none';
        }
    } // end of the IE4 case
    else if (isNS4) {
        var theLayers  = document.layers;
        var layersCnt  = theLayers.length;
        for (var i = 0; i < layersCnt; i++) {
            if (theLayers[i].id == expandedDb)
                theLayers[i].visibility   = 'show';
            else if (theLayers[i].id.indexOf('Child') != -1)
                theLayers[i].visibility   = 'hide';
            else
                theLayers[i].visibility   = 'show';
        }
        nsArrangeList();
    } // end of the NS4 case
} // end of the 'initIt()' function


/**
 * Collapses/expands a database when the user require this to be done
 *
 * @param  string  the  name of the room to act on
 * @param  boolean whether to expand or to collapse the database content
 *
 * @access  public
 */
function expandBase(el, unexpand)
{
    expandedDb = el+'Child';
    initIt();
    return;
} // end of the 'expandBase()' function



/**
 * Opens all databases
 *
 * @access  public
 */
function expandAll()
{
    if (!capable || !isServer)
        return;

    if (isDOM) {
        var tempColl    = document.getElementsByTagName('DIV');
        var tempCollCnt = tempColl.length;
        for (var i = 0; i < tempCollCnt; i++) {
            tempColl[i].style.display = 'block';
        }
    } // end of the DOM case
    else if (isIE4) {
        tempColl        = document.all.tags('DIV');
        var tempCollCnt = tempColl.length;
        for (var i = 0; i < tempCollCnt; i++) {
            tempColl(i).style.display = 'block';
        }
    } // end of the IE4 case
    else if (isNS4) {
        var theLayers  = document.layers;
        var layersCnt  = theLayers.length;
        for (var i = 0; i < layersCnt; i++) {
            theLayers[i].visibility   = 'show';
        }
        nsArrangeList();
    } // end of the NS4 case
} // end of the 'initIt()' function


/**
 * Add styles for positioned layers
 */
if (capable) {
    with (document) {
        // Brian Birtles : This is not the ideal method of doing this
        // but under the 7th June '00 Mozilla build (and many before
        // it) Mozilla did not treat text between <style> tags as
        // style information unless it was written with the one call
        // to write().
        if (isDOM) {
            var lstyle = '<style type="text\/css">'
                + '<!--'
                + 'div {color: #000000}'
                + '.heada {font-family: ' + fontFamily + '; font-size: ' + fontSize + '; color: #000000}'
                + '.headaCnt {font-family: ' + fontFamily + '; font-size: ' + fontSmall + '; color: #000000}'
                + '.parent {lfont-family: ' + fontFamily + '; color: #000000; text-decoration: none; display: block}'
                + '.child {display: none}'
                + '.item, .item:active, .item:hover, .tblItem, .tblItem:active {font-size: ' + fontSmall + '; color: #333399; text-decoration: none}'
                + '.tblItem:hover {color: #FF0000; text-decoration: underline}'
                + '\/\/-->'
                + '<\/style>';
            write(lstyle);
        }
        else {
            writeln('<style type="text\/css">');
            writeln('<!--');
            writeln('div {color: #000000}');
            writeln('.heada {font-family: ' + fontFamily + '; font-size: ' + fontSize + '; color: #000000}');
            writeln('.headaCnt {font-family: ' + fontFamily + '; font-size: ' + fontSmall + '; color: #000000}');
            if (isIE4) {
                writeln('.parent {font-family: ' + fontFamily + '; color: #000000; text-decoration: none; display: block}');
                writeln('.child {display: none}');
                writeln('.item, .item:active, .item:hover, .tblItem, .tblItem:active {font-size: ' + fontSmall + '; color: #333399; text-decoration: none}');
                writeln('.tblItem:hover {color: #FF0000; text-decoration: underline}');
            }
            else {
                // si es noexplorer (netscape) plataforma windows
                if (is.win){ 
                    writeln('.parent {left:631; top: 215; font-family: ' + fontFamily + '; color: #000000; text-decoration: none; position: absolute; visibility: hidden}');
                    writeln('.child {left:631; top: 215; position: absolute; visibility: hidden}');
                    writeln('.item, .tblItem {font-size: ' + fontSmall + '; color: #333399; text-decoration: none}');
                } else
                    // si es noexplorer (netscape) plataforma linux
                    if (is.linux){ 
                    writeln('.parent {left:631; top: 240; font-family: ' + fontFamily + '; color: #000000; text-decoration: none; position: absolute; visibility: hidden}');
                    writeln('.child {left:631; top: 240; position: absolute; visibility: hidden}');
                    writeln('.item, .tblItem {font-size: ' + fontSmall + '; color: #333399; text-decoration: none}');
                } else
                    // si es noexplorer (netscape) plataforma mac
                    if (is.mac){ 
                    writeln('.parent {left:631; top: 195; font-family: ' + fontFamily + '; color: #000000; text-decoration: none; position: absolute; visibility: hidden}');
                    writeln('.child {left:631; top: 195; position: absolute; visibility: hidden}');
                    writeln('.item, .tblItem {font-size: ' + fontSmall + '; color: #333399; text-decoration: none}');
                }
                else {
                    writeln('.parent {left:631; top: 191; font-family: ' + fontFamily + '; color: #000000; text-decoration: none; position: absolute; visibility: hidden}');
                    writeln('.child {left:631; top: 191; position: absolute; visibility: hidden}');
                    writeln('.item, .tblItem {font-size: ' + fontSmall + '; color: #333399; text-decoration: none}');
                }

            }
            writeln('\/\/-->');
            writeln('<\/style>');
        }
    }
}
else {
    with (document) {
        writeln('<style type="text\/css">');
        writeln('<!--');
        writeln('div {color: #000000}');
        writeln('.heada {font-family: ' + fontFamily + '; font-size: ' + fontSize + '; color: #000000}');
        writeln('.headaCnt {font-family: ' + fontFamily + '; font-size: ' + fontSmall + '; color: #000000}');
        writeln('.parent {font-family: ' + fontFamily + '; color: #000000; text-decoration: none}');
        writeln('.child {text-decoration: none}');
        writeln('.item, .item:active, .item:hover, .tblItem, .tblItem:active {font-size: ' + fontSmall + '; color: #333399; text-decoration: none}');
        writeln('.tblItem:hover {color: #FF0000; text-decoration: underline}');
        writeln('\/\/-->');
        writeln('<\/style>');
    }
} // end of adding styles


// onload = initIt;