


function changeTop(a) { //this is for the switcharoo section
		var temp = a.parentNode.getAttribute('id');
		//url="../inc/ajax/data_"+temp+".html";
		var topsection = document.getElementById('topsection'); //get the top div
		var featureArray = topsection.getElementsByTagName('dl') //get all DLs inside topsection
		for (i=0;i<featureArray.length;i++) { //loop through all DLs
			featureArray[i].style.display="none"; //hide every DL - we will go back and make the new one visible
		}
		var newFeature = document.getElementById(temp + "top"); //get the DL at the top of the switcharoo that needs to be made visible
		var newId = newFeature.getAttribute('id');
		document.getElementById('loadingtop').style.display = "block";
		window.setTimeout("showTop('" + newId + "')", 1000);
		//newFeature.style.display="block";
		document.getElementById('active_feature').removeAttribute('id');
		thisone = a.parentNode.parentNode;
		thisone.setAttribute('id', 'active_feature');
	}
	
function showTop(a) {
	document.getElementById('loadingtop').style.display="none";
	document.getElementById(a).style.display="block";
}

var stretchers = $$('div.accordion');
	stretchers.each(function(item){
		item.setStyles({'height': '0', 'overflow': 'hidden'});
	});
	
	/*window.onload = function(){ //safari cannot get style if window isnt fully loaded*/
	
	function accordionLoad() {
		/*var stretchers = $$('div.accordion');
		stretchers.each(function(item){
			item.setStyles({'height': '0', 'overflow': 'hidden'});
		});*/
	
		var togglers = $$('h3.toggler');
		
		var bgFx = [];
		
		togglers.each(function(toggler, i){
			toggler.defaultColor = toggler.getStyle('background-color');
			
			//fx creation
			bgFx[i] = new Fx.Color(toggler, 'background-color', {wait: false});
		});
	
		var myAccordion = new Fx.Accordion(togglers, stretchers, { fixedHeight: 105, opacity: false, transition: Fx.Transitions.quadOut,
			
			onActive: function(toggler, i){
				toggler.getSecond().setStyle('color', '#fff');
				bgFx[i].toColor('#0f3679');
				//toggler.getFirst().setStyle('color', '#fff');
				//toggler.getElementsByTagName('*')[1].setStyle('color', '#fff');
				
				toggler.getFirst().setAttribute('src', '../img/icons/arrow-down.gif');
			},
		
			onBackground: function(toggler, i){
				bgFx[i].clearTimer();
				toggler.setStyle('background-color', toggler.defaultColor);
				//toggler.getFirst().setStyle('color', '#0F3679');
				//toggler.getElementsByTagName('*')[1].setStyle('color', '#0F3679');
				toggler.getSecond().setStyle('color', '#0F3679');
				toggler.getFirst().setAttribute('src', '../img/icons/arrow-right.gif');
			}
		});
		
		//anchors
		function checkHash(){
			var found = false;
			$$('h3.toggler a').each(function(link, i){
				if (window.location.hash.test(link.hash)){
					myAccordion.showThisHideOpen(i);
					found = true;
				}
			});
			return found;
		}

		//if (!checkHash()) myAccordion.showThisHideOpen(0);
		//ball!
		var ball = $E('#header h1');
		var ballStyles = new Fx.Styles(ball, {duration: 800, transition: Fx.Transitions.elasticOut});
		new Drag.Move(ball, { 
			onComplete: function(){
				ballStyles.custom({'top': [this.element.getStyle('top').toInt(), 13], 'left': [this.element.getStyle('left').toInt(), 358]});
			}
		});

	};
	try {
		Window.disableImageCache();
	}catch(e){}