//Funzioni per la pagina home.htm

function resetp(){
	document.getElementById('home').src = "home_files/home_front.jpg"
	document.getElementById('storia').src = "home_files/storia_front.jpg"
	document.getElementById('bio').src = "home_files/bio_front.jpg"
	document.getElementById('diario').src = "home_files/diario_front.jpg"
	document.getElementById('repertorio').src = "home_files/repertorio_front.jpg"
	document.getElementById('foto').src = "home_files/foto_front.jpg"
	document.getElementById('contatti').src = "home_files/contatti_front.jpg"
	document.getElementById('guestbook').src = "home_files/guestbook_front.jpg"
	document.getElementById('concerti').src = "home_files/concerti_front.jpg"
	document.getElementById('multimedia').src = "home_files/multimedia_front.jpg"
	document.getElementById('concerti').src = "home_files/concerti_front.jpg"
}

function loader(id){
	if (id == "storia" || id == "home" || id == "bio" || id == "guestbook" || id == "contatti"|| id == "repertorio" || id == "foto" || id == "diario" || id == "concerti"){ //finchè non saranno attivi gli altri pulsanti.
		resetp();
		document.getElementById('centro').src = "home_files/frame_"+id+".htm";
		if (id == "guestbook"){
			//document.getElementById('centro').scrolling="yes";
		}
		pulsante(id);
	}
}

function pulsante(id){
	document.getElementById(id).src = "home_files/"+id+".jpg"
}


//Funzioni per la pagina bio.htm

function over(id){
	if(id != "dade" && id != "gio" && id != "fede")
		document.getElementById(id).src="frame_bio_data/_"+id+"s.gif"
}

function out(id){
	if(id != "dade" && id != "gio" && id != "fede")
		document.getElementById(id).src="frame_bio_data/_"+id+".gif"
}

function caricaProfilo(id){
	if(id != "dade" && id != "gio" && id != "fede")
		location.href = "frame_bio_"+id+".htm"
}

//Funzioni per la pagina guestbook.htm

function guestbook(){
	alert("Funzione guestbook");
	browser= navigator.appName;
	alert(browser);
	//Netscape = FireFox
	if (browser == "Netscape")
		window.location="http://utenti.lycos.it/thelizards/guestbook.htm"; 
	else 
		window.parent.location="http://utenti.lycos.it/thelizards/guestbook.htm";
}

//Funzioni per la pagina repertorio.htm

function caricaDemo(id){
	//if(id != "eleventh")
		location.href = "frame_repertorio_data/frame_demo_"+id+".htm";
	//else if ( id == "eleventh")
		//alert("PRESTO ON LINE!");
}


//Funzioni per la pagina foto.htm

function caricaFoto(id, title){
	var id, idImg, strTitle, title, data, a, url, params;
	//                          01   02   03   04   05   06    07   08    09   10  11   12   13   14   15   16   17   18   19   20    21    22    23   24    25   26 27   28    29   30    31    32   33    34    35   36	 37	   38    39   40  41    42   43   44    45   46   47   48
	param_image=new Array("0", "2", "2", "5", "10", "5", "5", "17", "3", "0", "7", "0", "0", "0", "0", "5", "0", "8", "8", "0", "0", "10", "14", "9", "14", "7", "12", "15", "0", "3", "13", "15", "13", "9", "12", "17", "8", "12", "14", "8", "9", "9", "9", "10", "9", "7", "6", "9", "10"); //, "49"); Aggiornare l'array ad ogni data aggiunta
	id = id.substring(4,6);																		                                                                //         con il numero delle foto della serata.	      	
	//If per passare l'id corretto dell'array al parametro4.
	if (id.substring(0,1) == "0")
		idImg = id.substring(1,2);
	else
		idImg = id;
	strTitle = title.split('-')
	nomeLocale = strTitle[0];
	data = document.getElementById('data'+id+'').title;
	//alert("Val ID: "+id+" Val Title: "+nomeLocale+" DATA: "+data);
	//URL = "file://C:/Documents%20and%20Settings/MMonza/Desktop/allegati/prova_sit/frame_foto"+id+".html?par1="+id+"&par2="+nomeLocale+"&par3="+data;
	//alert(url);
	//params = "toolbar=no,location=no,menubar=no,resizable=yes,scrollbars=no,status=yes,width=792,height=544";
	//a = window.open(url,"",params);
	
	//var url="QryPopUpRefrDeAbbn.do?refrDeAbbn="+valueDe+"&refrCdScnt="+valueCd+"&refrBarr="+valueBarr+"&enteCd="+enteCd;
	//var newWind = window.open(url, "subWindow", "alwaysRaised,height=450,width=500");
	location.href = "frame_foto"+id+".htm?par1="+id+"&par2="+nomeLocale+"&par3="+data+"&par4="+param_image[idImg];	
}

