var Browser = "";

function openMe(newin) 
{
        flyout=window.open(newin,"flyout","resizable=yes,scrollbars=yes,titlebar=yes,width=500,height=500,top=100,left=100")
}

function menuOver() 
{
	clearTimeout(timeOn);
	clearTimeout(timeOn2);
}

function menuOut() 
{
 	timeOn = setTimeout("hideAllMenus()", 600);
	timeOn2 = setTimeout("mOut()",600);
}

function mOut() 
{
	if (rootMenu != null) 
	{
		normalButton(rootMenu,rootItemBorderColor,rootFontColor);	
		rootMenu = null;
	}
	idName = null;
}

function showMenuBlank(menuNumber, eventObj,ID) 
{
	hideAllMenus();
	menuActive[menuNumber] = true;
	activeMenu[menuNumber] = ID;

	if (rootMenu == null)
	{
		rootMenu = 'lb' + ID;
	}
	else if (rootMenu != 'lb' + ID)
	{
		if (ID.substring(0,ID.indexOf("_")) == rootMenu.substring(2,rootMenu.indexOf("_")))
			normalButton(rootMenu,rootItemBorderColor,rootFontColor);
		else
			normalButton(rootMenu,oldRootItemBorderColor,oldRootFontColor);

		rootMenu = 'lb' + ID;
	}

	pressedButton('lb' + ID);
}

function openMenu(menuNumber,eventObj, align,ID) 
{
	var go = true;

	if (idName == null) 
	{
		go = false;
		raiseButton('lb' + ID);
	}

	else if (idName != ID.substring(0,ID.indexOf('_'))) 
	{
		go = false;
		raiseButton('lb' + ID);
	}

	if (rootMenu == null)
		rootMenu = 'lb' + ID;
	else if (rootMenu != 'lb' + ID)
	{
		if (ID.substring(0,ID.indexOf("_")) == rootMenu.substring(2,rootMenu.indexOf("_")))
			normalButton(rootMenu,rootItemBorderColor,rootFontColor);
		else
			normalButton(rootMenu,oldRootItemBorderColor,oldRootFontColor);
		rootMenu = 'lb' + ID;
	}

	if (go)
		showMenu(menuNumber,eventObj, align, ID);
}

function openSideMenu(menuNumber,eventObj, align,ID) 
{
	var go = true;

	if (idName == null) 
	{
		go = false;
		raiseButton('lb' + ID);
	}

	else if (idName != ID.substring(0,ID.indexOf('_'))) 
	{
		go = false;
		raiseButton('lb' + ID);
	}

	if (rootMenu == null)
		rootMenu = 'lb' + ID;
	else if (rootMenu != 'lb' + ID)
	{
		if (ID.substring(0,ID.indexOf("_")) == rootMenu.substring(2,rootMenu.indexOf("_")))
			normalButton(rootMenu,rootItemBorderColor,rootFontColor);
		else
			normalButton(rootMenu,oldRootItemBorderColor,oldRootFontColor);
		rootMenu = 'lb' + ID;
	}

	if (go)
		showSideMenu(menuNumber,eventObj, align, ID);
}

function openMenuBlank(ID) 
{
	var go = true;

	if (idName == null)
	{
		go = false;
		raiseButton('lb' + ID);
	}
	else if (idName != ID.substring(0,ID.indexOf('_')))
	{
		go = false;
		raiseButton('lb' + ID);
	}

	if (rootMenu == null)
	{
		rootMenu = 'lb' + ID;
	}
	else if (rootMenu != 'lb' + ID)
	{
		if (ID.substring(0,ID.indexOf("_")) == rootMenu.substring(2,rootMenu.indexOf("_")))
			normalButton(rootMenu,rootItemBorderColor,rootFontColor);
		else
			normalButton(rootMenu,oldRootItemBorderColor,oldRootFontColor);

		rootMenu = 'lb' + ID;
	}

	if (go)
		pressedButton('lb' + ID);
}

function showMenu(menuNumber, eventObj, align,ID) 
{
	menuId = ID.substring(0,ID.indexOf('_'));

	idArray[idArray.length] = ID;

	if (rootMenu == null)
	{
		rootMenu = 'lb' + ID;
	}
	else if (rootMenu != 'lb' + ID)
	{
		if (ID.substring(0,ID.indexOf("_")) == rootMenu.substring(2,rootMenu.indexOf("_")))
		{
			normalButton(rootMenu,rootItemBorderColor,rootFontColor);
		}
		else
		{
			normalButton(rootMenu,oldRootItemBorderColor,oldRootFontColor);
		}

		rootMenu = 'lb' + ID;
	}

	pressedButton('lb' + ID);
	idName = ID.substring(0,ID.indexOf('_'));

	hideAllMenus(ID);

	var x = 10;		
	var menuTop = 100;
	var menu = getStyleObject(ID);
	x = getElementLeft('lbl'+ID);
	menuTop = getElementTop('lbl'+ID);

	if ((navigator.userAgent.indexOf("Opera 5")!=-1) ||(navigator.userAgent.indexOf("Opera/5")!=-1)) 
	{
		menuTop = getElementTop('l'+ID);

		menu.pixelTop=menuTop + menuLabelBulletHeight;
 		menu.pixelLeft=x;
	} 
	else
	{
		menu.top=(1+menuTop+getElementHeight('lbl'+ID) + 2 * rootItemBorderWidth) +'px';
 		menu.left=x +'px';
		menu.position = "absolute";
	}
	var menuBox = getStyleObject('lb'+ ID);

	var menuId = ID;
	menuActive[menuNumber] = true;
	var firstTime = true;
	if (activeMenu[menuNumber] == ID)
		firstTime = false;

	activeMenu[menuNumber] = ID;

	arOpenMenusId[lengthArray] = menuId;
	var number = 1;
	var height = 0;

	while ((document.getElementById("lb" + menuId + "_" + number) != null) || (document.getElementById(menuId+"_"+number) != null))
	{
		if (document.getElementById("lb"+menuId+"_"+number) != null)
			height = height + document.getElementById("lb" + menuId + "_" + number).offsetHeight;
		else
			height = height + document.getElementById(menuId+"_"+number).offsetHeight;

		number = number + 1;
	}
	arOpenMenusHeight[lengthArray] = height;

	if (document.getElementById("lb"+menuId+"_1") != null)
		arOpenMenusWidth[lengthArray] = document.getElementById("lb" + menuId + "_1").offsetWidth;
	else
		arOpenMenusWidth[lengthArray] = document.getElementById(menuId+"_1").offsetWidth;

	lengthArray = lengthArray + 1;

    if (hideWindowedControls == "true") 
	{
      showAllObjects();
      showWindowedObjects(false,null);
    }
	
	if (fadeSpeed == "0")
	{
		if (changeObjectVisibility(menuId, 'visible')) 
		{
			document.getElementById(menuId).style.filter = "";
			return true;
	    } 
		else 
			return false;
	}
	else 
	{
		if (typeof(fade) == "function") 
		{
			if (firstTime == true)
			{
				fade(menuId, true, parseInt(fadeSpeed));
			}
		}
	}
}

function showSideMenu(menuNumber, eventObj, align,ID) 
{
	menuId = ID.substring(0,ID.indexOf('_'));

	idArray[idArray.length] = ID;

	if (rootMenu == null)
	{
		rootMenu = 'lb' + ID;
	}
	else if (rootMenu != 'lb' + ID)
	{
		if (ID.substring(0,ID.indexOf("_")) == rootMenu.substring(2,rootMenu.indexOf("_")))
		{
			normalButton(rootMenu,rootItemBorderColor,rootFontColor);
		}
		else
		{
			normalButton(rootMenu,oldRootItemBorderColor,oldRootFontColor);
		}

		rootMenu = 'lb' + ID;
	}

	pressedButton('lb' + ID);
	idName = ID.substring(0,ID.indexOf('_'));

	hideAllMenus(ID);

	var x = 10;		
	var menuTop = 100;
	var menu = getStyleObject(ID);
	x = getElementLeft('lb'+ID);

	menuTop = getElementTop('lbl'+ID);

	if ((navigator.userAgent.indexOf("Opera 5")!=-1) ||(navigator.userAgent.indexOf("Opera/5")!=-1)) 
	{
		menuTop = getElementTop('l'+ID);

		menu.pixelTop=menuTop + menuLabelBulletHeight;
 		menu.pixelLeft=x;
	} 
	else
	{
		menu.position = "absolute";

		menu.left=(x + getElementWidth('lb'+ID) + 2 * rootItemBorderWidth) + 'px';
		menu.top = menuTop;
	}

	var menuBox = getStyleObject('lb'+ ID);

	var menuId = ID;
	menuActive[menuNumber] = true;
	var firstTime = true;
	if (activeMenu[menuNumber] == ID)
		firstTime = false;

	activeMenu[menuNumber] = ID;

	arOpenMenusId[lengthArray] = menuId;
	var number = 1;
	var height = 0;

	while ((document.getElementById("lb" + menuId + "_" + number) != null) || (document.getElementById(menuId+"_"+number) != null))
	{
		if (document.getElementById("lb"+menuId+"_"+number) != null)
			height = height + document.getElementById("lb" + menuId + "_" + number).offsetHeight;
		else
			height = height + document.getElementById(menuId+"_"+number).offsetHeight;

		number = number + 1;
	}
	arOpenMenusHeight[lengthArray] = height;

	if (document.getElementById("lb"+menuId+"_1") != null)
		arOpenMenusWidth[lengthArray] = document.getElementById("lb" + menuId + "_1").offsetWidth;
	else
		arOpenMenusWidth[lengthArray] = document.getElementById(menuId+"_1").offsetWidth;

	lengthArray = lengthArray + 1;

    if (hideWindowedControls == "true") 
	{
      showAllObjects();
      showWindowedObjects(false,null);
    }
	
	if (fadeSpeed == "0")
	{
		if (changeObjectVisibility(menuId, 'visible')) 
		{
			document.getElementById(menuId).style.filter = "";
			return true;
	    } 
		else 
			return false;
	}
	else 
	{
		if (typeof(fade) == "function") 
		{
			if (firstTime == true)
			{
				fade(menuId, true, parseInt(fadeSpeed));
			}
		}
	}
}

