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

// ! noConflict()
var J = jQuery.noConflict();

// Hyphenator.config({displaytogglebox : false, minwordlength : 4});
// Hyphenator.run();

// Initialisieren
new SmoothScroll	({duration:500});
new LazyLoad		({onLoad: function(img) {img.setStyle('opacity',0).fade(1);}});
scroll_zutop();


// $$('.menu li') START -->
$$('.menu li').each(function(element){
	
	// 1.7.0. class -> item-ID ist immer drin -> muss raus!
	if ( ! element.get('class') ) {
	element.tween('opacity', 0.5);	
	}
		
	element.addEvents({
	'mouseover': function(){
		
		if ( ! this.get('class') ) {
		
			this.setStyle('opacity',1.0);
			this.set('morph', {duration: 200});
			this.morph({'border-top': '1px solid #ffffff'});
			// this.getElements('a').morph({'padding-top': '5px'});
			
		}

	},
	 'mouseout': function(){
		 
		if ( ! this.get('class') ) {
			
			this.setStyle('opacity',0.5);
			this.set('morph', {duration: 400});
			this.morph({'border-top': '4px solid #070707'});
			// this.getElements('a').morph({'padding-top': '8px'});
			
		}
		
	}
	});
	
});
// $$('.menu li') ENDE -->


// Pfad
$$('.layout_pfad').each(function(element){
	
	element.tween('opacity', 0.5);
	
	element.addEvents({
	'mouseover': function(){
	element.tween('opacity', 1.0);
	},
	 'mouseout': function(){
	element.tween('opacity', 0.5);
	}
	});
	
});

$$('.layout_social_bookmarks').each(function(element){
	
	element.tween('opacity', 0.5);
	
	element.addEvents({
	'mouseover': function(){
	element.tween('opacity', 1.0);
	},
	 'mouseout': function(){
	element.tween('opacity', 0.5);
	}
	});
	
});

$$('.layout_partner img').each(function(element){
	
	element.tween('opacity', 0.5);
	
	element.addEvents({
	'mouseover': function(){
	element.tween('opacity', 1.0);
	},
	 'mouseout': function(){
	element.tween('opacity', 0.5);
	}
	});
	
});
/*
if ( $$('div.news_item') != null ) {
	alert("ok");
}
*/


// $$('.news_item').setStyle('opacity',0.5);

$$('.news_item').each(function(element){
	
	element.addEvents({
	'mouseover': function(){
		this.set('morph', {duration: 200});
		// this.morph({'background-color': '#161616'});
		// this.morph('.news_item_hover');
	},
	 'mouseout': function(){
		this.set('morph', {duration: 400});
		// this.morph({'background-color': '#000000'});
		// this.morph('.news_item_normal');
	}
	});
	
});



}); // window.addEvent('domready' ENDE

function scroll_zutop() {
// ScrollSpy & SmoothScroll -->
$('zutop').set('opacity','0').setStyle('display','block');
  
	var ss = new ScrollSpy({
		min: 100,
		onEnter: function(position,state,enters) {
			$('zutop').fade(0.8);
		},
		onLeave: function(position,state,leaves) {
			$('zutop').fade('out');
		},
		container: window
	});
};
