window.addEvent('domready', function(){

var partnersAccordion = new Accordion('.toggler', '.element', {
	opacity: false,
	alwaysHide: false,
	show: 0,
	
	onActive: function(toggler, element){
		toggler.setStyle('background', 'url(/_img/big_accordion_head_off.jpg) repeat-y top left');
		toggler.setStyle('color', '#FFF');
		toggler.setStyle('cursor', 'default');
		toggler.getElements('span').setStyle('background', 'transparent');
		//$('myElement').getElements('a')
	},
	onBackground: function(toggler, element){
		toggler.setStyle('background', 'url(/_img/big_accordion_head_on.jpg) repeat-y top left');
		toggler.setStyle('color', '#093169');
		toggler.getElements('span').setStyle('background', 'url(/_img/accordion_plus.jpg) no-repeat 1px top');
		//toggler.getElements('span').setStyle('background-position', '2px top');
	}

}, $('big-accordion'));

var categories = new Array('parents-families', 'parent-groups', 'schools', 'educators', 'district-state');
var mostCurrent = 1;

function tabChange(num, className) {
	// turns off the old button with animation
	$('link-'+mostCurrent).setProperty('class', '');
	$('link-'+num).setProperty('class', 'active');
	
	// hides and shows headers
	$$('#big-accordion h4').setStyle('display', 'none');
	$$('#big-accordion h4.'+className).setStyle('display', 'block');
	$$('#big-accordion div').setStyle('display', 'none');
	$$('#big-accordion div.'+className).setStyle('display', 'block');
	$$('#big-accordion h2').setStyle('display', 'none');
	$$('#big-accordion h2.'+className).setStyle('display', 'block');

	var myEffects = new Fx.Styles('link-'+mostCurrent, {duration: 500, transition: Fx.Transitions.linear}); 
	myEffects.start({
    	'color': ['#093169', '#fff']
	});
	// set current button
	mostCurrent = num;
}
$('link-1').addEvent('click', function(event) {
	event = new Event(event).stop();
	tabChange(1, this.getElement('div').getProperty('class'));
});
$('link-2').addEvent('click', function(event) {
	event = new Event(event).stop();
	tabChange(2, this.getElement('div').getProperty('class'));
});
$('link-3').addEvent('click', function(event) {
	event = new Event(event).stop();
	tabChange(3, this.getElement('div').getProperty('class'));
});
$('link-4').addEvent('click', function(event) {
	event = new Event(event).stop();
	tabChange(4, this.getElement('div').getProperty('class'));
});
$('link-5').addEvent('click', function(event) {
	event = new Event(event).stop();
	tabChange(5, this.getElement('div').getProperty('class'));
});
$('link-6').addEvent('click', function(event) {
	event = new Event(event).stop();
	tabChange(6, this.getElement('div').getProperty('class'));
});



});