

function load_function(valexit){ 
  
      if (!valexit){
		  return;
	  }
	  
      var oDiv=document.createElement("div");
	  oDiv.setAttribute('id', 'divImmaginePopup');
      frmdati.insertBefore(oDiv);
	  
      var oCmd = document.createElement("div");
	  oCmd.innerHTML ="<a href=\"javascript:chiudiPopup();\">chiudi/close</a>";
	  //oCmd.style="text-align:right;width:700px;"
      divImmaginePopup.appendChild(oCmd,document.getElementById('immaginePopup'));

	  var oImg = document.createElement("img");
	  oImg.setAttribute('id', 'immaginePopup'); 	  
      divImmaginePopup.appendChild(oImg);

      
      divImmaginePopup.insertBefore(oCmd,document.getElementById('immaginePopup'));
	  
      openPopup('../repository/immagini/pergamena_blu_nativita.jpg');
	  	
}

function chiudi_div(idDiv){
	
	if (document.getElementById(idDiv)){
		document.getElementById(idDiv).visibility = "hidden";
	}
}


/*
###########################################
# SCRIPT DI MORPHEUSWEB.IT	 	  #
# distribuibile gratuitamente	 	  #
# a patto di non rimuovere questo commento#
# altri script su:			  #
# http://www.morpheusweb.it		  #
###########################################
*/


/*
###########################################
# variabili globali (CONFIGURABILI) 	  #
###########################################
*/

// La larghezza della div con lo zoom
var larghezzaDiv = 700;
// La larghezza dello schermo
var larghezzaSchermo; 
// Intervallo in millisecondi per l'effetto fade
var intervalloFade = 100
// Trasparenza iniziale della div
var divOpacity = 20
// Step di incremento della trasparenza
var incrementoOpacity = 5


function high(which2) {
	theobject=which2
	highlighting=setInterval("highlightit(theobject)",intervalloFade)
}

function low(which2) {
	clearInterval(highlighting)
	which2.filters.alpha.opacity=divOpacity //deve essere uguale al valore in #immaginePopup del css
}

function highlightit(cur2) {
	if (cur2.filters.alpha.opacity<100)
		cur2.filters.alpha.opacity+=incrementoOpacity
	else if (window.highlighting)
	clearInterval(highlighting)
}

function impostaPosizione(){
	if (window.innerWidth){ 
		larghezzaSchermo = window.innerWidth; 
	} 
	if (document.body.clientWidth){ 
		larghezzaSchermo = document.body.clientWidth; 
	}
	if	(document.all)//IE
	{
		document.all.divImmaginePopup.style.left =  (larghezzaSchermo-larghezzaDiv)/2 + 'px';
	}
	else if (document.getElementById)//NS
	{
		temp = document.getElementById('divImmaginePopup');
		temp.style.left =  (larghezzaSchermo-larghezzaDiv)/2 + 'px';
	}
	
}

function mostraImmagine(immagine) {
	if	(document.all)//IE
	{
		document.all.immaginePopup.src =  immagine;
		document.all.divImmaginePopup.style.visibility = 'visible';
	}
	else if (document.getElementById)//NS
	{
		temp1 = document.getElementById('immaginePopup');
		temp1.src = immagine;
		temp1 = "";
		
		temp2 = document.getElementById('divImmaginePopup');
		temp2.style.visibility = 'visible';
		temp2 = "";
	}
}

function openPopup(immagine){
	impostaPosizione();
	mostraImmagine(immagine);
}


function chiudiPopup(){
	if	(document.all)//IE
	{
		try
		{
			low(immaginePopup);
		}
		catch(er){}
		
		document.all.divImmaginePopup.style.visibility = 'hidden';
	}
	else if (document.getElementById)//NS
	{
		temp = document.getElementById('divImmaginePopup');
		temp.style.visibility = 'hidden';
		temp = "";
	}
}




