// JavaScript Document

function demarre(elmt,id){
	switch (elmt){
			case 1 : $('Content').morph('width:870px;height:410px;margin:110px 10px 0 100px;',	{afterFinish: function(){Chargement(id,elmt)} });break;
			case 2 : $('Content').morph('width:730px;height:450px;margin:70px 10px 0 40px;',	{afterFinish: function(){Affichage(elmt)} });break;
			case 3 : $('Content').morph('width:500px;height:500px;margin:20px 300px 0 0px;',	{afterFinish: function(){Affichage(elmt)} });break;
			case 4 : $('Content').morph('width:870px;height:500px;margin:15px 10px 0 40px;',	{afterFinish: function(){Affichage(elmt)} });break;
			case 5 : $('Content').morph('width:740px;height:440px;margin:80px 10px 0 40px;',	{afterFinish: function(){Affichage(elmt)} });break;
			case 51: $('Content').morph('width:740px;height:440px;margin:80px 10px 0 40px;',	{duration:0.1,afterFinish: function(){Chargement(id,elmt)} });break;
			case 6 : $('Content').morph('width:740px;height:440px;margin:80px 10px 0 40px;',	{afterFinish: function(){Affichage(elmt)} });break;
			case 61: $('Content').morph('width:740px;height:440px;margin:80px 10px 0 40px;',	{duration:0.1,afterFinish: function(){Chargement(id,elmt)} });break;
			case 7 : $('Content').morph('width:760px;height:440px;margin:80px 10px 0 40px;',	{afterFinish: function(){Affichage(elmt)} });break;
		}
	if(elmt == 61){
		clearItem(6);
		var btn = document.getElementById("item6");	
	}else{
	if(elmt == 51){
		clearItem(5);
		var btn = document.getElementById("item5");
	}else{
	clearItem(elmt);
	var btn = document.getElementById("item"+elmt);}}
	btn.morph('filter:alpha(opacity=100); opacity:1; -moz-opacity:1;', {duration: 1,afterFinish: function(){btn.className = 'Active';}});
	return true;
}


function Chargement(id,page){
	if(page==1){
		news(id);
	}
	else{
		if(page == 51){
			afficherYacht(id, 1);
			$('ContentLeft51').appear({duration:0.3});
			$('ContentRight51').appear({duration:0.3});
			
		}else{
			afficherYacht(id, 2);
			$('ContentLeft61').appear({duration:0.3});
			$('ContentRight61').appear({duration:0.3});
		}
	
	}
	return true;
}
