// JavaScript Document
function preload() {
 document.cachethemall = new Array();

 if(document.images) {
  
  document.cachethemall[0] = new Image();
   
   if (i*1+1 > 0 && i*1+1 < x) {
    
	if ( i*1+1 < 10 ) {
     document.cachethemall[0].src = file+"0"+(i*1+1)+".jpg";
	                  }
    else if ( i*1+1 >= 10 ) {
     document.cachethemall[0].src = file+(i*1+1)+".jpg";
	 	                    }
					           }
   else {}            
                     }   
			      }		            

function show()	{

preload();

	if (i < 10)			{
		source = file+"0"+i+".jpg";
						}

	else if (i >= 10) 	{
		source = file+i+".jpg";
					  	}
				  
	else 				{
		Check = confirm("La photo ne peut être affichée, veuillez recommencer à partir de la page des apperçus pour résoudre le problème!");
			if (Check == true) 	{
  				parent.window.location = "http://www.climbing-luxembourg.com/"+path;
  								}
				
				}
				
	document.images["picture"].src = source;

	if ((i >= 1) && (i <= x)) 	{
		document.title = titre+" | Photo n° "+i+" / "+x;
								}
    								
				}

function prev() {

	i = i - 1;

	if (i < 1) { i = 1 }
	show();
				}

function next() {

	i++;
	
	if (i > x) { i = x }
	show();
				}
