/*******************************************************************************
* Name         = ryderleftnav.js
*
* Description  = Javascript functions used to control the left navigation 
*                component of Product-specific Ryder.com pages.
*
* Revision History:
*
*  Date        Developer           Description
* ------------------------------------------------------------------------------
*  09/01/05    Maria Kaufmann      Initial implementation
*  09/29/05    Maria Kaufmann      Modified LeftNav_showMenu(id) to collapse
*                                  any other menus currently expanded.  Also
*                                  Added openWindow() function.
********************************************************************************/

/*******************************************************************************
* Expands the second-level menu items under the first-level menu identified by
* id.
*******************************************************************************/
function LeftNav_showMenu(id)
{
	var element = document.getElementById(id);

	// Toggle the state of the current division
	if ( element.style.display != "block" )
    {
		element.style.display = "block";
    }
    else
    {
		element.style.display = "none";
    }
	
	// Hide all other divisions
	if ( document.all )
	{
		// This is an IE browser.
		var divcount = document.all.tags("div").length;
		var divarray = document.all.tags("div");
		for ( var i=0; i < divcount; i++ )
		{
			if ( divarray[i].id )
			{
				if ( divarray[i].id.indexOf("sm-") != -1 &&
					 divarray[i].id != id )
				{
					document.getElementById(divarray[i].id).style.display = "none";
				}
			}
		}
	}
}

/*******************************************************************************
* Opens a scrollable, resizeable window with no menubar and tool bars.
*******************************************************************************/
function openWindow(url, urlDescription, height, width)
{
	var windowOptions = "width="  + width  + ",height=" + height + ",menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no";
  	window.open (url, urlDescription, windowOptions);
}

