// JavaScript Document
$.showID = '';
$.divID = '';
$.arrowID = '';
$.arrowTop = '';
$.enable = true;
$.pLeft = 0;
$.pTop = 0;
var alertText = 'bogus';
$(document).ready(
	function()
		{
		/*$("div#content").css('display', 'none');
		$("div#content").css('display', 'table');*/
		$("div#subWrapper")
			.mouseleave
				(
				function()
					{
					$('.level_0_hover').addClass('level_0');
					$('.level_0_hover').removeClass('level_0_hover');
					$("div.level_1").css('display', 'none');
					$("div.level_2").css('display', 'none');
					$("div.level_3").css('display', 'none');
					$("div.level_4").css('display', 'none');
					}
				);
		$("div.level_X")
			.mouseenter
				(
				function()
					{
					$('.level_0_hover').addClass('level_0');
					$('.level_0_hover').removeClass('level_0_hover');
					$("div.level_1").css('display', 'none');
					$("div.level_2").css('display', 'none');
					$("div.level_3").css('display', 'none');
					$("div.level_4").css('display', 'none');
					}
				);
		$("div#container")
			.mouseleave
				(
				function()
					{
					$("div.level_1").css('display', 'none');
					$("div.level_2").css('display', 'none');
					$("div.level_3").css('display', 'none');
					$("div.level_4").css('display', 'none');
					}
				);
		$("div.level_0")
			.mouseenter
				(
				function()
					{
					$('.level_0_hover').addClass('level_0');
					$('.level_0_hover').removeClass('level_0_hover');
					$(this).removeClass('level_0');
					$(this).addClass('level_0_hover');
					$("div.level_1").css('display', 'none');
					$("div.level_2").css('display', 'none');
					$("div.level_3").css('display', 'none');
					$("div.level_4").css('display', 'none');
					$.showID = $(this).get(0).id;
					$.parentID = '#' + $.showID;
					$.divID = '#sub_' + $.showID;
					$.arrowID = '#arrow_' + $.showID;
					var position = $($.parentID).position();
					var position2 = $($.arrowID).position();
				//alert('parentID='+ $.parentID);
					$.pLeft_0 = position2.left + 15;
					$.pTop_0 = position.top;
				//alert('pLeft='+ $.pLeft_0 + '\n pTop='+ $.pTop_0);
					
					$.arrowTop = $($.arrowID).position();
					$($.divID).css({'display': 'block', 'position': 'absolute', 'top': $.pTop_0, 'left': $.pLeft_0});
					}
				)
		$("div.hasSubmenu")
			.mouseenter
				(
				function()
					{
					$.showID = $(this).get(0).id;
					$.parentID = '#' + $.showID;
					$.divID = '#sub_' + $.showID;
					$.arrowID = '#arrow_' + $.showID;

					var position = $($.parentID).position();
					var position2 = $($.arrowID).position();
					$.pLeft_1 = $.pLeft_0 + position2.left + 9;
					
					$.pTop_1 = $.pTop_0 + position2.top;
					$($.divID).css({'display': 'block', 'position': 'absolute', 'top': $.pTop_1, 'left': $.pLeft_1});
					}
				)
		}
	);
