//Use this function to be able to add delay's to animations. jQuery doesnt have this built in for some reason.
$.fn.delay = function(time, callback){
    // Empty function:
    jQuery.fx.step.delay = function(){};
    // Return meaningless animation, (will be added to queue)
    return this.animate({delay:1}, time, callback);
}


jQuery(function($) {
	var timer;
	
	$('div#content-main').fadeOut(0);
	$('div#navbar').fadeOut(0);
	$('div#footer').fadeOut(0);

	function logoSlideDown(event) {
		$("h1").css("top","-320px");
		$("h1").animate({"top":42},1200, "swing", null);
	}

	function contentFadeIn(event) {
		$("div#content-main").delay(1200).fadeIn(1000);
		$("div#navbar").delay(1200).fadeIn(1000);
	}

	function footerSlideDown(event) {
		$("#footer").delay(2000).fadeIn(1000);
	}


	logoSlideDown();
	contentFadeIn();
	footerSlideDown();

});

$(function() {	
	// initialize tooltip trigger	
	$(".tooltip-trigger").tooltip();
});

$(function() {
    $('.slideshow p').cycle({timeout:7000});
    
    function onBefore() {
        $('#title').html(this.alt);
    }
});