function showSideMenuBlank(menuNumber, eventObj,ID) 
{
	hideAllMenus();
	menuActive[menuNumber] = true;
	activeMenu[menuNumber] = ID;

	if (rootMenu == null)
	{
		rootMenu = 'lb' + ID;
	}
	else if (rootMenu != 'lb' + ID)
	{
		if (ID.substring(0,ID.indexOf("_")) == rootMenu.substring(2,rootMenu.indexOf("_")))
			normalButton(rootMenu,rootItemBorderColor,rootFontColor);
		else
			normalButton(rootMenu,oldRootItemBorderColor,oldRootFontColor);

		rootMenu = 'lb' + ID;
	}

	pressedButton('lb' + ID);
}

function showSubMenu(menuNumber, eventObj, tier, myAlign, ID) 
{
   	hideAllMenusTier(tier,ID);

	var x = 10;
	var menuTop = 100;
	var menu = getStyleObject(ID);

	x = getElementLeft('l'+ID) + (parseInt(itemSpace) * 2);
	menuTop = getElementTop('l'+ID);

	if ((navigator.userAgent.indexOf("Opera 5")!=-1) ||(navigator.userAgent.indexOf("Opera/5")!=-1)) 
	{
		menu.pixelTop = menuTop ;
		menu.pixelLeft = (x - menuWidths[menuNumber] - menuItemBulletWidth);
		menu.position = "absolute";
	} 
	else 
	{
		menu.top = menuTop + 'px';
 		menu.left = (x - menuWidths[menuNumber] - menuItemBulletWidth) + 'px';
		menu.position = "absolute";
		menu.left = x + 20 + 2;
	}
	var menuBox = getStyleObject('lb'+ID);
	document.getElementById(ID + 't').style.color = hoverFontColor;
	document.getElementById('l' + ID).style.color = hoverFontColor;

	if (Browser != "IE") 
	{
		menuBox.backgroundColor = hoverColor;	
		document.getElementById(ID + 't').style.backgroundColor = hoverColor;
		if (document.getElementById(ID + 'i') != null)
			document.getElementById(ID + 'i').style.backgroundColor = hoverColor;
	}
	else 
	{
		if (hoverColorTo != "null") 
		{
	        if (hoverDirection == "1") 
			{
				if (document.getElementById(ID + "i") != null)
  				document.getElementById(ID + "i").style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=" + hoverColor + ",EndColorStr=" + hoverColor3 + ")";	  

				menuBox.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=" + hoverColor + ",EndColorStr=" + hoverColorTo + ")";
				document.getElementById(ID+"t").style.background = "";

				document.getElementById(ID + "t").style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=" + hoverColor3 + ",EndColorStr=" + hoverColor4 + ")";
				if (document.getElementById("l"+ID) != null)
				{
					document.getElementById("l" + ID).style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=" + hoverColor4 + ",EndColorStr=" + hoverColorTo + ")";       
				}
			}
			else 
			{
				if (document.getElementById(ID + "i") != null)
					document.getElementById(ID + "i").style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=" + hoverColor + ",EndColorStr=" + hoverColorTo + ")";	  
	
				menuBox.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=" + hoverColor + ",EndColorStr=" + hoverColorTo + ")";
				document.getElementById(ID+"t").style.background = "";
			}
		}
		else 
		{
			menuBox.backgroundColor = hoverColor;	
			document.getElementById(ID + 't').style.backgroundColor = hoverColor;
			var temp;

			if (document.getElementById(ID + "i") != null) 
			{
				if (document.getElementById(ID + "i").style.filter != "")
					document.getElementById(ID + "i").style.filter = "";

				document.getElementById(ID + 'i').style.backgroundColor = hoverColor;
				if (useBorderWidth == true)
				{
					temp = document.getElementById(ID +"i");
					temp.style.borderLeft = "1 solid " + hoverBorderColor;
					temp.style.borderTop = "1 solid " + hoverBorderColor;
					temp.style.borderBottom = "1 solid " + hoverBorderColor;
					temp.style.borderRight = "1 solid " + hoverColor;
				}
			}
		
			if (useBorderWidth == true) 
			{
				var temp;
				temp = document.getElementById(ID +"t");
			    temp.style.borderBottom = "1 solid " + hoverBorderColor;
				temp.style.borderTop = "1 solid " + hoverBorderColor;
				if (document.getElementById(ID + "i") != null)
			        temp.style.borderLeft = "1 solid " + hoverColor;
				else
			        temp.style.borderLeft = "1 solid " + hoverBorderColor;

				temp.style.borderRight = "1 solid " + hoverColor;

				temp = document.getElementById(ID +"o");

				if (temp == null)
					temp = document.getElementById("l" + ID);

				temp.style.borderBottom = "1 solid " + hoverBorderColor;
				temp.style.borderTop = "1 solid " + hoverBorderColor;
				temp.style.borderRight = "1 solid " + hoverBorderColor;
			    temp.style.borderLeft = "1 solid " + hoverColor;
		    }		
		}
	}
	menuActive[menuNumber] = true;

	var firstTime = true;

	if (activeMenu[menuNumber] == ID)
		firstTime = false;

	activeMenu[menuNumber] = ID;
    var menuId = ID;
	arOpenMenusId[lengthArray] = menuId;
	var number = 1;
	var height = 0;

	while ((document.getElementById("lb" + menuId + "_" + number) != null) || (document.getElementById(menuId+"_"+number) != null))
	{

		if (document.getElementById("lb"+menuId+"_"+number) != null)
			height = height + document.getElementById("lb" + menuId + "_" + number).offsetHeight;
		else
			height = height + document.getElementById(menuId+"_"+number).offsetHeight;

		number = number + 1;
	}

	if (document.getElementById("lb"+menuId+"_"+number) != null)
	  arOpenMenusWidth[lengthArray] = document.getElementById("lb" + menuId + "_1").offsetWidth;
	else
	  arOpenMenusWidth[lengthArray] = document.getElementById(menuId+"_1").offsetWidth;

	arOpenMenusHeight[lengthArray] = height;
    lengthArray = lengthArray + 1;
 
    if (hideWindowedControls == "true")
	  showWindowedObjects(false,null);

	if (fadeSpeed == "0")
		changeObjectVisibility(menuId, 'visible');
	else
	{
		if (typeof(fade) == "function") 
		{
			if (firstTime)
				fade(menuId, true, parseInt(fadeSpeed));
		}
	}
}

