// js file

function mappa(){
	document.getElementById('mappa').setAttribute('style','');
	box=document.getElementById('box_foto').getElementsByTagName('iframe').item(0);
	box.setAttribute('marginheight',"0");
	box.setAttribute('marginwidth',"0");
	box.setAttribute('src', "contenuti/googlemaps.html");
}


function rimpiazza(url_contenuto){
	
  	if(document.getElementById){
		
    	div = document.getElementById("descrizione").getElementsByTagName('iframe').item(0);
	
		setTimeout(function(){div.setAttribute('src',url_contenuto)},1000);
  	}
	else{
		alert('Your browser cannot handle this script');
	}
}


function cng_foto_(id_menu){
	setTimeout(function(){cng_main_foto(id_menu)},700);
	setTimeout(function(){cng_foto_footer(id_menu)},1000);
}

function cng_main_foto(id_menu){
	document.getElementById('mappa').setAttribute('style','display:none;');
	document.getElementById('mappa').setAttribute('src','contenuti/empty.html');
	document.getElementById('box_foto').getElementsByTagName('img').item(0).setAttribute('src', "images/foto_gallery/day/"+id_menu+"/0.jpg");
	
}

function cantina(){
	document.getElementById('mappa').setAttribute('style','display:none;');
	document.getElementById('mappa').setAttribute('src','contenuti/empty.html');
	document.getElementById('box_foto').getElementsByTagName('img').item(0).setAttribute('src', "images/foto_gallery/day/cantina/6.jpg");
	setTimeout(function(){cng_foto_footer_('cantina',0)},0);
	setTimeout(function(){cng_foto_footer_('cantina',1)},200);
	setTimeout(function(){cng_foto_footer_('cantina',2)},400);
	setTimeout(function(){cng_foto_footer_('cantina',3)},600);
	setTimeout(function(){cng_foto_footer_('cantina',4)},800);
	setTimeout(function(){cng_foto_footer_('cantina',5)},1000);
	setTimeout(function(){cng_foto_footer_('cantina',6)},1200);
	setTimeout(function(){cng_foto_footer_('cantina',7)},1400);
	setTimeout(function(){cng_foto_footer_('cantina',8)},1600);
	setTimeout(function(){cng_foto_footer_('cantina',9)},1800);
}

function cng_foto_footer(id_menu){

	setTimeout(function(){cng_foto_footer_(id_menu,0)},0);
	setTimeout(function(){cng_foto_footer_(id_menu,1)},200);
	setTimeout(function(){cng_foto_footer_(id_menu,2)},400);
	setTimeout(function(){cng_foto_footer_(id_menu,3)},600);
	setTimeout(function(){cng_foto_footer_(id_menu,4)},800);
	setTimeout(function(){cng_foto_footer_(id_menu,5)},1000);
	setTimeout(function(){cng_foto_footer_(id_menu,6)},1200);
	setTimeout(function(){cng_foto_footer_(id_menu,7)},1400);
	setTimeout(function(){cng_foto_footer_(id_menu,8)},1600);
	setTimeout(function(){cng_foto_footer_(id_menu,9)},1800);
	
}

function cng_foto_footer_(id_menu, i){
	code2=document.getElementById('foto_gallery').getElementsByTagName('img');
	code2.item(i).setAttribute('src', "images/foto_gallery/day/"+id_menu+"/thumb/"+i+".jpg");
	code2.item(i).setAttribute('id', "images/foto_gallery/day/"+id_menu+"/"+i+".jpg");
}

function cng_foto(chiamante){
	
  	if(document.getElementById){
		
		url_contenuto=chiamante.getAttribute('id');
		
    	div = document.getElementById("box_foto").getElementsByTagName("img").item(0);
		
		
		div.setAttribute('src', url_contenuto);
		document.getElementById('mappa').setAttribute('style','display:none;');
		document.getElementById('mappa').setAttribute('src','contenuti/empty.html');
		
		
  	}
	else{
		alert('Your browser cannot handle this script');
	}
}