/* mootools accordion */
window.addEvent('domready', function() { 

var toggles = $$('#sbnavi .togglers');
var content = $$('#sbnavi .elements');

$$('#sbnavi .togglers').addEvent('mouseenter', function(){
			if (this.clicked==null) {
				//get original color and background-color
				this.origColor=this.getStyle('color'); 
				//set new color and background-color
				this.setStyle('color', '#c7c7c7');
			}

		}

	);

	//code to change the way toggler looks with mouseout
	$$('#sbnavi .togglers').addEvent('mouseleave', function(){
			if (this.clicked==null) {
				//set new color and background-color
				this.setStyle('color', '#FFFFFF');
	
			}

		}

	);
	//code to change the way toggler looks with click
	$$('#sbnavi .togglers').addEvent('click', function(){
			$$('#sbnavi .togglers').each(function(el){
					el.clicked=null;
 
				}
			);

			this.clicked=1;
	
			//set new color and background-color
			this.setStyle('color', '#c7c7c7');
	
			//get original color and background-color
			this.origColor=this.getStyle('color'); 

		}

	);

//set up your object var
//create a "new" Accordion object
//set the toggle array
//set the content array
var AccordionObject = new Accordion(toggles, content, {  
	duration: 550, display: 0, alwaysHide: true, opacity: true, start: 'open_accordion_entry',display:1, initialDisplayFx: false, transition: Fx.Transitions.Quint.easeOut,
	'onComplete': function(a){a.setStyle('color', 'white');},
	'onBackground': function(a){a.setStyle('color', 'white');}
    });  

// kick selected:

function initAccordeon(arg){
    if($chk(arg)) {
		$('open_accordion_entry').fireEvent('click');
		$('open_accordion_entry').setStyle('color', '#c7c7c7');
    }
}

initAccordeon($('open_accordion_entry'));

// Slideit?

function initSlideshow(arg){
    if($chk(arg)) {
	    window.addEvents({
			'load': function(){			
				/* banner rotator example */	
				new SlideItMoo({overallContainer: 'SlideItMoo_banners_outer',
								elementScrolled: 'SlideItMoo_banners_inner',
								thumbsContainer: 'SlideItMoo_banners_items',		
								itemsVisible:1,
								itemsSelector: '.banner',
								showControls:0,
								autoSlide: 8000,
								itemWidth:477,
								transition: Fx.Transitions.Quint.easeOut,
								duration: 600,
								direction:-1});	
			}
		});
    }
}

initSlideshow($('SlideItMoo_banners_outer'));

});




