/* =================================================================================================
 * =================================================================================================
 * FULL COPYRIGHT AND UPDATE DESCRIPTION AVAILABLE IN menu_methods.js
 *	Script variables and configs relocated here for ease of use.
 *
 * ============================================================================================== */

  
  
//==================================================================================================
// Configuration properties
//==================================================================================================
TransMenu.spacerGif = "menu/img/x.gif";                     // path to a transparent spacer gif
TransMenu.dingbatOn = "menu/img/submenu-on.gif";            // path to the active sub menu dingbat
TransMenu.dingbatOff = "menu/img/submenu-off.gif";          // path to the inactive sub menu dingbat
TransMenu.dingbatSize = 14;                            // size of the dingbat (square shape assumed)
TransMenu.menuPadding = 5;                             // padding between menu border and items grid
TransMenu.itemPadding = 3;                             // additional padding around each item
TransMenu.shadowSize = 2;                              // size of shadow under menu
TransMenu.shadowOffset = 3;                            // distance shadow should be offset from leading edge
TransMenu.shadowColor = "#888";                        // color of shadow (transparency is set in CSS)
TransMenu.shadowPng = "menu/img/grey-40.png";               // a PNG graphic to serve as the shadow for mac IE5
TransMenu.backgroundColor = "white";                   // color of the background (transparency set in CSS)
TransMenu.backgroundPng = "menu/img/white-90.png";          // a PNG graphic to server as the background for mac IE5
TransMenu.hideDelay = 200;                            // number of milliseconds to wait before hiding a menu
TransMenu.slideTime = 400;                             // number of milliseconds it takes to open and close a menu


//==================================================================================================
// Internal use properties
//==================================================================================================
TransMenu.reference = {topLeft:1,topRight:2,bottomLeft:3,bottomRight:4};
TransMenu.direction = {down:1,right:2};
TransMenu.registry = [];
TransMenu._maxZ = 100;

//==================================================================================================
// Add a VAR for each main menu item
//==================================================================================================
var menu_1
var menu_2

//==================================================================================================
// Static methods
//==================================================================================================
 
function menuInit() { 

			//==========================================================================================
			// if supported, initialize TransMenus
			//==========================================================================================
			// Check isSupported() so that menus aren't accidentally sent to non-supporting browsers.
			// This is better than server-side checking because it will also catch browsers which would
			// normally support the menus but have javascript disabled.
			//
			// If supported, call initialize() and then hook whatever image rollover code you need to do
			// to the .onactivate and .ondeactivate events for each menu.
			//==========================================================================================
			if (TransMenu.isSupported()) {
			
				
				TransMenu.initialize();

				// hook all the highlight swapping of the main toolbar to menu activation/deactivation
				// instead of simple rollover to get the effect where the button stays hightlit until
				// the menu is closed.
				//menu_1.onactivate = function() { document.getElementById("menu_1").className = "hover"; };
				//menu_1.ondeactivate = function() { document.getElementById("menu_1").className = ""; };

				//menu_2.onactivate = function() { document.getElementById("menu_2").className = "hover"; };
				//menu_2.ondeactivate = function() { document.getElementById("menu_2").className = ""; };

				menu_1.onactivate = function() { imgSwapGif(document.getElementById("nav_chartertools"),'over'); };
				menu_1.ondeactivate = function() { imgSwapGif(document.getElementById("nav_chartertools"),'out'); };
				
				menu_2.onactivate = function() { imgSwapGif(document.getElementById("nav_aboutus"),'over'); };
				menu_2.ondeactivate = function() { imgSwapGif(document.getElementById("nav_aboutus"),'out'); };
			}
				
}

var ms

function CreateMenu() {
	if (TransMenu.isSupported()) {
		//==================================================================================================
		// create a set of dropdowns
		//==================================================================================================
		// the first param should always be down, as it is here
		//
		// The second and third param are the top and left offset positions of the menus from their actuators
		// respectively. To make a menu appear a little to the left and bottom of an actuator, you could use
		// something like -5, 5
		//
		// The last parameter can be .topLeft, .bottomLeft, .topRight, or .bottomRight to inidicate the corner
		// of the actuator from which to measure the offset positions above. Here we are saying we want the 
		// menu to appear directly below the bottom left corner of the actuator
		//==================================================================================================
		ms = new TransMenuSet(TransMenu.direction.down, 1, 0, TransMenu.reference.bottomLeft);

		//==================================================================================================
		// create a dropdown menu
		//==================================================================================================
		// the first parameter should be the HTML element which will act actuator for the menu
		//==================================================================================================
		
		// SAMPLE 3 TIER MENU ------------------------------------------------------------------------------
		//		menu_1 = ms.addMenu(document.getElementById("menu_1"));
		//		menu_1.addItem("menu_1_0", "http://yahoo.com/"); 
		//		menu_1.addItem("menu_1_1", ""); // send no URL if nothing should happen onclick
		//
		//			var submenu_1_1 = menu_1.addMenu(menu_1.items[1]);
		//				submenu_1_1.addItem("menu_1_1_1", "http://yahoo.com/");
		//				submenu_1_1.addItem("menu_1_1_2", "");
		//				submenu_1_1.addItem("menu_1_1_3", "");
		//
		//				var submenu_1_1_1 = submenu_1_1.addMenu(submenu_1_1.items[0]);
		//					submenu_1_1_1.addItem("foo");
		//					submenu_1_1_1.addItem("bar");
		
		
		
		//==================================================================================================
		// Menu 1
		//==================================================================================================
		
		menu_1 = ms.addMenu(document.getElementById("nav_chartertools"));
		menu_1.addItem("Charter Us", "charterus.aspx"); //menu_1_0 
		menu_1.addItem("Charter FAQ", "charterus_faqs.aspx"); //menu_1_1
		menu_1.addItem("Charter Basics", "charterus_checklist.aspx"); //menu_1_2
		menu_1.addItem("Travel FAQ", "travelfaq.aspx"); //menu_1_3
		menu_1.addItem("Fleet Information", "fleetinformation.aspx"); //menu_1_4
		menu_1.addItem("Security Information", "securityinformation.aspx"); //menu_1_5
		menu_1.addItem("Contact Charter Sales", "charterus_contact.aspx"); //menu_1_6
		
		
		//==================================================================================================
		// Menu 2
		//==================================================================================================
		menu_2 = ms.addMenu(document.getElementById("nav_aboutus"));
		menu_2.addItem("About Us",  "aboutus.aspx"); //menu_2_0 
		//menu_2.addItem("B767-LUXURY* Charters", "charter-luxury.aspx"); // luxury
		menu_2.addItem("Military", "military.aspx"); //menu_2_1
		menu_2.addItem("News Releases", "pressreleases.aspx"); //menu_2_2
		//menu_2.addItem("Discontinued Scheduled Service", "flynaa.aspx");
		menu_2.addItem("Obama Presidential Campaign", "pressrelease.aspx?id=101");
		
		menu_2.addItem("Career Opportunities", "careeropps.aspx"); //menu_2_3
		menu_2.addItem("Contact Us", "contactus.aspx"); //menu_2_4


		//==================================================================================================

		//==================================================================================================
		// write drop downs into page
		//==================================================================================================
		// this method writes all the HTML for the menus into the page with document.write(). It must be
		// called within the body of the HTML page.
		//==================================================================================================
		TransMenu.renderAll();
	}
}
	