var active;
active = "false";

function showmenu_unternehmen(){
	hideAllMenus();
	Menu_unternehmen.show();
	var ox = document.getElementById("navbox").offsetLeft;
	var oy = document.getElementById("navbox").offsetTop;
	Menu_unternehmen.moveTo(ox + 163, oy+240);
	}

function hidemenu_unternehmen(){
	var pop_var;
	hideAllMenus();
}


function showmenu_distributor(){
	hideAllMenus();
	Menu_distributor.show();
	var ox = document.getElementById("navbox").offsetLeft;
	var oy = document.getElementById("navbox").offsetTop;
	Menu_distributor.moveTo(ox + 163, oy+259);
	}

function hidemenu_distributor(){
	var pop_var;
	hideAllMenus();
}


function showmenu_pressebereich(){
	hideAllMenus();
	Menu_pressebereich.show();
	var ox = document.getElementById("navbox").offsetLeft;
	var oy = document.getElementById("navbox").offsetTop;
	Menu_pressebereich.moveTo(ox + 163, oy+327);
	}

function hidemenu_pressebereich(){
	var pop_var;
	hideAllMenus();
}

function showmenu(){
	hideAllMenus();
	//document.getElementById("showmenu09").className = "navactive";
	//active = "true";
	Menu1.show();
	
	
	var ox = document.getElementById("navbox").offsetLeft;
	var oy = document.getElementById("navbox").offsetTop;
		
	Menu1.moveTo(ox + 163, oy+221);
	
}

function hidemenu(){
	var pop_var;
	//active = "false";
	//document.getElementById("showmenu09").className = "navpunkt";
	hideAllMenus();
}


var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = updateIt;
var X = 0;
var Y = 0;

function updateIt(e) {
	
	
	if (active  == "true"){
		var ox = document.getElementById("navbox").offsetLeft;
		var oy = document.getElementById("navbox").offsetTop;
	
	  	if (IE) { 
	   		X = event.clientX + document.body.scrollLeft;
	   		Y = event.clientY + document.body.scrollTop;
	  	} else {  
	   		X = e.pageX;
	   		Y = e.pageY;
	  	}  
		var right 	= ox+715;
		var left 	= ox;
		var top 	= oy+163;
		var bottom 	= oy+360;
		
		if (X > right) 	hidemenu();
		if (X < left) 	hidemenu();
		if (Y > bottom) hidemenu();
		if (Y < top) 	hidemenu();
		
		
	}	

}



function mouseout(){
	if (itemElm.onmouseout == menuItemOut){
	hideAllMenus();
	}
};

function isIE5() {
  return (navigator.userAgent.indexOf("MSIE 5") > -1);
}

function isIE6() { 
  return ((navigator.userAgent.indexOf("MSIE 6") > -1) && (navigator.userAgent.indexOf("Opera") == -1));
}

function isIE() {
	return (isIE5() || isIE6());
}

function isOpera() {
  return (navigator.userAgent.indexOf("Opera") > -1);
}

function isSafari() {
  return ((navigator.userAgent.indexOf("Safari") > -1) && (navigator.userAgent.indexOf("Mac") > -1));
}

function getPageMode() {
  if (document.compatMode) {
    switch (document.compatMode) {
      case "BackCompat":
        return 0;
      case "CSS1Compat":
        return 1;
      case "QuirksMode":
        return 0;
    }
  }
  else {
    if (isIE5()) {
      return 0;
    }
    if (isSafari()) {
      return 1;
    }
  }
  return 0;
}

function getElmId(id) {
  return document.getElementById(id);
}

function createElm(tagName) {
  return document.createElement(tagName);
}

function getX(e) {
	if (!e) {
    var e = window.event;
  }
	if (isSafari()) {
		return (e.clientX - getScrollLeft());
	}
	else {
		return e.clientX;
	}
}

function getY(e) {
	if (!e) {
    var e = window.event;
  }
	if (isSafari()) {
		return (e.clientY - getScrollTop());
	}
	else {
		return e.clientY;
	}
}

