// Trans Config

var i = 1;
var totaal = 3;
var base = ".actie";
var timer;

var ttl = 7000;

var fx = "fade";
var fx_duration = 1000;
var fx_easing = "easeOutQuint";

$(function() {
    $(".actie").hide();
    $(".actie1").show();
    $(".wbg").show();
    
    p = $(".actie").first().position();
    
    $(".actie").each(function () {
        setAbsolute($(this), p);
    });
    
    timerAction = function() {        
        from = i;
        to = ++i;
        
        if(to > totaal) to = i = 1;

        doTrans($(base + from), $(base + to));
    };

    if(typeof timer == 'undefined')
        timer = setInterval(timerAction, ttl);
});

function doTrans(from, to) {
    from.fadeOut(fx_duration, fx_easing, function() { $(this).hide(); });    
    to.fadeIn(fx_duration, fx_easing, function() { $(this).show(); });
}

function setAbsolute(a, p) {
    a.css('position', 'absolute');
    
    a.css('top', p.top);
    a.css('left', p.left);
}

