$(document).ready(function() {

var bHeight = window.innerHeight;
var margin = eval(bHeight/2 - $('#dock').innerHeight()/2);
var bwidth = eval(window.innerWidth);

$('#dock').css('margin-top',margin+'px');

$('.fancyb').fancybox({
	'onClosed': function() {parent.location.reload(true);}
	});

$(window).resize(function() {
	var bHeight = window.innerHeight;
	var margin = eval(bHeight/2 - $('#dock').innerHeight()/2);
	var bwidth = eval(window.innerWidth);
	
	$('#dock').css('margin-top',margin+'px');
});

$('#my-list').waitForImages({
    finished: function() {
    	$('#dock').css('background-image','none');
    	$('#my-list li').fadeIn();
       	$('#my-list').hoverscroll({
            arrows: false,
            rtl: false,
            width: bwidth,
            height: 500
        });
        // Starting the movement automatically at loading
        // @param direction: right/bottom = 1, left/top = -1
        // @param speed: Speed of the animation (scrollPosition += direction * speed)
        var direction = 1,
            speed = 5;
        $("#my-list")[0].startMoving(direction, speed);
    }
});
      
	
});