function DataOn(id, title){
  id = id.substring(4,6);
  document.getElementById('data'+id).innerHTML = "<label title='"+title+"' id='foto"+id+"' onClick='caricaFoto(id, title);' onMouseOut='DataOff(id, title);'> - <u><b>"+title+"</b></u></label>"  
}

function DataOff(id, title){
  id = id.substring(4,6);
  document.getElementById('data'+id).innerHTML = "<label title='"+title+"' id='foto"+id+"' onClick='caricaFoto(id, title);' onMouseOver='DataOn(id, title);'> - "+title+"</label>"; 
}

//Funzioni per le pagine singole delle foto.

//pagina foto selezionata centrata.
function NewWindow(foto,myname,w,h){

  fotoNumber = foto;
  foto = serata+foto+".jpg"
    
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;

  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
 
  settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no';

  win = window.open("",myname,settings)
  win.document.write("<html>");
  win.document.write("<head>");
  win.document.write("<meta http-equiv='Content-Language' content='it'>");
  win.document.write("<title>" + fotoNumber + "</title>");
  win.document.write("</head>");
  win.document.write("<body bgcolor=#000000 oncontextmenu='return false'>");
  win.document.write("<div style='position:absolute; width:"+w+"px; height:"+h+"px; left:0px; top:0px;'>");
  win.document.write("<img src='" + foto + "'>");
  win.document.write("</div>");
  win.document.write("</body>");
  win.document.write("</html>");
  win.document.close();
   
  if(win.window.focus){
     win.window.focus();
  }
}
   
//Funzioni per le pagine annuali del diario.

function anni(){
	
	anniD=new Array("2008", "2007", "2006", "2005", "2004", "2003");
	
	document.write('<div align="center" style="overflow:auto; position:absolute; top:0px; width:806px; height:365px" >');
	document.write('	<table border="0" bordercolor="#000000" background="frame_diario_data/patt.gif" cellpadding="2" cellspacing="2" width="790px" height="360px">');

	
	//Controllo se devo aggiungere delle righe vuote alla tabella.
	if (anniD.length < 13)
		lengTab = anniD.length + (13 - anniD.length);
	else
		lengTab = anniD.length;

	
	//Creo le righe della tabella usando i valori degli Array.
	for(i=0;i<anniD.length;i++){
		document.write('<tr height="10px">');
		document.write('  <td width="198px" align="right">');
		document.write('		<font style="font-family:Bookman Old Style,Verdana,Times New Roman,Arial" size="4" color="#000010">');
		document.write('			<a href="frame_diario_anno.htm?par1='+anniD[i]+'">');
		document.write('				'+anniD[i]);
		document.write('			</a>');
		document.write('		</font>');
		document.write('	</td>');
		document.write('	<td width="76px"></td>');
		document.write('	<td width="528px">');
		document.write('		<b><font style="font-family:Bookman Old Style,Verdana,Times New Roman,Arial" size="4" color="#000010">');
		document.write('			&nbsp;');
		document.write('		</font></b>');
		document.write('	</td>');
		document.write('</tr>');
	}
	//Ciclo per aggiungere delle righe vuote alla tabella.
	if (anniD.length < lengTab){
		for(i=anniD.length;i<lengTab;i++){
			document.write('<tr height="10px">');
			document.write('  <td width="198px" align="right">');
			document.write('		<font style="font-family:Bookman Old Style,Verdana,Times New Roman,Arial" size="4" color="#000010">');
			document.write('			&nbsp;');
			document.write('		</font>');
			document.write('	</td>');
			document.write('	<td width="76px"></td>');
			document.write('	<td width="528px">');
			document.write('		<b><font style="font-family:Bookman Old Style,Verdana,Times New Roman,Arial" size="4" color="#000010">');
			document.write('			&nbsp;');
			document.write('		</font></b>');
			document.write('	</td>');
			document.write('</tr>');
		}
	}
	//Caricamento dell'immagine alla destra degli anni.
	document.write(' </table>');
	document.write('</div>');
	document.write('<div align="center" style="position:absolute; top:0px; left:274px; width:528px; height:360px" >');
	document.write('	<table border="0" bordercolor="#000000" cellpadding="2" cellspacing="2" width="528px" height="360px">');
	document.write('		<tr>');
	document.write('			<td>');
	document.write('				<img align="middle" src="frame_diario_data/diarioGif.gif"/>');
	document.write('			</td>');
	document.write('		</tr>');
	document.write('	</table>');
	document.write('</div>');
	document.close();	
	
}

