YAHOO.util.Event.onDOMReady(function(){
	document.getElementById('animatedHeader0').style.display = 'block';
	var theCurrentIndex = 0;
	var attributes = {marginLeft: {to: -600}};
	var animationButtons = YAHOO.util.Selector.query('.animationButton');
	theAnimation = new YAHOO.util.Anim("animatedHeader", attributes, .6, YAHOO.util.Easing.easeIn);
	for(var c = 0; c < animationButtons.length; c++){
		YAHOO.util.Event.addListener(animationButtons[c], "click", function(e,index){
			YAHOO.util.Dom.getLastChild('animatedHeader').innerHTML = document.getElementById('animatedContent' + index).innerHTML;
			YAHOO.util.Dom.removeClass(animationButtons[theCurrentIndex],"animationButtonOn");
			YAHOO.util.Dom.addClass(animationButtons[index],"animationButtonOn");
			theCurrentIndex = index;
			theAnimation.animate();
		},c);
	}
	theAnimation.onComplete.subscribe(function(s, o, index) {
		var theAnimatedElemHolder = new YAHOO.util.Element('animatedHeader');
		var childToSwap = YAHOO.util.Dom.getFirstChild('animatedHeader');
		theAnimatedElemHolder.removeChild(childToSwap);
		theAnimatedElemHolder.appendChild(childToSwap);
		document.getElementById('animatedHeader').style.marginLeft = '0px';
	});
	YAHOO.util.Dom.addClass(animationButtons[theCurrentIndex],"animationButtonOn");
	document.getElementById('citySelectGoLink').href = document.getElementById('citySelect').value;
	YAHOO.util.Event.addListener('citySelect','change', function(e){
		document.getElementById('citySelectGoLink').href = document.getElementById('citySelect').value;
	});
});