function hideAllMenus(ID) 
{
    for(counter = 1; counter <= numMenus; counter++) 
	{
		if (menuActive[counter] == true) 
		{
			if (ID != activeMenu[counter])
			{
				if (fadeSpeed == "0") 
					changeObjectVisibility(activeMenu[counter], 'hidden');
				else 
				{
				    if (typeof(fade) == "function") 
						fade(activeMenu[counter], false,parseInt(fadeSpeed));
				}
			}
						
			menuActive[counter] = false;

			var menuBox = getStyleObject('lb'+activeMenu[counter]);
			
			if (document.getElementById('lb' + activeMenu[counter]).className.indexOf('root') == -1)
			{
				document.getElementById(activeMenu[counter] + "t").style.color = foreColor;
				document.getElementById('l' + activeMenu[counter]).style.color = foreColor;

				if (Browser != "IE") 
				{
					document.getElementById(activeMenu[counter] + "t").style.color = foreColor;

					if (useImg == "True")
					{
						menuBox.backgroundColor = "transparent";
						document.getElementById(activeMenu[counter] + "t").style.backgroundColor = "transparent";
					}
					else
					{
						menuBox.backgroundColor = itemColor;
						document.getElementById(activeMenu[counter] + "t").style.backgroundColor = itemColor;
					}

					if (document.getElementById(activeMenu[counter] + "i") != null)
						document.getElementById(activeMenu[counter] + "i").style.backgroundColor = iconBackgroundColor;
				}
				else 
				{
					if (menuBox.filter != "") 
					{
						menuBox.filter = "";
						document.getElementById(activeMenu[counter] + "t").style.color = foreColor;
						document.getElementById(activeMenu[counter] + "t").style.filter = "";
						if (document.getElementById(activeMenu[counter] + "i") != null)
						{
							if (iconBackgroundColorTo != "")
							{
								document.getElementById(activeMenu[counter] + "i").style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=" 
									+ iconBackgroundColor + ",EndColorStr=" + iconBackgroundColorTo + ")";
							}
							else
								document.getElementById(activeMenu[counter] + "i").style.filter = "";
						}

						if (document.getElementById("l" + activeMenu[counter]) != null)
						{
							document.getElementById("l" + activeMenu[counter]).style.filter = "";       
							document.getElementById("l" + activeMenu[counter]).style.color = foreColor;
						}
	
						if (parseInt(opacityValue) < 100)
							menuBox.filter = "alpha(opacity=" + opacityValue + ")";
					}
					else 
					{
						document.getElementById(activeMenu[counter] + "t").style.color = foreColor;

						var temp;
						if (document.getElementById(activeMenu[counter] + "i") != null) 
						{
							if (iconBackgroundColorTo != "")
							{
								document.getElementById(activeMenu[counter] + "i").style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=" 
									+ iconBackgroundColor + ",EndColorStr=" + iconBackgroundColorTo + ")";
							}
	
							document.getElementById(activeMenu[counter] + "i").style.backgroundColor = iconBackgroundColor;
							if (useBorderWidth == true)
							{
								temp = document.getElementById(activeMenu[counter] + "i");
								temp.style.borderLeft = "1 solid " + iconBackgroundColor;
								temp.style.borderTop = "1 solid "  + iconBackgroundColor;
								temp.style.borderBottom = "1 solid " + iconBackgroundColor;
								temp.style.borderRight = "1 solid " + iconBackgroundColor;
							}
						}

						if (useBorderWidth)
						{
							temp = document.getElementById(activeMenu[counter] + "t");
							temp.style.borderBottom = "1 solid " + itemColor;
							temp.style.borderTop = "1 solid " + itemColor;
							temp.style.borderLeft = "1 solid " + itemColor;
						    temp.style.borderRight = "1 solid " + itemColor;

							temp = document.getElementById(activeMenu[counter] + "o");
							if (temp == null)
								temp = document.getElementById("l" + activeMenu[counter]);

							if (temp != null)
							{
								temp.style.borderBottom = "1 solid " + itemColor;
								temp.style.borderTop = "1 solid " + itemColor;
								temp.style.borderRight = "1 solid " + itemColor;
								temp.style.borderLeft = "1 solid " + itemColor;
							}
						}

						if (useImg == "True")
						{
							menuBox.backgroundColor = "transparent";
							document.getElementById(activeMenu[counter] + "t").style.backgroundColor = "transparent";					
						}
						else
						{
							menuBox.backgroundColor = itemColor;
							document.getElementById(activeMenu[counter] + "t").style.backgroundColor = itemColor;
						}
					}
				}
			}

			var i;
			var found;
			for (i=0;i<arOpenMenusId.length;i++) 
			{
				found = AreStringsEqual(arOpenMenusId[i].toUpperCase(),activeMenu[counter].toUpperCase());
			    if (found == true)
					break;
	        }
 
		    if (found == true) 
			{
				arOpenMenusId[i] = "-----------";
				arOpenMenusWidth[i] = 0;
            }

			if (ID != activeMenu[counter])
			{
				activeMenu[counter] = null;	
			}
		}
	}
	
	if (hideWindowedControls == "true")
	{
		showAllObjects();
	}
}

function showAllObjects() 
{
    if (ctrlArray.length > 0)
    {
		for (var k=0;k<ctrlArray.length;k++ )
		{
			ctrlArray[k].style.visibility = "visible";
			ctrlArray[k] == null;
		}
		ctrlArray.length = 0;
		menuArray.length = 0;
		lengthAr = 0;
    }
}

function AreStringsEqual(string1, string2) 
{
  var len = string1.length;
 
  if (len != string2.length) return false;  
    for (var k=0; k<len; k++)
     if (string1.charAt(k) != string2.charAt(k)) return false;
       return true;
}

function hideAllMenusTier(tierNum,ID) 
{
    for(counter = 1; counter <= numMenus; counter++) 
	{
		if (menuActive[counter] == true) 
		{
			if (tier[counter] > tierNum) 
			{
				if (ID != activeMenu[counter])
					changeObjectVisibility(activeMenu[counter], 'hidden');

				menuActive[counter] = false;

				var menuBox = getStyleObject('lb'+activeMenu[counter]);
				document.getElementById(activeMenu[counter] + "t").style.color = foreColor;
				document.getElementById('l' + activeMenu[counter]).style.color = foreColor;

				if (Browser != "IE") 
				{
					if (useImg == "True")
					{
						menuBox.backgroundColor ="transparent";				
						document.getElementById(activeMenu[counter] + "t").style.backgroundColor = "transparent";
					}
					else
					{
						menuBox.backgroundColor =itemColor;				
						document.getElementById(activeMenu[counter] + "t").style.backgroundColor = itemColor;
					}
					if (document.getElementById(activeMenu[counter] + "i") != null)
						document.getElementById(activeMenu[counter] + "i").style.backgroundColor = iconBackgroundColor;

					document.getElementById(activeMenu[counter] + "t").style.color = foreColor;
				}
				else
				{
					if (menuBox.filter != "") 
					{
						menuBox.filter = "";
						document.getElementById(activeMenu[counter] + "t").style.filter = "";
						document.getElementById(activeMenu[counter] + "t").style.color = foreColor;
						if (document.getElementById(activeMenu[counter] + "i") != null)
						{
							if (iconBackgroundColorTo != "")
							{
								document.getElementById(activeMenu[counter] + "i").style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=" 
									+ iconBackgroundColor + ",EndColorStr=" + iconBackgroundColorTo + ")";
							}
							else
								document.getElementById(activeMenu[counter] + "i").style.filter = "";
						}

						if (document.getElementById("l" + activeMenu[counter]) != null)
						{
							document.getElementById("l" + activeMenu[counter]).style.filter = "";       
							document.getElementById("l" + activeMenu[counter]).style.color = foreColor;       

						}

						if (parseInt(opacityValue) < 100)
							menuBox.filter = "alpha(opacity=" + opacityValue + ")";											
					}
					else 
					{
						if (useImg == "True")
						{
							menuBox.backgroundColor="transparent";
							document.getElementById(activeMenu[counter] + "t").style.backgroundColor = "transparent";
						}
						else
						{
							menuBox.backgroundColor=itemColor;
							document.getElementById(activeMenu[counter] + "t").style.backgroundColor = itemColor;
						}
						document.getElementById(activeMenu[counter] + "t").style.color = foreColor;
						var temp;
						if (document.getElementById(activeMenu[counter] + "i") != null)
						{
							if (iconBackgroundColorTo != "")
							{
								document.getElementById(activeMenu[counter] + "i").style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=" 
									+ iconBackgroundColor + ",EndColorStr=" + iconBackgroundColorTo + ")";
							}
					
							document.getElementById(activeMenu[counter] + "i").style.backgroundColor = iconBackgroundColor;
							
							if (useBorderWidth == true)
							{
								temp = document.getElementById(activeMenu[counter] + "i");
								temp.style.borderLeft = "1 solid " + iconBackgroundColor;
								temp.style.borderTop = "1 solid "  + iconBackgroundColor;
								temp.style.borderBottom = "1 solid " + iconBackgroundColor;
								temp.style.borderRight = "1 solid " + iconBackgroundColor;
							}
						}

						if (useBorderWidth)
						{
							temp = document.getElementById(activeMenu[counter] + "t");
							temp.style.borderBottom = "1 solid " + itemColor;
							temp.style.borderTop = "1 solid " + itemColor;
							temp.style.borderLeft = "1 solid " + itemColor;
						    temp.style.borderRight = "1 solid " + itemColor;

							temp = document.getElementById(activeMenu[counter] + "o");
							if (temp == null)
								temp = document.getElementById("l" + activeMenu[counter]);

							if (temp != null)
							{
								temp.style.borderBottom = "1 solid " + itemColor;
								temp.style.borderTop = "1 solid " + itemColor;
								temp.style.borderRight = "1 solid " + itemColor;
								temp.style.borderLeft = "1 solid " + itemColor;
							}
						}
					}
				}

			    var i;
				var found;
				for (i=0;i<arOpenMenusId.length;i++) 
				{
                  found = AreStringsEqual(arOpenMenusId[i].toUpperCase(),activeMenu[counter].toUpperCase());
                  if (found == true)
                    break;
                }

				if (hideWindowedControls == "true")
				{
					showWindowedObjects(true,activeMenu[counter]);
				}

				if (found == true) 
				{
                  arOpenMenusId[i] = "-----------";
                  arOpenMenusWidth[i] = 0;
	            }

				if (ID != activeMenu[counter])
					activeMenu[counter] = null;
			}
    	}
	}
}
		
