	    
	    function DynamicMenu(MenuOpener, Menu, DelayTimeHide, Position)
	    {
	        this.menuOpenerObj = document.getElementById(MenuOpener);
	        this.menuObj = document.getElementById(Menu);
	        this.delayTime = DelayTimeHide;
	        if (this.delayTime == null)
	        {
	            this.delayTime = 1;
	        }
	        
	        var mouseIsOver = false;
	        var menuOpened = false;
	        var timerId;
	        
	        this.MenuShow = showMenu;
	        this.MenuHide = delayHideMenu;
	        
	        function showMenu()
	        {
	            if (timerId)
	            {
	                window.clearTimeout(timerId)
	            }
	            
	            if (this.menuObj.style.zIndex != null)
                {
                    this.menuObj.style.zIndex = "111";
                    //alert(this.menuObj.style.zIndex);
                }
	            
	            menuOpened = true;
	            mouseIsOver = true;
	            if (Position == "right")
	            {
	                var offsetLeft = GetObjectLeft(this.menuOpenerObj) + GetObjectWidth(this.menuOpenerObj) - 1;
	                this.menuObj.style.left = offsetLeft + "px";
	                this.menuObj.style.top = GetObjectTop(this.menuOpenerObj) + "px";
	            }
	            else
	            {
	                this.menuObj.style.left = GetObjectLeft(this.menuOpenerObj) + "px";
	                var offsetTop = GetObjectTop(this.menuOpenerObj) + GetObjectHeight(this.menuOpenerObj) - 1;
	                this.menuObj.style.top = offsetTop + "px";	                
	            }
	            this.menuObj.style.visibility = "visible";
	        }
	        
	        function delayHideMenu()
            {
                if (this.menuObj.style.zIndex != null)
                {
                    this.menuObj.style.zIndex = "110"; 
                }   
                mouseIsOver = false;
                var me = this;
                timerId = window.setTimeout(function() { me.hideMenu(); }, this.delayTime);
            }
	        
            this.hideMenu = function()
            {
                if (mouseIsOver == false)
                {
                    menuOpened = false;
                    this.menuObj.style.visibility = "hidden";
                }
            };
        }

        //Get the x-position of an object i.e. a div tag in a cell in a table
	    function GetObjectLeft(obj) 
	    {
		    var curleft = 0;
		    if (obj.offsetParent) 
		    {
			    while (obj.offsetParent) 
			    {
				    curleft += obj.offsetLeft
				    obj = obj.offsetParent;
			    }
			    if (obj.offsetLeft)
			    {
			        curleft += obj.offsetLeft
			    }
		    }
		    else if (obj.x) {
			    curleft += obj.x;
		    }
		    return curleft;
	    }
		
	    //Get the y-position of an object i.e. a div tag in a cell in a table
	    function GetObjectTop(obj)
	    {
		    var curtop = 0;
		    if (obj.offsetParent)
		    {
			    while (obj.offsetParent)
			    {
				    curtop += obj.offsetTop
				    obj = obj.offsetParent;
			    }
			    if (obj.offsetTop)
			    {
			        curtop += obj.offsetTop
			    }
		    }
		    else if (obj.y)
		    {
			    curtop += obj.y;
			}
		    return curtop;
	    }
		
	    function GetObjectWidth(obj)
	    {
	        var w = 0;
		    if (obj.offsetWidth)
            {
                w = obj.offsetWidth;
            }
            else if (obj.w)
            {
                w = obj.w;
            }
            return w;
	    }
		
	    function GetObjectHeight(obj)
	    {
            var h = 0;
            if (obj.offsetHeight) 
            {
                h = obj.offsetHeight;
            }
            else if (obj.h) 
            {
                h = obj.h;
            }
            return h;
	    }
