var Lx = 0;
var Ly = 0;
var htmlText = '';
var obj = null;
var ns4 = (navigator.appName == 'Netscape' && parseInt(navigator.appVersion) == 4);
var ns6 = (document.getElementById)? true:false;
var ie4 = (document.all)? true:false;
if (ie4) var docRoot = 'document.body';
var ie5 = false;
if (ns4) {
	var oW = window.innerWidth;
	var oH = window.innerHeight;
	window.onresize = function () {if (oW!=window.innerWidth||oH!=window.innerHeight) location.reload();}
}
if (ie4) {
	if ((navigator.userAgent.indexOf('MSIE 5') > 0) || (navigator.userAgent.indexOf('MSIE 6') > 0)) {
		if(document.compatMode && document.compatMode == 'CSS1Compat') docRoot = 'document.documentElement';
		ie5 = true;
	}
	if (ns6) {
		ns6 = false;
	}
}
if ( (ns4) || (ie4) || (ns6) ) {
	if (ns4) obj = self.document.akkuna
	if (ie4) obj = self.akkuna.style
	if (ns6) obj = self.document.getElementById("akkuna");
}


// Capture events
if ( (ns4) || (ie4) || (ns6)) {
	document.onmousemove = mouseMove
	if (ns4) document.captureEvents(Event.MOUSEMOVE)
}
function HandleMoveOn(intext) {

	htmlText="<table class='kuvatxt' border=0 cellspacing=0 cellpadding=2 width=100 bordercolor='BLACK'><tr><td bgcolor='WHITE' align=center nowrap>" + intext + "</td></tr></table>";

	if (ns4) {
		var lyr = self.document.akkuna.document
		lyr.write(htmlText)
		lyr.close()
	} else if (ie4) {
		self.document.all["akkuna"].innerHTML = htmlText
	} else if (ns6) {
		range = self.document.createRange();
		range.setStartBefore(obj);
		domfrag = range.createContextualFragment(htmlText);
		while (obj.hasChildNodes()) {
			obj.removeChild(obj.lastChild);
		}
		obj.appendChild(domfrag);
	}

	if ( (ns4) || (ie4) ) {
		obj.left = (ie4 ? Lx + 'px' : Lx);
		obj.top = (ie4 ? Ly + 'px' : Ly);
	} else if (ns6) {
		obj.style.left = Lx + "px";
		obj.style.top = Ly + "px";
	}

	// Display the layer
	if (ns4) obj.visibility = "show";
	else if (ie4) obj.visibility = "visible";
	else if (ns6) obj.style.visibility = "visible";


}

function mouseMove(e) {

	if ( (ns4) || (ns6) ) {Lx=e.pageX; Ly=e.pageY;}
	if (ie4) {Lx=event.x; Ly=event.y;}
	if (ie5) {Lx=eval('event.x+self.'+docRoot+'.scrollLeft'); Ly=eval('event.y+self.'+docRoot+'.scrollTop');}

}

function HandleMoveOff() {
	
	if (ns4) obj.visibility = "hide";
	else if (ie4) obj.visibility = "hidden";
	else if (ns6) obj.style.visibility = "hidden";

}
