novUtils.addEvent(window,'load',caracInit);

function caracInit() {
	initPanno();
}

/***************/
/* initPanno */
/***************/
function initPanno() {
	var pannoViewer=novUtils.getElementsByClassName('viewPanno','div');
	var pannoViewerTmp=novUtils.getElementsByClassName('viewPanno','span');
	if(pannoViewerTmp.length>0)
		pannoViewer = pannoViewer.concat(pannoViewerTmp);
	
	var pannoViewerLength=pannoViewer.length;	
	for(var i=0; i<pannoViewerLength; i++){
		idDivPanno=pannoViewer[i].getAttribute('rel');
		novUtils.$(idDivPanno).style['display'] = "none";
		pannoViewer[i].onmouseover = function(e){ 
			this.style['textDecoration']='underline'; 
			this.style['color']='#4B7284';
			this.style['cursor']='pointer';

			//pointeur de fonction
			document.onmousemove = get_mouse;
			return false;
		}
		pannoViewer[i].onmouseout = function(){ 
			this.style['textDecoration']=''; 
			this.style['color']='';
			this.style['cursor']='pointer';
			novUtils.$(this.getAttribute('rel')).style['display'] = "none";
			document.onmousemove = null;
			return false;
		}			
	}
}
	
function get_mouse(e) {
	var idRef = novUtils.getEvtTarget(e).getAttribute('rel');	
	if (idRef!=null){
		
		var x = (window.ActiveXObject) ? (event.x)  : e.pageX ;
		var y = (window.ActiveXObject) ? (event.y)  : e.pageY ;
		if(!(window.ActiveXObject))
		{
			x=parseInt(x)-parseInt(novUtils.getLeft(novUtils.$("idFor_"+idRef)))+20;
			y=parseInt(y)-parseInt(novUtils.getTop(novUtils.$("idFor_"+idRef)))-40;
		}
		else
		{
			x=parseInt(x)+20;
			y=parseInt(y)-40;			
		}
		//redéfini le style du div à afficher
		novUtils.$(idRef).style['left'] = x+"px";
		novUtils.$(idRef).style['top'] = y+"px";
		novUtils.$(idRef).style['display'] = "block";
		novUtils.$(idRef).style['position'] = "absolute";
		novUtils.$(idRef).style['border'] = "1px solid #528EA5";
		novUtils.$(idRef).style['background'] = "#E7EBF7";
		novUtils.$(idRef).style['width'] = "200px";
		novUtils.$(idRef).style['padding'] = "5px";		
		novUtils.$(idRef).style['textDecoration'] = "none";	
		novUtils.$(idRef).style['zIndex'] = "10";	
		novUtils.$(idRef).style['zoom'] = "1";
	}
}
