window.addEvent('domready', function() { 
									 
	if(window.ie6) var heightValue='100%';
	else var heightValue='';
							 

	//code to change the way toggler looks with mouseover
	$$('.menuheader').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', '#333333');
			}

		}

	);

	//code to change the way toggler looks with mouseout
	$$('.menuheader').addEvent('mouseleave', function(){
			if (this.clicked==null) {
				//set new color and background-color
				this.setStyle('color', '#999999');
	
			}

		}

	);

	//code to change the way toggler looks with click
	$$('.menuheader').addEvent('click', function(){
			$$('.menuheader').each(function(el){
					el.clicked=null;
					el.setStyle('color', '#999999');
 
				}
			);

			this.clicked=1;
			
			//set new color and background-color
			this.setStyle('color', '#333333');
	
			//get original color and background-color
			this.origColor=this.getStyle('color');
			

		}

	);
	
	


	var myAccordion = new Accordion($('menu'), 'h2.menuheader', 'div.menucontent', {
	opacity: false,
	display: -1,
	onComplete: function() { 
				var element=$(this.elements[this.previous]);
				if(element && element.offsetHeight>0) element.setStyle('height', heightValue);			
			},

    onActive: function(menuheader, menucontent){
			menuheader.setStyle('color', '#333333');

		},
	onBackground: function(menuheader, menucontent){
			menuheader.setStyle('color', '#999999');

		}
    });
	
	$('open_accordion_entry').fireEvent('click');
	
});




window.addEvent('domready', function() {
	
	// Anpassung IE6
	if(window.ie6) var heightValue='100%';
	else var heightValue='';
	
	$$('.contentheader').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', '#333333');
			}

		}

	);
	
	$$('.contentheader').addEvent('mouseleave', function(){
			if (this.clicked==null) {
				//set new color and background-color
				this.setStyle('color', '#CCCCCC');
	
			}

		}

	);
	$$('.contentheader').addEvent('click', function(){
			$$('.contentheader').each(function(el){
					el.clicked=null;
					el.setStyle('color', '#cccccc');
 
				}
			);

			this.clicked=1;
	
			//set new color and background-color
			this.setStyle('color', '#333333');
	
			//get original color and background-color
			this.origColor=this.getStyle('color'); 

		}

	);
		// Accordion anwenden
		new Accordion($('maincol'), 'h2.contentheader', 'div.content', {
			opacity: false,
			display: -1,
			onComplete: function() { 
				var element=$(this.elements[this.previous]);
				if(element && element.offsetHeight>0) element.setStyle('height', heightValue);			
			},
			onActive: function(contentheader){
				contentheader.setStyle('font-color', '#333333');
			},
			onBackground: function(contentheader){
				contentheader.setStyle('font-color', '#CCCCCC');
			}
		});
		
		
	
	// Accordion mit der ID open_accordion_entry öffnen
	$('open_accordion_page').fireEvent('click');
});
