//***************************************************************************************
// contiene le funzioni:
// (1) ABILITA E DISABILITA LA PRIVACY
// (3) FUNZIONE DI APERTURA  POPOUP USATA  PER L'APERTURA DI: MODULINO, SEGNALA AD UNA AMICO
// (4) FUNZIONE DI VISUALIZZAZIONE DESCRIZIONI DELLE ICONE DEL MENU RAPIDO

// (6) CONTROLLO CONSISTENZA DEI DATI INSERITI NEL MODULO FEEDBACK

// (8) FUNZIONE AGGIUNGI AI PREFERITI (MENU' RAPIDO)
// (9) AGGIUNGE DINAMICAMENTE, A SECONDA DEL TIPO, LE ICONE AGLI ALLEGATI
// (10) AGGIUNGE DINAMICAMENTE, IL LINK CON TARGET BLANK AGLI URL INSERITI NEGLI ATTRIBUTI DEL CMS
// (11) FUNZIONE DI APERTURA POPUP PER GLI INGRANDIMENTI DELLE IMMAGINE DEL DETTAGLI SCHEDA
// (12) LANCIA TUTTE LE FUNZIONI CHE NECESSITANO DI ESSERE LANCIATE AL CARICAMENTO DELLA PAGINA  
//*****************************************************************************************

// (1) ABILITA E DISABILITA LA PRIVACY
var checkobj

function accetta(el){
checkobj=el
	if (document.all||document.getElementById){
			for (i=0;i<checkobj.form.length;i++){
				var tempobj=checkobj.form.elements[i]
				if(tempobj.type && tempobj.type.toLowerCase() == "submit")
				tempobj.disabled = !checkobj.checked;
			}
	}
}

function disabilita(el){
	if (!document.all&&!document.getElementById){
			if (window.checkobj&&checkobj.checked)
				return true
			else{
				alert("Per favore accetta i termini del contratto")
				return false
			}
	}
}


// (3) FUNZIONE DI APERTURA  POPOUP USATA  PER L'APERTURA DI: MODULINO, SEGNALA AD UNA AMICO     
function DoPopUp(URL,Name,X,Y,Center,Resizable,ScrollBars){

  //Center = yes or no
  //Resizable = yes or no
  //ScrollBars = yes or no

  if (Center == 'yes'){
    var PopUpX = (screen.width/2)-(parseInt(X)/2);
    var PopUpY = (screen.height/2)-(parseInt(Y)/2);
    var pos = ",left="+PopUpX+",top="+PopUpY;
  }else{
    var pos = "";
  }
  PopUpWindow = window.open(URL,Name,'scrollbars='+ScrollBars+',resizable='+Resizable+',width='+X+',height='+Y+pos);
}

// (4) FUNZIONE DI VISUALIZZAZIONE DESCRIZIONI DELLE ICONE DEL MENU RAPIDO
function showicondescription(element, whichbut){
	if (whichbut!=0){
		initinfo=document.getElementById(element).innerHTML;			
	}
	
	switch (whichbut){
			case 1:
				newinfo='Torna al livello superiore';
			break;

			case 2:
				newinfo='Richiedi informazioni su questo prodotto/servizio';
			break;

			case 3:
				newinfo='Stampa questa pagina';
			break;

			case 4:
				newinfo='Aggiungi questa pagina ai tuoi preferiti';
			break;

			case 5:
				newinfo='Segnala questa pagina ad un amico';
			break;
			
			case 6:
				newinfo='Richiedi informazioni su questo prodotto/servizio';
			break;

			case 7:
				newinfo='prova 3 l\'arredamento';
			break;

			case 8:
				newinfo='Delete this photo';
			break;
			
            case 9:
				newinfo='Accept this photo';
			break;

			case 10:
				newinfo='Decline this photo';
			break;
          
			case 0:
				newinfo=initinfo;
			break;
	}
   
	document.getElementById(element).innerHTML=newinfo;
}




