/**********************************************
 LMNavExpanderLite.js
 Controls Expandable menu functions without 
     animation or other effects
 Author:  M. Dempster 11/30/02
 Copyright:  LiquidMatrix Corp.
**********************************************/
var lastOpened = ""		//Last Menu Opened


/**********************************************
 popoutMenuOpen(integer)    
 Integer:  
 	use:  Required
	Datatype:  integer
	A valid integer
 Return:  none
 Description:  Takes the menu divs corresponding to integer.  Makes links
 				visible, then moves all lower divs down by that amount.
**********************************************/ 		
function popoutMenuOpen(which) {
	if (lastOpened != "") {														//do we have something open?
		popoutMenuClose(lastOpened, which);										//run our close function
		return;																	//stop this run.
	}
	lastOpened = which 															//Which one did we open?
	LinkElement = "Menu" + which + "Links"										//Set up the Link div reference
    	ThisElementHeight =  getElementUNPOSDimension(LinkElement, 'height')	//get the Link div height
		for (var i=which+1; i < 9; i++) {										//for all divs under this one
			Element = "Menu" + i												
			ElementY = getElementPosition(Element, 'top')						//get it's current position
			NewElementY = ElementY + ThisElementHeight 							//add it to the link div height
			setElementPosition(Element, '0', NewElementY)						//move the element, and continue
		}
		setElementVisibility(LinkElement, 'visible');							//make out links visible
}

/**********************************************
 popoutMenuClose(integer)    
 Integer:  
 	use:  Required
	Datatype:  integer
	A valid integer
 Return:  none
 Description:  Takes the menu divs corresponding to integer.  Makes links
 				invisible, then moves all lower divs down by that amount.
**********************************************/ 	
function popoutMenuClose(which, nextOpen) {
	LinkElement = "Menu" + which + "Links"										//Set up the Link div reference
    	ThisElementHeight =  getElementUNPOSDimension(LinkElement, 'height')	//get the Link div height
		for (var i=which+1; i < 9; i++) {										//for all divs under this one
			Element = "Menu" + i												
			ElementY = getElementPosition(Element, 'top')						//get it's current position
			NewElementY = ElementY - ThisElementHeight 							//subtract the link div height from the current position
			setElementPosition(Element, '0', NewElementY)						//move the element, and continue
		}
		setElementVisibility(LinkElement, 'hidden');							//make our links invisible
	lastOpened = ""																//set lastOPened to nothing (We've closed the menu)
	if (which != nextOpen) { popoutMenuOpen(nextOpen) }							//if we're not closing the same menu as was opened, open the new menu
}