
/**
 * Funkce pro posouvani videa na uvodni strance
 */
$(document).ready(function() {
	init_rotator();
});
 
function init_rotator() {
    // initial css parameter
    $('#rotator>div').css({
        'position': 'absolute',
        'top': 0,
        'left': 0
    });
    // init cycle rotator
    $('#rotator')
    .cycle({
        pager:  '.rotator_navigation',
        pagerAnchorBuilder: function(index, el) {return '<a href="#"> </a>';},
        speed: 2000,
        timeout: 6000,
        before: function() {
            if (rand(2) == 1) {
                $(this).find('img').css('left', 0);
                $(this).find('img').css('right', 'auto');
            }
            else {
                $(this).find('img').css('left', 'auto');
                $(this).find('img').css('right', 0);
            }            
            var cor_width = $('#rotator').width()-320;
            $(this).find('img').css({
                'width': cor_width
            }).animate({              
                'width': (cor_width *1.1)
            }, 8000, function() {                
                // animation has ended
            });
        }
    });
}
