/** main slidshow */

function slideSwitch() {
    var $active = $('#slideshow DIV.active');

    if ( $active.length == 0 ) $active = $('#slideshow DIV:last');

    // use this to pull the divs in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow DIV:first');

    // uncomment below to pull the divs randomly
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 7000 );
});



/** NEWS */
$(function(){
	$("ul.panel").load("news.html '#info'");
	$("ul.tab li a").click(function(){
		$("ul.tab li a").removeClass("selected");
		$(this).addClass("selected");
		$("ul.panel").load($(this).attr("href"));
		return false;
	});
});


/** kanban rotate */
$(function(){
$('#menu .kanban').rotate({ 
   bind: 
     { 
        mouseover : function() { 
            $(this).rotate({animateTo:20,easing: $.easing.easeOutElastic,duration:900})
        },
        mouseout : function() { 
            $(this).rotate({animateTo:0,duration:1200})
        }
     } 
   
});

});

/**img jump */
$(function() {
	$('#menu .jump')
	.each(function(){
		$(this).css('margin-top', '0px')
	})
	.hover(
		function(){
			$(this).stop().animate({
				'marginTop':'-30px'
			},'falst', 'easeOutBounce');
		},
		function () {
			$(this).stop().animate({
				'marginTop':'0px'
			},'slow', 'easeOutBounce');
		}
	);
});


/** tooltip */
$(function(){
     $(".tooltip .001a a").hover(function() {
        $(this).next("strong").animate({opacity: "show", top: "-125"}, "slow");}, function() {
               $(this).next("strong").animate({opacity: "hide", top: "-135"}, "fast");
     });
     $(".tooltip .002a a").hover(function() {
        $(this).next("strong").animate({opacity: "show", top: "-155"}, "slow");}, function() {
               $(this).next("strong").animate({opacity: "hide", top: "-165"}, "fast");
     });
     $(".tooltip .003a a").hover(function() {
        $(this).next("strong").animate({opacity: "show", top: "-175"}, "slow");}, function() {
               $(this).next("strong").animate({opacity: "hide", top: "-185"}, "fast");
     });
     $(".tooltip .004a a").hover(function() {
        $(this).next("strong").animate({opacity: "show", top: "-165"}, "slow");}, function() {
               $(this).next("strong").animate({opacity: "hide", top: "-175"}, "fast");
     });
});



