// JavaScript Document

//////////////////////////// CURSOR BEHAVIOUR //////////////////////////////////////////

var cursor_1="<table cellpadding='1' class='tipTable' style='width:";
var cursor_1a="px' cellspacing='0' cellpadding='1'><tr><td><div class='tipHead'>";
var cursor_2='</div></td></tr><tr><td class="tipBody">';
var cursor_3='</td></tr></table>';


function cursor_txt(title, author, l, activ){
var buffer=cursor_1+l+cursor_1a+title+cursor_2+author+cursor_3;
setTextOfLayer('cursorimage','', buffer);
}
	
var ie = document.all ? 1 : 0
var ns = document.layers ? 1 : 0
var mz = (document.getElementById && !ie)? 1: 0;

var initialize =-1;
var Ex, Ey;
if(ie){
document.onmousemove=overhere
Ex = "event.x"
Ey = "event.y"
}


if(ns){
Ex = "e.pageX"
Ey = "e.pageY"
window.captureEvents(Event.MOUSEMOVE)
window.captureEvents(Event.UNLOAD)
window.onmousemove=overhere
}

if(mz){
window.onmousemove=overhere
Ex = "e.clientX"
Ey = "e.clientY"
}


function MoveToolTip(layerName, FromTop, FromLeft, e)
{
var dv = tmt_findObj(layerName);
if(!dv) return;
if (ns) {dv.top = eval(FromTop); dv.left = eval(FromLeft); return }
lay = (dv.style)? dv.style : dv;
lay.top = (eval(FromTop) + document.body.scrollTop);
lay.left = (eval(FromLeft) + document.body.scrollLeft);
}


function tmt_findObj(n){
	var x,t; if((n.indexOf("?"))>0&&parent.frames.length){t=n.split("?");
	x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");
	}else{x=document.getElementById(n)}return x;
}

function setTextOfLayer(objName,x,newText) {//v3.0A Modified by Uncle Massimo and packaged by Uncle Al  for NN6 Compatibility
  var obj = (document.getElementById) ? tmt_findObj(objName) : findObj(objName);
  if (obj!=null) with (obj)
    if (document.layers) {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}

var pozX=10;
var pozY=10;
function relXY(x,y)
{pozX=x; pozY=Y}

function Activate(title, author, l, activ){initialize=1; cursor_txt(unescape(title),unescape(author), l, activ)}
function deActivate(){initialize=0; return}

function overhere(e){
var pX, pY;
lay = (tmt_findObj("cursorimage").style)? tmt_findObj("cursorimage").style : tmt_findObj("cursorimage");

if(initialize==1){
		pX=pozX+eval(Ex);
		pY=pozY+eval(Ey);
		pX = (pX >= (document.body.offsetWidth-tmt_findObj("cursorimage").offsetWidth)) ? (pX - tmt_findObj("cursorimage").offsetWidth) : pX;
		MoveToolTip("cursorimage", pY, pX, e);
		lay.visibility = "visible";
				}
	else if (initialize==0){			
			lay.visibility = "hidden";
			}
else if (initialize==-1){}
else return;
}


//////////////////////////// END CURSOR BEHAVIOUR //////////////////////////////////////////
