//
//		ASP EasyMenu
//	
//		Copyright obout inc      http://www.obout.com

// array containing the functions to run upon window.onload
ob_em_gSafeOnLoad = new Array();
// specifies that the function for window.onload has been added to the array
ob_em_loadEventAdded = false;

function ob_EasyMenu(ob_em_menu_id, ob_em_oat_id, ob_em_ui, ob_em_hz_o, ob_em_vt_o, ob_em_ms, ob_em_ds, ob_em_se)
{	
	// object id
	this.id = 'ob_em_' + ob_em_menu_id;
	// menu id
	this.menu_id = ob_em_menu_id;
	// Object to Attach To array
	this.oat_id = ob_em_oat_id;
	// Uses Icons
	this.ui = eval(ob_em_ui.toLowerCase());

	// menu classes (mi - MenuItem, ms - MenuSeparator, i - IconCell, c - ContentCell, _o - MouseOver)
	this.classes = ob_em_ms;
	// horizontal and vertical offset to mouse pointer
	this.hz_o = ob_em_hz_o;
	this.vt_o = ob_em_vt_o;
	// display style
	this.displayPosition = ob_em_ds.toLowerCase();
	// show event
	this.showEvent = ob_em_se.toLowerCase();

	// element over which the right click occured
	this.el = null;
	// menu
	this.menu = document.getElementById(this.menu_id);
	// document body
	this.body = document.getElementsByTagName('body')[0];
	// The iframe that will help display the menu
	this.cover_iframe = document.getElementById('obout_easymenu_iframe_' + ob_em_menu_id);

	// the right click event handler
	this.documentMouseDown = ob_em_documentMouseDown;
	// the mouseOver, mouseOut handler
	this.mouseHover = ob_em_mouseHover;
	// shows the menu
	this.showMenu = ob_em_showMenu;
	// hides all menus
	this.hideMenu = ob_em_hideMenu;
	// the click on a menu item handler
	this.menuItemClick = ob_em_menuItemClick;
	// the attach to controls function
	this.attachToControls = ob_em_attachToControls;
	// if the mouse is over the menu
	this.mouseOverMenu = ob_em_mouseOverMenu;
	// gets the menu top left coords
	this.getMenuCoords = ob_em_getMenuCoords;
	// gets the element registered for attachment
	this.getElementAttachedFromTarget = ob_em_getElementAttachedFromTarget;
	
	this.rightClickHideMenu = true;
	
	this.loadEventAdded = false;
	
	//ob_em_safeAddOnLoad("attachToControls()", this.id);
	ob_em_safeAddOnEvent("onload", "window", "ob_em_gSafeOnLoad", "ob_em_loadEventAdded", "attachToControls()", this.id);
	
	// hide the menu when lost focus or right click occured over it
	if(document.all)
	{
		this.menu.onblur = this.hideMenu;
		this.menu.oncontextmenu = this.hideMenu;
		if (this.showEvent == 'mouseover') this.menu.onmouseout = new Function(this.id + ".hideMenu(window.event, true);")
	}
	else
	{
		this.menu.setAttribute("onblur", this.id + ".hideMenu(event, false)");
		this.menu.setAttribute("oncontextmenu", this.id + ".hideMenu(event, false)");
		if (this.showEvent == 'mouseover') this.menu.setAttribute("onmouseout", this.id + ".hideMenu(event, true)");
	}

	ob_em_changeStyle(this.id);

	// wire the mouse over and mouse out events to the menu items
	for (var i=0; i < this.menu.childNodes[0].childNodes[0].childNodes.length; i++)
	{
		// get the menu item
		obj = this.menu.childNodes[0].childNodes[0].childNodes[i].firstChild;
		// set initial style class
		obj.className = this.classes[obj.getAttribute("type")]["c"];

		// create the event collections
		obj.setAttribute("mouseovercollection", new Array());
		obj.setAttribute("mouseoutcollection", new Array());
		obj.setAttribute("mouseclickcollection", new Array());

		// create the added flags attribute
		obj.setAttribute("mouseoveradded", false);
		obj.setAttribute("mouseoutadded", false);
		obj.setAttribute("mouseclickadded", false);

		// add the events
		ob_em_safeAddOnEvent("onmouseover", "document.getElementById('" + ob_em_menu_id + "').childNodes[0].childNodes[0].childNodes[" + i + "].firstChild", "document.getElementById('" + ob_em_menu_id + "').childNodes[0].childNodes[0].childNodes[" + i + "].firstChild.mouseovercollection", "document.getElementById('" + ob_em_menu_id + "').childNodes[0].childNodes[0].childNodes[" + i + "].firstChild.mouseoveradded", "mouseHover(document.getElementById('" + ob_em_menu_id + "').childNodes[0].childNodes[0].childNodes[" + i + "].firstChild, ev, true)", this.id);
		ob_em_safeAddOnEvent("onmouseout", "document.getElementById('" + ob_em_menu_id + "').childNodes[0].childNodes[0].childNodes[" + i + "].firstChild", "document.getElementById('" + ob_em_menu_id + "').childNodes[0].childNodes[0].childNodes[" + i + "].firstChild.mouseoutcollection", "document.getElementById('" + ob_em_menu_id + "').childNodes[0].childNodes[0].childNodes[" + i + "].firstChild.mouseoutadded", "mouseHover(document.getElementById('" + ob_em_menu_id + "').childNodes[0].childNodes[0].childNodes[" + i + "].firstChild, ev, false)", this.id);
		
		ob_em_safeAddOnEvent("onclick", "document.getElementById('" + ob_em_menu_id + "').childNodes[0].childNodes[0].childNodes[" + i + "].firstChild", "document.getElementById('" + ob_em_menu_id + "').childNodes[0].childNodes[0].childNodes[" + i + "].firstChild.mouseclickcollection", "document.getElementById('" + ob_em_menu_id + "').childNodes[0].childNodes[0].childNodes[" + i + "].firstChild.mouseclickadded", "menuItemClick(document.getElementById('" + ob_em_menu_id + "').childNodes[0].childNodes[0].childNodes[" + i + "].firstChild, ev)", this.id);

		obj.setAttribute("oncontextmenu", this.id + ".hideMenu(event, false);");
	}
}

