/* javafuncs.js -- Contains all javascript function used on
 * the site.
 *
 * Authors: Adam Hooper
 *          Robert Cotran
 *
 * $Id: javafuncs.js,v 1.1 2002/08/12 11:43:44 apache Exp $
 */

function setBackImage(elementId, imageurl) { // {{{
    if (imageurl=='') {
        document.getElementById(elementId).style.backgroundImage='';
    } else {
        document.getElementById(elementId).style.backgroundImage='url(' + imageurl + ')';
    }
} /* }}} */

function setColor(elementId, Color) { // {{{
    document.getElementById(elementId).style.color=Color;
} /* }}} */

function switchTabBack(state, tabId) { // {{{
    if (state) {
        setBackImage(tabId + 'l', '/images/tabs/tab_l_s.gif');
        setBackImage(tabId + 'm', '/images/tabs/tab_m_s.gif');
        setBackImage(tabId + 'r', '/images/tabs/tab_r_s.gif');
    } else {
        setBackImage(tabId + 'l', '/images/tabs/tab_l_n.gif');
        setBackImage(tabId + 'm', '/images/tabs/tab_m_n.gif');
        setBackImage(tabId + 'r', '/images/tabs/tab_r_n.gif');
    }
} /* }}} */

function switchSectBtnBack(state, btnId, b2b) { // {{{
    if (state) {
    	if (b2b=='B')
       	    setBackImage(btnId, '/images/buttons/red_s.gif');
        else
            setBackImage(btnId, '/images/buttons/blue_s.gif');

    } else {
        setBackImage(btnId, '');
    }
} /* }}} */

function switchBtnBack(state, btnId, type) { // {{{
    if (state) {

        Color = 'white';

        setBackImage(btnId, '/images/buttons/t' + type + '_s.gif');
    } else {
        
        if (type == 1)
            Color = '#62584a';
        else
            Color = 'white';
        setBackImage(btnId, '/images/buttons/t' + type + '_n.gif');
    }
    setColor(btnId, Color);
} /* }}} */