function setProperties(visProps,id) 
{
	if (menuProp != id)
	{
		menuProp = id;
		if ((idName != null) && (idName != id))
			hideAllMenus();

		hoverColor = visProps[0];
		hoverColorTo = visProps[1];
		itemColor = visProps[2];
		rootItemColor = visProps[3];
		rootItemColorTo = visProps[4];
		oldRootItemBorderColor = rootItemBorderColor;
		rootItemBorderColor = visProps[5];
	
		if (visProps[6] == "0")
			openOnClick = true;
		else
			openOnClick = false;

		oldIconBackgroundColor = iconBackgroundColor;
		iconBackgroundColor = visProps[7];

		if (visProps[8] != "none")
		{
			hoverColor3 = visProps[8];
			hoverColor4 = visProps[9];
		}
		hoverDirection = visProps[10];

		hideWindowedControls = visProps[11];
		hoverFontColor = visProps[12];
		if (foreColor != null)
			oldForeColor = foreColor;
		else
			oldForeColor = visProps[13];

		foreColor = visProps[13];

		if (visProps[14] == "-1")
			useBorderWidth = true;
		else
			useBorderWidth = false;

		hoverBorderColor = visProps[15];
		rootItemBorderWidth = visProps[16];
		rootHoverColor = visProps[17];
		oldRootFontColor = rootFontColor;
		rootFontColor = visProps[18];
		opacityValue = visProps[19];
		fadeSpeed = visProps[20];
		showIcons = visProps[21];
		rootItemHoverColor = visProps[25];
	    rootItemHoverColorTo = visProps[26];
		rootItemBorderHoverColor = visProps[27];
		rootItemDownColor = visProps[28];
	    rootItemDownColorTo = visProps[29];

		if (Browser != "Moz")
			itemSpace = visProps[22];
		else
			itemSpace = "0";

		useImg = visProps[23];

		if (visProps[24] != "")
			iconBackgroundColorTo = visProps[24];
		else
			iconBackgroundColorTo = "";
	}
}

function setPropsTier(arrayProp) 
{
	if (typeof(p_hideAllMenus) == "function") 
	{
		p_hideAllMenus();
	}


	for (i=0;i<arrayProp.length; i++)
	{
		tier[i] = arrayProp[i];
	}
}
	
function startMenuBar(width, arProp,visProp,subMenuImg) 
{
	if (subMenuImg)
		subMenuGlyph = subMenuImg;
	else
		subMenuGlyph = "";

	document.write('<table onmouseover="setPropsTier(' + arProp + '); setProperties(' + visProp + ',\'' + visProp.substring(0,visProp.length - 5) + '\')" width="' + width + '" cellpadding="0" cellspacing="0" border="0"><tr>');	
}
	
function endMenuBar() 
{
	document.write('</tr>');
	document.write('</table>\n');
}

function startMenu(menuNumber, width, tierNum, border,ID,zindex,backgroundImg,opacity) 
{
	menuWidths[menuNumber] = width;
	
	var style = "";
	document.write('<div style="position:absolute;z-index:' + zindex + ';" id="' + ID + '" name="' + ID + '" class="myMenu">');

	if (backgroundImg == "")
		document.write('<table ' + style + ' cellpadding="0" cellspacing="0" border="1">');
	else
		document.write('<table '  + style + ' background="' + backgroundImg + '" cellpadding="0" cellspacing="0" border="1">');
}
	
function endMenu() 
{
	document.write('</table></div>');
}

function menuItemHighlight(el,tier) 
{
	document.getElementById(el.id + "t").style.color = hoverFontColor;

	if (Browser != "IE")
	{
		el.style.background = hoverColor;
		document.getElementById(el.id + "t").style.background = hoverColor;
		document.getElementById(el.id + "o").style.background = hoverColor;
		if (document.getElementById(el.id + "i") != null)
			document.getElementById(el.id + "i").style.background = hoverColor;
	}
	else 
	{
		if (hoverColorTo != "null")
		{
	      if (hoverDirection == "1") 
		  {
			if (document.getElementById(el.id + "i") != null)
		        document.getElementById(el.id + "i").style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=" + hoverColor + ",EndColorStr=" + hoverColor3 + ")";	  
	
			document.getElementById(el.id + "t").style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=" + hoverColor3 + ",EndColorStr=" + hoverColor4 + ")";
	        document.getElementById(el.id+"o").style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=" + hoverColor4 + ",EndColorStr=" + hoverColorTo + ")";

	        el.style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=" + hoverColor + ",EndColorStr=" + hoverColorTo + ")";
		  }
	      else 
		  {
			if (document.getElementById(el.id + "i") != null)
				document.getElementById(el.id + "i").style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=" + hoverColor + ",EndColorStr=" + hoverColorTo + ")";	  

			document.getElementById(el.id + "t").style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=" + hoverColor + ",EndColorStr=" + hoverColorTo + ")";
	        el.style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=" + hoverColor + ",EndColorStr=" + hoverColorTo + ")";
	        document.getElementById(el.id + "o").style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=" + hoverColor + ",EndColorStr=" + hoverColorTo + ")";
		  }
		}
		else 
		{
			el.style.background = hoverColor;

			document.getElementById(el.id + "t").style.background = hoverColor;
			document.getElementById(el.id + "o").style.background = hoverColor;
			if (document.getElementById(el.id + "i") != null) 
			{
				document.getElementById(el.id + "i").style.filter = "";
				document.getElementById(el.id + "i").style.background = hoverColor;
				if (useBorderWidth == true)
				{
					temp = document.getElementById(el.id +"i");
					temp.style.borderLeft = "1 solid " + hoverBorderColor;
					temp.style.borderTop = "1 solid " + hoverBorderColor;
					temp.style.borderBottom = "1 solid " + hoverBorderColor;
					temp.style.borderRight = "1 solid " + hoverColor;
				}
			}
			if (useBorderWidth == true) 
			{
				var temp;
				temp = document.getElementById(el.id +"t");
			    temp.style.borderBottom = "1 solid " + hoverBorderColor;
  				temp.style.borderTop = "1 solid " + hoverBorderColor;
				if (document.getElementById(el.id + "i") != null)
			        temp.style.borderLeft = "1 solid " + hoverColor;
				else
			        temp.style.borderLeft = "1 solid " + hoverBorderColor;

		        temp.style.borderRight = "1 solid " + hoverColor;
				temp = document.getElementById(el.id +"o");
				temp.style.borderBottom = "1 solid " + hoverBorderColor;
				temp.style.borderTop = "1 solid " + hoverBorderColor;
				temp.style.borderRight = "1 solid " + hoverBorderColor;
			    temp.style.borderLeft = "1 solid " + hoverColor;
		    }
		}
	}
	menuOver(); 
	hideAllMenusTier(tier);
}