function ob_em_attachToControls ()
{
	addedDocumentEventsForThisMenu =false;

	// create the collections and the added attribute
	if (document.ob_em_mouseclickcollection == undefined) document.ob_em_mouseclickcollection = new Array();
	if (document.ob_em_mouseclickadded == undefined) document.ob_em_mouseclickadded = false;
	if (document.ob_em_contextmenucollection == undefined) document.ob_em_contextmenucollection = new Array();
	if (document.ob_em_contextmenuadded == undefined) document.ob_em_contextmenuadded = false;
	if (document.ob_em_mouseovercollection == undefined) document.ob_em_mouseovercollection = new Array();
	if (document.ob_em_mouseoveradded == undefined) document.ob_em_mouseoveradded = false;

	// wire the event to hide the menu upon clicking on the document
	ob_em_safeAddOnEvent("onclick", "document", "document.ob_em_mouseclickcollection", "document.ob_em_mouseclickadded", "documentMouseDown(ev)", this.id);

	// loop through the array of controls ids
	for (i=0; i < this.oat_id.length; i++)
	{
		// if document is contained, we 'translate' this to document.body
		ob_em_oat = this.oat_id[i].toLowerCase() == "document" ? this.body : document.getElementById(this.oat_id[i]);
		if (ob_em_oat != null)
		{
			if (ob_em_oat.ob_em_mouseclickcollection == undefined) ob_em_oat.ob_em_mouseclickcollection = new Array();
			if (ob_em_oat.ob_em_mouseclickadded == undefined) ob_em_oat.ob_em_mouseclickadded = false;
			if (ob_em_oat.ob_em_contextmenucollection == undefined) ob_em_oat.ob_em_contextmenucollection = new Array();
			if (ob_em_oat.ob_em_contextmenuadded == undefined) ob_em_oat.ob_em_contextmenuadded = false;
			if (ob_em_oat.ob_em_mouseovercollection == undefined) ob_em_oat.ob_em_mouseovercollection = new Array();
			if (ob_em_oat.ob_em_mouseoveradded == undefined) ob_em_oat.ob_em_mouseoveradded = false;
		
			// register the events
			if (document.layers)
			{
				ob_em_oat.captureEvents(Event.CLICK | Event.MOUSEDOWN | Event.MOUSEUP | Event.CONTEXTMENU | Event.MOUSEOVER | Event.MOUSEOUT);
				ob_em_body.captureEvents(Event.CLICK | Event.MOUSEDOWN | Event.MOUSEUP | Event.CONTEXTMENU | Event.MOUSEOVER | Event.MOUSEOUT);
				document.captureEvents(Event.CLICK | Event.MOUSEDOWN | Event.MOUSEUP | Event.CONTEXTMENU | Event.MOUSEOVER | Event.MOUSEOUT);
			}

			// attach the events
			if (this.showEvent == 'contextmenu')
			{
				ob_em_safeAddOnEvent("oncontextmenu", "document.getElementById('" + ob_em_oat.id + "')", "document.getElementById('" + ob_em_oat.id + "').ob_em_contextmenucollection", "document.getElementById('" + ob_em_oat.id + "').ob_em_contextmenuadded", "documentMouseDown(" + (document.all ? "window.event" : "ev") + ")", this.id);
				if (ob_em_oat != document && !addedDocumentEventsForThisMenu) 
				{
					ob_em_safeAddOnEvent("oncontextmenu", "document", "document.ob_em_contextmenucollection", "document.ob_em_contextmenuadded", "hideMenu(window.event, false)", this.id);
					ob_em_safeAddOnEvent("onclick", "document", "document.ob_em_mouseclickcollection", "document.ob_em_mouseclickadded", "hideMenu(window.event, false)", this.id);
					addedDocumentEventsForThisMenu = true;
				}
			}
			else if (this.showEvent == 'mouseclick')
			{
				ob_em_safeAddOnEvent("onclick", "document.getElementById('" + ob_em_oat.id + "')", "document.getElementById('" + ob_em_oat.id + "').ob_em_mouseclickcollection", "document.getElementById('" + ob_em_oat.id + "').ob_em_mouseclickadded", "documentMouseDown(" + (document.all ? "window.event" : "ev") + ")", this.id);
				if (ob_em_oat != document && !addedDocumentEventsForThisMenu) 
				{
					ob_em_safeAddOnEvent("onclick", "document", "document.ob_em_mouseclickcollection", "document.ob_em_mouseclickadded", "hideMenu(window.event, false)", this.id);
					ob_em_safeAddOnEvent("oncontextmenu", "document", "document.ob_em_contextmenucollection", "document.ob_em_contextmenuadded", "hideMenu(window.event, false)", this.id);
					addedDocumentEventsForThisMenu = true;
				}
			}
			else if (this.showEvent == 'mouseover')
			{
				ob_em_safeAddOnEvent("onmouseover", "document.getElementById('" + ob_em_oat.id + "')", "document.getElementById('" + ob_em_oat.id + "').ob_em_mouseovercollection", "document.getElementById('" + ob_em_oat.id + "').ob_em_mouseoveradded", "showMenu(" + (document.all ? "window.event" : "ev") + ")", this.id);
				if (ob_em_oat != document && !addedDocumentEventsForThisMenu)
				{
					ob_em_safeAddOnEvent("onclick", "document", "document.ob_em_mouseclickcollection", "document.ob_em_mouseclickadded", "documentMouseDown(window.event)", this.id);
					ob_em_safeAddOnEvent("oncontextmenu", "document", "document.ob_em_contextmenucollection", "document.ob_em_contextmenuadded", "hideMenu(window.event, false)", this.id);
					ob_em_safeAddOnEvent("onmouseover", "document", "document.ob_em_mouseovercollection", "document.ob_em_mouseoveradded", "hideMenu(ev, true)", this.id);
					addedDocumentEventsForThisMenu = true;
				}
			}
		}
	}
}

