
var linko ;
function changeImg(sorgente,variabile,commento){
document.getElementById('testimg').src = sorgente;
document.getElementById('tooltext').innerHTML = commento;
linko = variabile;
}

function visualizza(){
  if (document.getElementById){
     document.getElementById('tooltip').style.visibility = 'visible';
  }
}
function nascondi(){
  if (document.getElementById){
     document.getElementById('tooltip').style.visibility = 'hidden';
  }
}

function apriLink(){
  if (document.getElementById){
    document.location.href='reportages.php?id='+linko;
  }
}

/*
	firdom() version 1.1 (24.11.2003)
	written by Chris Heilmann (http://www.onlinetools.org)
*/
function firdom(){
	if(document.getElementsByTagName && document.createElement){
		for (var l=1;l<=6;l++){
			var h1s=document.getElementsByTagName('h'+l);
			scanandreplace(h1s,'h'+l);
		}
	}
}
function scanandreplace(h1s,tag){
	for(var i=0;i<h1s.length;i++){
		for(var f=0;f<replaceImages.length;f++){
			var chunks=replaceImages[f].split('|');
			var thish1=document.getElementsByTagName(tag)[i];
			if(thish1.firstChild.nodeValue==chunks[0]){
				var newImg=document.createElement('img');			
				newImg.setAttribute('alt',chunks[0])
				newImg.setAttribute('src',chunks[1])
				// or newImg.src=chunks[1];
				thish1.replaceChild(newImg,thish1.firstChild)
				break;
			}
		}
	}
}
window.onload=firdom;

$(document).ready(function() { 
		  $('a.media').media();
          $.blockUI({ 
            message: $('img#displayBox'), 
            css: { 
                top:  ($(window).height() - 540) /2 + 'px', 
                left: ($(window).width() - 580) /2 + 'px', 
                width: '540px' 
            } 
        });
		  // $('.blockOverlay').click();
		   $('.blockOverlay').click(function() { 
				$.unblockUI({ 
					onUnblock: function(){ $('.media').remove(); }  
				});
    		}); 		 
}	
);