function getScrollLeft() {
  switch (pageMode) {
    case 0:
      return document.body.scrollLeft;
    case 1:
      if (document.documentElement && (document.documentElement.scrollLeft > 0)) {
        return document.documentElement.scrollLeft;
      }
      else {
				return document.body.scrollLeft;
      }
  }
}

function getScrollTop() {
  switch (pageMode) {
    case 0:
      return document.body.scrollTop;
    case 1:
      if (document.documentElement && (document.documentElement.scrollTop > 0)) {
				return document.documentElement.scrollTop;
      }
      else {
				return document.body.scrollTop;
      }
  }
}

function getClientHeight() {
  switch (pageMode) {
    case 0:
      return document.body.clientHeight;
    case 1:
			if (isSafari()) {
				return self.innerHeight;
			}
			else {
				if ((!isOpera()) && document.documentElement && (document.documentElement.clientHeight > 0)) {
					return document.documentElement.clientHeight;
				}
				else {
					return document.body.clientHeight;
				}
			}
  }
}

function getClientWidth() {
  switch (pageMode) {
    case 0:
      return document.body.clientWidth;
    case 1:
			if (isSafari()) {
				return self.innerWidth;
			}
			else {
				if ((!isOpera()) && document.documentElement && (document.documentElement.clientWidth > 0)) {
					return document.documentElement.clientWidth;
				}
				else {
					return document.body.clientWidth;
				}
			}
  }
}

function getMainMenuLeftPos(menuObj, x) {
  if ((x + menuObj.offsetWidth) <= getClientWidth()) {
    return x;
  }
  else {
    if (x <= getClientWidth()) {
      return (x - menuObj.offsetWidth);
    }
    else {
      return (getClientWidth() - menuObj.offsetWidth);
    }
  }
}

function getMainMenuTopPos(menuObj, y) {
  if ((y + menuObj.offsetHeight) <= getClientHeight()) {
    return y;
  }
  else {
    if (y <= getClientHeight()) {
      return (y - menuObj.offsetHeight);
    }
    else {
      return (getClientHeight() - menuObj.offsetHeight);
    }
  }
}

function getSubMenuLeftPos(menuObj, x, offset) {
	var borderLeftWidth = parseInt(getPropertyValue(menuObj, "border-left-width"));
  if ((x + menuObj.offsetWidth - borderLeftWidth - 5) <= getClientWidth()) {
    return (x - borderLeftWidth - 5);
  }
  else {
    if (x <= getClientWidth()) {
      return (x - menuObj.offsetWidth - offset);
    }
    else {
      return (getClientWidth() - menuObj.offsetWidth);
    }
  }
}

function getSubMenuTopPos(menuObj, y, offset) {
	var borderTopWidth = parseInt(getPropertyValue(menuObj, "border-top-width"));
  if ((y + menuObj.offsetHeight) <= getClientHeight()) {
		if (isSafari()) {
			return (y - borderTopWidth);
		}
		else {
			return y;
		}
  }
  else {
    if (y <= getClientHeight()) {
			if (isSafari()) {
				return (y - borderTopWidth - menuObj.offsetHeight + offset);
			}
			else {
				return (y - menuObj.offsetHeight + offset);
			}
    }
    else {
      return (getClientHeight() - menuObj.offsetHeight + offset);
    }
  }
}

function popUpMainMenu(menuObj, e) {
	menuObj.style.left = (getMainMenuLeftPos(menuObj, getX(e)) + getScrollLeft()) + "px";
	menuObj.style.top = (getMainMenuTopPos(menuObj, getY(e)) + getScrollTop()) + "px";
	popUpMenuObj.menuObj.style.visibility = "visible";
}

