// Copyright (c) 2005-2007 Gianluigi Copia www.giagi.it


var Pic = new Array()
var Pic2 = new Array()


Pic[0] = '/foto/0.jpg';
Pic[1] = '/foto/1.jpg';
Pic[2] = '/foto/2.jpg';

Pic2[0] = '/foto/0a.jpg';
Pic2[1] = '/foto/1a.jpg';
Pic2[2] = '/foto/2a.jpg';
Pic2[3] = '/foto/2b.jpg';


var dh=1;// déplacement horizontal
var dv=1;// déplacement vertical
var delai=50;// délai du timer

var ricominca=0;






var t =0;
var l = -1;
var l2 = -1;
var lx = -1;
var l2x = -1;

var p = Pic.length
var p2 = Pic2.length

var preLoad = new Array()
var preLoad2 = new Array()
var i =0;
var i2 =0;

for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}



for (i2 = 0; i2 < p2; i2++){
   preLoad2[i2] = new Image()
   preLoad2[i2].src = Pic2[i2]
}





function run()
{
new Effect.Fade('loading',{duration:1.0,delay:0.0});
new Effect.Appear('container',{duration:0.5,delay:1.0});	
new Effect.Appear('footer',{duration:1.0,delay:1.0});	
new Effect.Appear('k',{duration:1.0,delay:1.0});	
new Effect.Appear('lingue',{duration:1.0,delay:1.0});	

new Effect.Move('desc1',{duration:0.6,delay:1.5, x: 710, y: -225, mode:'absolute'});
new Effect.Move('desc2',{duration:0.6,delay:1.5, x: -330, y: 235, mode:'absolute'});
new Effect.Move('p1',{duration:0.6,delay:1.5, x: 1, y: 180, mode:'absolute'});
new Effect.Move('p2',{duration:0.6,delay:1.6, x: 88, y: 180, mode:'absolute'});
new Effect.Move('p3',{duration:0.6,delay:1.7, x: 245, y: 180, mode:'absolute'});
	
new Effect.Fade('desc1',{duration:.0,delay:0.0,from:0.0, to:0.7});
new Effect.Fade('desc2',{duration:.0,delay:0.0,from:0.0, to:0.7});

cambia();
cambiax();
}
p1=0;
function espandi_p1()
{
if(p1==0)	{new Effect.Move('p1',{duration:1.0,delay:0.0, x: 1, y: 20, mode:'absolute'}); p1=1;}
else		{new Effect.Move('p1',{duration:1.0,delay:0.0, x: 1, y: 180, mode:'absolute'}); p1=0;}
}
xp2=0;
function espandi_p2()
{
if(xp2==0)	{new Effect.Move('p2',{duration:1.0,delay:0.0, x: 88, y: 20, mode:'absolute'});new Effect.Appear('pannello_booking',{duration:0.3,delay:1.0}); xp2=1;}
else		{new Effect.Move('p2',{duration:1.0,delay:0.0, x: 88, y: 180, mode:'absolute'});;new Effect.Fade('pannello_booking',{duration:0.3,delay:0.0}); xp2=0;}
}

p3=0;
function espandi_p3()
{
if(p3==0)	{new Effect.Move('p3',{duration:1.0,delay:0.0, x: 245, y: 20, mode:'absolute'}); p3=1;}
else		{new Effect.Move('p3',{duration:1.0,delay:0.0, x: 245, y: 180, mode:'absolute'}); p3=0;}
}


d1=0;
function espandi_d1()
{
if(d1==0)	{
			 new Effect.Move('desc1',{duration:1.0,delay:0.0, x: 375, y: 0, mode:'absolute'});
			 new Effect.Appear('text1',{duration:1.0,delay:1.0});
			 d1=1;
			 }
else		{
			 new Effect.Move('desc1',{duration:1.0,delay:1.0, x: 710, y: -225, mode:'absolute'});
			 new Effect.Fade('text1',{duration:1.0,delay:0.0});
			 d1=0;
			 }
}

d2=0;
function espandi_d2()
{
if(d2==0)	{
			 new Effect.Move('desc2',{duration:1.0,delay:0.0, x: 0, y: 10, mode:'absolute'});
			 new Effect.Appear('text2',{duration:1.0,delay:1.0});
			 d2=1;
			 }
else		{
			 new Effect.Move('desc2',{duration:1.0,delay:1.0, x: -330, y: 235, mode:'absolute'});
			 new Effect.Fade('text2',{duration:1.0,delay:0.0});
			 d2=0;
			 }
}



// 
//function cambia(){
//
//var im = $('FotoA');
//
//
//  l = l + 1
//   if (l > (p-1)) l=0
//   
//   
//	im.src = preLoad[l].src; 
//	 new Effect.Move('FotoA',{delay:0.0,duration:0.0, mode:'absolute' });
//	 new Effect.Appear('FotoA',{duration:1.0,delay:0.5 });
//	 new Effect.Move('FotoA',{duration:3.0,delay:1.0,  mode:'absolute'});
//	 new Effect.Fade('FotoA',{duration:1.0,delay:4.5,afterFinish:cambia });
//	
//
//}
//




function cambia(){

var im = $('FotoA');
 new Effect.Fade('FotoA',{duration:1.0,delay:0.5,afterFinish:cambia2 });
	

}


function cambia2(){
	
var im = $('FotoA');	
  l = l + 1
   if (l > (p-1)) l=0
  
	im.src = preLoad[l].src; 
	
	
 new Effect.Appear('FotoA',{duration:0.0,delay:2.0,afterFinish:cambia3 });
	
}



function cambia3(){
	
var im2 = $('FotoA2');	
  l2 = l + 1
   if (l2 > (p-1)) l2=0
  
	im2.src = preLoad[l2].src; 
	
	
 new Effect.Appear('FotoA2',{duration:0.0,delay:1.0,afterFinish:cambia });
	
}




function cambiax(){

var im = $('FotoB');
 new Effect.Fade('FotoB',{duration:1.0,delay:0.5,afterFinish:cambia2x });
	

}


function cambia2x(){
	
var imx = $('FotoB');	
  lx = lx + 1
   if (lx > (p2-1)) lx=0
  
	imx.src = preLoad2[lx].src; 
	
	
 new Effect.Appear('FotoB',{duration:0.0,delay:2.0,afterFinish:cambia3x });
	
}



function cambia3x(){
	
var im2x = $('FotoB2');	
  l2x = lx + 1
   if (l2x > (p2-1)) l2x=0
  
	im2x.src = preLoad2[l2x].src; 
	
	
 new Effect.Appear('FotoB2',{duration:0.0,delay:1.0,afterFinish:cambiax });
	
}




//
//
//
//function cambia2(){
//
//var im2 = $('FotoB');
//
//
//  l2 = l2 + 1
//   if (l2 > (p2-1)) l2=0
//   
//   
//	im2.src = preLoad2[l2].src; 
//	 new Effect.Move('FotoB',{delay:0.0,duration:0.0, mode:'absolute' });
//	 new Effect.Appear('FotoB',{duration:1.0,delay:0.5 });
//	 new Effect.Move('FotoB',{duration:3.0,delay:1.0,  mode:'absolute'});
//	 new Effect.Fade('FotoB',{duration:1.0,delay:4.5,afterFinish:cambia2 });
//	
//
//}

