var accordion;

window.addEvent('domready', function(){
	accordion = new Accordion('h3.atStart', 'div.atStart', {
		opacity: false,
		onActive: function(toggler, element){
			toggler.setStyle('color', '#D65E23');
			
			var i=0;
			for(i=0; i<3; i++) {
				/*if(i==toggler.getAttribute('id').charAt(0)) {
					document.getElementById(i).style.backgroundImage = "url(/templates/samueli_main/images/style1/frontpage_accordion_current.jpg)";	
				}
				else {
					document.getElementById(i).style.backgroundImage = "url/templates/samueli_main/images/style1/frontpage_accordion_mid.jpg)";	
				}*/
				
				if(i==0) {
					if(i==toggler.getAttribute('id').charAt(8)) {
						document.getElementById('atoggler0').style.backgroundImage = "url(/images/frontpage_accordion_current_top.jpg)";																					
					}
					else {
					    document.getElementById('atoggler0').style.backgroundImage = "url(/images/frontpage_accordion_top.jpg)";	
					}
				}
				if(i==1) {
					if(i==toggler.getAttribute('id').charAt(8)) {
					    document.getElementById('atoggler1').style.backgroundImage = "url(/images/frontpage_accordion_current_mid.jpg)";																					
					}
					else {
					    document.getElementById('atoggler1').style.backgroundImage = "url(/images/frontpage_accordion_mid.jpg)";	
					}
				}
				if(i==2) {
					if(i==toggler.getAttribute('id').charAt(8)) {
					    document.getElementById('atoggler2').style.backgroundImage = "url(/images/frontpage_accordion_current_bottom.jpg)";																					
					}
					else {
					    document.getElementById('atoggler2').style.backgroundImage = "url(/images/frontpage_accordion_bottom.jpg)";	
					}
					document.getElementById('element2').style.backgroundImage = "url(/images/frontpage_accordion_element_bottom.jpg)";	
					document.getElementById('element2').style.backgroundRepeat = "no-repeat";
		
				}
			}
			
		},
		
		onBackground: function(toggler, element){
			toggler.setStyle('color', '#222');
		}
	}, $('accordion'));
	
});


