// JavaScript Document

/*
 * menuExpandable.js - implements an expandable menu based on a HTML list
 * Author: Dave Lindquist (dave@gazingus.org)
 */

if (!document.getElementById)
    document.getElementById = function() { return null; }

function initializeMenu(objId, buttonId) {
    var winObj = document.getElementById(objId);
    var button = document.getElementById(buttonId);
    if (winObj == null || button == null) return;

    if (window.opera) return; // I'm too tired

    button.onclick = function(winObj) {
        var objBorderBot 	= winObj.style.borderBottom;
		var objBack			= winObj.style.background;
		var objHeight		= winObj.style.height;
		var butBack			= this.style.background;
       	winObj.style.objBorderBot = (objBorderBot == "none") ? "1px dashed #666" : "none";
        winObj.style.objBack = (objBack == "#fff url(../images/org_heading_back.gif) no-repeat") ? "#fff2e5 url(../images/org_heading_back.gif) no-repeat" : "#fff url(../images/org_heading_back.gif) no-repeat";
        winObj.style.objHeight = (objHeight == "16px") ? "auto" : "16px";
        this.style.butBack = (butBack == "url(../images/minimize.gif) no-repeat") ? "url(../images/maximize.gif) no-repeat" : "url(../images/minimize.gif) no-repeat";
		
        return false;
    }
}