var show_activ = 0;
var hide_activ = 0;

function getTipLayer(_index) {
	return document.getElementById('top_am_' + _index) || {style:{}};
}

function _showTip(_index) {
	_hideTips();
	var box = getTipLayer(_index);
	var pos = findPosition(document.getElementById('top_am_link_' + _index));
	var pos2 = findPosition(document.getElementById('top_am_viszonyit'));
	var xp = pos[0] - pos2[0];
	//if(_index == 'w')xp -= 70;
	box.style.left = xp + 'px';
	box.style.display = 'block';
}

function _hideTip(_index) {
	getTipLayer(_index).style.display = 'none';
	activ_hide = _index;
}

function _hideTips() {
	_hideTip(show_activ);
	show_activ = 0;      	
}

var _to = null;

function tipOver(_index) {
	if (_to) window.clearTimeout(_to);
        if (show_activ!=_index) _showTip(_index);
	show_activ = _index;
}

function tipOut(_index) {
	if (_to) window.clearTimeout(_to);
	_to = window.setTimeout('_hideTips()', 500);
}

function findPosition(obj)
{
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}


// kijel�l�s ellen
window.onload = function() {
  document.onselectstart = function() {return false;} // ie
  //document.onmousedown = function() {return false;} // mozilla
}

 var isNS = (navigator.appName == "Netscape") ? 1 : 0;
  if(navigator.appName == "Netscape") document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);
  function mischandler(){
   return false;
 }
  function mousehandler(e){
 	var myevent = (isNS) ? e : event;
 	var eventbutton = (isNS) ? myevent.which : myevent.button;
    if((eventbutton==2)||(eventbutton==3)) return false;
 }
 document.oncontextmenu = mischandler;
 document.onmousedown = mousehandler;
 document.onmouseup = mousehandler;

