if (document.images) 
{
   img1 = new Image();
   //img2 = new Image();
   img1.src = "img/nav_button_hover.png";
   //img2.src = "imageName2.gif"
}

$(document).ready(function(){

	//Slider für die Navigations-Buttons
    $('#navigation li').mouseover(function(){
      $(this).stop().animate({"height": "96px"}, 100,'swing');
    }).mouseout(function(){ 
      $(this).stop().animate({"height": "30px"}, 400,'swing');
    });;
    
    //Image-Slider für den Header
    $("#slider").easySlider({
    		auto: true,
    		continuous: true,
    		controlsShow: false,
    		speed: 800,
    		pause: 10000
    });
    
    //Hover-Effekt für Uni-Logos im Header
    $(function() {
    $("#logo-fh, #logo-esb").hover(function () {
     
    $(this).find("img").stop().animate({
    top: '-49'
    }, "fast",'swing');
    },
     
    function () {
    $(this).find("img").stop().animate({
    top: 0
    }, "fast",'swing');
    });
    });
    
	// Zitate-Fader
	$('#testimonials li').hide().eq(0).show();
	(function showNextTestimonial(){
	$('#testimonials li:visible').delay(7500).fadeOut('slow',function(){
	$(this).appendTo('#testimonials ul');
	$('#testimonials li:first').fadeIn('slow',function(){
	showNextTestimonial();
	});
	});
	})();
    
    //Tooltips
    $(".tip_trigger").hover(function(){
        tip = $(this).find('.tip');
        tip.fadeIn('fast'); //Show tooltip
    }, function() {
        tip.fadeOut('fast'); //Hide tooltip
    }).mousemove(function(e) {
        var mousex = e.pageX + 20; //Get X coodrinates
        var mousey = e.pageY + 20; //Get Y coordinates
        var tipWidth = tip.width(); //Find width of tooltip
        var tipHeight = tip.height(); //Find height of tooltip

        //Distance of element from the right edge of viewport
        var tipVisX = $(window).width() - (mousex + tipWidth);
        //Distance of element from the bottom of viewport
        var tipVisY = $(window).height() - (mousey + tipHeight);

        if ( tipVisX < 20 ) { //If tooltip exceeds the X coordinate of viewport
            mousex = e.pageX - tipWidth - 20;
        } if ( tipVisY < 20 ) { //If tooltip exceeds the Y coordinate of viewport
            mousey = e.pageY - tipHeight - 20;
        }
        //Absolute position the tooltip according to mouse position
        tip.css({  top: mousey, left: mousex });
    });
    
});