// Crea le righe sulla pagina per l'anno selezionato.
function creaRighe(anno){
	
	//Dalla pagina degli anni: passo l'anno e controllo quale coppia di array caricare in tabella.
	
	var lengTab = 0;
	
	if(anno == 2003){
		dataD=new Array("");
		dataPar= new Array("");
		descD=new Array("");
	}
  else if(anno == 2004){
		dataD=new Array("");
		dataPar= new Array("");
		descD=new Array("");
	}
	else if(anno == 2005){
		dataD=new Array("");
		dataPar= new Array("");
		descD=new Array("");
	}
	else if(anno == 2006){
		dataD=new Array("15 Dicembre 2006", "10 Dicembre 2006", "10 Novembre 2006", "01 Novembre 2006");
		dataPar= new Array("15122006", "10122006", "10112006", "01112006");
		descD=new Array("3° Stage Hunting...", "I misteri del concorso Fast Forward...", "1° Stage Hunting", "Compleanno Batteraio");
	}
  else if(anno == 2007){
		dataD=new Array("31 Maggio 2007", "27 Maggio 2007", "10 Maggio 2007", "29 Aprile 2007", "13 Aprile 2007");
		dataPar= new Array("31052007", "27052007", "10502007", "29042007", "13042007");
		descD=new Array("Kry e Tia al concerto di Dolores...", "Concerto cascina Scamozza", "Concerto Marmaja (tributo Cranberries)", "Radio OK MUSIC: Intervista e sessione acustica live...", "Concerto Roxanne");
	}
  else if(anno == 2008){
		dataD=new Array("22 Novembre 2008", "01 Novembre 2008", "16 Febbraio 2008", "09 Febbraio 2008");
		dataPar= new Array("22112008", "01112008", "16022008", "09022008");
		descD=new Array("THE LIZARDS: Work in progress!", "Concerto di saluto a Gio' e Fede", "Benvenuto Stefano!", "Davide prende la sua strada");
	}
		
	
	document.write('<div align="center" style="overflow:auto; position:absolute; top:0px; width:806px; height:365px" >');
	document.write('	<table border="0" bordercolor="#ffffff" background="frame_diario_data/patt.gif" cellpadding="2" cellspacing="2" width="790px" height="360px">');

	
	//Controllo se devo aggiungere delle righe vuote alla tabella.
	if (dataD.length < 13)
		lengTab = dataD.length + (13 - dataD.length);
	else
		lengTab = dataD.length;
	
	//Creo le righe della tabella usando i valori degli Array.
	for(i=0;i<dataD.length;i++){
		//Ricarico il javascript siccome altrimenti non vedrebbe i metodi richiamati nel codice craato.
		document.write('<script language="JavaScript" src="js/js.js"></script>');
		document.write('<tr height="10px">');
		document.write('  <td width="198px" align="right">');
		document.write('		<label>');
		//document.write('			<font class="diario_righe">');
		document.write('			<font id="dataD'+i+'" style="font-family:Bookman Old Style,Verdana,Times New Roman,Arial" size="4" color="#000010">');
		document.write('				'+dataD[i]);
		document.write('			</font>');
		document.write('		</label>');
		document.write('	</td>');
		document.write('	<td width="76px"></td>');
		document.write('	<td width="528px">');
		//document.write('		<font class="diario_righe_b">');
		document.write('		<b><font style="font-family:Bookman Old Style,Verdana,Times New Roman,Arial" size="4" color="#000010"> - ');
		document.write('			<a id="'+i+'" onMouseOut="scaricaFont(id);" onMouseOver="caricaFont(id);" href="frame_diario_flash.htm?par1='+dataPar[i]+'">');
		//alert("Valore di i: "+i);
		document.write('				'+descD[i]);
		document.write('			</a>');
		document.write('		</font></b>');
		document.write('	</td>');
		document.write('</tr>');
	}
	//Ciclo per aggiungere delle righe vuote alla tabella.
	if (dataD.length < lengTab){
		for(i=dataD.length;i<lengTab;i++){
			document.write('<tr height="10px">');
			document.write('  <td width="198px" align="right">');
			//document.write('		<font class="diario_righe">');
			document.write('		<font style="font-family:Bookman Old Style,Verdana,Times New Roman,Arial" size="4" color="#000010">');
			document.write('			&nbsp;');
			document.write('		</font>');
			document.write('	</td>');
			document.write('	<td width="76px"></td>');
			document.write('	<td width="528px">');
			//document.write('		<font class="diario_righe_b">');
			document.write('		<b><font style="font-family:Bookman Old Style,Verdana,Times New Roman,Arial" size="4" color="#000010">');
			document.write('			&nbsp;');
			document.write('		</font></b>');
			document.write('	</td>');
			document.write('</tr>');
		}
	}
	
	document.write(' </table>');
	document.write('</div>');
	document.close();
}

//Cambiamento font della data per titolo diario selezionato.
function caricaFont(id){
	document.getElementById('dataD'+id).color='#ff0000'; 
}

function scaricaFont(id){
	document.getElementById('dataD'+id).color='#000010';
}