function popUpSubMenu(menuItemObj) {
	var parentMenuObj = menuItemObj.parent.menuObj;
	var menuObj = menuItemObj.subMenu.menuObj;
	var borderTopWidth = parseInt(getPropertyValue(menuObj, "border-top-width"));
	var borderBottomWidth = parseInt(getPropertyValue(menuObj, "border-bottom-width"));
	if (menuObj.style.position == "fixed") {
		var x = parentMenuObj.offsetLeft + parentMenuObj.offsetWidth;
		var y = parentMenuObj.offsetTop + menuItemObj.offsetTop;
		menuObj.style.position = "absolute";
		menuObj.style.left = getSubMenuLeftPos(menuObj, x, menuItemObj.offsetWidth) + "px";
		menuObj.style.top = getSubMenuTopPos(menuObj, y, menuItemObj.offsetHeight + borderBottomWidth + borderTopWidth) + "px";
		menuObj.style.position = "fixed";
	}
	else {
		var x = parentMenuObj.offsetLeft + parentMenuObj.offsetWidth - getScrollLeft();
		var y = parentMenuObj.offsetTop + menuItemObj.offsetTop - getScrollTop();
		menuObj.style.left = (getSubMenuLeftPos(menuObj, x, menuItemObj.offsetWidth) + getScrollLeft()) + "px";
		menuObj.style.top = (getSubMenuTopPos(menuObj, y, menuItemObj.offsetHeight + borderBottomWidth + borderTopWidth) + getScrollTop()) + "px";
	}
	if ((isIE()) && (menuObj.mode == "fixed")) {
    menuObj.initialLeft = parseInt(menuObj.style.left) - getScrollLeft();
    menuObj.initialTop = parseInt(menuObj.style.top) - getScrollTop();
  }
	menuObj.style.visibility = "visible";
}

function toCamelCase(input) {
	var inputArray = input.split("-");
	if (inputArray.length == 1) {
		return inputArray[0];
	}
	else {
		var camelCase = inputArray[0];
		var i;
		for (i = 1; i < inputArray.length; i++) {
			var word = inputArray[i];
			camelCase += word.charAt(0).toUpperCase() + word.substring(1);
		}
		return camelCase;
	}
}

function getPropertyValue(obj, propertyName) {
	var propertyValue = obj.style[toCamelCase(propertyName)];
	if (propertyValue) {
		return propertyValue;
	}
  else {
		if (document.defaultView && document.defaultView.getComputedStyle) {
			return document.defaultView.getComputedStyle(obj, null).getPropertyValue(propertyName);
		}
		else {
			if (obj.currentStyle) {
				return obj.currentStyle[toCamelCase(propertyName)];
			}
			else {
				return null;
			}
		}
  }
}

function refreshMenuItems(menuObj) {
	var i;
  for (i = 0; i < menuObj.childNodes.length; i++) {
    if (menuObj.childNodes[i].enabled) {
      menuObj.childNodes[i].className = menuObj.childNodes[i].itemClassName;
      if (menuObj.childNodes[i].hasSubMenu) {
        var arrowObj = getElmId(menuObj.childNodes[i].id + "Arrow");
        arrowObj.className = menuObj.childNodes[i].arrowClassName;
      }
    }
  }
}

function menuItemOver(e) {
  if (this.parent.previousItem) {
		if (this.parent.previousItem.className == this.parent.previousItem.itemClassNameOver) {
			this.parent.previousItem.className = this.parent.previousItem.itemClassName;
    }
    if (this.parent.previousItem.hasSubMenu) {
      this.parent.previousItem.className = this.parent.previousItem.itemClassName;
      var arrowObj = getElmId(this.parent.previousItem.id + "Arrow");
      arrowObj.className = this.parent.previousItem.arrowClassName;
    }
		var menuObj = getElmId(this.parent.menuObj.id);
		var i;
		for (i = 0; i < menuObj.childNodes.length; i++) {
			if ((menuObj.childNodes[i].enabled) && (menuObj.childNodes[i].hasSubMenu)) {
				hideMenus(menuObj.childNodes[i].subMenu.menuObj);
			}
		}
  }
  if (this.enabled) {
    this.className = this.itemClassNameOver;
    if (this.hasSubMenu) {
      var arrowObj = getElmId(this.id + "Arrow");
      arrowObj.className = this.arrowClassNameOver;
			popUpSubMenu(this);
    }
  }
  this.parent.previousItem = this;
}

