// JavaScript Document
//<![CDATA[
window.addEvent('domready', function()
{
	/* smooth */
	new SmoothScroll({duration:500});
	
	/* link management */
	$('gototop').set('opacity','0').setStyle('display','block');
	
	/* scrollspy instance */
	var ss = new ScrollSpy({
		min: 1,
		onEnter: function(position,enters) {
			$('gototop').fade('in');
		},
		onLeave: function(position,leaves) {
			$('gototop').fade('out');
		},
		onTick: function(position,state,enters,leaves) {
			//if(console) { console.log('Tick  [' + enters + ', ' + leaves + '] at: ' + position.x + ' / ' + position.y); }
		},
		container: window
	});
	
	
	var scroll = new Fx.Scroll(window, {
		wait: false,
		duration: 500,
		transition: Fx.Transitions.Cubic.easeInOut
	});
	
	$('gototop').addEvent('click',function(event) {
		event = new Event(event).stop();
		scroll.toTop();
	});
	
	//Etxerne Linkbehandlung
	$$('a.Extern').each(function(link){
		link.target = "_blank";
	});


	$$('.jsToolTip').each(function(element,index) {   
        var content = element.get('title').split('::');   
        element.store('tip:title', content[0]);   
        element.store('tip:text', content[1]);   
    });   
    var tipz = new Tips('.jsToolTip', {   
        className: 'jsToolTip',   
        fixed: false,
		offset: {'x': 15, 'y': 5},
        hideDelay: 50,   
        showDelay: 50   
    }); 
	tipz.addEvent('onShow', function(tip){ 
		tip.fade('in');
	});
	tipz.addEvent('onHide', function(tip){ 
		tip.fade('out');
	});
	
	

	
	

});	
//]]>
