window.onload = init1;

function init1() {
	var p1 = document.getElementById('parent1');
	var p2 = document.getElementById('parent2');
	var s1 = document.getElementById('submeniu1');
	var s2 = document.getElementById('submeniu2');
	p1.onmouseover = function() {s1.style.display = 'block';}
	p1.onmouseout  = function() {s1.hide=setTimeout(callLater(s1), 100);}
	p2.onmouseover = function() {s2.style.display = 'block';}
	p2.onmouseout  = function() {s2.hide=setTimeout(callLater(s2), 100);}
	s1.onmouseover = s2.onmouseover = over;
	s1.onmouseout = s2.onmouseout = out;}

function over(){if (this.hide!=undefined) {clearTimeout(this.hide);}}
function out() {this.hide=setTimeout(callLater(this), 100);}
function callLater(obj) {return (function(){obj.style.display="none";});}