
var detect = navigator.userAgent.toLowerCase();
var OS,browser,total,thestring;
var version = 0;



var currentMenu = null;

if (!document.getElementById)
    document.getElementById = function() { return null; }

function initializeMenu(menuId, actuatorId) {
    var menu = document.getElementById(menuId);
    var actuator = document.getElementById(actuatorId);
	var timer;
	
    if (menu == null || actuator == null) return;
	
	actuator.onmouseover = function() {
		window.clearTimeout(timer);
        if (currentMenu) {
            currentMenu.style.display = "none";
			menu.style.left ="";
			menu.style.top = "";
            this.showMenu();
        }
    }
	
	actuator.onmouseout = function() {
		window.clearTimeout(timer);
        if (currentMenu != menu) {
			menu.style.left ="";
			menu.style.top = "";
            this.showMenu();
        }
    }
	
	menu.onmouseout = function() {
        if (currentMenu != null) {
			timer = window.setTimeout('currentMenu.style.display = "none"',0)
		}
		else {
			window.clearTimeout(timer);
		}
    }
	
	menu.onmouseover = function() {
   		window.clearTimeout(timer);
    }

	actuator.showMenu = function() {
		tmph = menu.offsetTop;
		
			if (checkIt('firefox')) 
			{
				menu.style.left = tmph + this.offsetLeft + "px";
			}
			else if (checkIt('opera'))
			{
				menu.style.left = tmph + this.offsetLeft + "px";
			}
			else
			{
				menu.style.left = this.offsetLeft + "px";
			}
	
		menu.style.top = (this.offsetTop + this.offsetHeight) + "px";
		menu.style.display = "inline";
		currentMenu = menu
	}
}




function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}