function menuItemClick(e) {
  if ((this.enabled) && (this.actionOnClick)) {
    var action = this.actionOnClick;
    if (action.indexOf("link:") == 0) {
      location.href = action.substr(5);
    }
    else {
      if (action.indexOf("code:") == 0) {
        eval(action.substr(5));
      }
      else {
        location.href = action;
      }
    }
  }
  if (!e) {
    var e = window.event;
    e.cancelBubble = true;
  }
	if (e.stopPropagation) {
    e.stopPropagation();
  }
  if (this.parent.menuObj.mode == "cursor") {
    hideCursorMenus();
  }
  if ((this.parent.menuObj.mode == "absolute") || (this.parent.menuObj.mode == "fixed")) {
		hideVisibleMenus();
		if (typeof(hideMenuBarMenus) != "undefined") {
			hideMenuBarMenus();
		}
  }
}

function menuItemOut() {
  if (this.enabled) {
    if (!((this.hasSubMenu) && (this.subMenu.menuObj.style.visibility == "visible"))) {
      this.className = this.itemClassName;
    }
    if (this.hasSubMenu) {
      var arrowObj = getElmId(this.id + "Arrow");
      if (this.subMenu.menuObj.style.visibility == "visible") {
        arrowObj.className = this.arrowClassNameOver;
      }
      else {
        arrowObj.className = this.arrowClassName;
      }
    }
  }
}

function setSubMenu(menuObj) {
  var arrowElm = createElm("div");
  arrowElm.id = this.id + "Arrow";
	arrowElm.className = this.arrowClassName;
  this.appendChild(arrowElm);
	var height;
	if (isIE()) {
		var height = parseInt(getPropertyValue(arrowElm, "height"));
	}
	else {
		var height = arrowElm.offsetHeight;
	}
	arrowElm.style.top = Math.floor((this.offsetHeight - height) / 2) + "px";
	this.hasSubMenu = true;
  this.subMenu = menuObj;
  this.arrowObj = arrowElm;
  this.setArrowClassName = function(className) {
    if (this.arrowObj) {
      this.arrowClassName = className;
      this.arrowObj.className = this.arrowClassName;
    }
  };
  this.setArrowClassNameOver = function(className) {
    if (this.arrowObj) {
      this.arrowClassNameOver = className;
    }
  };
  menuObj.menuObj.style.zIndex = this.parent.menuObj.level + 1;
  menuObj.menuObj.level = this.parent.menuObj.level + 1;
}

function addMenuItem(menuItemObj) {

  if (menuItemObj.displayText == "-") {
    var hrElm = createElm("hr");
    var itemElm = createElm("div");
    var itemElm = createElm("&nbsp;&nbsp;");
    itemElm.appendChild(hrElm);
    itemElm.id = menuItemObj.id;
    if (menuItemObj.className.length > 0) {
      itemElm.sepClassName = menuItemObj.className;
    }
    else {
      itemElm.sepClassName = menuItemObj.sepClassName;
    }
    itemElm.className = itemElm.sepClassName;
    this.menuObj.appendChild(itemElm);
    itemElm.parent = this;
    itemElm.setClassName = function(className) {
      this.sepClassName = className;
      this.className = this.sepClassName;
    };
    itemElm.onclick = function(e) {
      if (!e) {
        var e = window.event;
        e.cancelBubble = true;
      }
      if (e.stopPropagation) {
        e.stopPropagation();
      }
    };
    itemElm.onmouseover = menuItemOver;
    if (menuItemObj.itemName.length > 0) {
      this.items[menuItemObj.itemName] = itemElm;
    }
    else {
      this.items[this.items.length] = itemElm;
    }
  }
  else {
    var itemElm = createElm("div");
    itemElm.id = menuItemObj.id;
    itemElm.actionOnClick = menuItemObj.actionOnClick;
    itemElm.enabled = menuItemObj.enabled;
		itemElm.itemClassName = menuItemObj.className;
    itemElm.itemClassNameOver = menuItemObj.classNameOver;
    itemElm.className = itemElm.itemClassName;
    itemElm.hasSubMenu = false;
    itemElm.subMenu = null;
		itemElm.arrowClassName = arrowClassName;
		itemElm.arrowClassNameOver = arrowClassNameOver;
    this.menuObj.appendChild(itemElm);
    var textNode = document.createTextNode(menuItemObj.displayText);
    itemElm.appendChild(textNode);
    itemElm.parent = this;
    itemElm.setClassName = function(className) {
      this.itemClassName = className;
      this.className = this.itemClassName;
    };
    itemElm.setClassNameOver = function(classNameOver) {
      this.itemClassNameOver = classNameOver;
    };
    itemElm.setDisplayText = function(text) {
      this.firstChild.nodeValue = text;
    };
    itemElm.setSubMenu = setSubMenu;
    itemElm.onmouseover = menuItemOver;
		itemElm.onclick = menuItemClick;
    itemElm.onmouseout = menuItemOut;
    
    
    if (menuItemObj.itemName.length > 0) {
      this.items[menuItemObj.itemName] = itemElm;
    }
    else {
      this.items[this.items.length] = itemElm;
    }
  }
}