function ob_em_documentMouseDown (e)
{
	if (!e) var e = window.event;
	if (!e) 
	{
		this.hideMenu(null, true);
		return false;
	}

	if ((e.type == 'contextmenu' && this.showEvent.toLowerCase() == 'contextmenu') || this.showEvent.toLowerCase() == 'mouseclick')
	{
		// try to show menu
		return this.showMenu(e);
	}
	// if a click has taken place inside the menu and the menu was visible
	else if (this.mouseOverMenu(e)) return true;
 	// hide the menus
 	else 
 	{
 		this.rightClickHideMenu = true;
 		this.hideMenu(e, false);
 		return true;
 	}
	
	return false;
}

function ob_em_mouseHover (obj, e, over)
{
	// we set the class name to that of the element type (if over, concatenated with _o)
	obj.className = this.classes[obj.getAttribute("type")]["c" + (over ? "_o" : "")];
	// if the menu uses icons
	if (this.ui)
	{
		// if there is a link on this menu item
		if (obj.firstChild.tagName.toLowerCase() == 'a') parentObj = obj.firstChild;
		else parentObj = obj;

		// the first cell (icon or content)
		tmpObj = parentObj.firstChild.firstChild.firstChild.firstChild;
		tmpObj.className = this.classes[obj.getAttribute("type")]["c_" + tmpObj.getAttribute("type") + (over ? "_o" : "")];
		
		// the second cell (icon or content)
		tmpObj = parentObj.firstChild.firstChild.firstChild.firstChild.nextSibling;
		tmpObj.className = this.classes[obj.getAttribute("type")]["c_" + tmpObj.getAttribute("type") + (over ? "_o" : "")];
	}
}

