		var MenuObjects = new Object();
		var isMSIE = false;
		var IE = document.all?true:false
		var cX = -1;
		var cY = -1;
		
		document.onmousemove = getMouseXY;
		
		var x = -1;
		var y = -1;
		var over = false;
		var dist = -1;
		var dX = 0;
		var dY = 0;
		function check()
		{
			if(dX > 100 || dY > 50)
			{
				HideMenu(Menu1);
				HideMenu(Menu2);
				HideMenu(Menu3);
				dist = -1;
				dY = -1;
				dX = -1;
				cX = -1;
				cY = -1;
			}
		}
		function getMouseXY(e)
		{
			if (!e) e = window.event; 

  			if (e)
			{ 
				if ((e.pageX || e.pageY) && over)
    				{ // this doesn't work on IE6!! (works on FF,Moz,Opera7)
      					cX = e.pageX;
      					cY = e.pageY;
      					over = false;
     			
    				}
				else if((e.pageX || e.pageY))
				{
					x = e.pageX;
					y = e.pageY;
					
				}	
    				else if ((e.clientX || e.clientY) && over)
    				{ // works on IE6,FF,Moz,Opera7
     					 cX = e.clientX + document.body.scrollLeft;
     					 cY = e.clientY + document.body.scrollTop;
					over = false;
     					
    				} 
				else if((e.clientX || e.clientY))
				{
					 x = e.clientX + document.body.scrollLeft;
     					 y = e.clientY + document.body.scrollTop;
					
				}	
  			}
			
			//if ( IE && over) { // grab the x-y pos.s if browser is IE
 			 // 	cX = event.clientX
   		//		cY = event.clientY
		//		over = false;
 		//	}
		//	else if (IE) { // grab the x-y pos.s if browser is IE
 		//	  	x = event.clientX
   		//		y = event.clientY
 		//	}
		//	
			if(cX != -1)
			{
				dX = cX - x;
				dY = cY - y;
				dist = Math.sqrt(Math.pow(dX,2) + Math.pow(dY,2));
				
				
			}
			
		}
		

		if (navigator.appName == "Microsoft Internet Explorer")
			isMSIE = true;

		// MenuItem /////////////////////////////////////////
		function MenuItem(name, url)
		{
			if (arguments.length > 0)
			{
				this.init(name, url);
			}
		}

		MenuItem.prototype.AddMenuObject = function()
		{
			var x = 0;

			do
			{
				x = Math.floor((Math.random() * 100000));
			} while (MenuObjects[x] != null);

			MenuObjects[x] = this;
			
			return x;
		}

		MenuItem.prototype.init = function(name, url)
		{
			this.Name = name;
			this.Parent = null;
			this.ID = this.AddMenuObject();
			this.Icon = null;
			this.Url = url;
		}

		MenuItem.prototype.Paint = function(doc)
		{
			var style = "MenuItemStyle";

			var menuItemRow      = null;
			var menuItemIcon     = null;
			var menuItemIconCell = null;
			var menuItemDataCell = null;
			var menuItemLink     = null;

			menuItemRow = doc.createElement("TR");
			menuItemRow.id = "MenuItem_" + this.ID;
			menuItemRow.onmouseover = new Function("parent.MenuObjects[" + this.ID + "].Highlight();");
			menuItemRow.onmouseout  = new Function("parent.MenuObjects[" + this.ID + "].UnHighlight();");
			menuItemRow.onclick     = new Function("parent.MenuObjects[" + this.ID + "].Click();");

			if (this.Parent.Icons == "on")
			{
				menuItemIconCell = doc.createElement("TD");
				menuItemIconCell.className = "MenuItemStyleIcon";

				menuItemIcon = doc.createElement("IMG");
				menuItemIcon.width  = this.Parent.MenuStyle.IconWidth;
				menuItemIcon.height = this.Parent.MenuStyle.IconHeight;

				if (this.Icon == null)
					menuItemIcon.src = "trans.gif";
				else
					menuItemIcon.src = this.Icon;

				// Add the image to the cell
				menuItemIconCell.appendChild(menuItemIcon);
				
				// Add the cell to the row
				menuItemRow.appendChild(menuItemIconCell);

				menuItemIcon = doc.createElement("IMG");
				menuItemIcon.src = "trans.gif";
				menuItemIcon.width  = 1;
				menuItemIcon.height = 1;
				
				menuItemIconCell = doc.createElement("TD");
				menuItemIconCell.className = "MenuItemStyleMiddle";
				menuItemIconCell.style.width = '1px';
				
				// Add the spacer to the cell
				menuItemIconCell.appendChild(menuItemIcon);

				// Add the cell to the row
				menuItemRow.appendChild(menuItemIconCell);

				style = "MenuItemStyleRight";
			}
			
			menuItemDataCell = doc.createElement("TD");
			// menuItemDataCell.colSpan = 2;
			// menuItemDataCell.className = style;

			menuItemDataCell.className = this.Parent.MenuStyle.ClassName;
			
			//menuItemDataCell.style.borderWidth  = "1px;"
			//menuItemDataCell.style.borderStyle  = "solid";
			//menuItemDataCell.style.borderColor  = "#000000";
			//menuItemDataCell.style.paddingLeft  = 5;
			//menuItemDataCell.style.paddingRight = 5;
			//menuItemDataCell.style.fontFamily   = "Arial, sans-serif";
			//menuItemDataCell.style.fontSize     = "8pt";
			
			menuItemLink = doc.createElement("A");
			menuItemLink.href = this.Url;
			menuItemLink.target = "_top";
			menuItemLink.appendChild(doc.createTextNode(this.Name));

			menuItemDataCell.appendChild(menuItemLink);
			
			menuItemRow.appendChild(menuItemDataCell);

			// Save our item ref for later use in highlighting and unhighlighting	
			this.ContentRef = menuItemRow;

			return menuItemRow;
		}

		MenuItem.prototype.GetLocation = function()
		{
			if (this.Parent instanceof MenuItem)
			{
				//var loc = this.Parent.GetLocation();
				var loc = new Object();
				loc.x = parseInt(this.Parent.IFrame.style.left);
				loc.y = parseInt(this.Parent.IFrame.style.top);

				if (this.Parent instanceof Menu)
				{
					var doc = this.Parent.IFrame.contentWindow.document;
					var element = this.ContentRef;
					var eLoc = GetHtmlElementLocation(element);
					var sz = this.GetSize();
					loc.x += eLoc.x;
					loc.y += eLoc.y;

					if (this.AnchorDirection == "right")
					{
						loc.x += element.offsetWidth;
						loc.x += parseInt(this.Parent.MenuStyle.ItemMarginWidth);

						// Check window size
						var lastX = loc.x + sz.Width + (isMSIE ? 15 : 0);
						if (lastX > document.body.clientWidth)
						{
							this.AnchorDirection = "left";
							loc = this.GetLocation();
							this.AnchorDirection = "right";
						}
					}
					else if (this.AnchorDirection == "left")
					{
						loc.x -= sz.Width;
						loc.x -= (parseInt(this.Parent.MenuStyle.ItemMarginWidth));

						if (isMSIE) loc.x -= (parseInt(this.Parent.MenuStyle.ItemMarginWidth));
					}

					// Check window height
					var lastY = loc.y + sz.Height;

					//status(lastY + " " + document.body.clientHeight + " " + document.body.scrollHeight + " " + document.body.offsetHeight);
					if (lastY > document.body.clientHeight)
					{
						loc.y -= sz.Height;
						loc.y += element.offsetHeight;
						loc.y += (parseInt(this.Parent.MenuStyle.BorderWidth));

						if (!isMSIE) loc.y += (parseInt(this.Parent.MenuStyle.ItemMarginWidth));
					}
				}

				return loc;
			}
			else
			{
				var loc = GetHtmlElementLocation(this.Parent);
				if (this.AnchorDirection == "down")
				{
					loc.y += this.Parent.offsetHeight;
				}
				else if (this.AnchorDirection == "right")
				{
					loc.x += this.Parent.offsetWidth;
				}
				else if (this.AnchorDirection == "up")
				{
					var table = this.MenuRef;
					loc.y -= table.scrollHeight;
					if (isMSIE)
						loc.y -= this.MenuStyle.ShadowWidth;
				}
				else if (this.AnchorDirection == "left")
				{
					var table = this.MenuRef;
					loc.x -= table.scrollWidth;
					if (isMSIE)
						loc.x -= this.MenuStyle.ShadowWidth;
				}


				return loc;
			}
		}


		MenuItem.prototype.GetSize = function()
		{
			if (this instanceof Menu)
			{
				var table = this.MenuRef;
				var sz = new Object();
				sz.Width = table.scrollWidth;
				sz.Height = table.scrollHeight;
				return sz;
			}
		}

		MenuItem.prototype.Highlight = function()
		{
			var menuItemElement = this.ContentRef;
			over = true;
			for (var i = 0; i < menuItemElement.childNodes.length; i++)
			{
				var td = menuItemElement.childNodes.item(i);

				if (td.className.search(/Over/) < 0)
					td.className += "Over";
			}

			this.Parent.MousedOver = true;

			// Unhighlight everything else
			for (var j = 0; j < this.Parent.MenuItems.length; j++)
			{
				var item = this.Parent.MenuItems[j];

				if (item.ID != this.ID)
				{
					if (item instanceof Menu)
						item.Hide();

					item.UnHighlight();
				}

			}
		}

		MenuItem.prototype.UnHighlight = function()
		{
			if (this instanceof Menu)
			{
				if (this.isVisible())
				{
					return false;
				}
			}

			var menuItemElement = this.ContentRef;
			
			if (menuItemElement == null) return;

			for (var i = 0; i < menuItemElement.childNodes.length; i++)
			{
				var td = menuItemElement.childNodes.item(i);

				td.className = td.className.replace(/Over/, ""); 
			}
		}

		MenuItem.prototype.Click = function()
		{
			// Do nothing right now.
		}

		function GetHtmlElementLocation(element)
		{
			var loc = new Object();
			loc.x = 0;
			loc.y = 0;

			do
			{
				loc.x += element.offsetLeft;
				loc.y += element.offsetTop;
				element = element.offsetParent;
			} while (element != null);

			return loc;
		}

		// Menu /////////////////////////////////////////////

		Menu.prototype = new MenuItem();
		Menu.prototype.constructor = Menu;
		Menu.superclass = MenuItem.prototype;

		function Menu(name, anchorElement, menuStyle, url)
		{
			if (arguments.length > 0)
			{
				this.init(name, anchorElement, menuStyle, url);
			}

		}

		Menu.prototype.init = function(name, anchorElement, menuStyle, url)
		{
			Menu.superclass.init.call(this, name, url);

			if (anchorElement != null)
			{
				this.Parent = anchorElement;
				this.Parent.onmouseover = new Function("HideAllMenus(); MenuObjects[" + this.ID + "].Show(); return false;");
		
}
			this.IFrame = document.createElement("IFRAME");
			this.IFrame.style.position = "absolute";
			this.IFrame.style.display = "none";
			this.IFrame.style.top = "0";
			this.IFrame.style.left = "0";
			this.IFrame.allowTransparency = true;
			this.IFrame.frameBorder = 0;
			this.IFrame.scrolling = "no";

			// this.IFrame.src = "blank.html";
			document.body.appendChild(this.IFrame);

			if (isMSIE || !isMSIE)
			{
				var IFrameDoc = this.IFrame.contentWindow.document;
				IFrameDoc.open();
				IFrameDoc.writeln("<html><head></head><body></body></html>");
				IFrameDoc.close();
			}

			this.MenuItems = new Array();

			this.ContentBuilt = false;
			this.MousedOver = false;
			this.ShowOn = "over";
			this.Icons = "off";
			this.AnchorDirection = "down";

			// Style Stuff
			if (menuStyle == null)
				this.MenuStyle = new MenuStyle();
			else
				this.MenuStyle = menuStyle;
		}

		Menu.prototype.Highlight = function()
		{
			Menu.superclass.Highlight.call(this);
			if (this.ShowOn == "over")
			{
				this.Show();
			}
		}

		Menu.prototype.Click = function()
		{
			Menu.superclass.Click.call(this);
			if (this.ShowOn == "click")
			{
				this.Show();
			}
		}

		Menu.prototype.isVisible = function()
		{
			return (this.IFrame.style.display != "none");
		}

		Menu.prototype.AddItem = function(item)
		{
			if (item instanceof MenuItem)
			{
				item.Parent = this;
				this.MenuItems[this.MenuItems.length] = item;

				// Propagate various properties.
				if (item instanceof Menu)
				{
					item.ShowOn = this.ShowOn;
					item.Icons = this.Icons;
					item.AnchorDirection = "right";
				}
			}
			else
			{
				throw "Only MenuItems can be added to a Menu.";
			}
		}
		
		var doneOnce = false;

		Menu.prototype.Refresh = function()
		{
			var body = this.IFrame.contentWindow.document.body;
			var doc  = this.IFrame.contentWindow.document;

			var menuTable          = null;
			var menuTableBody      = null;
			var menuTableRow       = null;
			var menuTableCell      = null;
			var menuInnerTable     = null;
			var menuInnerTableBody = null;

			body.style.backgroundColor = "transparent";
			body.style.margin = "0px 0px 0px 0px";

			var style = this.MenuStyle;

			var content = "";

			if (isMSIE)
			{
				var ss = this.IFrame.contentWindow.document.createStyleSheet("/_css/master.css");
				// ss.cssText = style.GetItemStyleSheet();
			}
			else
			{
				var documentStyles = null;
				
				documentStyles = this.IFrame.contentWindow.document.createElement("LINK");
				documentStyles.href = "/_css/master.css";
				documentStyles.rel  = "stylesheet";
				documentStyles.type = "text/css";
				// documentStyles.appendChild(this.IFrame.contentWindow.document.createTextNode(style.GetItemStyleSheet()));

				var headNode = this.IFrame.contentWindow.document.getElementsByTagName("HEAD")[0];
				
				if (headNode == null)
				{
					alert("headNode si null");
				}

				headNode.appendChild(documentStyles);
			}
			
			menuTable = doc.createElement("TABLE");
			menuTable.id          = "Menu_" + this.ID;
			menuTable.cellSpacing = 1;
			menuTable.cellPadding = 3;
			menuTable.width       = style.Width;
			menuTable.bgColor     = style.BackgroundColor;
			// menuTable.style.borderWidth = style.BorderWidth;
			// menuTable.style.borderStyle = style.BorderStyle;
			// menuTable.style.borderColor = style.BorderColor;
			// menuTable.style.borderCollapse = "collapse";

			if (style.Shadow)
			{
				menuTable.style.filter = "progid:DXImageTransform.Microsoft.DropShadow(color = #30000000 offX = " + style.ShadowWidth + " offY = " + style.ShadowWidth + ")";
			}
			
			menuTable.appendChild(menuTableBody = doc.createElement("TBODY"));
			
			// menuTableRow  = doc.createElement("TR");
			// menuTableCell = doc.createElement("TD");
			// menuTableCell.width = style.Width;

			// menuInnerTable = doc.createElement("TABLE");
			// menuInnerTable.cellSpacing   = 0;
			// menuInnerTable.cellPadding   = 0;
			// menuInnerTable.width         = style.Width;
			// menuInnerTable.style.cssText = style.GetMenuStyle();
			// menuInnerTable.appendChild(menuInnerTableBody = doc.createElement("TBODY"));

			// menuTableCell.appendChild(menuInnerTable);
			// menuTableRow.appendChild(menuTableCell);
			// menuTableBody.appendChild(menuTableRow);

			for (var i = 0; i < this.MenuItems.length; i++)
			{
				menuTableBody.appendChild(this.MenuItems[i].Paint(this.IFrame.contentWindow.document));
			}

			body.appendChild(menuTable);

			this.MenuRef = menuTable;
			this.ContentBuilt = true;
		}

		Menu.prototype.Initialize = function()
		{
			if (isMSIE)
			{
				this.Refresh();

				for (var i = 0; i < this.MenuItems.length; i++)
				{
					if (this.MenuItems[i] instanceof Menu)
					{
						this.MenuItems[i].Initialize();
					}
				}
			}
		}

		Menu.prototype.Show = function()
		{
			if (!this.ContentBuilt)
			{
				this.Refresh();
			}

			this.IFrame.style.visibility = "hidden";
			this.IFrame.style.display = "";
			var loc = this.GetLocation();
			this.IFrame.style.top = loc.y;
			this.IFrame.style.left = loc.x;
			this.IFrame.style.visibility = "";

			var table = this.MenuRef;
			this.IFrame.style.width = table.scrollWidth + 15;
			this.IFrame.style.height = table.scrollHeight + 15;
		}
		
		Menu.prototype.Hide = function()
		{
			for (var i = 0; i < this.MenuItems.length; i++)
			{
				if (this.MenuItems[i] instanceof Menu)
				{
					// The order here is very important.  Hide() before UnHighlight()
					this.MenuItems[i].Hide();
					this.MenuItems[i].UnHighlight();
				}
}

			this.IFrame.style.display = "none";

		}

		Menu.prototype.Paint = function(doc)
		{
			var style = "MenuItemStyleLeft";

			var menuItemRow       = null;
			var menuItemIcon      = null;
			var menuItemIconCell  = null;
			var menuItemDataCell  = null;
			var menuItemArrowCell = null;
			var menuItemLink      = null;

			menuItemRow = doc.createElement("TR");
			menuItemRow.id = "MenuItem_" + this.ID;
			menuItemRow.onmouseover = new Function("parent.MenuObjects[" + this.ID + "].Highlight();");
			menuItemRow.onmouseout  = new Function("parent.MenuObjects[" + this.ID + "].UnHighlight();");
			menuItemRow.onclick     = new Function("parent.MenuObjects[" + this.ID + "].Click();");

			if (this.Parent.Icons == "on")
			{
				menuItemIconCell = doc.createElement("TD");
				menuItemIconCell.className = "MenuItemStyleIcon";

				menuItemIcon = doc.createElement("IMG");
				menuItemIcon.width  = this.Parent.MenuStyle.IconWidth;
				menuItemIcon.height = this.Parent.MenuStyle.IconHeight;

				if (this.Icon == null)
					menuItemIcon.src = "trans.gif";
				else
					menuItemIcon.src = this.Icon;

				// Add the image to the cell
				menuItemIconCell.appendChild(menuItemIcon);
				
				// Add the cell to the row
				menuItemRow.appendChild(menuItemIconCell);

				menuItemIcon = doc.createElement("IMG");
				menuItemIcon.src = "trans.gif";
				menuItemIcon.width  = 1;
				menuItemIcon.height = 1;
				
				menuItemIconCell = doc.createElement("TD");
				menuItemIconCell.className = "MenuItemStyleMiddle";
				menuItemIconCell.style.width = '1px';
				
				// Add the spacer to the cell
				menuItemIconCell.appendChild(menuItemIcon);

				// Add the cell to the row
				menuItemRow.appendChild(menuItemIconCell);

				style = "MenuItemStyleMiddle";
			}
			
			menuItemDataCell = doc.createElement("TD");
			// menuItemDataCell.colSpan = 2;
			// menuItemDataCell.className = style;
			// menuItemDataCell.style.borderWidth  = "1px;"
			// menuItemDataCell.style.borderStyle  = "solid";
			// menuItemDataCell.style.borderColor  = "#000000";
			// menuItemDataCell.style.paddingLeft  = 5;
			// menuItemDataCell.style.paddingRight = 5;
			// menuItemDataCell.style.fontFamily   = "Arial, sans-serif";
			// menuItemDataCell.style.fontSize     = "8pt";

			menuItemDataCell.className = this.Parent.MenuStyle.ClassName;
			
			menuItemLink = doc.createElement("A");
			menuItemLink.href = this.Url;
			menuItemLink.target = "_top";
			menuItemLink.appendChild(doc.createTextNode(this.Name));

			menuItemDataCell.appendChild(menuItemLink);
			
			menuItemRow.appendChild(menuItemDataCell);
			
			// menuItemArrowCell = doc.createElement("TD");
			// menuItemArrowCell.align     = "right";
			// menuItemArrowCell.vAlign    = "middle";
			// menuItemArrowCell.className = "MenuItemStyleRight";
			
			// menuItemIcon = doc.createElement("IMG");
			// menuItemIcon.src = "arrow.gif";
			// menuItemIcon.width  = 4;
			// menuItemIcon.height = 7;
			// menuItemIcon.allign = "absmiddle";
			
			// menuItemArrowCell.appendChild(menuItemIcon);
			// menuItemRow.appendChild(menuItemArrowCell);

			// Save our item ref for later use in highlighting and unhighlighting	
			this.ContentRef = menuItemRow;

			return menuItemRow;
		}

		// MenuSeparator ////////////////////////////////////

		MenuSeparator.prototype = new MenuItem();
		MenuSeparator.prototype.constructor = MenuSeparator;
		MenuSeparator.superclass = MenuItem.prototype;

		function MenuSeparator()
		{
			this.init();
		}
		
		MenuSeparator.prototype.init = function()
		{
			MenuSeparator.superclass.init("");
		}

		MenuSeparator.prototype.Paint = function(doc)
		{
			var style = "MenuItemStyleLeft";

			var menuItemRow       = null;
			var menuItemIcon      = null;
			var menuItemIconCell  = null;
			var menuItemDataCell  = null;

			menuItemRow = doc.createElement("TR");
			menuItemRow.id = "MenuItem_" + this.ID;

			if (this.Parent.Icons == "on")
			{
				menuItemIconCell = doc.createElement("TD");
				menuItemIconCell.className = "MenuItemStyleSeparatorIcon";

				menuItemIcon = doc.createElement("IMG");
				menuItemIcon.src          = "trans.gif";
				menuItemIcon.width        = 1;
				menuItemIcon.height       = 1;
				menuItemIcon.style.height = this.Parent.MenuStyle.SeparatorHeight;

				// Add the image to the cell
				menuItemIconCell.appendChild(menuItemIcon);
				
				// Add the cell to the row
				menuItemRow.appendChild(menuItemIconCell);

				menuItemIconCell = doc.createElement("TD");
				menuItemIconCell.className = "MenuItemStyleSeparatorIconRight";
				menuItemIconCell.style.width = '1px';

				// Add the cell to the row
				menuItemRow.appendChild(menuItemIconCell);
			}
			
			menuItemDataCell = doc.createElement("TD");
			// menuItemDataCell.colSpan   = 2;
			menuItemDataCell.className = "MenuItemSeparatorStyle";
			
			menuItemIcon = doc.createElement("IMG");
			menuItemIcon.src          = "trans.gif";
			menuItemIcon.width        = 1;
			menuItemIcon.height       = 1;
			menuItemIcon.style.height = this.Parent.MenuStyle.SeparatorHeight;
			
			menuItemDataCell.appendChild(menuItemIcon);
			menuItemRow.appendChild(menuItemDataCell);

			// Save our item ref for later use in highlighting and unhighlighting	
			this.ContentRef = menuItemRow;

			return menuItemRow;
		}

		// MenuStyle ////////////////////////////////////////
		function MenuStyle()
		{
			this.Width = 200;
			this.BackgroundColor = "white";
			this.BorderColor = "#666666";
			this.BorderWidth = "1px";
			this.BorderStyle = "solid";
			this.Shadow = false;
			this.ShadowWidth = 4;
			this.FontFamily = "Verdana, sans-serif";
			this.FontSize = "10pt";
			this.FontColor = "black";
			this.FontWeight = "normal";
			this.FontDecoration = "none";
			this.FontStyle = "normal";

			// MenuItem Stuff
			this.ItemBackgroundColor = "white";
			this.ItemHighlightColor = "#B6BDD2";
			this.ItemHighlightBorderColor = "navy";
			this.ItemHighlightBorderWidth = "1px";
			this.ItemHighlightBorderStyle = "solid";
			this.ItemPaddingWidth = "1px";
			this.ItemMarginWidth = "0px";

			// Separator Stuff
			this.SeparatorColor = "darkgray";
			this.SeparatorHeight = "1px"

			// Icon Stuff
			this.IconBackgroundColor = "#E0E0E0";
			this.IconWidth = 20;
			this.IconHeight = 20;

			// Style Methods
			this.GetSeparatorStyle = MenuStyle_SeparatorStyle;
			this.GetItemStyle = MenuStyle_ItemStyle;
			this.GetHighlightStyle = MenuStyle_HighlightStyle;
			this.GetMenuStyle = MenuStyle_MenuStyle;
			this.GetItemStyleSheet = MenuStyle_ItemStyleSheet;
			
			// Class Name
			this.ClassName = "";
		}

		function MenuStyle_SeparatorStyle()
		{
			var styleText = "";
			
			styleText += "background-color: " + this.SeparatorColor + ";";
			styleText += " cursor: pointer; padding: 0px 0px 0px 0px;";
			styleText += " height: " + this.SeparatorHeight + ";";

			return styleText;
		}

		function MenuStyle_ItemStyleSheet()
		{
			var commonText = "";
			var styleText = "";

			commonText += "font-family: " + this.FontFamily + ";";
			commonText += " font-size: " + this.FontSize + ";";
			commonText += " font-weight: " + this.FontWeight + ";";
			commonText += " font-style: " + this.FontStyle + ";";
			commonText += " text-decoration: " + this.FontDecoration + ";";
			commonText += " padding: " + this.ItemPaddingWidth + ";";
			commonText += " margin: " + this.ItemMarginWidth + ";";

			// Icon Styles
			styleText += ".MenuItemStyleIcon { " + commonText
					+ " background-color: " + this.IconBackgroundColor + ";"
					+ " border-left: " + this.ItemHighlightBorderWidth + " solid " + this.IconBackgroundColor + ";"
					+ " border-top: " + this.ItemHighlightBorderWidth + " solid " + this.IconBackgroundColor + ";"
					+ " border-bottom: " + this.ItemHighlightBorderWidth + " solid " + this.IconBackgroundColor + ";"
					+ " width: " + this.IconWidth + "px;"
					+ " }\n";

			styleText += ".MenuItemStyleIconHighlight { " + commonText
					+ " background-color: " + this.ItemHighlightColor + ";"
					+ " border-left: " + this.ItemHighlightBorderWidth + " " + this.ItemHighlightBorderStyle + " " + this.ItemHighlightBorderColor + ";"
					+ " border-top: " + this.ItemHighlightBorderWidth + " " + this.ItemHighlightBorderStyle + " " + this.ItemHighlightBorderColor + ";"
					+ " border-bottom: " + this.ItemHighlightBorderWidth + " " + this.ItemHighlightBorderStyle + " " + this.ItemHighlightBorderColor + ";"
					+ " width: " + this.IconWidth + "px;"
					+ " }\n";

			// Single Column Styles

			styleText += ".MenuItemStyle { " + commonText
					+ " background-color: " + this.ItemBackgroundColor + ";"
					+ " border: " + this.ItemHighlightBorderWidth + " solid " + this.ItemBackgroundColor + ";"
					+ " }\n";

			styleText += ".MenuItemStyleHighlight { " + commonText
					+ " background-color: " + this.ItemHighlightColor + ";"
					+ " border: " + this.ItemHighlightBorderWidth + " " + this.ItemHighlightBorderStyle + " " + this.ItemHighlightBorderColor + ";"
					+ " }\n";

			// Left Column Styles
			styleText += ".MenuItemStyleLeft { " + commonText
					+ " background-color: " + this.ItemBackgroundColor + ";"
					+ " border-left: " + this.ItemHighlightBorderWidth + " solid " + this.ItemBackgroundColor + ";"
					+ " border-top: " + this.ItemHighlightBorderWidth + " solid " + this.ItemBackgroundColor + ";"
					+ " border-bottom: " + this.ItemHighlightBorderWidth + " solid " + this.ItemBackgroundColor + ";"
					+ " }\n";

			styleText += ".MenuItemStyleLeftHighlight { " + commonText
					+ " background-color: " + this.ItemHighlightColor + ";"
					+ " border-left: " + this.ItemHighlightBorderWidth + " " + this.ItemHighlightBorderStyle + " " + this.ItemHighlightBorderColor + ";"
					+ " border-top: " + this.ItemHighlightBorderWidth + " " + this.ItemHighlightBorderStyle + " " + this.ItemHighlightBorderColor + ";"
					+ " border-bottom: " + this.ItemHighlightBorderWidth + " " + this.ItemHighlightBorderStyle + " " + this.ItemHighlightBorderColor + ";"
					+ " }\n";

			// Middle Column Styles
			styleText += ".MenuItemStyleMiddle { " + commonText
					+ " background-color: " + this.ItemBackgroundColor + ";"
					+ " border-top: " + this.ItemHighlightBorderWidth + " solid " + this.ItemBackgroundColor + ";"
					+ " border-bottom: " + this.ItemHighlightBorderWidth + " solid " + this.ItemBackgroundColor + ";"
					+ " }\n";

			styleText += ".MenuItemStyleMiddleHighlight { " + commonText
					+ " background-color: " + this.ItemHighlightColor + ";"
					+ " border-top: " + this.ItemHighlightBorderWidth + " " + this.ItemHighlightBorderStyle + " " + this.ItemHighlightBorderColor + ";"
					+ " border-bottom: " + this.ItemHighlightBorderWidth + " " + this.ItemHighlightBorderStyle + " " + this.ItemHighlightBorderColor + ";"
					+ " }\n";

			// Right Column Styles
			styleText += ".MenuItemStyleRight { " + commonText
					+ " background-color: " + this.ItemBackgroundColor + ";"
					+ " border-right: " + this.ItemHighlightBorderWidth + " solid " + this.ItemBackgroundColor + ";"
					+ " border-top: " + this.ItemHighlightBorderWidth + " solid " + this.ItemBackgroundColor + ";"
					+ " border-bottom: " + this.ItemHighlightBorderWidth + " solid " + this.ItemBackgroundColor + ";"
					+ " }\n";

			styleText += ".MenuItemStyleRightHighlight { " + commonText
					+ " background-color: " + this.ItemHighlightColor + ";"
					+ " border-right: " + this.ItemHighlightBorderWidth + " " + this.ItemHighlightBorderStyle + " " + this.ItemHighlightBorderColor + ";"
					+ " border-top: " + this.ItemHighlightBorderWidth + " " + this.ItemHighlightBorderStyle + " " + this.ItemHighlightBorderColor + ";"
					+ " border-bottom: " + this.ItemHighlightBorderWidth + " " + this.ItemHighlightBorderStyle + " " + this.ItemHighlightBorderColor + ";"
					+ " }\n";


			styleText += ".MenuItemSeparatorStyle { "
					+ "background-color: " + this.SeparatorColor + ";"
					+ " cursor: pointer; padding: 0px;"
					+ " border: " + this.ItemMarginWidth + " solid " + this.ItemBackgroundColor + ";"
					+ " height: " + this.SeparatorHeight + ";"
					+ " }\n";

			styleText += ".MenuItemStyleSeparatorIcon { " + commonText
					+ " background-color: " + this.IconBackgroundColor + ";"
					+ " border-left: " + this.ItemHighlightBorderWidth + " solid " + this.IconBackgroundColor + ";"
					+ " border-top: " + this.ItemHighlightBorderWidth + " solid " + this.IconBackgroundColor + ";"
					+ " border-bottom: " + this.ItemHighlightBorderWidth + " solid " + this.IconBackgroundColor + ";"
					+ " width: " + this.IconWidth + "px;"
					+ " cursor: pointer; padding: 0px;"
					+ " height: " + this.SeparatorHeight + ";"
					+ " }\n";

			styleText += ".MenuItemStyleSeparatorIconRight { " + commonText
					+ " background-color: " + this.ItemBackgroundColor + ";"
					+ " border: " + this.ItemHighlightBorderWidth + " solid " + this.ItemBackgroundColor + ";"
					+ " cursor: pointer; padding: 0px;"
					+ " height: " + this.SeparatorHeight + ";"
					+ " }\n";

			return styleText;
		}

		function MenuStyle_ItemStyle()
		{
			var styleText = "";
			var menuStyle = this;

			styleText += "font-family: " + menuStyle.FontFamily + ";";
			styleText += " font-size: " + menuStyle.FontSize + ";";
			styleText += " font-weight: " + menuStyle.FontWeight + ";";
			styleText += " font-style: " + menuStyle.FontStyle + ";";
			styleText += " text-decoration: " + menuStyle.FontDecoration + ";";
			styleText += " background-color: " + menuStyle.ItemBackgroundColor + ";";
			styleText += " border: " + menuStyle.ItemHighlightBorderWidth + " solid " 
					+ menuStyle.ItemBackgroundColor + ";";
			styleText += " padding: " + menuStyle.ItemPaddingWidth + ";";
			styleText += " margin: " + menuStyle.ItemMarginWidth + ";";

			return styleText;
		}

		function MenuStyle_HighlightStyle()
		{
			var styleText = "";
			var menuStyle = this;

			styleText += "font-family: " + menuStyle.FontFamily + ";";
			styleText += " font-size: " + menuStyle.FontSize + ";";
			styleText += " font-weight: " + menuStyle.FontWeight + ";";
			styleText += " font-style: " + menuStyle.FontStyle + ";";
			styleText += " text-decoration: " + menuStyle.FontDecoration + ";";
			styleText += " background-color: " + menuStyle.ItemHighlightColor + ";";
			styleText += " border: " + menuStyle.ItemHighlightBorderWidth + " " + menuStyle.ItemHighlightBorderStyle 
					+ " " + menuStyle.ItemHighlightBorderColor + ";";
			styleText += " padding: " + menuStyle.ItemPaddingWidth + ";";
			styleText += " margin: " + menuStyle.ItemMarginWidth + ";";

			return styleText;
		}

		function MenuStyle_MenuStyle()
		{
			var styleText = "";

			styleText += "background-color: " + this.BackgroundColor + ";";
			styleText += " border: " + this.ItemMarginWidth + " solid " + this.ItemBackgroundColor + ";";
			styleText += " cursor: pointer;";

			return styleText;
		}

		/////////////////////////////////////////////////////

		function HideMenu(menuRef)
		{
			menuRef.Hide();
			menuRef.MousedOver = false;
		}

		var menuStyle1  = new MenuStyle();
		var menuStyle2  = new MenuStyle();
		var menuStyle3  = new MenuStyle();
		var menuStyle1s = new MenuStyle();
		var menuStyle2s = new MenuStyle();
		var menuStyle3s = new MenuStyle();

		menuStyle1.ClassName   = "residentMain";
		menuStyle2.ClassName   = "businessMain";
		menuStyle3.ClassName   = "visitorMain";
		
		menuStyle1.BackgroundColor = "#993333";
		menuStyle2.BackgroundColor = "#CC6600";
		menuStyle3.BackgroundColor = "#669933";

		menuStyle1s.ClassName   = "residentSub";
		menuStyle2s.ClassName   = "businessSub";
		menuStyle3s.ClassName   = "visitorSub";

		menuStyle1s.BackgroundColor = "#993333";
		menuStyle2s.BackgroundColor = "#CC6600";
		menuStyle3s.BackgroundColor = "#669933";
		
		menuStyle1.Width  = menuStyle2.Width  = menuStyle3.Width  = 153;
		menuStyle1s.Width = menuStyle2s.Width = menuStyle3s.Width = 153;

		