// (6) CONTROLLO CONSISTENZA DEI DATI INSERITI NEL MODULO FEEDBACK
function convalida_feedback() {
     // Variabili associate ai campi del form
     var email2 = document.modulo_feedback.email2.value;
     var vantaggi = document.modulo_feedback.vantaggi.value;
     var svantaggi = document.modulo_feedback.svantaggi.value;
	 var codice_sicurezza_2 = document.modulo_feedback.codice_sicurezza_2.value;
	 
     // Espressione regolare dell'email
     var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
	 
		//Effettua il controllo sul campo e-mail
		if ((email2 == "") || (email2 == "undefined")) {
           alert("Il tuo INDIRIZZO MAIL è necessario per la spedizione del messaggio");
           document.modulo_feedback.email2.focus();
           return (false);
        }
			//Effettua il controllo sul campo e-mail
         else if (!email_reg_exp.test(email2)) {
			alert("Il tuo INDIRIZZO MAIL non è corretto, il messaggio non può essere spedito");
            document.modulo_feedback.email2.focus();
			return (false);
        								}

	//Effettua il controllo sul campo VANTAGGI
        if ((vantaggi == "") || (vantaggi == "undefined")) {
           alert("Non hai scritto cosa ti è piaciuto del sito, ti preghiamo di rispondere alla domanda...");
           document.modulo_feedback.vantaggi.focus();
           return (false);
        }
		else if (vantaggi.replace(/\s/g, '') == "")
		{
           alert("Non hai scritto cosa ti è piaciuto del sito, ti preghiamo di rispondere alla domanda...");
           document.modulo_feedback.vantaggi.focus();
           return (false);
        }
		
		//Effettua il controllo sul campo SVANTAGGI
        if ((svantaggi == "") || (svantaggi == "undefined")) {
           alert("Non hai scritto cosa NON ti è piaciuto del sito, ti preghiamo di rispondere alla domanda...");
           document.modulo_feedback.svantaggi.focus();
           return (false);
        }
		else if (svantaggi.replace(/\s/g, '') == "")
		{
           alert("Non hai scritto cosa NON ti è piaciuto del sito, ti preghiamo di rispondere alla domanda...");
           document.modulo_feedback.svantaggi.focus();
           return (false);
        }
			
		
		//Effettua il controllo sul campo CODICE_SICUREZZA
        if ((codice_sicurezza_2 == "") || (codice_sicurezza_2 == "undefined")) {
           alert("Il CODICE SICUREZZA è necessario per spedire il messaggio.");
           document.modulo_contatti_generale.codice_sicurezza_2.focus();
           return (false);
        }
		else if (codice_sicurezza_2.replace(/\s/g, '') == "")
		{
           alert("Il CODICE SICUREZZA è necessario per spedire il messaggio.");
           document.modulo_contatti_generale.codice_sicurezza_2.focus();
           return (false);
        }

		
	 return (true);  
        
  }


// (8) FUNZIONE AGGIUNGI AI PREFERITI (MENU' RAPIDO)
function preferiti(titolo,url)
{
var sito = location.hostname;
if( window.sidebar && window.sidebar.addPanel ) 
	{ 
	if (navigator.userAgent.lastIndexOf("Netscape") != -1) 
		{
	document.write( '<a href="#preferiti" onClick="home();" onmouseover="showicondescription('+"'thb_iconinfo2_8655'"+' , 4)" onmouseout="showicondescription('+"'thb_iconinfo2_8655'"+' , 0)"><img src="http://'+sito+'/images_layout/icone_cat/preferiti.gif"><\/a>' );
		}
else{
	document.write( '<a href="#preferiti" onClick="home();" onmouseover="showicondescription('+"'thb_iconinfo2_8655'"+' , 4)" onmouseout="showicondescription('+"'thb_iconinfo2_8655'"+' , 0)"><img src="http://'+sito+'/images_layout/icone_cat/preferiti.gif"><\/a>' );
	}
}
if( window.opera && window.print ) 
	{
	var a="<a title=";
	var b=document.title;
	var c="href=";
	var d=window.location;
	document.write( a+ '"'+ b+ '"' +' rel="sidebar" '+ c+ '"'+ d+ '"' + ' onmouseover="showicondescription('+"'thb_iconinfo2_8655'"+' , 4)" onmouseout="showicondescription('+"'thb_iconinfo2_8655'"+' , 0)"><img src="http://'+sito+'/images_layout/icone_cat/preferiti.gif"><\/a>');
	} 
else if ((ind = navigator.appVersion.indexOf("MSIE")) > -1 && navigator.userAgent.indexOf("Opera") == -1)
	 {
document.write( '<a href="javascript:addbookmark()" onmouseover="showicondescription('+"'thb_iconinfo2_8655'"+' , 4)" onmouseout="showicondescription('+"'thb_iconinfo2_8655'"+' , 0)"><img src="http://'+sito+'/images_layout/icone_cat/preferiti.gif">' + ( ( navigator.platform == 'Win32' ) ? '' : 'Hotlist entry' ) + '<\/a>' );
	}
}