function ob_em_showMenu(e)
{
	// set the element over which the right click has taken place
	if (e.target) this.el = e.target;
	else if (e.srcElement) this.el = e.srcElement;
	
	this.getElementAttachedFromTarget();
	if (this.el == null) return true;

	// get the coords of the menu
	menuCoords = this.getMenuCoords (e, true);
	
	// if the event is mouseover and the cursor is not over the menu, hide all the menu
	if (this.showEvent != 'mouseover' || !this.mouseOverMenu(e, menuCoords)) ob_em_hideAllMenus(e, false)
	
	// change the stylesheet to that of the menu
	ob_em_changeStyle(this.id);

	// set the menu coordinates
	this.menu.style.left = menuCoords[0] + "px";
	this.menu.style.top = menuCoords[1] + "px";

	// make the menu visible
	this.menu.style.visibility = "visible";
	
	// set the coords and dimensions of the iframe
	if (document.all)
	{
		this.cover_iframe.style.width = this.menu.offsetWidth;
		this.cover_iframe.style.height = this.menu.offsetHeight;
    }
    this.cover_iframe.style.top = this.menu.style.top;
    this.cover_iframe.style.left = this.menu.style.left;
    this.cover_iframe.style.zIndex = this.menu.style.zIndex - 1;
    this.cover_iframe.style.display = "block";
	
	// stop event propagation
	e.returnValue = false;
	e.cancelBubble = true; 
	if (e.stopPropagation) e.stopPropagation();
	
	return false;
}

function ob_em_hideAllMenus(e, withVerify)
{
	// loop through all the menus ids in the array ob_em_Menus
	for (i=0; i < ob_em_Menus.length; i++)
	{
		if (eval(ob_em_Menus[i]).menu.style.visibility.toLowerCase() == "visible")
			eval(ob_em_Menus[i]).hideMenu(e, withVerify);
	}
		
	return false;
}

function ob_em_hideMenu(e, withVerify)
{
	if (!e) e = window.event;
	menu = this.menu != undefined ? this.menu : this;

	if (!this.rightClickHideMenu && this.showEvent != 'mouseover') return;

	if (menu.style.visibility == 'hidden' || (this.showEvent != 'mouseover' || (e && (!withVerify || !this.mouseOverMenu(e)) )))
	{
		// set its coordinates to 0,0 and visibility to hidden
		menu.style.left = 0;
		menu.style.top = 0;
		menu.style.visibility = "hidden";
		menu.style.display = "none";

		// if the iframe is not set, try to set it
		if (!this.cover_iframe) this.cover_iframe = document.getElementById('obout_easymenu_iframe_' + menu.id);

		// hide the iframe
		if (this.cover_iframe) this.cover_iframe.style.display = "none";
		
		this.rightClickHideMenu = true;
	}
}

function ob_em_menuItemClick (menuObject, menuEvent)
{
	if (!menuEvent) menuEvent = window.event;
	
	// set the params that the client can make use of
	var targetEl = this.el;
	var easyMenu = this;
	
	// hide the menu
	this.rightClickHideMenu = true;
	if (menuObject.getAttribute("nohide") == null) this.hideMenu(menuEvent, false);
	
	// deselect the item
	this.mouseHover(menuObject, menuEvent, false);

	// execute client script
	eval(menuObject.getAttribute("OnClientClick"));
	
	if (menuObject.getAttribute("nohide") != null) this.rightClickHideMenu = false;
}

