/* =================================================================================================
 * =================================================================================================
 * 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 = 0;                             		// padding between menu border and items grid
TransMenu.itemPadding = 2;                             		// additional padding around each item
TransMenu.shadowSize = 4;                              		// size of shadow under menu
TransMenu.shadowOffset = 0;                            		// distance shadow should be offset from leading edge
TransMenu.shadowColor = "Transparent"; //"#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 = "FFFFFF";                   	// color of the background (transparency set in CSS)
TransMenu.backgroundPng = "menu/img/dark-80.png";           // a PNG graphic to server as the background for mac IE5
TransMenu.hideDelay = 1000;                            		// number of milliseconds to wait before hiding a menu
TransMenu.slideTime = 400;                             		// number of milliseconds it takes to open and close a menu
//==================================================================================================
// Customized for BWC
TransMenu.leftDingbatOn = "menu/img/leftdingbat-on.gif";	// CUSTOM BWC Left Digbat ON path
TransMenu.leftDingbatOff = "menu/img/leftdingbat-off.gif";	// CUSTOM BWC Left Digbat OFF path
TransMenu.SubmenuDigbatMargin = 36;							// CUSTOM BWC How far the submenu dingbat is from the text
TransMenu.shadowBottomPng = "menu/img/shadow_bottom.png";
TransMenu.shadowRightPng = "menu/img/shadow_right.png";
TransMenu.shadowRightCornerPng = "menu/img/shadow_right_corner.png";
TransMenu.dingbatPaddingRight = 4;
TransMenu.dingbatPaddingLeft = 12;

//==================================================================================================
// 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
var menu_3
var menu_4

//==================================================================================================
// 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 = ""; };

			}
				
}

var ms

function CreateMenu() {

		//==================================================================================================
		// 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, 0, 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 (About us)
		//==================================================================================================
		menu_1 = ms.addMenu(document.getElementById("menu_1"));
		menu_1.addItem("Our Unique Value", "1_aboutUs_1.shtml"); 	//menu_1_1

		//==================================================================================================
		// Menu 2 (Our Products)
		//==================================================================================================
		menu_2 = ms.addMenu(document.getElementById("menu_2"));
		//menu_2.addItem("menu_2_0", "Template_2.html"); 			//menu_2_0 
		menu_2.addItem("Carpet", "2_ourProducts_1.shtml"); 			//menu_2_1
		menu_2.addItem("Ceramic / Porcelain / Stone", "2_ourProducts_2.shtml"); 	//menu_2_2
		menu_2.addItem("Hardwood", "2_ourProducts_3.shtml"); 		//menu_2_3
		menu_2.addItem("Vinyl Flooring", "2_ourProducts_4.shtml"); 	//menu_2_4
		menu_2.addItem("Window Treatments", "2_ourProducts_5.shtml"); 	//menu_2_5

		//==================================================================================================
		// Menu 3  (Design Consulting)
		//==================================================================================================
		menu_3 = ms.addMenu(document.getElementById("menu_3"));
		//menu_3.addItem("menu_3_0", "Template_3.html"); 							//menu_3_0 
		menu_3.addItem("Design Services", "3_designConsulting_1.shtml"); 	//menu_3_1
		menu_3.addItem("Design Gallery", "3_designConsulting_2.shtml"); 		//menu_3_2
					var submenu_3_1 = menu_3.addMenu(menu_3.items[0]);
						submenu_3_1.addItem("Home Solutions Interactive", "3_designConsulting_1_1.shtml");
						submenu_3_1.addItem("Design Center DVD", "3_designConsulting_1_2.shtml");
						submenu_3_1.addItem("One-On-One Appointment", "3_designConsulting_1_3.shtml");
		

		//==================================================================================================
		// Menu 4 (Builder Services)
		//==================================================================================================
		menu_4 = ms.addMenu(document.getElementById("menu_4"));
		//menu_4.addItem("menu_4_0", "Template_4.html"); 						//menu_4_0 
		menu_4.addItem("Builder Services", "4_ourServices_1.shtml"); 	//menu_4_1
		menu_4.addItem("Commercial Services", "4_ourServices_2.shtml"); //menu_4_2
		menu_4.addItem("Retail Services", "4_ourServices_3.shtml"); 		//menu_4_3
					var submenu_4_1 = menu_4.addMenu(menu_4.items[0]);
						submenu_4_1.addItem("Professionally Trained", "4_ourServices_1_1.shtml");
						submenu_4_1.addItem("Builder Education", "4_ourServices_1_2.shtml");
						submenu_4_1.addItem("Service &amp; Warranty", "4_ourServices_1_3.shtml");
					var submenu_4_2 = menu_4.addMenu(menu_4.items[1]);
						submenu_4_2.addItem("Professionally Trained", "4_ourServices_2_1.shtml");
						submenu_4_2.addItem("Service &amp; Warranty", "4_ourServices_2_2.shtml");
						submenu_4_2.addItem("Commercial Projects", "4_ourServices_2_3.shtml");
		//==================================================================================================

		//==================================================================================================
		// 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();
	}