function cleanUp(bodyClass) {
	$$("body")[0].writeAttribute("class", bodyClass);
	$$("#sectCont div.section")[0].remove();
	addSect();
}

function changeSection(button) {
	var nextSect = $$("#sectCont div.section")[1];
	var nextCont = {};
	switch (button) {
		case "leadership" : 
			nextCont = sectionsEnglish.leadership;
			break;
		case "efficiency" : 
			nextCont = sectionsEnglish.efficiency;
			break;
		case "productivity" : 
			nextCont = sectionsEnglish.productivity;
			break;
		case "sustainability" : 
			nextCont = sectionsEnglish.sustainability;
			break;
		case "managing" : 
			nextCont = sectionsEnglish.managing;
			break;
		case "contact" : 
			nextCont = sectionsEnglish.contact;
			break;
		case "privacy" : 
			nextCont = sectionsEnglish.privacy;
			break;
		case "advertising" : 
			nextCont = sectionsEnglish.advertising;
			break;
		default : 
			nextCont = sectionsEnglish.home;
	}
	nextSect.writeAttribute("id", nextCont.sectId);
	nextSect.down().writeAttribute("src", nextCont.mainImage.src);
	nextSect.down().writeAttribute("alt", nextCont.mainImage.alt);
	nextSect.down(2).insert(nextCont.content.h1);
	nextSect.down(2).next().insert(nextCont.content.colLeft);
	nextSect.down(2).next(1).down().writeAttribute("class", nextCont.content.nextSection.name);
	nextSect.down(2).next(1).down(1).writeAttribute("href", nextCont.content.nextSection.href);
	nextSect.down(2).next(1).down(1).writeAttribute("title", nextCont.content.nextSection.title);
	nextSect.down(2).next(1).down(2).writeAttribute("src", nextCont.content.nextSection.src);
	nextSect.down(2).next(1).down(2).writeAttribute("alt", nextCont.content.nextSection.alt);
	nextSect.down(2).next(1).down(2).writeAttribute("width", nextCont.content.nextSection.width);
	nextSect.down(2).next(1).insert({
		top: nextCont.content.colRight
	});
	var currSectId = $$("#sectCont div.section")[0].readAttribute("id");
	var nextSectId = $$("#sectCont div.section")[1].readAttribute("id");
	var nextSectId = $$("#sectCont div.section")[1].show();
	new Effect.Parallel(
		[
			new Effect.Move(currSectId, {
				x: -900,
				mode: "absolute"
			}),
			new Effect.Move(nextSectId, {
				x: 0,
				mode: "absolute"
			})
		],
		{
			duration: 0.5
		}
	);
	buttons = nextCont.buttons;
	setButtonHovers();
	if (button == "advertising") {
		popOpen = false;
		advertisingPops();
	}
	setTimeout("cleanUp('" + nextCont.bodyClass + "')", 500);
}

var sectMarkUp = "<div class='section'><img src='' alt='' width='900' height='323' id='mainImage' /><div id='content'><h1></h1><div class='column colLeft'></div><div class='column'><p class=''><a href='' title='' class='next'><img src='' alt='' width='' height='22' /></a></p></div><div class='clear'>&nbsp;</div></div></div>";

function addSect() {
	var sects = $$("#sectCont div.section").length;
	$$("#sectCont div.section")[sects - 1].insert({
		after: sectMarkUp
	});
	$$("#sectCont div.section")[sects].setStyle({
		width: "900px",
		height: "576px",
		position: "absolute",
		left: "900px",
		top: "0"
	});
	$$("#sectCont div.section")[sects].hide();
}

function setStage() {
	if (browser != "ie6") {
		$("stage").setStyle({
			width: "900px",
			height: "576px",
			overflow: "hidden"
		});
		$("sectCont").setStyle({
			width: "1800px",
			height: "576px",
			position: "relative",
			overflow: "hidden"
		});
		$$("#sectCont div.section").each(function(sect) {
			sect.setStyle({
				width: "900px",
				height: "576px",
				position: "absolute",
				left: "0",
				top: "0"
			});
		});
		addSect();
	}
}

function clicks() {
	if (browser != "ie6") {
		$$("a").each(function(a) {
			if ((a.up(1).readAttribute("id") == "topNav") || (a.up(1).readAttribute("id") == "subNav") || (a.readAttribute("class") == "next") || (a.readAttribute("title") == "Accueil") || (a.readAttribute("title") == "Notre publicitaire")) {
				a.observe("click", function(a) {
					if (this.readAttribute("title") == "Accueil") {
						if (popOpen == true) {
							Effect.Fade("popCont", {
								duration: 0.5,
								from: 1.0,
								to: 0.0
							});
							popOpen = false;
						}
						if ($$("body")[0].readAttribute("class") != "home") 
							changeSection("home");
					} else if (this.readAttribute("title") == "Notre publicitaire") {
						if ($$("body")[0].readAttribute("class") != "advertising") {
							changeSection("advertising");
							this.down().writeAttribute("src", "images/button_ouradvertising_on.gif");
						}
					} else {
						if ($$("body")[0].readAttribute("class") != this.up().readAttribute("class")) {
							if (popOpen == true) {
								Effect.Fade("popCont", {
									duration: 0.5,
									from: 1.0,
									to: 0.0
								});
								setTimeout("$('pcStage').remove()", 450);
								setTimeout("$('popCont').remove()", 500);
								popOpen = false;
							}
							changeSection(this.up().readAttribute("class"));
						}
					}
					a.stop();
				});
			}
		});
	}
}
