
$(document).ready(function() {
    
    //$("#tekst").find("a").not(".ticketlink").not(".image").wrapInner('<span class="link">').append('<span class="swoosh"></span>');
    
	Cufon.replace('h1, h2, h3, .rows div.item.item-agenda .data-agenda, .gb div.item div.header');
	Cufon.replace('#menu', { hover: true });
    Cufon.replace('.ticketlink', { hover: {
	       color: 'white',
		textShadow: '2px 2px #224c07'
       }
	});
    Cufon.replace('.eventlink', { hover: {
		textShadow: '1px 1px #cde4be'
       }
	});
    Cufon.replace('#content a', {     hover: {
        color: 'white',
		textShadow: '1px 1px #316D0A'
        }
	});
    
    // fanCybox	
	$(".thumb a").attr('rel', 'gallery').fancybox({
		'showNavArrows' : true,
		'centerOnScroll' : true,
		'scrolling' : 'no',
		'titlePosition'	:	'over',
			'onComplete'	:	function() {
				$("#fancybox-wrap").hover(function() {
					$("#fancybox-title").show();
				}, function() {
					$("#fancybox-title").hide();
				});
			}
	});
	
    setContainerHeight();
    
    $(window).bind('resize', function() {
        setContainerHeight();
    });
    
	// Fotoboek
	
	$(".album").hover(function() {
		$(this).find(".descr").show();
	} , function() { 
		$(this).find(".descr").hide();
	})
	
	// Submenu in hoofdmenu hover (horizontaal)
	
	$("#container #menu.menu-h li a").hover(function() {
		$(this).parent().find(".subpages-h").show();
	} , function() { 
		$(this).parent().find(".subpages-h").hide();
	})
	
	$(".off a").hover(function() {
		$(this).find(".swoosh").stop().animate({ width: "97%" }, 500, "easeOutQuart");
	} , function() { 
		$(this).find(".swoosh").stop().animate({ width: "0" }, 500, "easeOutQuart");
	})
	
	
	$(".on a").find(".swoosh").css({ width: "120%" }, 500, "easeOutQuart");
    
    
    $("#tekst").find(".link").hover(function() {
        $(this).parent().find(".swoosh").stop().animate({ width: $(this).width()+10 }, 500, "easeOutQuart");
    },function () {
        $(this).parent().find(".swoosh").stop().animate({ width: 0 }, 500, "easeOutQuart");
    });
    
    
    
	/* $(".sponsors").delay(1000).animate({ top: "0" }, 1000, "easeOutQuart"); */
	$("#bgunit").delay(250).animate({ opacity: "1" }, 500, "easeOutQuart");
	$("#menu").delay(750).fadeIn(500, "easeOutQuart");
	$("#content").delay(1000).animate({ opacity: "1" }, 500, "easeOutQuart");
	/*
	$(".rotator").cycle({
	
		speed: 500,
		timeout: 6000,
		random: 1,
		fx: 'scrollHorz'
	
	});
    */
    /*
    $("#ubercontainer").scroll(function(){
        setTimeout(function(){
            $("#menu").stop().animate({"marginTop": ($("#ubercontainer").scrollTop()+20) + "px"}, 500, "" );
          }, 200);
	});
    */
    
    $(".sponsors").hover(
        function(){
            //$(this).animate({opacity: "1" },500 "easeOutQuart");
            $(this).find("img").removeClass("greyscale");
            $(this).stop().animate({ opacity: "1" }, 300);
            $(this).find(".message").show();
        },
        function () {
            $(this).find("img").addClass("greyscale");
            $(this).stop().animate({ opacity: "0.5" }, 300);
            $(this).find(".message").hide();
        });
	
	$("#bgunit").cycle({
		timeout: 0,
		speed: 0,
		random: 1
	});
});

function setContainerHeight(){
    var containerheight = $(window).height() - 75;
    $("#ubercontainer").height(containerheight);   
}


	
    

