/* $Id: jura.js,v 1.3 2006/09/11 09:02:22 sondberg Exp $
 * ---------------------------------------------------------
 * Javascript container for the juraportal project
 */


function get_keystone_vars () {
    return document.keystone;
}



function toggle_identifier_box (id) {
    var img_cell_id = id + '_img';
    var div_cell_id = id + '_div';
    var vars = get_keystone_vars();
    var expanded_img = 'arrow_brown_down.gif';
    var collapsed_img = 'arrow_brown_right.gif';
    var div_cell = document.getElementById(div_cell_id);
    var base_url = vars.portal_root.value + '/gfx/';

    if ( !div_cell ) {
        return;
    }

    if ( img_cell = document.getElementById(img_cell_id) ) {
        var state = img_cell.getAttribute('state');

        if ( state == 'collapsed' ) {
            img_cell.setAttribute('state', 'expanded');
            img_cell.src = base_url + expanded_img;
            div_cell.style.display = 'block';
        } else {
            img_cell.setAttribute('state', 'collapsed');
            img_cell.src = base_url + collapsed_img;
            div_cell.style.display = 'none';
        }
    }
}
