//-- M. Valmaseda 2008
//-- Este fichero recoge los comentarios correspondientes a las fotos Color de
//-- la página web www.valmam.com.es. 


/* Esta variable es el número útil de fotos en el álbum */

     var numTHUMBS = 62;


/* Este array contiene los valores de los comentarios */

imgArray = [
' Madrid; Two storks walking',
' Madrid; A couple of storks in their nest',
' Madrid; Storks in the fog',
' The old factory',
' Madrid; The Arganda\'s bridge',
' Young almond tree',
' The gate of the Sigüenza\'s Cathedral',
' Madrid; Building up the skyscraper in a misty day',
' Snail\'s shell',
' Valencia; The Science\'s town',
' Valencia; The Science\'s town',
' Valencia; The Science\'s town',
' Valencia; Ready to go to fish',
' Gandía\'s harbour',
' Burgos\'s Cathedral',
' wild flowers',
' Saragossa\'s Seo in a rainy day',
' The russian dancers',
' The sad tree of autumn',
' Two raindrops',
' Madrid; Neptune square',
' Storks in the nest',
' Stork flying',
' Madrid; Gran Vía',
' Madrid; Royal Palace',
' Guadalajara\'s fields',
' Village facades',
' Railroad',
' A nice wall in Málaga',
' Málaga; sea at the sunset',
' Salamanca\'s Cathedral',
' Salamanca; Street in the night',
' Salamanca; Cathedral\'s lateral gate',
' Madrid\'s fields',
' Flying for fun',
' I\'m looking at you',
' Follow me',
' the resting of the dragonfly',
' Entomological model',
' Magpie',
' Easter Procession in Malaga 2009',
' a man, two dogs',
' Easter Procession in Malaga 2009',
' Easter Procession in Malaga 2009',
' Easter Procession in Malaga 2009',
' Easter Procession in Malaga 2009',  
' Seashore sunset',
' the orange tree',
' Las Batuecas landscape',
' Black Mountain at Las Batuecas',
' Las Batuecas landscape',
' two chimneys',
' a nice balcony',
' Rose',
' White arum lily (Zantedeschia aethiopica)',
' Rose',
' a wet day in Osma de Burgos',
' Osma de Burgo\'s crucero',
' Storm',
' storks flying',
' Madrid; Gran Vía',
' Arriving to Malaga\'s harbour',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment',
' Comment'
]
;

/*   ------------------- The functions --------------------   */

 onerror=handleErr;

 function handleErr(msg,url,l) {
 	//-- Handle the error here and return true or false
	}

 function updateCPhoto(url,index,isSuper) {

	if  ( isSuper == true ) {
                	var MainPHOTO = "<IMG ID=\"MainPhoto\" STYLE=\"border:12px solid white;\" OnClick=\"NextOne();\">" ;
		document.getElementById('IMGRECIPIENT').innerHTML = MainPHOTO;
		}
 	document.getElementById('MainPhoto').src=url;
        var iLen = String(url).length;
	var t = String(url).substring( iLen, iLen - 7 );
	t = String(t).substring(0, 3);
	t = t/1;		
   	document.getElementById('Ctitulo').innerHTML = imgArray[t-1];	
	}


 function ADJUSTHCOLORPHOTO() { 

      	var H = 750; //--document.getElementById('MainPhoto').height;//--good idea, but fixed hieght is better for tthe page!	
      	document.getElementById('MAINBOX').style.height= H ;
      	var THUMBstring = "<TABLE WIDTH=\"150\ HEIGHT=\"1000\" >";
	var FileName = "";
	for ( n= 1; n <= numTHUMBS; n++ ) {	
		if ( n  < 10 )              FileName = "ColorPhoto00" + n + ".jpg";
		if ( n  >= 10 && n < 100 )  FileName = "ColorPhoto0" + n + ".jpg";
		if ( n  >= 100 )            FileName = "ColorPhoto" + n + ".jpg";  
		THUMBstring = THUMBstring + "<TR><TD ALIGN=\"CENTER\"><A ONCLICK=\"updateCPhoto('" + FileName
			+ "', 0, false); return false;\"><IMG SRC=\"" + FileName + "\" HSPACE=\"10\" VSPACE=\"2\""
			+ "\" WIDTH=\"100\"  ALT='" + imgArray[n-1] + "' STYLE=\"border:1px solid white; cursor:hand;\"/></A></TD></TR>";		
		}	
	THUMBstring = THUMBstring + "</TABLE>";
	document.getElementById('MAINBOX').innerHTML = THUMBstring;
	}
 


function NextOne()  {
	
	var currentPhoto = document.getElementById('MainPhoto').src;
	var nt = 7; //-- padding plus extension
	var n = 3;
	var strnewt;
	var iLen = String(currentPhoto).length;
	var t = String(currentPhoto).substring( iLen, iLen - nt );
//alert ("1)   " + t);
	t = String(t).substring(0, n);
//alert ("2)   " + t); 
	t = t/1;
	var newt = t+1;
	if ( newt > numTHUMBS ) newt = 1;
	if ( newt > 0 && newt < 10 )	strnewt = "00" + newt;
	if ( newt > 9 && newt < 100 )	strnewt = "0" + newt;
	if ( newt > 99 ) strnewt = newt;
	var newPhoto = String(currentPhoto).substring( 0, iLen - nt ) + strnewt + ".jpg";
//alert (newPhoto);
	updateCPhoto(newPhoto,0,false);

	}
 

//----------------------------------------------------------------------------------------------------------------------------

/*  end of file   */
