/*******************************************************************************
* Name         = general.js
*
* Description  = General purpose Javascript functions for Ryder.com Investor
*                 Portal.
*
* Revision History:
*
*  Date        Developer           Description
* ------------------------------------------------------------------------------
*  08/22/06    Maria Kaufmann      Initial implementation
********************************************************************************/

// Initialize images
var linkIcon = new Image();
linkIcon.src = "http://media.corporate-ir.net/media_files/irol/10/108468/images/nav_icon.gif";

/*******************************************************************************
* Expands the left navigation bar's second-level menu items under the
* first-level menu identified by id.
*******************************************************************************/
function LeftNav_showMenu(id)
{
	var element = document.getElementById(id);
    var linkImgName = "img_" + id;
	
	// Toggle the state of the current division
	if ( element != null )
	{
		if ( element.style.display != "block" )
    	{
			element.style.display = "block";

            if ( document[linkImgName] != null )
				document[linkImgName].src = "http://media.corporate-ir.net/media_files/irol/10/108468/images/nav_icon_down.gif";
    	}
    	else
    	{
			element.style.display = "none";
			
            if ( document[linkImgName] != null )
            	document[linkImgName].src = "http://media.corporate-ir.net/media_files/irol/10/108468/images/nav_icon.gif";
    	}

		// 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";
						
                        var linkImgName2 = "img_" + divarray[i].id;
                        if ( document[linkImgName2] != null )
                        	document[linkImgName2].src = "http://media.corporate-ir.net/media_files/irol/10/108468/images/nav_icon.gif";
					}
				}
			} // end for
		} // end if ( document.all )
	} // end if ( element != null )
	
}

/*******************************************************************************
* Opens a scrollable, resizeable window with no menubar and tool bars.
*******************************************************************************/
function openWindow(url, urlDescription, height, width)
{
	if ( height == null ) height = 400;
	if ( width == null ) width = 600;

	var windowOptions = "width="  + width  + ",height=" + height + ",menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no";
  	window.open (url, urlDescription, windowOptions);
}

function leftLinkIconDown(id)
{
	img_investors_invinfo.src = "http://media.corporate-ir.net/media_files/irol/10/108468/images/nav_icon_down.gif";
}