function menuItem() {

	this.displayText = arguments[0];
 	if (this.displayText == "-") {
    this.id = "MenuSep" + (++sepCount);
    this.className = sepClassName;
      }


  else {
    this.id = "MenuItem" + (++menuItemCount);
    this.className = menuItemClassName;
  }
  this.itemName = "";
  this.actionOnClick = "";
  this.enabled = true;
  this.classNameOver = menuItemClassNameOver;
	this.sepClassName = sepClassName;
  var length = arguments.length;
  if ((length > 1) && (arguments[1].length > 0)) {
    this.itemName = arguments[1];
  }
  if ((length > 2) && (arguments[2].length > 0)) {
    this.actionOnClick = arguments[2];
  }
  if ((length > 3) && (typeof(arguments[3]) == "boolean")) {
    this.enabled = arguments[3];
  }
  if ((length > 4) && (arguments[4].length > 0)) {
    if (arguments[4] == "-") {
      this.className = arguments[4];
      this.sepClassName = arguments[4];
    }
    else {
      this.className = arguments[4];
    }
  }
  if ((length > 5) && (arguments[5].length > 0)) {
    this.itemClassNameOver = arguments[5];
  }
 
if   (this.itemName == "item6")
{

this.className="jsdomenuitem2";

}

if   (this.itemName == "item7")
{

this.className="jsdomenuitem2";

}

if   (this.itemName == "item5")
{

this.className="jsdomenuitem2";

}

if   (this.itemName == "item3")
{

this.className="jsdomenuitem2";

}

}