function ob_em_safeAddOnEvent(eventName, object, collection, eventAdded, functionToExecute, menuId)
{
	obj = eval (object);

	if(((document.all)&&((navigator.appVersion.indexOf("Mac")!=-1))) && ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1))) 
	{
		eval("obj." + eventName + ' = (function() {ob_em_safeOnEvent(collection)})');
		eval(collection + "[" + collection + ".length] = Function(" + menuId  + "." + functionToExecute + ")");
	}
	// if there are already functions wired for the event
	else if (eval("obj." + eventName))
	{
		// if the existing functions in the event were not already added to the loading array
		if(eval(eventAdded + " == false"))
		{
			eval(eventAdded + "= true");
			eval(collection + "[0] = obj." + eventName);
			eval('obj.' + eventName + ' = function(ev) {ob_em_safeOnEvent(collection, ev)}');
		}
		fct = function (ev) {eval(menuId + "." + functionToExecute);};
		eval(collection + "[" + collection + ".length] = " + fct);
	}
	else 
	{
		eval('obj.' + eventName + '= function (ev) {' + menuId + '.' + functionToExecute + ';}');
	}
}

function ob_em_safeOnEvent(collection, ev) 
{
	for(var i = 0; i < eval(collection).length; i++) 
	{
		ran = false;

		// runs each function registered in collection
		try
		{
			eval(collection)[i](ev);
			ran = true;
		}
		catch (e) {}
		
		// just to be on the safe side
		if (!ran)
		{
			try
			{
				eval (collection)[i];
			}
			catch (e) {}
		}
	}
}

// returns all stylesheets in the page
function ob_em_getAllSheets()
{
	// for ICEbrowser support (if exists)
	if (!window.ScriptEngine && navigator.__ice_version)
	{
		return document.styleSheets;
	}

	if (document.getElementsByTagName)
	{
		// link tags
		var Lt = document.getElementsByTagName('link');
		// style tags
		var St = document.getElementsByTagName('style');
	} 
	else if (document.styleSheets && document.all)
	{
		// link tags
		var Lt = document.all.tags('LINK');
		// style tags
		var St = document.all.tags('STYLE');
	} 
	else 
	{ 
		return []; 
	} 

	// add all links
	for (var x = 0, os = []; Lt[x]; x++)
	{
		var rel = Lt[x].rel ? Lt[x].rel : Lt[x].getAttribute ? Lt[x].getAttribute('rel') : '';
		// if is a stylesheet link
		if (typeof(rel) == 'string' && rel.toLowerCase().indexOf('style') + 1)
		{
			os[os.length] = Lt[x];
		}
	} 

	// add all styles
	for (var x = 0; St[x]; x++ )
	{
		os[os.length] = St[x];
	} 
	return os;
}

// disables all style sheets except for those set as parameters
function ob_em_changeStyle()
{
	for (var x = 0, ss = ob_em_getAllSheets(); ss[x]; x++)
	{
		// disable it
		if (ss[x].title)
		{
			ss[x].disabled = true;
		}
		// loop through the arguments
		for (var y = 0; y < arguments.length; y++) 
		{
			// if found in arguments
			if(ss[x].title == arguments[y])
			{
				// enable it
				ss[x].disabled = false; 
			} 
		}
	} 
}

// gets the absolute left position of the element
function ob_em_getLeft(obj){
    var pos = 0;
    if (!obj) return 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent) 
		{
			pos += obj.offsetLeft;
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		pos += obj.x;
    return pos;
}

// gets the absolute top position of the element
function ob_em_getTop(obj){
    var pos = 0;
    if (!obj) return 0;
    if (obj.offsetParent) 
    {
        while (obj.offsetParent) 
        {
            pos += obj.offsetTop;
            obj = obj.offsetParent;
        }
    }
    else if (obj.y) pos += obj.y;
    return pos;
}

