//funzione per aprire i link esterni in una nuova finestra
	function nuova_finestra(pagina) {
		window.open(pagina,'Galleria','scrollbars=yes,resizable=yes,status=no,width=900,height=600,location=yes,toolbar=yes');
		}



//funzione per aprire una finestra centrata
	
function apriPopupCentrata(nome, titolo, lar, alt, feat){
        var wdt = screen.width;
        var hgt = screen.height;
        var x = Math.round( (wdt / 2) - (lar / 2) );
        var y = Math.round( (hgt / 2) - (alt / 2) );
        window.open(nome, titolo, 'width=' + lar + ',height=' + alt + ',left=' + x + ',screenX=' + x + ',top=' + y + ',screenY=' + y + ',' + feat); 
}


//funzione per l'ingrandimento delle immagini in una pop up 		

function apri(url_foto,des_foto){
		addr="/include/fullsize.htm?"+url_foto+"&amp;"+escape(des_foto)
		alt=350
		lar=500
		rszb=(document.layers)?1:0;
		props='height='+alt+',width='+lar+',top='+parseInt((screen.availHeight-alt)/2)+',left='+parseInt((screen.availWidth-lar)/2)+',scrollbars=0,resizable='+rszb+',toolbar=0,menubar=0,location=0,status=0';
		window.open(addr,'_blank',props);
	}



// updated with fix for IE7 runtime error
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') window.onload = func;
    else {
        window.onload = function() {
            if (oldonload) oldonload();
            func();
        }
    }
} 

/* 
 * Show or Hide tag groups
 */

function tagGroups(action,obj) {
    var obj1 = document.getElementById('gall_3');
    var obj2 = document.getElementById('gall_2');
    var obj3 = document.getElementById('gall_1');
    if (action == 'showgall_3') {
     obj1.style.display = 'block';
     obj2.style.display = 'none';
     obj3.style.display = 'none';
    } else if (action == 'showgall_2') {
     obj1.style.display = 'none';
     obj2.style.display = 'block';
     obj3.style.display = 'none';
    } else if (action == 'showgall_1') {
     obj1.style.display = 'none';
     obj2.style.display = 'none';
     obj3.style.display = 'block';
    }
  var list = document.getElementById("taggroups");
  var group = list.getElementsByTagName("a");
  for (var i = 0; i < group.length; i++){
   group[i].parentNode.className="";
  }
  obj.parentNode.className="live";
  obj.blur();
  return false;
}


