var Image1 = new Image;
var Image2 = new Image;
var Image3 = new Image;
var Image4 = new Image;

var demo1effect;
var demo10effect;
var demo100effect;
var demo1000effect;

function openup(path,largeur,hauteur)
{
hauteur = hauteur + 64;
var dessus = (screen.height-hauteur)/2;
var gauche = (screen.width-largeur)/2;
var txt = "top="+dessus+",left="+gauche+",width="+largeur+",height="+hauteur+"";
photoWin = window.open( "", "photo",txt);

photoWin.document.write('<html><head></head><body bgcolor=\'#f4ea7f\'><p style="text-align: center;"><img src="'+ path +'" style="margin-top: 0px; margin-left: 0px;"/></p>');	
		photoWin.document.write('<p style="text-align: center; font-family: Verdana, Arial;"><a href="javascript:window.close()">-- Fermer la fen&ecirc;tre --</a></p></body></html>');
photoWin.document.close();	
}

function check()
{
fini = true;
if(Image1.complete == false)
fini = false;
if(Image2.complete == false)
fini = false;
if(Image3.complete == false)
fini = false;
if(Image4.complete == false)
fini = false;
if(!fini)
	setTimeout("check();",100);
else
{
demo1effect.custom(0,1);
demo10effect.custom(0,1);
demo100effect.custom(0,1);
demo1000effect.custom(0,1);
}
}

function next2()
{
var demo3effect = $('comptoir').effect('opacity', {duration: 1000, transition: Fx.Transitions.sineInOut, wait: true});
demo3effect.custom(0,1);
}

function next()
{
var demo2effect = $('all').effect('opacity', {duration: 1000, transition: Fx.Transitions.sineInOut, wait: true});
demo2effect.custom(0,1);
}

function go()
{
// var el = $('titre');
// var demo1effect = $('titre').effect('opacity');
$('comptoir').effect('opacity').set(0);
$('tartes1').effect('opacity').set(0);
$('tartes2').effect('opacity').set(0);
$('pains').effect('opacity').set(0);
Image1.src = "photos/tartes.jpg";
Image2.src = "photos/tartes2.jpg";
Image3.src = "photos/pains.jpg";
Image4.src = "comptoir.jpg";

$('comptoir').src="comptoir.jpg";
$('tartes1').src="photos/tartes.jpg";
$('tartes2').src="photos/tartes2.jpg";
$('pains').src="photos/pains.jpg";




demo1effect = $('comptoir').effect('opacity', {duration: 1000, transition: Fx.Transitions.sineInOut, wait: true});
demo10effect = $('tartes1').effect('opacity', {duration: 1000, transition: Fx.Transitions.sineInOut, wait: true});
demo1000effect = $('tartes2').effect('opacity', {duration: 1000, transition: Fx.Transitions.sineInOut, wait: true});
demo100effect = $('pains').effect('opacity', {duration: 1000, transition: Fx.Transitions.sineInOut, wait: true});

check();
// its the same as var demo1effect = new Fx.Style('demo1', 'opacity');

// setTimeout("next();",1000);
// setTimeout("next2();",1800);

/*
demo1effect.custom(0,1);
demo10effect.custom(0,1);
demo100effect.custom(0,1);
demo1000effect.custom(0,1);
*/

// var myEffect = el.effect('opacity', {duration: 500, transition: Fx.quadOut, wait: false}).set(0);
// myEffect.custom(10, 100);
}