﻿function mycarousel_initCallback(carousel) {
    jQuery('#next').bind('click', function() {
        carousel.next();
        return false;
    });
    jQuery('#prev').bind('click', function() {
        carousel.prev();
        return false;
    });
    $(".realisatie").hover(function(){
        $(".plus", this).stop().fadeTo('fast', 1);
    }, function() {
        $(".plus", this).stop().fadeTo('fast', 0);
    });
};

$(document).ready(function(){
    $("#splashbusiness").hover(function(){
        $("img.splashpijl", this).css("position","relative");
        $("img.splashpijl", this).stop().animate({ top: '8px'}, {easing: 'easeOutBounce'}, 100);
    }, function() {
        $("img.splashpijl", this).stop().animate({ top: '0'}, {easing: 'easeOutBounce'}, 100);
    });
    
    $("#splashparticulieren").hover(function(){
        $("img.splashpijl", this).css("position","relative");
        $("img.splashpijl", this).stop().animate({ top: '8px'}, {easing: 'easeOutBounce'}, 100);
    }, function() {
        $("img.splashpijl", this).stop().animate({ top: '0'}, {easing: 'easeOutBounce'}, 100);
    });
    
    $("#realisatiesslider").jcarousel({
        scroll: 1,
        animation: "slow",
        wrap: "circular",
        easing: "easeInOutExpo",
        initCallback: mycarousel_initCallback,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
    
    $("a.videoclick").fancybox({
 		'autoscale': true,
 		'zoomSpeedIn': 0, 
 		'zoomSpeedOut':	0, 
 		'overlayColor': '#000',
 		'overlayOpacity': 0.8,
 		'padding': 4,
 		'showCloseButton': false,
        'type': 'iframe',
        'width': 634,
        'height': 358,
        'centerOnScroll': true
     });
     
     $("a.realisatieviewer").fancybox({
 		'zoomSpeedIn': 0, 
 		'zoomSpeedOut':	0, 
 		'overlayColor': '#000',
 		'overlayOpacity': 0.8,
 		'titlePosition': 'inside'
     });
     
     $(".product").hover(function(){
        $(".plusproduct", this).stop().fadeTo('fast', 1);
     }, function() {
        $(".plusproduct", this).stop().fadeTo('fast', 0);
     });
    
    setFooterPos();
    $(window).resize(function () {
        setFooterPos();
    });
    function setFooterPos() {
        if ($(window).height() > $("body").height()) {
            $("#splashfooter, #footer").css({ "top": ($(window).height() - $("body").height()) + "px" });
        }
    }
});

$(window).load(function() {
    /*jwplayer("videoplayer").setup({
        autostart: false,
        controlbar: "over",
        file: "video/video.flv",
        players: [
            { type: "html5" },
            { type: "flash", src: "jwplayer/player.swf", width: "640", height: "360" }  
        ],
        volume: 100,
        width: 640,
        skin: "jwplayer/glow.zip"
    });*/
    setFooterPos();
    $(window).resize(function () {
        setFooterPos();
    });
    function setFooterPos() {
        if ($(window).height() > $("body").height()) {
            $("#splashfooter, #footer").css({ "top": ($(window).height() - $("body").height()) + "px" });
        }
    }
});
