$(document).ready(function(){

    //
    // SUPERSLEIGHT
    //
    
    $('body').supersleight();

    //
    // TWITTER FEED
    //
    slideTwitter();
    

    //
    // CLIP PREVIEW LINK BOUNCE
    //

//    $('.clippreview').hover(function onHoverIn(){
//
        // show arrow
//        $('a', this).animate({
//            left: '0px'
//        }, 500);
//
//    }
//    ,
//
    // hide arrow
//    function onHoverOut(){
//
//        $('a', this).animate({
//            left: '150px'
//        }, 500);
//
//    });

    //
    // CLIP PREVIEW FANCYBOX
    //

    $(".clippreview a").fancybox({
            'padding'		: 0,
            'autoScale'		: false,
            'transitionIn'	: 'none',
            'transitionOut'	: 'none',
            'type'          : 'iframe',
            'width'		: 720,
            'height'		: 480,
            'overlayColor'    : '#000',
            'overlayOpacity' : '0.9',
            'callbackOnClose': function() {
                $("#fancy_content").empty();
            }
    });

});

var position = 1;
function slideTwitter(){

	var vorigepositie = position-1;
	if(position == 1){
		vorigepositie = 3;
	}

	var itemIn = $('#bericht'+position);
	var itemOut = $('#bericht'+vorigepositie);

	itemOut.css('display','none');
	itemIn.fadeIn(2000);


	// verhoog met 1 en herhaal
	// ga terug naar 1 indien 3 behaalt is

	position++;

	if(position > 3){
		position = 1;
	}

	setTimeout("slideTwitter()",7000);
}
