	var isIE = document.all?true:false;
	if (!isIE) document.captureEvents(Event.MOUSEMOVE);
	document.onmousemove = getMousePosition;
	var posx=0;
	var posy=0;
	var myWidth = 0, myHeight = 0;
	var maxWidth = 0, maxHeight = 0;
	var activeobject;

	function SizeWindow(){
		if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
	}
	
	function getMousePosition(mp) {
		var _x;
		var _y;
		if (!isIE) {
			_x = mp.pageX;
			_y = mp.pageY;
			activeobject=mp.target;
		}
		if (isIE) {
			_x = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
			_y = event.clientY + document.body.scrollTop + document.documentElement.scrollTop;
			activeobject=event.srcElement;
		}

/*
		var tmp = activeobject;
		var lin=tmp.id+' : ';
		while (tmp.parentNode){
			tmp = tmp.parentNode;
			lin +=','+tmp.id;
		}
		document.getElementById('lalalalo').value=document.getElementById('boxlang').style.display+'-'+lin;
*/
		posx=_x;
		posy=_y;
		MaxPosition();
		return true;
	}

	function MaxPosition(){
		SizeWindow();
		
		maxWidth=myWidth+document.body.scrollLeft + document.documentElement.scrollLeft;
		maxHeight=myHeight+document.body.scrollTop + document.documentElement.scrollTop;
	}
	
	function ShowBox(obj, opc){
		if (opc==0){
			document.getElementById(obj).style.display='none';
			return false;
		}else if (opc==1){
			var restay=20, restax=20;
			posx=posx+10;
			posy=posy+10;

			if (isIE) restay=7;
			if (posy>maxHeight-document.getElementById(obj).clientHeight-restay)
				posy=posy-document.getElementById(obj).clientHeight;

			if (isIE) restax=5;
			if (posx>maxWidth-document.getElementById(obj).clientWidth-restax)
				posx=posx-document.getElementById(obj).clientWidth-20;

			document.getElementById(obj).style.top=posy+'px';
			document.getElementById(obj).style.left=posx+'px';
		}
			document.getElementById(obj).style.display='block';
	}
	
	function ShowBox2(obj, opc){
		if (opc==0){
			document.getElementById(obj).style.display='none';
			return false;
		}else if (opc==1){
			document.getElementById(obj).style.display='block';
			posy=posy-document.getElementById(obj).clientHeight/2;
			posx=posx-document.getElementById(obj).clientWidth/2;

			document.getElementById(obj).style.top=posy+'px';
			document.getElementById(obj).style.left=posx+'px';
		}
		
	}