function menuItemNormal(el,e) 
{
	document.getElementById(el.id + "t").style.color = foreColor;

	if (Browser != "IE") 
	{
		if (useImg == "True")
		{
			el.style.background = "transparent";
			document.getElementById(el.id + "t").style.background = "transparent";
			document.getElementById(el.id + "o").style.background = "transparent";

			if (document.getElementById(el.id + "i") != null)
			{
				if (document.getElementById(el.id+"i").className.indexOf("checked") != -1)
					document.getElementById(el.id+"i").style.background = hoverColor;
				else
					document.getElementById(el.id + "i").style.background = iconBackgroundColor;
			}
		}
		else
		{
			el.style.background = itemColor;
			document.getElementById(el.id + "t").style.background = itemColor;
			document.getElementById(el.id + "o").style.background = itemColor;

			if (document.getElementById(el.id + "i") != null)
			{
				if (document.getElementById(el.id+"i").className.indexOf("checked") != -1)
					document.getElementById(el.id+"i").style.background = hoverColor;
				else
					document.getElementById(el.id + "i").style.background = iconBackgroundColor;
			}
		}
	}
	else 
	{
		if (el.style.filter != "")
		{
			el.style.filter = "";
			document.getElementById(el.id + "t").style.filter = "";
			if (document.getElementById(el.id + "i") != null)
			{
				/*
				if(iconBackgroundColorTo != "")
					document.getElementById(el.id + "i").style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=" + iconBackgroundColor + ",EndColorStr=" + iconBackgroundColorTo + ")";
				else
					document.getElementById(el.id + "i").style.filter = "";
				*/
				
				if(iconBackgroundColorTo != "")
					document.getElementById(el.id + "i").style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=" + iconBackgroundColor + ",EndColorStr=" + iconBackgroundColorTo + ")";
				else
				{
					if (document.getElementById(el.id +"i").className.indexOf("checked") != -1)
						document.getElementById(el.id + "i").style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=" + hoverColor + ",EndColorStr=" + hoverColorTo + ")";
					else
						document.getElementById(el.id + "i").style.filter = "";
				}
			}

			document.getElementById(el.id+"o").style.filter = "";
			if (parseInt(opacityValue) < 100)
				el.style.filter = "alpha(opacity=" + opacityValue + ")";
		}
		else 
		{
			var temp;

			if (useImg == "True")
			{
				el.style.background = "transparent";
				document.getElementById(el.id + "t").style.background = "transparent";
				document.getElementById(el.id + "o").style.background = "transparent";
			}
			else
			{
				el.style.background = itemColor;
				document.getElementById(el.id + "t").style.background = itemColor;
				document.getElementById(el.id + "o").style.background = itemColor;
			}

			if (useBorderWidth == true)
			{
				temp = document.getElementById(el.id +"t");
				temp.style.borderBottom = "1 solid " + itemColor;
				temp.style.borderTop = "1 solid " + itemColor;
				temp.style.borderLeft = "1 solid " + itemColor;
			    temp.style.borderRight = "1 solid " + itemColor;
				temp = document.getElementById(el.id + "o");
				temp.style.borderBottom = "1 solid " + itemColor;
				temp.style.borderTop = "1 solid " + itemColor;
				temp.style.borderRight = "1 solid " + itemColor;
				temp.style.borderLeft = "1 solid " + itemColor;
			}

			if (document.getElementById(el.id + "i") != null) 
			{
				if (iconBackgroundColorTo != "")
				{
					document.getElementById(el.id + "i").style.filter = "";
			        document.getElementById(el.id + "i").style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=" + iconBackgroundColor 
						+ ",EndColorStr=" + iconBackgroundColorTo + ")";
				}

				//document.getElementById(el.id + "i").style.background = iconBackgroundColor;
				if (document.getElementById(el.id+"i").className.indexOf("checked") != -1)
					document.getElementById(el.id + "i").style.background = hoverColor;
				else
					document.getElementById(el.id + "i").style.background = iconBackgroundColor;


				if (useBorderWidth == true)
				{
					temp = document.getElementById(el.id + "i");
					temp.style.borderLeft = "1 solid " + iconBackgroundColor;
					temp.style.borderTop = "1 solid "  + iconBackgroundColor;
					temp.style.borderBottom = "1 solid " + iconBackgroundColor;
					temp.style.borderRight = "1 solid " + iconBackgroundColor;
				}
			}
		}
	}
	menuOut();
}

function raiseButton(el) 
{
	var element = document.getElementById(el);
	element.style.color = rootHoverColor;

    if (rootItemHoverColor != "") {
	  if ((rootItemHoverColorTo != "") && (Browser = "IE"))	{
		element.style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=" + rootItemHoverColor + ",EndColorStr=" + rootItemHoverColorTo + ")";	  
 	  } else {
		element.style.background = rootItemHoverColor;  	
	  }
	}

    if (rootItemBorderHoverColor != "") {
  	  element.style.borderColor = rootItemBorderHoverColor;
  	}
	else
	if (Browser == "IE")
	{
	    element.style.borderTop = rootItemBorderWidth + " solid buttonhighlight";
		element.style.borderLeft = rootItemBorderWidth + " solid buttonhighlight";
		element.style.borderBottom = rootItemBorderWidth + " solid buttonshadow";
		element.style.borderRight = rootItemBorderWidth + " solid buttonshadow";
		element.style.padding ="1";
	    element.style.paddingLeft = "7";
		element.style.paddingRight = "7";
	}
}

function pressedButton(el) 
{
	var element = document.getElementById(el);

  	element.style.color = rootHoverColor;

    if (rootItemDownColor != "") {
	  if ((rootItemDownColorTo != "") && (Browser = "IE"))	{
		element.style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=" + rootItemDownColor + ",EndColorStr=" + rootItemDownColorTo + ")";	  
 	  } else {
		element.style.background = rootItemDownColor;  			
	  }
	}

    if (rootItemBorderHoverColor != "") {
  	  element.style.borderColor = rootItemBorderHoverColor;
  	}
	else
	if (Browser == "IE") 
	{
		element.style.borderTop = rootItemBorderWidth + " solid buttonshadow";
		element.style.paddingTop = "2";
	    element.style.borderLeft = rootItemBorderWidth + " solid buttonshadow";
	    element.style.paddingLeft = "8";
	    element.style.borderBottom = rootItemBorderWidth + " solid buttonhighlight";
	    element.style.paddingBottom= "0";
	    element.style.borderRight = rootItemBorderWidth + " solid buttonhighlight";
	    element.style.paddingRight = "6";
	}
}

function normalButton(el,brdColor,rootFColor) 
{
	var element = document.getElementById(el);


	if (element != null)
	{
		element.style.color = rootFColor;

        if (rootItemHoverColor != "") {
      	  if ((rootItemColorTo != "") && (Browser = "IE")) {
	        element.style.filter = "progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=" + rootItemColor + ",EndColorStr=" + rootItemColorTo + ")";	  
     	  } else {
   	        element.style.background = rootItemColor;
    	  }
     	}

		if (rootItemBorderHoverColor != "")
		{
			element.style.borderColor = rootItemBorderColor;
		}

		if (Browser == "IE") {
			element.style.border = rootItemBorderWidth + " solid " + brdColor;
			element.style.padding ="1";
			element.style.paddingLeft = "7";
			element.style.paddingRight = "7";
		}
	}
}

function getBrowser() 
{
	if (navigator.appName.indexOf("Microsoft") != -1)
	{
		if (window.opera)
			Browser = "Opera";
		else
			Browser = "IE";
	}
	else
	{
		if (navigator.userAgent.toLowerCase().indexOf("netscape") > -1)
			Browser = "NS";
		else
			Browser = "Moz";
	}
}
	
function menuItem(label, menuItemNumber, tier, ID,imgSource,showIcon,iconColor,itemHeight,opacity,useImage,itemSpacing,clientScript,enabled,checked,iconColorTo) 
{		
	menuId = ID.substring(0,ID.indexOf("_"));

	var width;
	if (useBorderWidth)
		height = itemHeight - 2;
	else
		height = itemHeight;

	document.write('<tr><td height="' + height + 'px" id="' + ID + '"');

	if (enabled == "True")
	{
		document.write(' onMouseover="menuItemHighlight(this,' + tier + ');" ');
		document.write('onMouseout = "menuItemNormal(this,event);" ');

		if (clientScript == "False")
		{
			document.write(' onclick="' + ID.substring(0,ID.indexOf('_')) + 'SubmitValue(\'' + ID + '\');"');
		}
	}

	document.write('width="100%" valign="middle" ');

	if (opacity != 100)
		document.write('style="cursor:pointer;cursor:hand;border:0;filter:alpha(opacity=' + opacity + ')"');
	else
		document.write('style="cursor:pointer;cursor:hand;border:0"');
	
	document.write('><div id="' + ID + 'div" name="' + ID + 'div" style="height:' + height + 'px">');

	if (Browser == "Moz")
		itemSpacing = "0";

	if (useImage == "True")
		document.write('<table width=100% cellspacing="0" cellpadding="' + itemSpacing + '" height="' + height + 'px" border="0"><tr>');
	else
		document.write('<table width=100% cellspacing="0" cellpadding="' + itemSpacing + '" height="' + height + 'px" border="0" bgcolor="' + itemColor + '"><tr>');

	if (showIcon == "True")
	{
		var classIcon = "";
		if (checked == "True")
			classIcon = 'class="' + menuId + 'checked"';

		var filter = "";
		if ((iconColorTo != "") && (Browser == "IE"))
			filter = 'filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=' + iconColor + ',EndColorStr=' + iconColorTo + ')';	  

		if (useBorderWidth)
			document.write('<td ' + classIcon + ' width="20px" height="' + height + 'px" bgcolor="' + iconColor + '" id="' + ID + 'i" style="border:1 solid ' + iconColor + ';' + filter + '">');
		else
			document.write('<td ' + classIcon + ' width="20px" height="' + height + 'px" bgcolor="' + iconColor + '" id="' + ID + 'i" style="' + filter +'">');

		if (window.opera)
			document.write('<div style="overflow:hidden;height:' + height + 'px;width:19px">');
		else
			document.write('<div style="overflow:hidden;height:' + height + 'px;width:20px">');

		if (checked == "True")
			document.write('a');
		else
		{
			if (imgSource != "")
				document.write('<img src="' + imgSource + '" border="0" align="left" id="' + ID + 'img">');
			else
				document.write('&nbsp;');
		}

		document.write('</div></td>');
	}
		
	var clients = "";
	if (clientScript == "True")
		clients = 'onclick="' + ID + '(this);"';

	if (useBorderWidth)
	{
		if (enabled == "True")
			document.write('<td ' + clients + ' height="' + height + 'px" class="' + menuId + 'textItem" nowrap id="' + ID + 't" style="border:1 solid ' + itemColor + '">');
		else
			document.write('<td ' + clients + ' height="' + height + 'px" class="' + menuId + 'disabled" nowrap id="' + ID + 't" style="border:1 solid ' + itemColor + '">');
	}
	else
	{
		if (enabled == "True")
			document.write('<td ' + clients + ' height="' + height + 'px" class="' + menuId + 'textItem" nowrap id="' + ID + 't">');
		else
			document.write('<td ' + clients + ' height="' + height + 'px" class="' + menuId + 'disabled" nowrap id="' + ID + 't">');
	}

	document.write('<div style="overflow:hidden;height:' + height + 'px">&nbsp;' + label);
	if (useBorderWidth)
		document.write('</div></td><td height="' + height + 'px" width="20px" id="' + ID + 'o" style="border:1 solid ' + itemColor + '">&nbsp;</td></tr></table>');
	else
		document.write('</td><td width="20px" id="' + ID + 'o" height="' + height + 'px" >&nbsp;</td></tr></table>');

	document.write('</div></td></tr>');
}
		
