/*
ribamenüü 14.apr.2008
richard tõnnis
rix@multiscript.net
*/
document.onclick = new Function("closemenu();");
var active = 0;
function showdiv(id){
closemenu();
var xid = document.getElementById('x'+id);
var fid = document.getElementById('f'+id);
xid.style.display = 'block';
var pos = fPos(fid);
var browser=navigator.appName;
if (browser=="Microsoft Internet Explorer"){
xid.style.left = pos[0]-40+'px';
xid.style.top = pos[1]+20+'px';
}
else{
xid.style.left = pos[0]+'px';
xid.style.top = pos[1]+9+'px';
}
active = 'x'+id;
}
function closemenu(){
if (active != 0){
var act = document.getElementById(active); 
act.style.display = 'none';	
}
}
function fPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	var arr = new Array(2);
	arr[0] = curleft;
	arr[1] = curtop;
	return arr;
}
function showleftul(id){
closemenu();
var xid = document.getElementById('x'+id);
var fid = document.getElementById('f'+id);
xid.style.display = 'block';
var pos = fPos(fid);
var browser=navigator.appName;
if (browser=="Microsoft Internet Explorer"){
xid.style.left = pos[0]-153+'px';
xid.style.top = pos[1]-4+'px';
}
else{
xid.style.left = pos[0]-155+'px';
xid.style.top = pos[1]-4+'px';
}
active = 'x'+id;
}