window.addEvent('load', function() {
	var myAccordion = new Accordion($('accordion'), 'div.article-head', 'div.article-content', {
		onActive: function(toggler, element) {
			toggler.active = true;
			toggler.setStyle('background-color', '#3f3f3f');
		},
		onBackground: function(toggler, element) {
			toggler.active = false;
			toggler.setStyle('background-color', '#222222');
		}
	});
	
	var heads = $$('div.article-head');
	for(var i = 0; i<heads.length; i++) {
		$(heads[i]).addEvents({
			mouseenter: function(){
				this.style.cursor = 'pointer';
				if(this.active == true) return;
				this.morph({
					'duration': 100,
					'background-color': '#3f3f3f'
				});
			},
			mouseleave: function(){
				this.style.cursor = 'move';
				if(this.active == true) return;
				this.morph({
					'duration': 500,
					backgroundColor: '#222222'
				});
			}
		});	
	}
		
	var links = $$('a');
	for(var i = 0; i<links.length; i++) {
		$(links[i]).addEvents({
			mouseenter: function(){
				this.morph({
					'duration': 0,
					'color': '#ffffff'
				});
			},
			mouseleave: function(){
				this.morph({
					'duration': 500,
					'color': '#fea417'
				});
			}
		});	
	}	
});