/* Either show or hide an element */
function ShowHide(elem) {
    if ($(elem).css('display') != 'block')
        $(elem).css('display','block');
    else
        $(elem).css('display','none');
}

function getSelectedValue(Select) {
    Object = document.getElementById(Select);
    return Object.options[Object.selectedIndex].value;
}

/* Show a tr in a table list */
function Show(e,a) {
    $(e).css('display','');
    
    $('#'+a).attr('href','javascript:Hide(\''+e+'\',\''+a+'\');');
    $('#'+a).html('<img src="/engine/img/showhide/minus.png" alt="" title="" />');
}

/* Hide a tr in a table list */
function Hide(e,a) {
    $(e).css('display','none');
    
    $('#'+a).attr('href','javascript:Show(\''+e+'\',\''+a+'\');');
    $('#'+a).html('<img src="/engine/img/showhide/plus.png" alt="" title="" />');
}

/* Do this when page has loaded */
$(document).ready(
    function() {
        /* Handle hovers in a table list */
        $('table.list tr').hover(
            function() {if (!$(this).hasClass('nohover')) $(this).css('background-color','#fcfdc4');},
            function() {if (!$(this).hasClass('nohover')) $(this).css('background-color','white');}
        );
    }
);