function menuSpacer(sepColor,ID,showIcon, opacity,itemSpacing,itemColor,iconBackgroundColor,iconColorTo) 
{		
	document.write('<tr>');
	
	if (useImg == "True")
	{
		if (opacity < 100)
			document.write('<td id="' + ID + '" style="border:0;filter:alpha(opacity=' + opacity + ');">');
		else
			document.write('<td id="' + ID + '" style="border:0">');
	}
	else
	{
		if (opacity < 100)
			document.write('<td id="' + ID + '" bgcolor="' + itemColor + '" style="border:0;filter:alpha(opacity=' + opacity + ');">');
		else
			document.write('<td id="' + ID + '" style="border:0" bgcolor="' + itemColor + '">');
	}

	if (Browser == "Moz")
		itemSpacing = "0";

	document.write('<table width=100% cellspacing="0" cellpadding="' + itemSpacing + '" border="0">');
	document.write('<tr>');

	if (showIcon == "True")
	{
		var filter = "";
		if ((iconColorTo != "") && (Browser == "IE"))
			filter = 'filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=' + iconBackgroundColor +',EndColorStr=' + iconColorTo +')';	  

		if (useBorderWidth)
			document.write('<td bgcolor="' + iconBackgroundColor + '" width="20px" height=4px" style="border:1 solid ' + iconBackgroundColor + ';' + filter + '">');
		else
			document.write('<td bgcolor="' + iconBackgroundColor + '" width="20px" height=4px" style="border:0;' + filter + '">');
	
		document.write('<div style="overflow:hidden;width:20px;height:4px">&nbsp;</div></td>');
	}

	if (useImg)
	{
		document.write('<td width=100% colspan="2"><div style="overflow:hidden;height:1px;background:' + sepColor + '">&nbsp;</div></td></tr></table></td></tr>');
	}
	else
		document.write('<td width=100% colspan="2" bgcolor="' + itemColor + '"><div style="overflow:hidden;height:1px;background:' + sepColor + '">&nbsp;</div></td></tr></table></td></tr>');
}

function subMenuLabel(label, menuNumber, menuItemNumber, tier, myAlign,ID,imgSource,showIcon,iconColor,itemHeight,opacity,useImage,itemSpacing,enabled,iconColorTo) 
{		
	menuId = ID.substring(0,ID.indexOf("_"));

	var height;
	if (useBorderWidth)
		height = itemHeight - 2;
	else
		height = itemHeight;

	if (useImage == "True")
		document.write('<tr><td width="100%" valign="middle" height="' + height + 'px" ');
	else
		document.write('<tr><td bgcolor="' + itemColor + '" valign="middle" height="' + height + 'px" ');

	if (opacity != 100)
		document.write('style="cursor:pointer;cursor:hand;border: 0;filter:alpha(opacity=' + opacity + ')"');
	else
		document.write('style="cursor:pointer;cursor:hand;border: 0"');

	document.write('id="lb' + ID + '" name="lb' + ID + '">');
	document.write('<div id="' + ID + 'l" name="' + ID + 'l" ');

	document.write('onmouseover="menuOver(); return !showSubMenu(' + menuNumber + ', event, ' + tier + ', \'' + myAlign + '\',\'' + ID + '\');"  ');
	document.write('onmouseout="menuOut();"');

	document.write('>');

	if (Browser == "Moz")
		itemSpacing = "0";
	
	document.write('<table width=100% border="0" cellspacing="0" cellpadding="' + itemSpacing + '" height="' + height + 'px"><tr>');

	if (showIcon == "True")
	{
		var filter = "";
		if ((iconColorTo != "") && (Browser == "IE"))
			filter = 'filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=' + iconBackgroundColor + ',EndColorStr=' + iconColorTo + ')';	
	
		if (useBorderWidth)
		{
			if (imgSource != "")
				document.write('<td height="' + height + 'px" bgcolor="' + iconColor + '" width="20px" id="' + ID + 'i" style="border:1 solid ' + iconColor + ';' + filter + '"><div style="overflow:hidden;height:' + height + 'px;width:20px"><img src="' + imgSource + '" width="20px" height="' + height + 'px" border="0" align="left" id="' + ID + 'img"></div></td>');
			else
				document.write('<td height="' + height + 'px" bgcolor="' + iconColor + '" width="20px" id="' + ID + 'i" style="border:1 solid ' + iconColor +';' + filter + '"><div style="overflow:hidden;height:' + height + 'px;width:20px">&nbsp;</div></td>');
		}
		else 
		{
			if (imgSource != "")
				document.write('<td height="' + height + 'px" bgcolor="' + iconColor + '" width="20px" id="' + ID + 'i" style="' + filter + '"><div style="overflow:hidden;height:' + height + 'px;width:20px"><img src="' + imgSource + '" width="20px" height="' + height + 'px" border="0" align="left" id="' + ID + 'img"></div></td>');
			else
				document.write('<td height="' + height + 'px" bgcolor="' + iconColor + '" width="20px" id="' + ID + 'i" style="' + filter + '"><div style="overflow:hidden;height:' + height + 'px;width:20px">&nbsp;</div></td>');		
		}
	}

	if (useBorderWidth)
	{
		if (enabled == "True")
			document.write('<td class="' + menuId + 'textItem" nowrap id="' + ID + 't" style="border:1 solid ' + itemColor + '">');
		else
			document.write('<td class="' + menuId + 'disabled" nowrap id="' + ID + 't" style="border:1 solid ' + itemColor + '">');
	}
	else
	{
		if (enabled == "True")
			document.write('<td class="' + menuId + 'textItem" nowrap id="' + ID + 't">');
		else
			document.write('<td class="' + menuId + 'disabled" nowrap id="' + ID + 't">');
	}

	document.write('&nbsp;' + label + '</td>');

	if (useBorderWidth)
	{
		if (subMenuGlyph != "")
			document.write('<td class="' + menuId + 'more" align="right" width="20px" height="' + height + 'px" style="border:1 solid ' + itemColor + '" id="l' + ID + '" name="l' + ID + '"><img src="' + subMenuGlyph + '" align="top" border="0"></td>');
		else
			document.write('<td class="' + menuId + 'more" align="right" width="20px" height="' + height + 'px" style="border:1 solid ' + itemColor + '"  id="l' + ID + '" name="l' + ID + '"><font face="webdings">4</font></td>');
	}
	else
	{
		if (subMenuGlyph != "")
			document.write('<td class="' + menuId + 'more" align="right" width="20px" height="' + height + 'px" id="l' + ID + '" name="l' + ID + '"><img src="' + subMenuGlyph + '" align="top" border="0"></td>');
		else
			document.write('<td class="' + menuId + 'more" align="right" width="20px" height="' + height + 'px" id="l' + ID + '" name="l' + ID + '"><font face="webdings">4</font></td>');
	}

	document.write('</tr></table>');
	document.write('</div></td></tr>');
}
	
function menuLabel(label, menuNumber, width, align,ID,rootHeight,arrayProp,clientScript,rootImg) 
{
	menuId = ID.substring(0,ID.indexOf('_'));

	var rootImgSrc = "";
	if (rootImg != "")
		rootImgSrc = '<img align="middle" border="0" src="' + rootImg + '">';

	if (clientScript == "True")
		document.write('<td style="cursor:pointer;cursor:hand" onclick="' + ID + '(this);" class="' + menuId + 'root" valign="middle" height="' + rootHeight + 'px"');
	else
		document.write('<td style="cursor:pointer;cursor:hand" class="' + menuId + 'root" valign="middle" height="' + rootHeight + 'px"');

	document.write('id="lb' + ID + '" name="lb' + ID + '" align="left"' );

	if (openOnClick == false) 
	{
		document.write(' onmouseover="setProperties(' + arrayProp + ',\'' + menuId + '\'); menuOver(); return !showMenu(' 
		+ menuNumber + ', event,  \'' + align + '\',\'' + ID + '\');"  onmouseout="menuOut();">');
	}
	else 
	{
		document.write(' onmouseover="setProperties(' + arrayProp + ',\'' + menuId + '\'); menuOver(); openMenu(' 
		+ menuNumber + ', event,  \'' + align + '\',\'' + ID + '\');"  onclick="return !showMenu(' 
		+ menuNumber + ', event,  \'' + align + '\',\'' + ID + '\');" onmouseout="menuOut();">');
	}

	document.write('<div id="lbl' + ID + '" name="lbl' + ID + '" style="height:' + rootHeight + 'px" valign="middle">' + rootImgSrc + '&nbsp;' + label + '</div></td>\n');		
}	
	