function jsDOMenu() {
  this.items = new Array();
  var menuElm = createElm("div");
  menuElm.id = "DOMenu" + (++menuCount);
  menuElm.level = 10;
  menuElm.previousItem = null;
  menuElm.allExceptFilter = allExceptFilter;
  menuElm.noneExceptFilter = noneExceptFilter;
  menuElm.className = menuClassName;
  menuElm.mode = "cursor";
  menuElm.alwaysVisible = false;
  menuElm.initialLeft = 0;
  menuElm.initialTop = 0;
  var length = arguments.length;
  if ((length > 1) && (arguments[1].length > 0)) {
		menuElm.className = arguments[1];
  }
  if ((length > 2) && (arguments[2].length > 0)) {
    switch (arguments[2]) {
			case "cursor":
				menuElm.style.position = "absolute";
        break;
      case "absolute":
				menuElm.style.position = "absolute";
        menuElm.mode = "absolute";
        break;
      case "fixed":
				if (isIE()) {
					menuElm.style.position = "absolute";
				}
				else {
					menuElm.style.position = "fixed";
				}
				menuElm.mode = "fixed";
        break;
    }
  }
  if ((length > 3) && (typeof(arguments[3]) == "boolean")) {
    menuElm.alwaysVisible = arguments[3];
  }
  with (menuElm.style) {
    width = arguments[0] + "px";
    left = "0px";
    top = "0px";
  }
  document.body.appendChild(menuElm);
	if (!getPropertyValue(menuElm, "border-left-width")) {
		menuElm.style.borderWidth = menuBorderWidth + "px";
	}
  this.menuObj = menuElm;
  this.addMenuItem = addMenuItem;
  this.setClassName = function(className) {
    this.menuObj.className = className;
  };
  this.setMode = function(mode) { 
		switch (mode) {
			case "cursor":
				this.menuObj.style.position = "absolute";
        this.menuObj.mode = "cursor";
				break;
      case "absolute":
				this.menuObj.style.position = "absolute";
        this.menuObj.mode = "absolute";
				var left = parseInt(this.menuObj.style.left);
				var top = parseInt(this.menuObj.style.top);
				this.menuObj.initialLeft = left;
				this.menuObj.initialTop = top;
        break;
      case "fixed":
				if (isIE()) {
					this.menuObj.style.position = "absolute";
					var left = parseInt(this.menuObj.style.left);
					var top = parseInt(this.menuObj.style.top);
					this.menuObj.initialLeft = left;
					this.menuObj.initialTop = top;
				}
				else {
					this.menuObj.style.position = "fixed";
				}
				this.menuObj.mode = "fixed";
        break;
    }
  };
  this.setAlwaysVisible = function(alwaysVisible) {
		if (typeof(alwaysVisible) == "boolean") {
			this.menuObj.alwaysVisible = alwaysVisible;
		}
  };
  this.show = function() { // Public method
    this.menuObj.style.visibility = "visible";
  };
  this.hide = function() { // Public method
    this.menuObj.style.visibility = "hidden";
		if (this.menuObj.mode == "cursor") {
			with (this.menuObj.style) {
				left = "0px";
				top = "0px";
			}
			menuObj.initialLeft = 0;
			menuObj.initialTop = 0;
		}
  };
  this.setX = function(x) {
    this.menuObj.initialLeft = x;
    this.menuObj.style.left = x + "px";
  };
  this.setY = function(y) { 
    this.menuObj.initialTop = y;
    this.menuObj.style.top = y + "px";
  };
  this.moveTo = function(x, y) { 
    this.menuObj.initialLeft = x;
    this.menuObj.initialTop = y;
    this.menuObj.style.left = x + "px";
    this.menuObj.style.top = y + "px";
  };
  this.moveBy = function(x, y) { 
    var left = parseInt(this.menuObj.style.left);
    var top = parseInt(this.menuObj.style.top);
    this.menuObj.initialLeft = left + x;
    this.menuObj.initialTop = top + y;
    this.menuObj.style.left = (left + x) + "px";
    this.menuObj.style.top = (top + y) + "px";
  };
  this.setAllExceptFilter = function(filter) { 
    this.menuObj.allExceptFilter = filter;
    this.menuObj.noneExceptFilter = new Array();
  };
  this.setNoneExceptFilter = function(filter) { 
    this.menuObj.noneExceptFilter = filter;
    this.menuObj.allExceptFilter = new Array();
  };
  this.setBorderWidth = function(width) { 
    this.menuObj.style.borderWidth = width + "px";
  };
}

function findMatch(tagName, tagId, filter) {
  var i;
	for (i = 0; i < filter.length; i++) {
    var filterArray = filter[i].toLowerCase().split(".");
    if (((filterArray[0] == "*") && (filterArray[1] == "*")) || 
        ((filterArray[0] == "*") && (filterArray[1] == tagId)) ||
        ((filterArray[0] == tagName) && (filterArray[1] == "*")) ||
        ((filterArray[0] == tagName) && (filterArray[1] == tagId))) {
      return true;
    }
  }
  return false;
}

function canShowMenu(tagName, tagId, allExcept, noneExcept) {
  if (allExcept.length > 0) {
    return (!findMatch(tagName.toLowerCase(), tagId.toLowerCase(), allExcept));
  }
  else {
    if (noneExcept.length > 0) {
      return findMatch(tagName.toLowerCase(), tagId.toLowerCase(), noneExcept);
    }
    else {
      return true;
    }
  }
}

