var ie = document.all ? true : false;
if(!ie){ document.captureEvents(Event.MOUSEMOVE)}
document.onmousemove = getMouseXY;

var activeId = "";
var tempX = 0;
var tempY = 0;

var tekstArray = new Array();

function push(value){
	tekstArray[tekstArray.length] = value;
}

function getMouseXY(e){
	if(ie){ // grab the x-y pos.s if browser is IE
		tempX = event.clientX + document.body.scrollLeft;
		tempY = event.clientY + document.body.scrollTop;
	}
	else{ // grab the x-y pos.s if browser is NS
		tempX = e.pageX;
		tempY = e.pageY;
	}
	
	if (tempX < 0){tempX = 0;}
	if (tempY < 0){tempY = 0;}
	
	if(activeId != ""){
		document.getElementById(activeId).style.left = Math.round(tempX+10);
		document.getElementById(activeId).style.top = Math.round(tempY-150);
	}
	
	return true;
}

function showPop(id,index){
	activeId = id;
	var elm = document.getElementById(id);
	elm.style.position = "absolute";
	elm.style.left = Math.round(tempX+10)+"px";
	elm.style.top = Math.round(tempY-30)+"px";
	elm.innerHTML = tekstArray[index];
	elm.style.display = 'block';
}
function hidePop(id){
	activeId = "";
	var elm = document.getElementById(id);
	elm.innerHTML = "";
	elm.style.display = 'none';
}
