window.addEvent('domready', function(){

	
	// teaserbox-highlight
	$each($$('a.teaser'), function(el) {
		var original = el.getStyle('background-color');
		var morph = new Fx.Morph(el,{ 'duration':'900', link:'cancel' });
		el.addEvents({
			'mouseenter' : function() { morph.start({ 'background-color':'#e6ebf0' }) },
			'mouseleave' : function() { morph.start({ 'background-color': original }) }
		});
	});
	
	// newsitem-highlight
	$each($$('p.newsitem'), function(el) {
		var original = el.getStyle('color');
		var morph = new Fx.Morph(el,{ 'duration':'500', link:'cancel' });
		el.addEvents({
			'mouseenter' : function() { morph.start({ 'color':'#006699' }) },
			'mouseleave' : function() { morph.start({ 'color': original }) }
		});
	});
	
	// form input
	$each($$('input'), function(el) {
		var original = el.getStyle('background-color');
		var morph = new Fx.Morph(el,{ 'duration':'500', link:'cancel' });
		el.addEvents({
			'focus' : function() { morph.start({ 'background-color':'#ffffdc' }) },
			'blur' : function() { morph.start({ 'background-color': original }) }
		});
	});
	
	
	// equal height for teaserboxes
	var columns = $$('.teaser');
	var max_height = 0;
	
	columns.each(function(item) 
	{ max_height = Math.max(max_height, item.getSize().y); });
	
	columns.setStyle('height', max_height-100);
	
	
	// equal height for subnavi and content-column
	var columns = $$('.equalize');
	var max_height = 0;
	
	columns.each(function(item) 
	{ max_height = Math.max(max_height, item.getSize().y); });
	
	columns.setStyle('height', max_height);	
	
	// equal height for content and news
	var columns = $$('.equalize-1');
	var max_height = 0;
	
	columns.each(function(item) 
	{ max_height = Math.max(max_height, item.getSize().y); });
	
	columns.setStyle('height', max_height);	
	
	
	// mainnavi-highlight
	$each($$('#navibox a'), function(el1) {
		var original = el1.getStyle('background-color');
		var morph = new Fx.Morph(el1,{ 'duration':'400', link:'chain' });
		el1.addEvents({
			'mouseenter' : function() { morph.start({ 'background-color':'#e6ebf0' }) },
			'mouseleave' : function() { morph.start({ 'background-color': original }) }
		});
	});
		
	

	// Tooltips
	$$('.tipper').each(function(element,index) {
        var content = element.get('title').split('::');
        element.store('tip:title', content[0]);
        element.store('tip:text', content[1]);
    });
     
    //create the tooltips
    var tipz = new Tips($$('.tipper'), {
		initialize: function() { this.tip.fade('hide'); },
        onShow: function(tip) { tip.fade('in');  },
        onHide: function(tip) { tip.fade('out'); },				   
        fixed: true,
		offsets: {x: 15, y: -50} ,
        hideDelay: 50,
        showDelay: 50,
		maxTitleChars: 60, 
		maxOpacity: .9
	});
	
	
	/*
	
	
	// NESTED ACCORDION (SUBNAVI) //
	
	// Anpassung IE6
	if(window.ie6) var heightValue='100%';
	else var heightValue='';
	
	// Selektoren der Container für Schalter und Inhalt
	var togglerName='dt.accordion_toggler_';
	var contentName='dd.accordion_content_';
	
	
	// Selektoren setzen
	var counter=1;	
	var toggler=$$(togglerName+counter);
	var content=$$(contentName+counter);
	
	while(toggler.length>1)
	{
		// Accordion anwenden
		new Accordion(toggler, content, {
			opacity: false,
			display: -1,
			alwaysHide: true,
			onComplete: function() { 
				var element=$(this.elements[this.previous]);
				if(element && element.offsetHeight>0) element.setStyle('height', heightValue);			
			},
			onActive: function(toggler, content) {
				toggler.addClass('open');
			},
			onBackground: function(toggler, content) {
				toggler.removeClass('open');
			}
		});
		
		// Selektoren für nächstes Level setzen
		counter++;
		toggler=$$(togglerName+counter);
		content=$$(contentName+counter);
	}	
	
	*/
	
	
	
});



	



