

        // Obsługa pojawiania się zgłoszenia w warstwie
        var xmouse = 0;
        var ymouse = 0;
	var enabletip=false;
	var offsetxpoint=0 //Customize x offset of tooltip
	var offsetypoint=0 //Customize y offset of tooltip
        var ns = (document.layers);
        var ie = (document.all);
        if (navigator.userAgent.indexOf('Firefox') > -1) {
                ff=true;
        } else {
                ff=false;
        }
        (ns)?window.captureEvents(Event.MOUSEMOVE):0;



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



      // reakcja na ruch myszką
      function Mouse(evnt) {
	if (enabletip) {
		tipobj = document.getElementById('warstwa_zgloszenie'); 
                if (!ff) {
                        if (document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollLeft)) {
                                theTop = document.documentElement.scrollTop;
				theLeft = document.documentElement.scrollLeft;
                        } else if (document.body) {
                                theTop = document.body.scrollTop;
                                theLeft = document.body.scrollLeft;
                        }
                        curY = (ns)?evnt.pageY - 50 + theTop:event.y - 50 + theTop;
                        curX = (ns)?evnt.pageX + 20 + theLeft:event.x + 20 + theLeft;
                } else {
                        curY = evnt.pageY - 100;
                        curX = evnt.pageX + 30;
                }
		//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-evnt.clientX-offsetxpoint-20;
		var bottomedge = ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-evnt.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<tipobj.offsetWidth)
			//move the horizontal position of the menu to the left by it's width
			tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+evnt.clientX-tipobj.offsetWidth-20+"px";
		else if (curX<leftedge)
			tipobj.style.left="5px";
		else*/ 
			//position the horizontal position of the menu where the mouse is positioned
			tipobj.style.left=curX+offsetxpoint+"px";
		
		//same concept with the vertical position
		if (bottomedge<tipobj.offsetHeight) {
			tempSize = (tipobj.offsetHeight - bottomedge - 80) / 2;
			tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+tempSize+"px" : window.pageYOffset+evnt.clientY-tipobj.offsetHeight-offsetypoint+tempSize+"px";
		} else
			tipobj.style.top=curY+offsetypoint+"px";
		tipobj.style.visibility="visible";
                return false;
        }
	}



        // Wyświetlenie warstwy ze zgłoszeniem
        function showWaitingUserText(title, organizator){
               
                document.getElementById('warstwa_zgloszenie').innerHTML =
        '<div style=\"width: 160px; height: 36px; background-image: url(notes/notes_bg3_01.gif); background-repeat: no-repeat; padding-left: 15px; vertical-align: bottom; color: #CE5003;\"><div style=\"height: 23px;\">&nbsp;</div></div><div style=\"width: 160px; height: auto; background-image: url(notes/notes_bg3_02.gif); background-repeat: repeat-y; padding-left: 15px;  \"><div style=\"width: 130px; height: auto; vertical-align: top; font-family: Tahoma; font-size: 11px; color: #CE5003; text-decoration: none; border: none; background-color: #FEF0A5;\"> '+title+'<br /><br /><b>Organizator:</b><br />'+organizator+'</div></div><div style=\"width: 160px; height: 25px; \"><img src=\"notes/notes_bg3_04.gif\"></div></div>';

		enabletip=true;
                return false;
        }



        // Chowanie warstwy ze zgłoszeniem
        function hideWaitingUserText(){
		enabletip=false;
                document.getElementById('warstwa_zgloszenie').style.visibility = 'hidden';
                document.getElementById('warstwa_zgloszenie').style.top = '-3000px';
                return false;
        }

	



