window.addEvent('domready', function() {
	

if($type($('accordion')) != false) {
	
	//assign the accordion functions to our submenu
	var theAccordion = new Accordion($('accordion'), 'h3.togglerzu', 'div.element', {
		opacity: false,
		trigger: 'click',
		transition: 'quad',
		display: -1,
		openClose: true,
		alwaysHide: true,
		onActive: function(togglerzu, element){
			togglerzu.setStyle('color', '#FFFFFF');
			if(togglerzu.getNext().getElements('a') == location.toString()) {
				
				togglerzu.setStyle('background-position', 'left -90px');
			}
			else
			togglerzu.setStyle('background-position',  'left -30px');
		},
		onBackground: function(togglerzu, element){
			togglerzu.setStyle('color', '#FFFFFF');
			//alert(togglerzu.getNext().getElements('a'));
			if(togglerzu.getNext().getElements('a') == location.toString()) {
				
				togglerzu.setStyle('background-position', 'left -60px');
			}
			else
				togglerzu.setStyle('background-position',  'left top');
		}

		
	});


	//check if one of the accordion's urls contains the current url
	var accordionLinks = $('accordion').getElements('a');
	
	//alert(location);
	
	current = 0;
	accordionLinks.each(function(item){
		//alert(current + ' / ' + item + ' / ' + location);
		if(item == location.toString()) {
			 //alert('that\'s a match!');
			$('accordion').getElements('h3')[current].setStyle('background-position', 'left -60px');
		}
		current++;
		
		//alert(item.getParent('div').getElements('a').get('href'));
	
	});
	
	//accordionLinks.addEvent('click'
	
	//alert(accordionLinks);
	/*accordionElements.each(function(item){
	
		//alert(item.getParent('div').getElements('a').get('href'));
	
	});*/

} //end of if type(accordion) blahblah

});