function addbookmark()
	{
	var bookmarkurl=window.location;
	var bookmarktitle=document.title;
	if (document.all)
	window.external.AddFavorite(bookmarkurl,bookmarktitle)
	}
	
function home()
{
	alert("Per aggiungere questa pagina tra i TUOI SITI PREFERITI\ne poterci tornare comodamente in fututo devi:\ntenere premuto il tasto CRTL e contemporaneamente premere il tasto D\n\n                  ---------------> CTRL+D <---------------\n\n\nOppure trascinare questa icona sulla barra del tuo browser\nin corrispondenza della voce PREFERITI o BOOKMARKS");
}
	
// (9) AGGIUNGE DINAMICAMENTE, A SECONDA DEL TIPO, LE ICONE AGLI ALLEGATI
function modificaLink() 
{
	var indirizzo_base_sito = location.hostname;
	var links = document.getElementsByTagName('a');
	for (i = 0; i < links.length; i++) 
	{
	var link = links[i];
	url = links[i].getAttribute('href');
	if(url)
	{
	if (url.substring(url.length-3, url.length)=='zip') 
		{
		var icona = document.createElement('img');
		icona.setAttribute('src', 'http://'+indirizzo_base_sito+'/images_layout/icone_cat/zip.gif');
		icona.setAttribute('alt', 'File zip');
		icona.setAttribute('style',"margin-left:10px");
		icona.setAttribute('class', 'tipo_allegato');
		icona.setAttribute('align', 'absmiddle');
		icona.className = 'tipo_allegato'
		icona.style.border='0';
		link.appendChild(icona);
		}
else if (url.substring(url.length-3, url.length)=='pdf') 
	{
	var icona = document.createElement('img');
	icona.setAttribute('src', 'http://'+indirizzo_base_sito+'/images_layout/icone_cat/pdf.gif');
	icona.setAttribute('alt', 'Documento PDF');
	icona.setAttribute('style',"margin-left:10px");
	icona.setAttribute('class', 'tipo_allegato');
	icona.setAttribute('align', 'absmiddle');
	icona.className = 'tipo_allegato'
	icona.style.border='0';
	link.appendChild(icona);
	}
else if (url.substring(url.length-3, url.length)=='doc') 
	{
	var icona = document.createElement('img');
	icona.setAttribute('src', 'http://'+indirizzo_base_sito+'/images_layout/icone_cat/doc.gif');
	icona.setAttribute('alt', 'Documento Word');
	icona.setAttribute('style',"margin-left:10px");
	icona.setAttribute('class', 'tipo_allegato');
	icona.setAttribute('align', 'absmiddle');
	icona.className = 'tipo_allegato'
	icona.style.border='0';
	link.appendChild(icona);
	}
else if (url.substring(url.length-3, url.length)=='txt')
	{
	var icona = document.createElement('img');
	icona.setAttribute('src', 'http://'+indirizzo_base_sito+'/images_layout/icone_cat/txt.gif');
	icona.setAttribute('alt', 'Documento di testo');
	icona.setAttribute('style',"margin-left:10px");
	icona.setAttribute('class', 'tipo_allegato');
	icona.setAttribute('align', 'absmiddle');
	icona.className = 'tipo_allegato'
	icona.style.border='0';
	link.appendChild(icona);
	}
else if (url.substring(url.length-3, url.length)=='xls') 
	{
	var icona = document.createElement('img');
	icona.setAttribute('src', 'http://'+indirizzo_base_sito+'/images_layout/icone_cat/pdf.gif');
	icona.setAttribute('alt', 'Documento Excel');
	icona.setAttribute('style',"margin-left:10px");
	icona.setAttribute('class', 'tipo_allegato');
	icona.setAttribute('align', 'absmiddle');
	icona.className = 'tipo_allegato'
	icona.style.border='0';
	link.appendChild(icona);
	}
	}
	}
}