function ob_em_getMenuCoords (e, returnCurrentIfVisible)
{
	if (this.el == null) return new Array (0,0);
	
	if (this.menu.style.visibility == "hidden" || returnCurrentIfVisible)
	{
		var windowWidth = 0;
		var windowHeight = 0;
		var scrollLeft = document.body.scrollLeft + document.documentElement.scrollLeft
		var scrollTop = document.body.scrollTop + document.documentElement.scrollTop;

		// display the menu on page (needed to be able to compute width)
		this.menu.style.visibility = "hidden";
		this.menu.style.display = "none";
		this.menu.style.display = "block";

		// compute initial menuLeft and menuTop
		if (this.displayPosition == 'cursor')
		{
			var menuLeft = e.clientX + this.hz_o + scrollLeft;
			var menuTop = e.clientY + this.vt_o + scrollTop;
		}
		else
		{
			// align to top left of element with top left of menu
			var menuTop = ob_em_getTop(this.el) + this.vt_o;
			var menuLeft = ob_em_getLeft(this.el) + this.hz_o;

			// adjust depending on the align position
			// for vertical
			if (this.displayPosition.toLowerCase() == 'above')
				menuTop -= this.menu.offsetHeight - 2 * this.vt_o;
			if (this.displayPosition.toLowerCase() == 'under')
				if (this.el != null && this.el.offsetHeight != null && typeof(this.el.offsetHeight) != 'undefined') menuTop += this.el.offsetHeight + 2;
			// for horizontal
			if (this.displayPosition.toLowerCase() == 'left')
				menuLeft -= this.menu.offsetWidth - 2 * this.hz_o;
			if (this.displayPosition.toLowerCase() == 'right')
				if (this.el != null && this.el.offsetWidth != null && typeof(this.el.offsetWidth) != 'undefined') menuLeft += this.el.offsetWidth + 2;
		}

		// compute the Window Width and Window Height
		if (typeof(window.innerWidth) == 'number')
		{
			windowWidth = window.innerWidth;
			windowHeight = window.innerHeight;
		}
		else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
		{
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		}
		else if (document.body && (document.body.clientWidth || document.body.clientHeight))
		{
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;	
		}
		
		windowWidth += scrollLeft;
		windowHeight += scrollTop;

		// if align is cursor then verify that the menu is inside the visible zone
		if (this.displayPosition.toLowerCase() == 'cursor')
		{
			// if menu would be outside the document on the right but would fit in the left of the mouse pointer
			if ((menuLeft + this.menu.offsetWidth) > windowWidth && (menuLeft - this.menu.offsetWidth) > scrollLeft)
				menuLeft -= this.menu.offsetWidth;
			// if menu would be outside the document on the bottom but would fit in the top of the mouse pointer
			if ((menuTop + this.menu.offsetHeight) > windowHeight && (menuTop - this.menu.offsetHeight) > scrollTop)
				menuTop -= this.menu.offsetHeight;
		}
		return new Array(menuLeft, menuTop);
	}
	else
		return new Array(this.menu.offsetLeft, this.menu.offsetTop);
}

function ob_em_mouseOverMenu (e, coords)
{
	if (!coords) coords = this.getMenuCoords(e, false);
	menuLeft = eval(coords[0]);
	menuTop = eval(coords[1]);
	
	var scrollLeft = document.body.scrollLeft + document.documentElement.scrollLeft
	var scrollTop = document.body.scrollTop + document.documentElement.scrollTop;

	free_zone_hz = 0;
	free_zone_vt = 0;
	
	if (this.showEvent.toLowerCase() != 'contextmenu')
	{
		free_zone_hz = 5;
		free_zone_vt = 5;		
	}
	
	return (this.menu.style.visibility == 'visible' && 
				((e.clientX + scrollLeft) >= (menuLeft - this.hz_o - free_zone_hz)) && 
				((e.clientX + scrollLeft) <= (menuLeft + this.menu.offsetWidth + this.hz_o + free_zone_hz)) && 
				((e.clientY + scrollTop) >= (menuTop - this.vt_o - free_zone_vt)) && 
				((e.clientY + scrollTop) <= (menuTop + this.menu.offsetHeight + this.vt_o + free_zone_vt)));
}

function ob_em_getElementAttachedFromTarget ()
{
	if (this.el == null) return;

	do
	{
		if (ob_em_searchArrayForElement(this.oat_id,this.el.id) > -1) return;
		else this.el = this.el.parentNode;
	}
	while (this.el != null)
}

function ob_em_searchArrayForElement (array, element)
{
	for (i = 0; i < array.length; i++)
		if (array[i].toLowerCase() == element.toLowerCase()) return i;
		
	return -1;
}

// script version
ob_em_js_version = "505";