function activatePopUpMenu(e) {
  if (!popUpMenuObj) {
    return;
  }
  var state = popUpMenuObj.menuObj.style.visibility;
  if (state == "visible") {
		var i;
    for (i = 1; i <= menuCount; i++) {
      var menuObj = getElmId("DOMenu" + i);
      if (menuObj.mode == "cursor") {
        with (menuObj.style) {
          visibility = "hidden";
					left = "0px";
          top = "0px";
        }
        menuObj.initialLeft = 0;
        menuObj.initialTop = 0;
        refreshMenuItems(menuObj);
      }
    }
  }
  else {
    if (!e) {
      var e = window.event;
    }
    var targetElm = (e.target) ? e.target : e.srcElement;
		if (targetElm.nodeType == 3) {
			targetElm = targetElm.parentNode;
		}
    if (canShowMenu(targetElm.tagName, targetElm.id, popUpMenuObj.menuObj.allExceptFilter, popUpMenuObj.menuObj.noneExceptFilter)) {
      popUpMainMenu(popUpMenuObj.menuObj, e);
    }
  }
}

function activatePopUpMenuBy() {
  showValue = ((typeof(arguments[0]) == "number") && (arguments[0] > -1)) ? arguments[0] : 0;
  if (arguments.length > 1) {
    hideValue = ((typeof(arguments[1]) == "number") && (arguments[1] > -1)) ? arguments[1] : 0;
  }
  else {
    hideValue = showValue;
  }
  if ((showValue == 1) || (showValue == 2) || (hideValue == 1) || (hideValue == 2)) {
    document.oncontextmenu = rightClickHandler;
  }
}

function hideAllMenus() {
  var i;
	for (i = 1; i <= menuCount; i++) {
    var menuObj = getElmId("DOMenu" + i);
    if (!menuObj.alwaysVisible) {
			if (menuObj.style.position == "fixed") {
				menuObj.style.position == "absolute";
				menuObj.style.visibility = "hidden";
				menuObj.style.position == "fixed";
			}
			else {
				menuObj.style.visibility = "hidden";
				if (menuObj.mode == "cursor") {
					with (menuObj.style) {
						left = "0px";
						top = "0px";
					}
					menuObj.initialLeft = 0;
					menuObj.initialTop = 0;
				}
			}
    }
    refreshMenuItems(menuObj);
  }
}

function hideCursorMenus() {
  var i;
	for (i = 1; i <= menuCount; i++) {
    var menuObj = getElmId("DOMenu" + i);
    if ((menuObj.mode == "cursor") && (!menuObj.alwaysVisible)) {
      with (menuObj.style) {
        visibility = "hidden";
				left = "0px";
        top = "0px";
      }
      menuObj.initialLeft = 0;
      menuObj.initialTop = 0;
    }
    if (menuObj.mode == "cursor") {
      refreshMenuItems(menuObj);
    }
  }
}

function hideVisibleMenus() {
  var i;
	for (i = 1; i <= menuCount; i++) {
    var menuObj = getElmId("DOMenu" + i);
    if (((menuObj.mode == "absolute") || (menuObj.mode == "fixed")) && (!menuObj.alwaysVisible)) {
			if (menuObj.style.position == "fixed") {
				menuObj.style.position = "absolute";
				menuObj.style.visibility = "hidden";
				menuObj.style.position = "fixed";
			}
			else {
				menuObj.style.visibility = "hidden";
				with (menuObj.style) {
					left = "0px";
					top = "0px";
				}
				menuObj.initialLeft = 0;
				menuObj.initialTop = 0;
			}
		}
    if ((menuObj.mode == "absolute") || (menuObj.mode == "fixed")) {
      refreshMenuItems(menuObj);
    }
  }
}

function hideMenus(menuObj) { 
	refreshMenuItems(menuObj);
	var i;
	for (i = 0; i < menuObj.childNodes.length; i++) {
    if ((menuObj.childNodes[i].enabled) && (menuObj.childNodes[i].hasSubMenu)) {
      hideMenus(menuObj.childNodes[i].subMenu.menuObj);
    }
  }
	if (menuObj.style.position == "fixed") {
		menuObj.style.position = "absolute";
		menuObj.style.visibility = "hidden";
		menuObj.style.position = "fixed";
	}
	else {
		menuObj.style.visibility = "hidden";
		with (menuObj.style) {
			left = "0px";
			top = "0px";
		}
		menuObj.initialLeft = 0;
		menuObj.initialTop = 0;
	}
}

