/* 
UTILIZZO DELLA FUNZIONE HINT

[collegamento]
<script language="javascript" src="include/js/hint.js"></script>

[nella pagina]
<div style="display: none; position: absolute;z-index:110; " id="hint"></div>

[funzionamento]
show_hint(valore)  -> chiama la funzione (valore accetta dati in html... anche iframe che caricano altre pagine)

esempio:
onmouseover="show_hint('<div>suuuuca</div>')" onmouseout="hide_hint()"

*/

var offsetfrommouse=[15,-10]; 
var coordsXY=[0,0];
var timer;

function gettrailobj(idobj){
if (document.getElementById)
return document.getElementById(idobj).style
}

function gettrailobjnostyle(idobj){
if (document.getElementById)
return document.getElementById(idobj)
}

function hide_win(idobj){	
	gettrailobj(idobj).display= "none";
	gettrailobj(idobj).left="-500px";
	clearTimeout(timer);
}


var opened_div=new Array();
var counter=0;
var DivTimer=false;

function show_win(idobj, value, x, y, type){

	//if( (navigator.userAgent.indexOf("Firefox")!=-1 || (navigator.userAgent.indexOf("Opera")==-1 && navigator.appVersion.indexOf("MSIE")!=-1))) {
		
		if (navigator.userAgent.indexOf("Firefox"==72)){
				x=x+((document.getElementById('mainTable').offsetWidth/2)-779/2);
		}
		
		gettrailobjnostyle(idobj).innerHTML = value;
		gettrailobj(idobj).display="block";
		gettrailobj(idobj).left=(x)+"px";
		gettrailobj(idobj).top=(type==0)?(coordsXY[1]+y+document.body.scrollTop)+"px":y+"px";

		opened_div[counter]=idobj;
		counter++;
		
		clearInterval(DivTimer);
		DivTimer=setInterval('closeOpenedDivs()',3000);
	//}	
}


function closeOpenedDivs(){
		for (i=0;i<opened_div.length;i++){
			//alert(opened_div[i]);
				if (opened_div[i]!='div_25'){
					hide_win(opened_div[i]);
				}
		}
		counter=0;
	}

function getMousePos(e) {
	//NS
	if (document.layers||document.getElementById&&!document.all) {
		coordsXY[0]=e.pageX;
		coordsXY[1]=e.pageY;
	}
	//IE
	else if (document.all) {
		//window.status=window.event.clientX+" and "+window.event.clientY;
		//window.status=document.body.scrollTop;
		coordsXY[0]=window.event.clientX;
		coordsXY[1]=window.event.clientY;
	}
}
document.onmousemove=getMousePos;



