/*function startMenu(){
	if(document.all&&document.getElementById){
	navmenu=document.getElementById('nav');
	for(i=0;i<navmenu.childNodes.length;i++){
	node=navmenu.childNodes[i];
	if(node.nodeName=='LI'){
	node.onmouseover=function(){this.className+=' over';}
	node.onmouseout=function(){this.className=this.className.replace(' over','');}
	}
	}
	}
	}


	if(window.attachEvent){window.attachEvent('onload',startMenu);}else{window.onload=startMenu;}
 */

function getTotalLeft(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
				obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function getTotalTop(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
				obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}


function menuShow(el, id, dir)
{

	if (hide[""+id])
		clearTimeout(hide[""+id]);

	var seznam = document.getElementById('menuInner'+id);

	if (dir == 'horizontal')
	{
		seznam.style["top"] = getTotalTop(el) + el.offsetHeight + 5;
		seznam.style["left"] =  getTotalLeft(el) + 5;
	}
	else if (dir == 'vertical')
	{
		seznam.style["top"] = getTotalTop(el) + 5;
		seznam.style["left"] =  getTotalLeft(el) + el.offsetWidth + 5;
	}



	seznam.style["display"] = "block";
}
var hide = array();

function menuHide(id)
{	
	hide[""+id] = setTimeout('hide(\''+id+'\')', 800);
}


function hide(id)
{
	document.getElementById('menuInner'+id).style["display"] = "none";
}


function mail_replace(){
	var protocol = 'send';

	var name, server, i; 
	for (i = 0; i < document.links.length; i++) {
		link = document.links[i];
		if(link.protocol=='send:'||link.protocol==''){
			href = link.href;
			name = link.href.substring((protocol.length+1), link.href.indexOf(')'));
			server = link.href.substring((link.href.indexOf(')')+1), link.href.indexOf('('));

			finalHref = name+'@'+server;
			link.firstChild.nodeValue=finalHref;
			link.href='mailto:'+finalHref;
		}
	}
}
if(window.attachEvent){window.attachEvent('onload',mail_replace);}else{window.onload=mail_replace;}