function menuLabelBlank(label, menuNumber, width, align,ID,rootHeight,arrayProp,clientScript,rootImg) 
{
	menuId = ID.substring(0,ID.indexOf('_'));

	var rootImgSrc = "";
	if (rootImg != "")
		rootImgSrc = '<img align="middle" border="0" src="' + rootImg + '">';

	if (clientScript == "True")
		document.write('<td style="cursor:pointer;cursor:hand" onclick="' + ID + '(this);" class="' + menuId + 'root" width="' + width + '" valign="middle" height="' + rootHeight + 'px" ');
	else
		document.write('<td style="cursor:pointer;cursor:hand" class="' + menuId + 'root" width="' + width + '" valign="middle" height="' + rootHeight + 'px" ');

	if (openOnClick == false)
	{
		document.write('id="lb' + ID + '" name="lb' + ID + '" align="left" onmouseover="setProperties(' + arrayProp + ',\'' + menuId + '\'); menuOver(); return !showMenuBlank(' + menuNumber + ', event,\'' + ID + '\');"  onmouseout="menuOut();" ');
		document.write(' onclick="pressedButton(\'lb' + ID + '\');' + ID.substring(0,ID.indexOf('_')) + 'SubmitValue(\'' + ID + '\');">');
	}
	else 
	{
		document.write('id="lb' + ID + '" name="lb' + ID + '" align="left" onmouseover="setProperties(' + arrayProp + ',\'' + menuId + '\'); menuOver(); openMenuBlank(\'' + ID + '\'); return !showMenuBlank(' + menuNumber + ', event,\'' + ID 
			+ '\');"  onmouseout="menuOut();" ');
		document.write(' onclick="' + ID.substring(0,ID.indexOf('_')) + 'SubmitValue(\'' + ID + '\');">');
	}
	document.write('<div id="lbl' + ID + '" name="lbl' + ID + '" style="height:' + rootHeight + 'px" valign="middle">' + rootImgSrc + '&nbsp;' + label + '</div></td>\n');		
}
	
function startSideMenuBar(width, arProp,visProp,subMenuImg) 
{
	if (subMenuImg)
		subMenuGlyph = subMenuImg;
	else
		subMenuGlyph = "";

	document.write('<table onmouseover="setPropsTier(' + arProp + '); setProperties(' + visProp + ',\'' + visProp.substring(0,visProp.length - 5) + '\')" width="' + width + '" cellpadding="0" cellspacing="0" border="0"><tr>');	
}

function endSideMenuBar() 
{
	document.write('</table>\n');
}

function sideMenuLabel(label, menuNumber, width, align,ID,rootHeight,arrayProp,clientScript,rootImg) 
{
	menuId = ID.substring(0,ID.indexOf('_'));
	var rootImgSrc = "";

	if (rootImg != "")
		rootImgSrc = '<img align="middle" border="0" src="' + rootImg + '">';

	if (clientScript == "True")
		document.write('<tr><td style="cursor:pointer;cursor:hand" width="' + width + '" onclick="' + ID + '(this);" class="' + menuId + 'root" valign="middle" height="' + rootHeight + 'px"');
	else
		document.write('<tr><td style="cursor:pointer;cursor:hand" width="' + width + '" class="' + menuId + 'root" valign="middle" height="' + rootHeight + 'px"');

	document.write('id="lb' + ID + '" name="lb' + ID + '" align="left"' );

	if (openOnClick == false) 
	{
		document.write(' onmouseover="setProperties(' + arrayProp + ',\'' + menuId + '\'); menuOver(); return !showSideMenu(' 
		+ menuNumber + ', event,  \'' + align + '\',\'' + ID + '\');"  onmouseout="menuOut();">');
	}
	else 
	{
		document.write(' onmouseover="setProperties(' + arrayProp + ',\'' + menuId + '\'); menuOver(); openSideMenu(' 
		+ menuNumber + ', event,  \'' + align + '\',\'' + ID + '\');"  onclick="return !showSideMenu(' 
		+ menuNumber + ', event,  \'' + align + '\',\'' + ID + '\');" onmouseout="menuOut();">');
	}

	document.write('<div id="lbl' + ID + '" name="lbl' + ID + '" style="height:' + rootHeight + 'px" valign="middle">' + rootImgSrc + '&nbsp;' + label + '</div></td></tr>\n');		
}	

function sideMenuLabelBlank(label, menuNumber, width, align,ID,rootHeight,arrayProp,clientScript,rootImg) 
{
	menuId = ID.substring(0,ID.indexOf('_'));

	var rootImgSrc = "";
	if (rootImg != "")
		rootImgSrc = '<img align="middle" border="0" src="' + rootImg + '">';

	if (clientScript == "True")
		document.write('<tr><td style="cursor:pointer;cursor:hand" onclick="' + ID + '(this);" class="' + menuId + 'root" width="' + width + '" valign="middle" height="' + rootHeight + 'px" ');
	else
		document.write('<tr><td style="cursor:pointer;cursor:hand" class="' + menuId + 'root" width="' + width + '" valign="middle" height="' + rootHeight + 'px" ');

	if (openOnClick == false)
	{
		document.write('id="lb' + ID + '" name="lb' + ID + '" align="left" onmouseover="setProperties(' + arrayProp + ',\'' + menuId + '\'); menuOver(); return !showSideMenuBlank(' + menuNumber + ', event,\'' + ID + '\');"  onmouseout="menuOut();" ');
		document.write(' onclick="pressedButton(\'lb' + ID + '\');' + ID.substring(0,ID.indexOf('_')) + 'SubmitValue(\'' + ID + '\');">');
	}
	else 
	{
		document.write('id="lb' + ID + '" name="lb' + ID + '" align="left" onmouseover="setProperties(' + arrayProp + ',\'' + menuId + '\'); menuOver(); openMenuBlank(\'' + ID + '\'); return !showSideMenuBlank(' + menuNumber + ', event,\'' + ID 
			+ '\');"  onmouseout="menuOut();" ');
		document.write(' onclick="' + ID.substring(0,ID.indexOf('_')) + 'SubmitValue(\'' + ID + '\');">');
	}
	document.write('<div id="lbl' + ID + '" name="lbl' + ID + '" style="height:' + rootHeight + 'px" valign="middle">' + rootImgSrc + '&nbsp;' + label + '</div></td></tr>\n');		
}

