function addLoadEvent(func) {

  var oldonload = window.onload;

  if (typeof window.onload != 'function') {

    window.onload = func;

  } else {

    window.onload = function() {

      oldonload();

      func();

    }

  }

}



function prepare_navigation () {

	

	hide_popup();

	

	document.getElementById("palvelut").onmouseover = function () {

		show_popup();

	}

	

	document.getElementById("palvelut").onmouseout = function () {

		t=setTimeout("hide_popup()",150);

		

		//clearTimeout(t);

	}

	

	document.getElementById("dropdownmenu").onmouseover = function () {

		show_popup();

		clearTimeout(t);

	}

	

	document.getElementById("dropdownmenu").onmouseout = function () {

		t=setTimeout("hide_popup()",150);

	}

	

	

}



function hide_popup() {

	document.getElementById("dropdownmenu").style.visibility="hidden";

}



function show_popup() {

	document.getElementById("dropdownmenu").style.visibility="visible";

}



addLoadEvent(prepare_navigation);









