var W=200,H=190,R=40,D=400,A=240,I=-70,B=220,C=300,P=4,CP=4,E=80;function d(a){return D+A*(1-Math.cos(a*Math.PI))}function sl(a){return Math.round(W*D/d(a))}function sh(a){return Math.round(H*D/d(a))}function sy(a){return Math.round(B+I*(1-Math.cos(a*Math.PI))-(H-R)*D/d(a))}function sx(a){return Math.round(C-sl(a)/2+A*Math.sin(a*Math.PI))}var photos_suivantes=[1,2,5,0,3,4];var jeux_photos=[[2,5,4,1,0,3],[5,4,3,2,1,0],[4,3,0,5,2,1],[1,2,5,0,3,4],[0,1,2,3,4,5],[3,0,1,4,5,2]];function tourne_photo(){stop_animation=false;$('#images img').each(function(a){switch(jeux_photos[P][a]){case 0:$(this).attr('class','');$(this).animate({width:sh(7/9),height:sl(7/9),left:sx(-7/9),top:sy(7/9)},E,function(){$(this).animate({width:sh(8/9),height:sl(8/9),left:sx(-8/9),top:sy(8/9)},E,function(){$(this).animate({width:sh(1),height:sl(1),left:sx(-1),top:sy(1)},E)})});break;case 1:$(this).attr('class','');$(this).animate({width:sh(8/9),height:sl(8/9),left:sx(8/9),top:sy(8/9)},E,function(){$(this).animate({width:sh(7/9),height:sl(7/9),left:sx(7/9),top:sy(7/9)},E,function(){$(this).animate({width:sh(2/3),height:sl(2/3),left:sx(2/3),top:sy(2/3)},E)})});break;case 2:$(this).attr('class','');$(this).animate({width:sh(5/9),height:sl(5/9),left:sx(5/9),top:sy(5/9)},E,function(){$(this).animate({width:sh(4/9),height:sl(4/9),left:sx(4/9),top:sy(4/9)},E,function(){$(this).attr('class','h');$(this).animate({width:sh(1/3),height:sl(1/3),left:sx(1/3),top:sy(1/3)},E)})});break;case 3:$(this).attr('class','h');$(this).animate({width:sh(4/9),height:sl(4/9),left:sx(-4/9),top:sy(4/9)},E,function(){$(this).animate({width:sh(5/9),height:sl(5/9),left:sx(-5/9),top:sy(5/9)},E,function(){$(this).attr('class','');$(this).animate({width:sh(2/3),height:sl(2/3),left:sx(-2/3),top:sy(2/3)},E)})});break;case 4:$(this).attr('class','hp');$(this).animate({width:sh(1/9),height:sl(1/9),left:sx(-1/9),top:sy(1/9)},E,function(){$(this).animate({width:sh(2/9),height:sl(2/9),left:sx(-2/9),top:sy(2/9)},E,function(){$(this).attr('class','h');$(this).animate({width:sh(1/3),height:sl(1/3),left:sx(-1/3),top:sy(1/3)},E)})});break;case 5:$(this).attr('class','h');$(this).animate({width:sh(2/9),height:sl(2/9),left:sx(2/9),top:sy(2/9)},E,function(){$(this).animate({width:sh(1/9),height:sl(1/9),left:sx(1/9),top:sy(1/9)},E,function(){$(this).attr('class','hp');$(this).animate({width:sh(0),height:sl(0),left:sx(0),top:sy(0)},E,function(){P=photos_suivantes[P];if(CP!=a)tourne_photo();else stop_animation=true})})});break}})}stop_animation=true;function ct(b){var c=parseInt($('body').css('width'))-3*W+(240-A)*2;$('#textes > div').css('position','relative');$('#textes > div').animate({left:c},200,function(){$(this).animate({left:0},200,function(){$(this).css('position','')});$('#textes > div > div').each(function(a){if(a!=b)$(this).css('display','none');else $(this).css('display','block')})});var d=CP;CP=b;if(stop_animation)tourne_photo()}$(function(){$('#banniere').css('position','relative');$('#banniere').css('top','-180px');$('#banniere').css('visibility','visible');$('#banniere').fadeTo(0,0);$('#banniere').animate({top:0,opacity:1},600);$('#images a').each(function(a){$(this).replaceWith($(this).html())});var b=parseInt($('body').css('width'));if(b<850){A=140;C=220}else if(b<1000){A=180;C=260}var c=b/2-W*1.5;$('#images').css('left',c+'px');$('#images').css('position','absolute');$('#images').animate({left:0},600);$('#textes > div > div').each(function(a){if(a!=CP)$(this).css('display','none');else $(this).css('display','block')});$('#textes').css('margin-top','440px');$('#textes').animate({marginTop:0,marginLeft:3*W+60-(240-A)*2,marginRight:58},600);$('#boutons').fadeTo(0,0);$('#boutons').fadeTo(600,1);$('#boutons').html('<div class="fg">&nbsp;</div><div class="fd">&nbsp;</div>');$('#boutons .fg').css('margin-left',3*W+10-(240-A)*2);$('#boutons .fd').click(function(){for(var a=0;a<6;a++)if(photos_suivantes[a]==CP)break;ct(a)});$('#boutons .fg').click(function(){ct(photos_suivantes[CP])});$('#boutons div').hover(function(){$(this).fadeTo(200,0.6)},function(){$(this).fadeTo(200,1)});$('#images img').each(function(a){$(this).attr('class',(a<3?'':'h'));if(a<3){$(this).css('position','absolute');$(this).css('top',0);$(this).css('left',a*W)}else{$(this).css('position','absolute');$(this).css('top',H);$(this).css('left',(a-3)*W)}if(a==0||a==2)$(this).animate({width:sh(2/3),height:sl(2/3),left:sx((1-a)*2/3),top:sy(2/3)});else if(a==1)$(this).animate({width:sh(1),height:sl(1),left:sx(1),top:sy(1)});else if(a==3||a==5)$(this).animate({width:sh(1/3),height:sl(1/3),left:sx((a-4)*1/3),top:sy(1/3)});else{$(this).attr('class','hp');$(this).animate({left:sx(0),top:sy(0)})}$(this).click(function(){if(a!==CP)ct(a)})})});