function showWindowedObjects(show,closedMenu) 
{
    if (show == false)
	{
		var isIE = navigator.appName.indexOf("Microsoft") != -1;

		if (hideWindowedControls)
		{
			var windowedObjectTags = new Array("SELECT", "IFRAME", "OBJECT", "APPLET","EMBED");
			var windowedObjects = new Array();
			var j=0;

			var sLeft = 0;
			var sTop = 0;
			var eLeft = 0;
			var eTop = 0;
			var prevW = 0;

			for(var i=0;i<arOpenMenusId.length;i++) 
			{
				var openMenu = document.getElementById(arOpenMenusId[i]);
				if (openMenu != null) 
				{
					var table = openMenu;
  					var stl = 0;
					do
						stl += table.offsetLeft;
					while ((table = table.offsetParent));

					var stt = 0;
					var table = openMenu;
				    do
						stt += table.offsetTop;
					while ((table = table.offsetParent));

  					if ((sLeft == 0) | (sLeft > stl))
						sLeft = stl;
	
					if ((sTop == 0) | (sTop > stt))
						 sTop = stt;

				    if ((prevW == 0) && (sLeft != stl)) 
						var enl = arOpenMenusWidth[i] + eLeft;
				    else 
						var enl = arOpenMenusWidth[i] + stl;

					var ent = arOpenMenusHeight[i] + stt;

					if ((eLeft == 0) | (eLeft < enl)) 
						eLeft = enl;
	
					if ((eTop == 0) | (eTop < ent))
						eTop = ent;
				}
				prevW = arOpenMenusWidth[i];
			}
			eLeft += 5;
	
			for (var i=0; i<windowedObjectTags.length; i++) 
			{
				if (isIE)
					var tmpTags = document.all.tags(windowedObjectTags[i]);
				else
					var tmpTags = document.getElementsByTagName(windowedObjectTags[i]);
				  
				if (tmpTags.length > 0) 
				{
					for (var k=0; k<tmpTags.length; k++) 
					{
						var topOb = document.getElementById(tmpTags[k].id).style.top;
						var leftOb = document.getElementById(tmpTags[k].id).style.left;
						var widthOb = document.getElementById(tmpTags[k].id).offsetWidth;
						var heightOb = document.getElementById(tmpTags[k].id).offsetHeight;	

						var topI = parseInt(topOb.substring(0,topOb.length - 2));
						var leftI = parseInt(leftOb.substring(0,leftOb.length - 2));
						var widthI = parseInt(widthOb);
						var heightI = parseInt(heightOb);
								  
						var cell = document.getElementById(tmpTags[k].id);
						var leftBegin = 0;
						var topBegin = 0;
						var elem = cell;
						do
						{
							leftBegin += elem.offsetLeft;
							topBegin += elem.offsetTop;
						}
						while ((elem = elem.offsetParent));
						leftI = leftBegin;
						topI = topBegin;

						var endLeftI = leftI + widthI;        
						var endTopI = topI + heightI;

						if ((((leftI > sLeft) && (leftI < eLeft)) | ((endLeftI > sLeft) && (endLeftI < eLeft))) && (((topI > sTop) && (topI < eTop)) | ((endTopI > sTop) && (endTopI < eTop))))
							windowedObjects[j++] = tmpTags[k];
						else if (((leftI < sLeft) && (endLeftI > eLeft)) && (((topI < eTop) && (topI > sTop)) | ((endTopI < eTop) && (endTopI > sTop))))
							windowedObjects[j++] = tmpTags[k];
					}	 
				}
			}

			for (var i=0; i<windowedObjects.length; i++) 
			{
				var visibleObject = true;
				var prevWidth = 0;

				var topObject = document.getElementById(windowedObjects[i].id).style.top;
				var leftObject = document.getElementById(windowedObjects[i].id).style.left;
				var widthObject = document.getElementById(windowedObjects[i].id).offsetWidth;
				var heightObject = document.getElementById(windowedObjects[i].id).offsetHeight;	
			
				var topInt = parseInt(topObject.substring(0,topObject.length - 2));
				var leftInt = parseInt(leftObject.substring(0,leftObject.length - 2));

				var cell = document.getElementById(windowedObjects[i].id);
				var lb = 0;
				var tb = 0;
				var elem = cell;
				do
				{
					lb += elem.offsetLeft;
					tb += elem.offsetTop;
				}
				while ((elem = elem.offsetParent));
				topInt = tb;
				leftInt = lb;

				var rightInt = leftInt + parseInt(widthObject);
				var bottomInt = heightObject + topInt;   
	
				for(k=0;k<arOpenMenusId.length;k++) 
				{
					var OpenMenu = document.getElementById(arOpenMenusId[k]);

					if (OpenMenu != null) 
					{
						var table = OpenMenu;
						var startTop = 0;
						var startLeft = 0;
						do 
						{
							startLeft  += table.offsetLeft;
							startTop += table.offsetTop;
						}
						while ((table = table.offsetParent));

						var endLeft = startLeft + arOpenMenusWidth[k];        
						var endTop = startTop + arOpenMenusHeight[k];

						prevWidth = arOpenMenusWidth[k];

						if ((((leftInt >= startLeft) && (leftInt <= endLeft)) | ((rightInt >= startLeft) && (rightInt <= endLeft)) | ((leftInt <= startLeft) && (rightInt >= startLeft))) && (((topInt >= startTop) && (topInt <= endTop)) | ((bottomInt >= startTop) && (bottomInt <= endTop)))) 
						{         
							if (windowedObjects[i].style.visibility != "hidden")
								menuArray[lengthAr] = arOpenMenusId[k];

							visibleObject = false;
							break;
						}
					}
				}
    
				if (visibleObject == false) 
				{
					if (windowedObjects[i].style.visibility != "hidden")
					{
						ctrlArray[lengthAr] = windowedObjects[i];		
						windowedObjects[i].style.visibility = "hidden";
						lengthAr = lengthAr + 1;
					}
				}
			}
		}
	}
	else 
	{
		if (menuArray[lengthAr-1] == closedMenu)
		{
			do
			{
				lengthAr = lengthAr - 1;
				ctrlArray[lengthAr].style.visibility = "visible";
			}
			while (menuArray[lengthAr-1] == closedMenu);
		}
	}
}  

function fade(elem, fadeIn, steps, msec) 
{
	var el;
    if (document.getElementById && document.getElementById(elem)) 
		el = document.getElementById(elem);
	else if (document.all && document.all(elem)) 
		el = document.all(elem);
	
	if (msec == null) 
		msec = fademsec;
  
	if (el != null)
	{
		if (fadeIn == true)
		{
			if (el.fadeIndexIn == null)
				el.fadeIndexIn = fadeArrayIn.length;
		}
		else
		{
			if (el.fadeIndex == null)
				el.fadeIndex = fadeArray.length;	
		}

		if (fadeIn == true)
			fadeArrayIn[el.fadeIndexIn] = el;
		else
			fadeArray[el.fadeIndex] = el;

		if (fadeIn == true)
		{
			if (el.fadeStepNumberIn == null) 
			{
				if (el.style.visibility == "hidden")
					el.fadeStepNumberIn = 0;
				else
					el.fadeStepNumberIn = steps;
	
				if (fadeIn)
					el.style.filter = "Alpha(Opacity=0)";
				else
					el.style.filter = "Alpha(Opacity=100)";
			}	
		}
		else
		{
			if (el.fadeStepNumber == null) 
			{
				if (el.style.visibility == "hidden")
					el.fadeStepNumber = 0;
				else
					el.fadeStepNumber = steps;
	
				if (fadeIn)
					el.style.filter = "Alpha(Opacity=0)";
				else
					el.style.filter = "Alpha(Opacity=100)";
			}
		}

		if (fadeIn == true)
		{	
			repeat = " SetTimeOut fadein for : " + el.id + "  index : " + el.fadeIndexIn + "  stepnumber : " + el.fadeStepNumberIn + "  filter : " + el.style.filter;
			window.setTimeout("repeatFadeIn(" + fadeIn + "," + el.fadeIndexIn + "," + steps + "," + msec + "," + el.id + ")", msec);
		}
		else	
		{
			repeatOut = " SetTimeOut fadeOut for : " + el.id + "  index : " + el.fadeIndex + "  stepnumber : " + el.fadeStepNumber + "  filter : " + el.style.filter;
			window.setTimeout("repeatFade(" + fadeIn + "," + el.fadeIndex + "," + steps + "," + msec + "," + el.id + ")", msec);
		}
	}
}  

function repeatFadeIn(fadeIn,index,steps,msec)
{
	el = fadeArrayIn[index];

	var found = false;

	if (el == null)
		return false;
	 
    for (i=0;i<arOpenMenusId.length;i++) 
	{
		found = AreStringsEqual(arOpenMenusId[i].toUpperCase(),el.id.toUpperCase());
		if (found == true)
			break;    
	}

	if ((found == true) || (!fadeIn))
	{
		c = el.fadeStepNumberIn;

		if (fadeIn)
		{
			if (el.fadeTimerIn != null)
				window.clearTimeout(el.fadeTimerIn);	
		}
		else 
		{
			if (el.fadeTimer != null)
				window.clearTimeout(el.fadeTimer);
		}

		if ((c == 0) && (!fadeIn)) 
		{				
			el.style.filter = "";
			el.style.visibility = "hidden";		
		    return true;
		}
		else 
		{
			if ((c==steps) && (fadeIn)) 
			{	
				el.style.filter = "";
				el.style.visibility = "visible";
				el.fadeStepNumberIn = 0;
				return true;
			}
			else 
			{		
				(fadeIn) ? 	c++ : c--;
				
				el.style.visibility = "visible";
				el.style.filter = "Alpha(Opacity=" + 100*c/steps + ")";

				el.fadeStepNumberIn = c;
				el.fadeTimerIn = window.setTimeout("repeatFadeIn(" + fadeIn + "," + index + "," + steps + "," + msec + ")", msec);
			}
		}
	}
}

function repeatFade(fadeIn, index, steps, msec) 
{	
	el = fadeArray[index];

	var found = false;

	if (el == null)
		return false;
 
    for (i=0;i<arOpenMenusId.length;i++) 
	{
		found = AreStringsEqual(arOpenMenusId[i].toUpperCase(),el.id.toUpperCase());
		if (found == true)
			break;    
	}

	if ((found == true) || (!fadeIn))
	{
		c = el.fadeStepNumber;

		if (el.fadeTimer != null)
			window.clearTimeout(el.fadeTimer);
 
		if ((c == 0) && (!fadeIn)) 
		{				
			el.style.visibility = "hidden";		
		    return true;
		}
		else 
		{
			if ((c==steps) && (fadeIn)) 
			{	
				el.style.filter = "";
				el.style.visibility = "visible";
				return true;
			}
			else 
			{			
				(fadeIn) ? 	c++ : c--;
				
				el.style.visibility = "visible";
				el.style.filter = "Alpha(Opacity=" + 100*c/steps + ")";

				el.fadeStepNumber = c;

				el.fadeTimer = window.setTimeout("repeatFade(" + fadeIn + "," + index + "," + steps + "," + msec + ")", msec);
			}
		}
	}
}