jQuery(function( $ ){
	
	 /*
		//borrowed from jQuery easing plugin
		//http://gsgd.co.uk/sandbox/jquery.easing.php
		
		$.easing.elasout = function(x, t, b, c, d) {
			var s=1.70158;var p=0;var a=c;
			if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
			if (a < Math.abs(c)) { a=c; var s=p/4; }
			else var s = p/(2*Math.PI) * Math.asin (c/a);
			return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
		};
		
		$('a.back').click(function(){
			$(this).parents('div.pane').scrollTo( 0, 800, { queue:true } );
			$(this).parents('div.section').find('span.message').text( this.title );
			return false;
		});
		
		
	*/	
	
	//for scrollTo
	//<![CDATA[

				//borrowed from jQuery easing plugin
				//http://gsgd.co.uk/sandbox/jquery.easing.php
				//see jquery.easing.1.3.js for available tweens
				$.easing.easeOutQuint = function (x, t, b, c, d) {
      		return c*((t=t/d-1)*t*t*t*t + 1) + b;
				};
				
		
	
	//by default, the scroll is only done vertically ('y'), change it to both.
	$.scrollTo.defaults.axis = 'x'; 			
	//this one is important, many browsers don't reset scroll on refreshes
	$('div.pane').scrollTo( 0 );//reset all scrollable panes to (0,0)
	$.scrollTo( 0 );//reset the screen to (0,0)
	
	//TOC, shows how to scroll the whole window
	$('.grafikdesign a').click(function(){//$.scrollTo works EXACTLY the same way, but scrolls the whole screen
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('span.message').text( this.title );
		return false;
	});
	$('.screendesign a').click(function(){//$.scrollTo works EXACTLY the same way, but scrolls the whole screen
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('span.message').text( this.title );
		return false;
	});
	$('.artworx a').click(function(){//$.scrollTo works EXACTLY the same way, but scrolls the whole screen
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('span.message').text( this.title );
		return false;
	});
	$('.objekte a').click(function(){//$.scrollTo works EXACTLY the same way, but scrolls the whole screen
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('span.message').text( this.title );
		return false;
	});
	$('.kontakt a').click(function(){//$.scrollTo works EXACTLY the same way, but scrolls the whole screen
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('span.message').text( this.title );
		return false;
	});
	$('.networx a').click(function(){//$.scrollTo works EXACTLY the same way, but scrolls the whole screen
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('span.message').text( this.title );
		return false;
	});
	$('#footer a').click(function(){//$.scrollTo works EXACTLY the same way, but scrolls the whole screen
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('span.message').text( this.title );
		return false;
	});
	
	
	//Submenu
	$('.submenu a.start').click(function(){
		$.scrollTo( this.hash, 2000, { easing:'easeOutQuint' });
		$(this.hash).find('#leftsider').text( this.title );
		return false;
	});
	$('.submenu a.grafikdesign').click(function(){
		$.scrollTo( this.hash, 2000, { easing:'easeOutQuint' });
		$(this.hash).find('#c02').text( this.title );
		return false;
	});
	$('.submenu a.screendesign').click(function(){
		$.scrollTo( this.hash, 2000, { easing:'easeOutQuint' });
		$(this.hash).find('#c03').text( this.title );
		return false;
	});
	$('.submenu a.artworx').click(function(){
		$.scrollTo( this.hash, 2000, { easing:'easeOutQuint' });
		$(this.hash).find('#c04').text( this.title );
		return false;
	});
	$('.submenu a.objekte').click(function(){
		$.scrollTo( this.hash, 2000, { easing:'easeOutQuint' });
		$(this.hash).find('#c05').text( this.title );
		return false;
	});
	$('.submenu a.networx').click(function(){
		$.scrollTo( this.hash, 2000, { easing:'easeOutQuint' });
		$(this.hash).find('#c06').text( this.title );
		return false;
	});
	$('.submenu a.kontakt').click(function(){
		$.scrollTo( this.hash, 2000, { easing:'easeOutQuint' });
		$(this.hash).find('#c07').text( this.title );
		return false;
	});
	
	
	//Target Pfeile rollover
	$('.anfang a.anfang_leftsider').click(function(){
		$.scrollTo( this.hash, 4000, { easing:'easeOutQuint' });
		$(this.hash).find('#leftsider').text( this.title );
		return false;
	});
	$('.ende a.ende_c09').click(function(){
		$.scrollTo( this.hash, 4000, { easing:'easeOutQuint' });
		$(this.hash).find('#c09').text( this.title );
		return false;
	});
	$('.rechts a.rechts_c02').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c02').text( this.title );
		return false;
	});
	$('.rechts a.rechts_c03').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c03').text( this.title );
		return false;
	});
	$('.links a.links_c01').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#leftsider').text( this.title );
		return false;
	});
	$('.rechts a.rechts_c04').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c04').text( this.title );
		return false;
	});
	$('.links a.links_c02').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c02').text( this.title );
		return false;
	});
	$('.rechts a.rechts_c05').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c05').text( this.title );
		return false;
	});
	$('.links a.links_c03').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c03').text( this.title );
		return false;
	});
	$('.rechts a.rechts_c06').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c06').text( this.title );
		return false;
	});
	$('.links a.links_c04').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c04').text( this.title );
		return false;
	});
	$('.rechts a.rechts_c07').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c07').text( this.title );
		return false;
	});
	$('.links a.links_c05').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c05').text( this.title );
		return false;
	});
	$('.rechts a.rechts_c08').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c08').text( this.title );
		return false;
	});
	$('.links a.links_c06').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c06').text( this.title );
		return false;
	});
	$('.rechts a.rechts_c09').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c09').text( this.title );
		return false;
	});
	$('.links a.links_c07').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c07').text( this.title );
		return false;
	});
	$('.links a.links_c08').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c08').text( this.title );
		return false;
	});
		
		
	//Target Pfeile
	$('#bfmenu01 a.rechts_c02').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c02').text( this.title );
		return false;
	});
	$('#bfmenu01 a.rechts').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c09').text( this.title );
		return false;
	});
	
		$('#bfmenu02 a.links').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#leftsider').text( this.title );
		return false;
	});
	$('#bfmenu02 a.rechts').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c09').text( this.title );
		return false;
	});
	$('#bfmenu02 a.rechts_c03').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c03').text( this.title );
		return false;
	});
	
	$('#bfmenu03 a.links_c02').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c02').text( this.title );
		return false;
	});
	$('#bfmenu03 a.links').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#leftsider').text( this.title );
		return false;
	});
	$('#bfmenu03 a.rechts').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c09').text( this.title );
		return false;
	});
	$('#bfmenu03 a.rechts_c04').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c04').text( this.title );
		return false;
	});
	$('#bfmenu04 a.links_c03').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c03').text( this.title );
		return false;
	});
	$('#bfmenu04 a.links').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#leftsider').text( this.title );
		return false;
	});
	$('#bfmenu04 a.rechts').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c09').text( this.title );
		return false;
	});
	$('#bfmenu04 a.rechts_c05').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c05').text( this.title );
		return false;
	});
	$('#bfmenu05 a.links_c04').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c04').text( this.title );
		return false;
	});
	$('#bfmenu05 a.links').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#leftsider').text( this.title );
		return false;
	});
	$('#bfmenu05 a.rechts').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c09').text( this.title );
		return false;
	});
	$('#bfmenu05 a.rechts_c06').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c06').text( this.title );
		return false;
	});
	$('#bfmenu06 a.links_c05').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c05').text( this.title );
		return false;
	});
	$('#bfmenu06 a.links').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#leftsider').text( this.title );
		return false;
	});
	$('#bfmenu06 a.rechts').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c09').text( this.title );
		return false;
	});
	$('#bfmenu06 a.rechts_c07').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c07').text( this.title );
		return false;
	});
	$('#bfmenu07 a.links_c06').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c06').text( this.title );
		return false;
	});
	$('#bfmenu07 a.links').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#leftsider').text( this.title );
		return false;
	});
	$('#bfmenu07 a.rechts').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c09').text( this.title );
		return false;
	});
	$('#bfmenu07 a.rechts_c08').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c08').text( this.title );
		return false;
	});
	$('#bfmenu08 a.links_c07').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c07').text( this.title );
		return false;
	});
	$('#bfmenu08 a.links').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#leftsider').text( this.title );
		return false;
	});
	$('#bfmenu08 a.rechts').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c09').text( this.title );
		return false;
	});
	$('#bfmenu08 a.rechts_c09').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c09').text( this.title );
		return false;
	});
	$('#bfmenu09 a.links_c08').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#c07').text( this.title );
		return false;
	});
	$('#bfmenu09 a.links').click(function(){
		$.scrollTo( this.hash, 1500, { easing:'easeOutQuint' });
		$(this.hash).find('#leftsider').text( this.title );
		return false;
	});
	/*
	$('#bfmenu01 a.01').click(function(){
				$.scrollTo( {top:'0px', left:'1001px'}, 2000, { easing:'elasout' } );
				return false;		
	});
	*/
	//Target examples bindings
	var $paneTarget = $('#pane-target');
	
	});
	
