/******************************************************************************
 *  COLLAPSABLE DHTML MENU V1.1
 *  Copyright (C) 2004 Giovanni Glass <momendo at yahoo dot com>
 *  http://www.giovanniglass.com
 *
 *  This library is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation; either version 2.1 of the License, or
 *  (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful, but
 *  WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 ******************************************************************************
 *
 *  Steps to execute:
 *  1. Instantiate toggler and pass array of menus that collapse
 *
 *****************************************************************************/
 

function toggler()
{
	this.arrayOfMenus = arguments[0];

	this.turnMenusOff = function()
	{
		for(var _ in this.arrayOfMenus) {
			if (_ == 0) {continue}; // jump out
			document.getElementById(this.arrayOfMenus[_] + "a").style.display = "none";
			document.getElementById(this.arrayOfMenus[_] + "style").className = "navLiOff";
//			document.getElementById(this.arrayOfMenus[_] + "href").className = "navHAOff";
		}
	}

	this.flip = function(objString, obj)
	{
		objDisplay = document.getElementById(objString + "a").style.display;
		if(objDisplay == "none") {
			this.turnMenusOff(); // turn menus off
			document.getElementById(objString + "a").style.display = "block";
			document.getElementById(objString + "style").className = "navLiOn";
//			obj.className = "navHAOn";
		} else if(objDisplay == "block") {
			document.getElementById(objString + "a").style.display = "none";
			document.getElementById(objString + "style").className = "navLiOff";
//			obj.className = "navHAOff";
		}
	}
}

function goURL(url)
{
	window.location.href = url;
}

// Example instance
// toggle = new toggler(["nav_1","nav_3","nav_4"]);

toggle = new toggler(["nav_1","nav_3"]);

// preload our arrows
arrowImage1 = new Image();
arrowImage1.src = "images/arrow_collapsed.gif";

arrowImage2 = new Image();
arrowImage2.src = "images/arrow_expanded.gif";