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;
		case "contest" : 
			nextCont = sectionsEnglish.contest;
			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
	});
	if (nextCont.orange != null) 
		nextSect.insert(nextCont.orange);
	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 == "home") {
		popOpen = false;
		contestRulesPop();
		loadContest();
	}
	if (button == "advertising") {
		popOpen = false;
		advertisingPops();
	}
	if (button == "contest") {
		popOpen = false;
		contestForm();
		contestRulesPop();
	}
	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 launchClicks(a) {
	if (a == null) 
		a = $("ieNoThis");
	if (a.readAttribute("title") == "Go back to the home page") {
		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 (a.readAttribute("title") == "Our Advertising") {
		if ($$("body")[0].readAttribute("class") != "advertising") {
			changeSection("advertising");
			a.down().writeAttribute("src", "images/button_ouradvertising_on.gif");
		}
	} else if (a.readAttribute("title") == "Contest") {
		if ($$("body")[0].readAttribute("class") != "contest") {
			changeSection("contest");
			a.down().writeAttribute("src", "images/button_contest_on.gif");
		}
	} else {
		if ($$("body")[0].readAttribute("class") != a.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(a.up().readAttribute("class"));
		}
	}
}

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") == "Go back to the home page") || (a.readAttribute("title") == "Our Advertising") || (a.readAttribute("title") == "Contest")) {
				a.observe("click", function(a) {
					launchClicks(this);
					a.stop();
				});
			}
		});
	}
}
function loadContest() {
	if (browser != "ie6") {
		$$("a").each(function(a) {
			if (a.readAttribute("title") == "Enter for your chance to win an iPod touch courtesy of CGA") {
				a.observe("click", function(a) {
					if (popOpen == true) {
						Effect.Fade("popCont", {
							duration: 0.5,
							from: 1.0,
							to: 0.0
						});
						popOpen = false;
					}
					changeSection("contest");
					a.stop();
				});
			}
		});
	}
}