var alma=1;
/*
kell:
    prototype.js

    <div id="dbtip"></div>
es a hozza tartozo css formazas
#dbtip {
    font-family: verdana;
    font-size: 11px;
    position: absolute;
    width: 150px;
    border: 1px solid #FFF;
    padding: 2px;
    visibility: hidden;
    z-index: 100;
}
*/
var offsetxpoint=-60; //Customize x offset of tooltip
var offsetypoint=20; //Customize y offset of tooltip
var ie=document.all;
var ns6=(document.getElementById && !document.all);
var enabletip=false;

function ietruebody(){
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}

function ddrivetip(thetext, thecolor, thewidth, ieframe) {
    if (ns6||ie) {
	if (typeof thewidth!="undefined") $('dbtip').style.width=thewidth+"px";
	if (typeof thecolor!="undefined" && thecolor!="") $('dbtip').style.backgroundColor=thecolor;
	    $('dbtip').innerHTML=thetext;
	    var magas=$('dbtip').getHeight()-2;
	if (ieframe&&ie) {
	    $('dbtip').innerHTML="<SPAN STYLE=\"z-index:10000;\">"+thetext+"</SPAN><IFRAME id=\"frTest\" style=\"width:"+(parseInt(thewidth)+4)+"px;height:"+magas+"px;position:absolute;top:0;left:0;display:none;z-index:-1;background-color:#FFF;\" frameborder=0 scrolling=no marginwidth=0 src=\"\" marginheight=0></iframe>";
	    frame0=window.frames.frTest;
	    frame0.document.open();
	    frame0.document.write("<HTML><BODY BGCOLOR=\""+thecolor+"\"></BODY></HTML>");
	    frame0.document.close();
	}
	enabletip=true;
	return false;
    }
}


function positiontip(e){
    if (enabletip) {
	var curX=(ns6)?e.pageX : event.x+ietruebody().scrollLeft;
	var curY=(ns6)?e.pageY : event.y+ietruebody().scrollTop;
	//Find out how close the mouse is to the corner of the window
	var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20;
	var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20;
	var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000;
	//if the horizontal distance isn't enough to accomodate the width of the context menu
	if (rightedge<$('dbtip').offsetWidth)
	    //move the horizontal position of the menu to the left by it's width
	    $('dbtip').style.left=ie? ietruebody().scrollLeft+event.clientX-$('dbtip').offsetWidth+"px" : window.pageXOffset+e.clientX-$('dbtip').offsetWidth+"px";
	else if (curX<leftedge)
	    $('dbtip').style.left="5px";
	else
	    //position the horizontal position of the menu where the mouse is positioned
	    $('dbtip').style.left=curX+offsetxpoint+"px";
	    //same concept with the vertical position
	if (bottomedge<$('dbtip').offsetHeight)
	    $('dbtip').style.top=ie? ietruebody().scrollTop+event.clientY-$('dbtip').offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-$('dbtip').offsetHeight-offsetypoint+"px";
	else
	    $('dbtip').style.top=curY+offsetypoint+"px";
	$('dbtip').style.visibility="visible";

	if (ie) document.getElementById("frTest").style.display = "inline";
    }
}

function hideddrivetip(){
    if (ns6||ie){
	enabletip=false;
	$('dbtip').style.visibility="hidden";
        $('dbtip').style.left="-1000px";
	$('dbtip').style.backgroundColor='';
	$('dbtip').style.width='';
	
	if (ie) document.getElementById("frTest").style.display = "none";
    }
}
document.onmousemove=positiontip;
