


var ie4 = false; if(document.all) { ie4 = true; }
function getObject(id) { if (ie4) { return document.all[id]; } else { return document.getElementById(id); } }


function Peekaboo(pp_lngId) {
	
	ll_strId1 = "curr" + pp_lngId + "a";
	ll_object1 = getObject(ll_strId1);
	
	if (ll_object1.style.display == 'none') {
		ll_object1.style.display = 'block';
	}else{
		ll_object1.style.display = 'none';
	}	
}	

var gg_strPic 			= new Array() 
var gg_strPicSource 	= new Array() 

gg_strPic[0] 			= 'gindroslide.jpg';
gg_strPicSource[0] 	= 'Marco Rossati, <em>Ritratto di Gindro</em>';
gg_strPic[1] 			= 'genimentiti.jpg';
gg_strPicSource[1] 	= 'Riccardo Tommasi Ferroni, <em>Non son geni mentiti<em>'
gg_strPic[2] 			= 'lava.jpg';
gg_strPicSource[2] 	= 'Massimo Livadiotti, <em>I trafficanti di lava</em>'
gg_strPic[3] 			= 'ludovisi.jpg';
gg_strPicSource[3] 	= '<em>Trono Ludovisi</em>'
gg_strPic[4] 			= 'tondo_doni.jpg';
gg_strPicSource[4] 	= 'Michelangelo Buonarroti, <em>Tondo Doni</em>';
gg_strPic[5] 			= 'mozart.jpg';
gg_strPicSource[5] 	= 'Gian Paolo Berto, <em>A Mozart</em>';
gg_strPic[6] 			= 'paidoforo.jpg';
gg_strPicSource[6] 	= 'Stefano Di Stasio, <em>Paidoforo</em>';
gg_strPic[7] 			= 'decalogo.jpg';
gg_strPicSource[7] 	= 'Georges De Canino, <em>Decalogo della commissione</em>';
gg_strPic[8] 			= 'gaetaniello.jpg';
gg_strPicSource[8] 	= 'Vincenzo Gaetaniello, <em>La violenza</em>';
gg_strPic[9] 			= 'tende.jpg';
gg_strPicSource[9] 	= 'Giovanni Tommasi Ferroni, <em>Tende beduine a Piazzetta Mattei</em>';
gg_strPic[10] 			= 'orfeo.jpg';
gg_strPicSource[10] 	= 'Davoud Madjidian, <em>Orfeo</em>';


var gg_lngCurrentPic = 1;
var gg_lngMaxPic 		= 10;
var gg_strPath			= 'img/slideshow/';


function preload() { 
	var tmp = null; 
   
   
   for (var j = 0; j < gg_strPic.length; j++) { 
   	tmp = gg_strPath + gg_strPic[j]; 
     	gg_strPic[j] = new Image(); 
     	gg_strPic[j].src = tmp; 
   } 
   
   var gg_strPicSmrd;
   gg_strPicSmrd = new Image(); 
   gg_strPicSmrd.src = 'img/microwedge.gif';

 
   var gg_strPicSmrd1;
   gg_strPicSmrd1 = new Image(); 
   gg_strPicSmrd1.src = 'img/subnav_blocks.gif';

} 

function ChangeImage() {
	
	div1 = document.getElementById('photofader1');
	div1.style.background = 'url(' + gg_strPic[gg_lngCurrentPic].src + ')';
	div2 = document.getElementById('photofader2a');
	div2.style.visibility = 'hidden';
	if (gg_lngCurrentPic < gg_lngMaxPic) {
		gg_lngCurrentPic = gg_lngCurrentPic + 1;
	}else{
		gg_lngCurrentPic = 0;
	}
//	div2.src = gg_strPic[gg_lngCurrentPic].src;
	setTimeout('ChangeImage1()', 3500);
	
}

function ChangeImage1() {
	div2 = document.getElementById('photofader2a');
	div2.src = gg_strPic[gg_lngCurrentPic].src;
}	

function initImage() {

	imageId = 'photofader2a';
	image = document.getElementById(imageId);
	setOpacity(image, 0);
	image.style.visibility = 'visible';
	fadeIn(imageId,0);
	
}
function fadeIn(objId,opacity) {

	if (document.getElementById) {
		ll_objId2 = document.getElementById('photofader_source');
		ll_objId2.innerHTML = '';
		obj = document.getElementById(objId);
		if (opacity <= 100) {
			setOpacity(obj, opacity);
			opacity += 5;
			setTimeout("fadeIn('"+objId+"',"+opacity+")", 50);
		}else{
			ChangeImage();
			ll_objId2 = document.getElementById('photofader_source');
			if (gg_lngCurrentPic-1>=0) {
				ll_objId2.innerHTML = gg_strPicSource[gg_lngCurrentPic-1];			
			}else{
				ll_objId2.innerHTML = gg_strPicSource[gg_lngMaxPic];
			}
			setTimeout('initImage()', 3500);
		}
	}
	
}
function setOpacity(obj, opacity) {
	opacity = (opacity == 100)?99.999:opacity;
	// IE/Win
	obj.style.filter = "alpha(opacity:"+opacity+")";
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
}


function runSlideShow(){
	ll_objId2 = document.getElementById('photofader_source');
	ll_objId2.innerHTML = ' ';			
	ll_objId2.style.fontSize='0px';
	ll_objId2.style.padding='1px 2px 1px 2px';
//	ll_objId2.innerHTML = gg_strPicSource[gg_lngCurrentPic];			
   if (document.all){
      document.images.photofader2a.style.zindex = "-1";
      document.images.photofader2a.style.filter="blendTrans(duration=2)";
      document.images.photofader2a.style.filter="blendTrans(duration=1)";
      document.images.photofader2a.filters.blendTrans.Apply();
      t1 = setTimeout('SetPhotofaderLabel()', 1000);
   }
   document.images.photofader2a.src = gg_strPic[gg_lngCurrentPic].src
   if (document.all){
      
      document.images.photofader2a.filters.blendTrans.Play()      
   }
	if (gg_lngCurrentPic < gg_lngMaxPic) {
		gg_lngCurrentPic = gg_lngCurrentPic + 1;
	}else{
		gg_lngCurrentPic = 0;
	}
   t = setTimeout('runSlideShow()', 4000)
}


function SetPhotofaderLabel() {
	ll_objId2 = getObject('photofader_source');
	ll_objId2.style.fontSize='11px';
	ll_objId2.style.padding='2px';
	if (gg_lngCurrentPic-1>=0) {
		ll_objId2.innerHTML = gg_strPicSource[gg_lngCurrentPic-1];			
	}else{
		ll_objId2.innerHTML = gg_strPicSource[gg_lngMaxPic];
	}

}

function GoBack()
{
	history.go(-1);
}

function GoBackTwice()
{
	history.go(-2);
}


function Cite() {
	
	ll_strId1 = "lead_g";
	ll_strId2 = "lead_g_off";

	ll_object1 = getObject(ll_strId1);
	ll_object2 = getObject(ll_strId2);
	
	if (ll_object1.style.display == 'none') {
		ll_object1.style.display = 'block';
		ll_object2.style.display = 'none';		
	}else{
		ll_object1.style.display = 'none';
		ll_object2.style.display = 'block';
	}	
}	
