/**
 * @author leo
 */

function initFum(){
	var fumo = document.createElement('div');
	fumo.setAttribute("style", "color:red;width:129px;z-index:100");
	fumo.style.cssText="color:red; width:129px;z-index:100;margin:0;padding:0;display:none";
	
	var sopra = document.createElement('div');
	sopra.setAttribute("style", "background-image: url("+urlo+"img/sopra."+ext+");background-repeat:no-repeat;margin:0;padding:0;height:9px;");
	sopra.style.cssText ="background-image: url("+urlo+"img/sopra."+ext+");background-repeat:no-repeat;background-position:bottom 0;margin-top:0;margin-bottom:0;height:9px;";
	
	
	var mezzano = document.createElement('div');
	mezzano.setAttribute("style", "background-image: url("+urlo+"img/mezzana."+ext+");margin-bottom:0;margin-top:0;padding-left:9px;");
	mezzano.style.cssText ="background-image: url("+urlo+"img/mezzana."+ext+");margin-bottom:0;margin-top:0;padding-left:9px;";
	
	var sotto = document.createElement('div');
	sotto.setAttribute("style", "background-image: url("+urlo+"img/sotto."+ext+");background-repeat:no-repeat;margin-top:0;margin-bottom:0;height:36px;");
	sotto.style.cssText ="background-image: url("+urlo+"img/sotto."+ext+");background-repeat:no-repeat;background-position:top 0;margin-top:0;margin-bottom:0;height:36px;";
	
	
	
	fumo.appendChild(sopra);
	fumo.appendChild(mezzano);
	fumo.appendChild(sotto);
	document.getElementById('container').appendChild(fumo);
	
	var i=0;
	var titolo;
	for(i=0;i<document.links.length;i++ ){
	 	document.links[i].onmouseover=function (e){
			if (!e) var e = window.event;
			if(this.title!=''){
			titolo=	this.title;
			P=getPageScroll()[1]-80;
			plus=(titolo.length)/15;
			plus=Math.floor(plus)*13;
			P=P-plus;
			//titolo=this.title;
			titolo=titolo.replace("http://","");
			
			mezzano.innerHTML=titolo;
			
			//this.setAttribute('title','');
			fumo.setAttribute('style',"position:absolute;left:"+(e.clientX-30)+"px;top:"+(e.clientY+P)+"px;color:red;width:129px;z-index:100;display:inline;");
			fumo.style.cssText = "position:absolute;left:"+(e.clientX-30)+"px;top:"+(e.clientY+P)+"px;color:red;width:129px;z-index:100;display:inline;";
			
			}
		}
		document.links[i].onmouseout=function (e){
			fumo.setAttribute('style',"display:none");
			fumo.style.cssText = "display:none";
			//this.setAttribute('title',titolo);
		}
		
		}
		
		
}


function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}
