function toggleMessage(elementId) {
    var flag = 'show';
    var link = '<<<';
    if ($("#m" + elementId).is(':visible')) {
        flag = 'hide';
        link = '>>>';
    }
    $("#ma" + elementId).html(link);
    $("#m" + elementId).animate({
        opacity: flag,
        height: flag
    });
}

function disp(elementId) {
    if (document.getElementById(elementId).style.display == 'none')
        show(elementId);
    else
        hide(elementId);

}

function show(elementId) {
    document.getElementById(elementId).style.display = '';
}

function hide(elementId) {
    document.getElementById(elementId).style.display = 'none';
}


function openNewWindow(url) {
    msg = open(url, "", "toolbar=no,directories=no,menubar=no,status=no,resizable=yes,fullscreen=no,scrollbars=yes");
}

function openNewWindow(url, show_toolbar, show_menubar, show_status) {
    msg = open(url, "", "toolbar=" + show_toolbar + ",directories=no,menubar=" + show_menubar + ",status=" + show_status + ",resizable=yes,fullscreen=no,scrollbars=yes");
}

function search() {
    document.forms.searcher.submit();
}


/**
 * EasySubMenu v0.2
 *    Written by: Daan Eeltink (http://www.daantje.nl)
 *    Last update: Sat Aug  7 12:29:14 CEST 2004
 *
 *    Documentation:
 *        This script can popup a DIV width some links.
 *        The width and position of the DIV are calculated from
 *        the object you point. This can be any object with an ID
 *        parameter. Than the function getSubMenu looks for a
 *        simular array value, drops it into the DIV and makes it
 *        visible. It's realy easy ;) It should work on MSIE >= 5
 *        and Mozilla >= 1.3 or better.
 *
 *    License:
 *        This is free for anyone with a computer.
 *        Please leave my credits alone.
 *
 *    Support:
 *        Please don't...
 */
/**
 * VOID getSubMenu(OBJECT_EVENT e)
 *    Checks the object below the mouse pointer and determins
 *    if the subMenuDiv should be shown with what content.
 */
function getSubMenu(e) {
    //get object from mouse position.
    subObj = obj = document.all ? event.srcElement : e.target;
    //get submenu object.
    subMenuObj = document.getElementById ? document.getElementById('subMenuDiv') : document.all.subMenuDiv;

    //check if the pointer is in an menu object or not.
    foundSubDiv = false;
    while (obj) {
        if (obj.id == subMenuObj.id)
            foundSubDiv = true;
        obj = obj.offsetParent;
    }

    if (foundSubDiv == false) {
        if (menu[subObj.id] && $(subMenuObj).is(":hidden")) {
            //determin width, top position and left position.
            t = subObj.offsetTop + subObj.offsetHeight;
            l = subObj.offsetLeft;

            //patch top and left when we are in an other object.
            obj = subObj;
            while (obj.offsetParent) {
                t += obj.offsetParent.offsetTop;
                l += obj.offsetParent.offsetLeft;
                obj = obj.offsetParent;
            }

            //set DIV mesurements and position.
            subMenuObj.style.top = t + 'px';
            subMenuObj.style.left = (l - 5) + 'px';
            //subMenuObj.style.width = subObj.offsetWidth; //remark this line and set the width in the DIV style, for static width.

            $(subMenuObj).html(menu[subObj.id]).slideDown(100,'swing');
        } else if (!menu[subObj.id]) {
            $(subMenuObj).slideUp(100, 'swing', function() {
                subMenuObj.innerHTML = "";
            });
        }
    }
}

function slideDownMenu(menu, callBack) {
    $(menu).animate({
        opacity: 'show',
        height: 'show'
    }, 'fast', callBack);
}

function smoothSlideUp(element, callBack) {
    $(element).animate({
        opacity: 'hide',
        height: 'hide'
    }, 'fast', callBack);
}