function leftClickHandler(e) { 
  if ((getX(e) > getClientWidth()) || (getY(e) > getClientHeight())) {
    return;
  }
  if (!e) {
    var e = window.event;
  }
	if ((e.button) && (e.button == 2)) {
    return;
  }
  hideVisibleMenus();
   // imgOff('img_03');
        //if (pop_var!=true){
        //    imgOff('img_03');
        //};
	if (typeof(hideMenuBarMenus) == "function") {
		hideMenuBarMenus();
	}
  if (popUpMenuObj) {
    var state = popUpMenuObj.menuObj.style.visibility;
    if ((state == "visible") && ((hideValue == 0) || (hideValue == 2))) {
      activatePopUpMenu(e);
    }
    if (((state == "hidden") || (state == "")) && ((showValue == 0) || (showValue == 2))) {
      activatePopUpMenu(e);
    }
  }
}

function rightClickHandler(e) {
  if ((getX(e) > getClientWidth()) || (getY(e) > getClientHeight())) {
    return;
  }
  if (popUpMenuObj) {
    var state = popUpMenuObj.menuObj.style.visibility;
    if ((state == "visible") && ((hideValue == 1) || (hideValue == 2))) {
      activatePopUpMenu(e);
      return false;
    }
    if (((state == "hidden") || (state == "")) && ((showValue == 1) || (showValue == 2))) {
      activatePopUpMenu(e);
      return false;
    }
  }
}

function scrollHandler() { 
  var i;
	for (i = 1; i <= menuCount; i++) {
      var menuObj = getElmId("DOMenu" + i);
      if ((isIE()) && (menuObj.mode == "fixed")) {
        with (menuObj.style) {
          left = (menuObj.initialLeft + getScrollLeft()) + "px";
          top = (menuObj.initialTop + getScrollTop()) + "px";
        }
      }
  }
	if (typeof(menuBarCount) == "number") {
		menuBarScrollHandler();
	}
}

function setPopUpMenu(menuObj) { 
  popUpMenuObj = menuObj;
}

function initjsDOMenu() { 
  if (document.createElement && document.getElementById) {
    createjsDOMenu();
  }
}

if (typeof(allExceptFilter) == "undefined") {
  var allExceptFilter = new Array("A.*", 
                                  "BUTTON.*", 
                                  "IMG.*", 
                                  "INPUT.*", 
                                  "OBJECT.*", 
                                  "OPTION.*", 
                                  "SELECT.*", 
                                  "TEXTAREA.*"); 
}

if (typeof(noneExceptFilter) == "undefined") {
  var noneExceptFilter = new Array(); 
}

if (typeof(menuClassName) == "undefined") {
  var menuClassName = "jsdomenudiv"; 
}

if (typeof(menuItemClassName) == "undefined") {
  var menuItemClassName = "jsdomenuitem"; 
}

if (typeof(menuItemClassNameOver) == "undefined") {
  var menuItemClassNameOver = "jsdomenuitemover"; 
}

if (typeof(sepClassName) == "undefined") {
  var sepClassName = "jsdomenusep"; 
}

if (typeof(arrowClassName) == "undefined") {
  var arrowClassName = "jsdomenuarrow"; 
}

if (typeof(arrowClassNameOver) == "undefined") {
  var arrowClassNameOver = "jsdomenuarrowover"; 
}

if (typeof(menuBorderWidth) == "undefined") {
  var menuBorderWidth = 2; 
}

var menuCount = 0; 
var menuItemCount = 0; 
var sepCount = 0; 
var popUpMenuObj = null; 
var showValue = 0; 
var hideValue = 0; 
var pageMode = getPageMode(); 
document.onclick = leftClickHandler;
window.onscroll = scrollHandler;
