// Die jQuery Scrollfunktion definieren
$(function() {
    $('td pre code').each(function() {
        eval($(this).text());
    });
});

$('#scroll1').cycle({
speed:  500, 
fx:     'scrollHorz',
next:   '.next1',
prev:   '.prev1',
timeout: 0,
easing:  'easeOutQuint'
});

$('#scroll3').cycle({
speed:   250, 
speedIn:  700, 
speedOut: 200,
fx:      'none', 
sync:     0,
next:   '.next3',
prev:   '.prev3',
timeout: 0,
easing:  'easeInOutQuint'
});

$('#scroll2').cycle({
speedIn:  700, 
speedOut: 200, 
fx:      'fade', 
sync:     0,
next:   '.next2',
prev:   '.prev2',
timeout: 0,
easing:  'easeInOutQuint'
});


// Die jQuery Menu-Effekte definieren
jQuery(document).ready(function(){
$("#menu ul li a").hover(
function(){
$(this).animate({ width: "155px" }, {queue:false, duration:100} );
},
function(){
$(this).animate({ width: "145px" }, {queue:false, duration:100} );
});
});

jQuery(document).ready(function(){
$("#menu ul li a.act").hover(
function(){
$(this).animate({ width: "155px" }, {queue:false, duration:"normal"} );
},
function(){
$(this).animate({ width: "155px" }, {queue:false, duration:"normal"} );
});
});

// Die jQuery Seiten-Übergänge definieren
$(document).ready(function() {
	$("a.transition").click(function(event){
	        event.preventDefault();
	        linkLocation = this.href;
			$("#menu ul li a.act").animate({ width: "145px" }, {queue:false, duration:200} );
			$("#maindiv.fotostream").fadeOut(200);
			$("#tweetdiv").fadeOut(200, redirectPage);
	    });
	    function redirectPage() {
	        window.location = linkLocation;
	    }
});

// Die Pfeil- u. Lighboxlinks mit JQuery hovern
$(document).ready(function() {
$(".arrows img").hover(function() {
$(this).fadeTo("fast", 0.6);
},function() {
$(this).fadeTo("fast", 1.0);
});
});

// Background-Image preloaden
function bgpreload (CssClass,Bildlink) {
	// when the DOM is ready
	$(function () {
	  var img = new Image();
	  // wrap our new image in jQuery, then:
	  $(img)
	    // once the image has loaded, execute this code
	    .load(function () {
	      // set the image hidden by default    
	      $(this).hide();
	      // with the holding div #loader, apply:
	      $('.' + CssClass + '')
	        // remove the loading class (so no background spinner), 
	        .removeClass('loading')
	        // then insert our image
	        .append(this);			
	      // fade our image in to create a nice effect
	      $(this).fadeIn();
		  $(".pixelbg").fadeIn();
	
	
	    })
	    // if there was an error loading the image, react accordingly
	    .error(function () {
	      // notify the user that the image could not be loaded
	    })
	    // *finally*, set the src attribute of the new image to our image
	    .attr('src', '' + Bildlink + '');
	
	});
}