// (10) AGGIUNGE DINAMICAMENTE, IL LINK CON TARGET BLANK AGLI URL INSERITI NEGLI ATTRIBUTI DEL CMS
function convert()
		{
  		var table = document.getElementById('attributi');
		if(table)
		{
  		var tds = table.getElementsByTagName('td');
  		var re = /^www.[a-z0-9_.-]+.[a-z]{2,3}$/i
  		for (var i=0; i<tds.length; i++) 
			{
		    var text = tds.item(i).innerHTML;
    		if (text.match(re)) 
				{
      			tds.item(i).removeChild(tds.item(i).firstChild);
      			var a = document.createElement('a');
      			a.setAttribute('href', "http://"+text);
	  			a.setAttribute('target', "_blank");
      			var t = document.createTextNode(text);
      			a.appendChild(t);
      			tds.item(i).appendChild(a);
    			}
  			}
		}
}

// (11) FUNZIONE DI APERTURA POPUP PER GLI INGRANDIMENTI DELLE IMMAGINE DEL DETTAGLI SCHEDA

///////////////// USER SETTINGS /////////////////
// Set the target for browsers that don't support the script.  By default,
// target is "_self" which will open in the same window as the link.  Change
// it to whatever target you like.  The built in targets (_blank, _self,
// _top, and _parent) are supported.
iPop.DegradeTarget = "_self";

// Set this to true if you want to be able to click on the image to close
// the popup window
iPop.ClickImageToClose = false;

// Set this to true if you want to close the last open popup image when you click
// on a new popup (like window reuse)
iPop.CloseOpenWindows = false;

// Set this to false if you want to disable the Internet Explorer image toolbar
iPop.ieImageToolBar = true;

// Set the background color (ex: "black", "white", "#33dc80")
iPop.bgColor = "white";

// Set the padding around the image
iPop.imagePadding = 10;

// Messages displayed, you can customize them for your own language or wording
iPop.Messages = {
	loading: "Loading image.",
	loadingSub: "Please wait...",

	errorLoading: "Image not found.",
	errorLoadingSub: "Could not load image.",
	errorLoadingClose: "Close window",

	noResize: "Image loaded.",
	noResizeSub: "Your browser does not allow for window resizing.",
	noResizeView: "View Image",

	imageCloseTip: "Click to Close Window"
};

///////////////// FUNCTIONALITY /////////////////
/////////////////  DO NOT EDIT  /////////////////
iPop.Version = 2.82;
iPop.imgWin = null;
iPop.ieSp2 = (navigator.appName.toLowerCase().indexOf("internet explorer") > -1
	&& navigator.appMinorVersion.toLowerCase().indexOf("sp2") > -1);
iPop.ie7 = navigator.userAgent.indexOf("MSIE 7") > -1;
iPop.imagePadding = Math.max(iPop.imagePadding, 0);

