var delay = 5 ; // (10 = 1 second)
var last=null;

    function $ID(a) {
        return document.getElementById(a);
    }
	
    function menu() {		
        var b = $ID("Menu");
        var c = [];
        var d = b.getElementsByTagName("a");
        for (var i = 0; i < d.length; i++) {
            if (d[i].className.indexOf("mainLink") >= 0) {
                c.push(d[i]);
            }
        }
        for (var i in c) {			
            var e = null;
						var q = 0;
						try{
	            q = c[i].parentNode.childNodes;
						} catch(err){}
						
            for (var j = 0; j < q.length; j++) {
                if (q[j].tagName == "DIV") {
					if(q[j].className.indexOf("subMenu")>-1){
                    e = q[j];
					}
                }
            }
			if(e){
				if(e.parentNode!=last){
					e.style.display = "none";							
				}else{
					last=null;	
				}
				c[i].parentNode.onmouseover = function () {
					last=this;		
					clearTimeout(this.timeout);
					menu();
					var a = null;
					var q = this.childNodes;
					for (var j = 0; j < q.length; j++) {
						if (q[j].tagName == "DIV") {
							a = q[j];
						}
					}
					this.timeout = setTimeout(function () {a.style.display = "";}, delay * 100);};				
			}
		}			
    }		
	
	if (window.addEventListener) {
	  window.addEventListener("load", menu, false);
	} else if (window.attachEvent) {
	  window.attachEvent("onload", menu);
	}

