// <img src="/assets/layout/images/hintergruende/hintergrund1.jpg" id="bg" alt="">
/**
 * (c) Simon Fakir 2011
 * Labdanum Javascript 
 */

$().ready(function() {
	// initCrossFader();
	initBackground();
	inithoverFader();
	//$('.tipsylnk').tipsy({html:true});
	// $('input.focustip').tipsy({trigger: 'focus', gravity: 'ne', fade: true});

});
   var inithoverFader = function () 
     {
     	$(".hoverFader").animate({opacity: "0.8"}, 50);
                $(".hoverFader").hover(
                   function() {
                      $(this).animate({opacity: "1"}, 300);
                },
                function() {
                       $(this).animate({opacity: "0.8"}, 300);
                     
                });
     };

var initBackground = function () {
	 var theWindow        = $(window),
            $bg              = $("#bg"),
            aspectRatio      = $bg.width() / $bg.height();

         theWindow.resize(function() {
          if ( (theWindow.width() / theWindow.height()) < aspectRatio ) {
             $bg
               .removeClass()
               .addClass('bgheight');
           } else {
                $bg
                  .removeClass()
                  .addClass('bgwidth');
           }
        }).trigger("resize");


}