function iPop(img, imgTitle) {

	function degrade() {
		switch(iPop.DegradeTarget) {
			case "_blank" : open(img); break;
			case "_self" : location = img; break;
			case "_top" : top.location = img; break;
			case "_parent" : parent.location = img; break;
			default : open(img, iPop.DegradeTarget);
		}
		return false;
	}
	
	// just follow the link in browsers that do not support images or the DOM
	// or launch in specified target if that's what you wanted it to do
	if(!document.images || !document.getElementById) { return degrade(); }
	
	// check to close open popups (if set to do so)
	if(iPop.CloseOpenWindows && iPop.imgWin) {
		if(iPop.imgWin.close) { iPop.imgWin.close(); }
		iPop.imgWin = null;
	}
	
	// initial (small) window with loading screen
	var width = 150, height = 100;
	if(iPop.ieSp2) { height += 20; }
	if(iPop.ie7) { height += 45; }
	var left = (screen.availWidth - width)/2, top = (screen.availHeight - height)/ 2;
	var imgWin = window.open("about:blank", "", "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top);
	// when moz disables all popups, imgWin will be false
	if(!imgWin) { return degrade(); }
	
	// user can pass an image title if they wish.  by default,
	// window title will display: "Image (img source)"
	imgTitle = imgTitle || "Image (" + img + ")";
	
	// before the script is loaded, at least in Win/IE when doing local testing;
	// timeout should (presumably) prevent that
	var html = '<!--\niPop Script (http://stilleye.com/projects/dhtml/iPop/)'
		+ '\niPop.Version = ' + iPop.Version + '\n-->'
		+ '\n<html><head><title>Loading</title>';
	if(iPop.ieImageToolBar == false) {
		html += '<meta http-equiv="imagetoolbar" content="no">\n';
	}
	html += '\n<script type="text/javascript">\nvar _e = null;'
		+ '\nvar ip = window.opener.iPop;'
		+ '\nvar _pageLoaded = false;'
		+ '\nvar _title = "' + imgTitle + '"'
		+ '\nonload = function(e) { _pageLoaded = true; }'
		+ '\nfunction imgLoad(e) { ip.ImageLoaded(e, window); }'
		+ '\nfunction imgError(e) { ip.ErrorLoading(e, window); }'
		+ '\nimgShow = ip.ImageShow;'
		+ '\nimgManualPopup = ip.ImageLoadedManualPopup;'
		+ '\n</script>'
		+ '\n<style type="text/css">'
		+ '\nhtml, body { font : 12px Arial; margin : 0; overflow : hidden; background-color : white; }'
		+ '\nh1 { font-size : 1.5em; }'
		+ '\n h2 { font-size : 1.2em; } a { color : blue; } img { visibility: hidden; border-color : black; }'
		+ '\n .message { position : absolute; left : 0px; top : 0px; width : 150px; height : 100px; background : white; text-align : center; }'
		+ '\n .message .main-message { font-weight : bold; display : block; }'
		+ '\n .message .secondary-message { color : #999; font-size : 11px; }'
		+ '\n .main-message.loading { margin-top : 35px; } .main-message.loaded { margin-top : 33px; } .main-message.error { margin-top : 25px; }'
		+ '\n #loading { z-index : 50; } #resize { z-index : 30; } #error { z-index : 40; }'
		+ '\n #image { position : absolute; left : 0px; top : 0px; width : 100%; height : 100%; z-index : 20; padding : ' + iPop.imagePadding + '; background : white; }'
		+ '\n</style>'
		+ '\n</head>\n<body>'
		+ '\n<div id="loading" class="message"><span class="main-message loading">'
		+ iPop.Messages.loading
		+ '</span> <span class="secondary-message">'
		+ iPop.Messages.loadingSub
		+ '</span></div>'
		+ '\n<div id="error" class="message"><span class="main-message error">'
		+ iPop.Messages.errorLoading
		+ '</span> <span class="secondary-message">'
		+ iPop.Messages.errorLoadingSub
		+ '<br><a href="javascript:window.close()">'
		+ iPop.Messages.errorLoadingClose
		+ '</a></span></div>'
		+ '\n<div id="resize" class="message"><span class="main-message error">'
		+ iPop.Messages.noResize
		+ '</span> <span class="secondary-message">'
		+ iPop.Messages.noResizeSub
		+ '<br><a href="javascript:imgManualPopup(_e, window)">'
		+ iPop.Messages.noResizeView
		+ '</a></span></div>'
		+ '\n<div id="image">';
	if(iPop.ClickImageToClose) {
			html += '\n<a href="javascript:window.close()" title="'
			+ iPop.Messages.imageCloseTip
			+ '">';
	}
	html += '\n<img src="' + img + '" id="theImg" border="1" onload="imgLoad(this)" onerror="imgError(this)">';
	if(iPop.ClickImageToClose) { html += '</a>'; }
	html += '\n</div>'
		+ '\n</body></html>';
	
	imgWin.document.open();
	imgWin.document.write(html);
	imgWin.document.close();
	
	iPop.imgWin = imgWin;
	
	return false;
}

iPop.ImageLoaded = function(e, win) {
	if(!e || !win) { return; }
	e.onload = null;
	e.onerror = null;
	if(win._pageLoaded) {
		function show() {
			win.imgShow(e, win);
		}
		win.setTimeout(show, 100);
	} else {
		function noShow() {
			win.imgLoad(e, win);
		}
		win.setTimeout(noShow, 100);
	}
}

iPop.ImageShow = function(e, win) {
	if(!e || !win) { return; }
	e.onload = null; e.onerror = null;
	
	var doc = win.document;
	var width = e.width + 2 * iPop.imagePadding + 7,
		height = e.height + 2 * iPop.imagePadding + 37;
	if(iPop.ieSp2 || (win.statusbar && win.statusbar.visible)) { height += 20; }
	if(iPop.ie7) { height += 45; }

	var tooLarge = false;
	
	if(width > screen.availWidth) {
		width = screen.availWidth - 20;
		tooLarge = true;
	}
	if(height > screen.availHeight) {
		height = screen.availHeight - 20;
		tooLarge = true;
	}
	if(tooLarge) {
		doc.getElementById("image").style.overflow = "auto";
	}
	
	var tooSmall = false;
	if(e.width < doc.body.clientWidth && e.height < doc.body.clientHeight) {
		tooSmall = true;
	}
	
	var left = (screen.availWidth - width)/2, top = (screen.availHeight - height)/ 2;
	win.moveTo(left, top);
	win.resizeTo(width, height);
	
	var docElm = doc.documentElement || {};
	var winWidth = docElm.clientWidth||doc.body.clientWidth||win.innerWidth,
		winHeight = docElm.clientHeight||doc.body.clientHeight||win.innerHeight;
	if( (tooLarge && (winWidth < 200 || winHeight < 200) )
		|| !tooLarge && !tooSmall && (e.width > 150 && winWidth <= 150 || e.height > 100 && winHeight <= 100) ) {
		// It didn't resize
		win._e = {
			src : e.src,
			width : e.width,
			height : e.height,
			tooLarge : tooLarge
		}
		doc.getElementById("loading").style.display = "none";
		doc.getElementById("error").style.display = "none";
		doc.getElementById("image").style.display = "none";
		doc.title = "Image Loaded";
	} else {
		// It did resize
		doc.getElementById("loading").style.display = "none";
		doc.getElementById("error").style.display = "none";
		doc.getElementById("resize").style.display = "none";
		doc.getElementById("theImg").style.visibility = "visible";
		doc.getElementById("image").style.backgroundColor = iPop.bgColor;
		doc.title = win._title;
	}
}

iPop.ErrorLoading = function(e, win) {
	if(!e || !win) { return; }
	var doc = win.document;
	e.onload = null; e.onerror = null;
	
	doc.getElementById("loading").style.display = "none";
	doc.getElementById("resize").style.display = "none";
	doc.getElementById("image").style.display = "none";
	doc.title = "Image not found";
}

iPop.ImageLoadedManualPopup = function(e, win) {
	if(!e || !win) { return; }
	var width = e.width + 20, height = e.height + 20;
	if(width > screen.availWidth) { width = screen.availWidth - 20; }
	if(height > screen.availHeight) { height = screen.availHeight - 100; }
	var left = (screen.availWidth - width)/2, top = (screen.availHeight - height)/ 2;
	win.open(e.src, "ManualImageViewer", "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + (e.tooLarge ? ",scrollbars" : ""));
	win.close();
}

///////////////// EXTENSIONS /////////////////

iPop.AutoApply = function(container) {
	if(!container) { container = document; }
	var a = container.getElementsByTagName("A");
	for(var i = 0; i < a.length; i++) {
		if( a[i].href.match(/\.(gif|jpg|jpeg|png|bmp)$/i) ) {
			applyPopup(a[i]);
		}
	}
	
	function applyPopup(link) {
		// check to see if link holds *just* a thumbnail and get
		// the thumbnail's alternate text for image popup title
		var n, imgs = 0, whitespace = 0, alt = null;
		for(var i = 0; n = link.childNodes[i]; i++) {
			if(n.tagName == "IMG") {
				imgs++;
				alt = n.alt;
			} else if(n.nodeValue) {
				var val = n.nodeValue;
				if(val.replace(/\s+/g, "") == "") { whitespace++; }
			}
		}
		n = null;
		if(!alt) { alt = link.title; }
		
		// apply iPop to link
		link.onclick = function(e) { return iPop(this.href, alt); }
	}
}



// (12) LANCIA TUTTE LE FUNZIONI CHE NECESSITANO DI ESSERE LANCIATE AL CARICAMENTO DELLA PAGINA  
function start()
{
	modificaLink();
	convert();
	iPop.AutoApply(document.getElementById('fotogallery') );
}
