function depressButton1(button) {

	var x, y;

	// Update the button's style class to make it look like it's depressed.

	button.className += " menuButtonActive";



	// [MODIFIED] Added for activate/deactivate on mouseover.

	// Set mouseout event handler for the button, if not already done.

	if (button.onmouseout == null)
		button.onmouseout = buttonOrMenuMouseout;
	if (button.menu.onmouseout == null)
		button.menu.onmouseout = buttonOrMenuMouseout;

	// [END MODIFIED]


	// Position the associated drop down menu under the button and show it.

	x = getPageOffsetLeft(button);
	y = getPageOffsetTop(button) + button.offsetHeight;

	// For IE, adjust position.

	if (browser.isIE) {
		x += button.offsetParent.clientLeft;
		y += button.offsetParent.clientTop;
	}

	// AZ: corrected IE position error and NS position error on non image menubar links
	var childNodeName = "";
	try {
		if (browser.isNS) {
			// check if there is an image child node in Mozilla based browsers
			childNodeName = button.childNodes[0].tagName;
		}
	} catch (e) {}
		if (browser.isIE) {
		y += 1;
	}
	// /AZ

	// << etec
        
          width=(window.innerWidth)?window.innerWidth:document.body.clientWidth;
          if (browser.isIE){
                  x = x - button.menu.offsetWidth + button.offsetWidth;
          }else{
                  x = x - button.menu.offsetWidth + button.offsetWidth;
          }
        
	// >>

	button.menu.style.left = (x - 20) + "px";
	button.menu.style.top  = (y-16) + "px";


	if (browser.isNS) {
		// AZ: workaround to avoid display issues in NS based browsers (disabled)
		//tempMenu = button.menu;
		//setTimeout("showMainMenu();", 0);
	} else {
		//button.menu.style.visibility = "visible";
	}
	button.menu.style.visibility = "visible";

	// For IE; size, position and show the menu's IFRAME as well.

//<< etec 85-05-02
////	if (button.menu.iframeEl != null) {
////		button.menu.iframeEl.style.left = button.menu.style.left;
////		button.menu.iframeEl.style.top  = button.menu.style.top;
////		button.menu.iframeEl.style.width  = button.menu.offsetWidth + "px";
////		button.menu.iframeEl.style.height = button.menu.offsetHeight + "px";
////		button.menu.iframeEl.style.display = "";
////	}
//>>
}


function buttonClick1(event, menuId) {

	var button;
	try {
		// Get the target button element.

		if (browser.isIE)
			button = window.event.srcElement;
		else
			button = event.currentTarget;

		// Blur focus from the link to remove that annoying outline.

		button.blur();

		// Associate the named menu to this button if not already done.
		// Additionally, initialize menu display.

		if (button.menu == null) {
			button.menu = document.getElementById(menuId);
			if (button.menu.isInitialized == null)
				menuInit(button.menu);
		}

	
		// [MODIFIED] Added for activate/deactivate on mouseover.

		// Set mouseout event handler for the button, if not already done.

		if (button.onmouseout == null)
			button.onmouseout = buttonOrMenuMouseout;

		// Exit if this button is the currently active one.

		if (button == activeButton)
			return false;

		// [END MODIFIED]
	

		// Reset the currently active button, if any.

		if (activeButton != null) {
			resetButton(activeButton);}

		// Activate this button, unless it was the currently active one.

		if (button != activeButton) {
			depressButton1(button);
			activeButton = button;
		}
		else {
			activeButton = null;
		}
	} catch (e) {}

	return false;
}

function buttonMouseover1(event, menuId) {

	var button;

	// [MODIFIED] Added for activate/deactivate on mouseover.

	// Activates this button's menu if no other is currently active.

	if (activeButton == null) {
		buttonClick1(event, menuId);
		return;
	}

	// [END MODIFIED]


	// Find the target button element.

	if (browser.isIE)
		button = window.event.srcElement;
	else
		button = event.currentTarget;

	// If any other button menu is active, make this one active instead.

	if (activeButton != null && activeButton != button)
		buttonClick1(event, menuId);
}

