  
  /////////////////////////////////////////////////////////////////////
  //
  // Agriturismo Casalone - photos.js 
  // Paolo Faccini (http://www.paolofaccini.com)
  //
  /////////////////////////////////////////////////////////////////////

	var today = new Date().getDate();

	var IA="", DA="";

	IA =  "0602-01,0602-02,0602-04,0602-05,0602-07,0602-10,"
	IA += "0602-12,0602-14,0602-19,"
	DA =  "A,A,A,A,F,F,F,F,F,"

	IA += "21,01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20"
	DA += "Il Casalone,Mrs. Marcella Lignana,,,A,F,A,,,A,Piscina Agriturismo / Swimming Pool Agriturismo,A,F,F,V,V,V,F,F,A,A"
	
	DA_A = "Agriturismo 'Il Casalone'";
	DA_F = "Fattoria 'Il Casalone' / Farm 'Il Casalone'";
	DA_V = "Vigneti / Vineyards"
	
	IA = IA.split(",")	
	DA = DA.split(",")
	
	document.write('<table width="774" border="0" align="center" cellpadding="0" cellspacing="0">');
	
	var L = parseInt(IA.length/5);
	L += ((IA.length/5-L)>0)?1:0;

	function pChkFN(s,t){
		return(((t==1)?'images/Gallery/Pics':'../images/Gallery/Thumbs')+'/'+s+'.jpg');
	}

	var cIA, cDA;
	function readCurImg(n,t){
		if (n<IA.length){ 
			cIA = pChkFN(IA[n],t); 
			cDA = DA[n]; 
			if (cDA=="A") cDA = DA_A;
			if (cDA=="F") cDA = DA_F;
			if (cDA=="V") cDA = DA_V;
		}else{	
			cIA = spcImg; 
			cDA = "";	
		}
	}

	n=0;
	spcImg = "../images/spacer.gif";
	for (k=0;k<L;k++){
		document.write('<tr><td bgcolor="#5E8F1A" align="center">');
			for (q=0;q<5;q++){
				n2 = (n+today) % IA.length;
				readCurImg(n2,0);
				document.write('<a href="javascript:pImage('+n2+');">');
				document.write('<img src="'+cIA+'" alt="'+cDA+'" width=145 height=97 border=0></a>');
				if (q<4) document.write('<img src="'+spcImg+'" width=3>');
				n++;
			}
		if (k<L-1) document.write('</td></tr><tr><td>&nbsp;</td></tr>');
	}
	
	document.write('</table>');
	
	function pImage(n,u){
		readCurImg(n,1);
		x = window.open("../image.htm?"+cIA+"|"+cDA,"Foto","width=50,height=50");
		x.focus();
	}
