jQuery(function ($) {
    function getFloat(value){
        return parseFloat(value.replace('px', ''))  ;
    }

    $('@selector').each(function () {
        (function (slider) {
            $(window).ready(function () {
            
            @if (topNavPosition) {
                var blockClass = '#homepage-slider',
                    topNav = '#top-nav-position';
                if ($(topNav, slider).length > 0)
                {
                    var block = $(blockClass, slider),
                        block_header = $(topNav, block);

                    block_header.css('min-height', '35px');
                    block_header.css('position', 'relative');

                    $('.bd-left-button', slider).appendTo(block_header);
                    $('.bd-right-button', slider).appendTo(block_header);

                    $('.bd-left-button', slider).css({
                        'top': '5px',
                        'right': '60px',
                        'left': 'auto',
                        'bottom': 'auto'
                    });

                    $('.bd-right-button', slider).css({
                        'top': '5px',
                        'right': '0px',
                        'bottom': 'auto'
                    });
                }
            }

                $('.bd-left-button @(navigator.carousel.selector)', slider).attr('href', '#');
                $('.bd-left-button @(navigator.carousel.selector)', slider).click(function() {
                    $(slider).carousel('prev');
                    return false;
                });

                $('.bd-right-button @(navigator.carousel.selector)', slider).attr('href', '#');
                $('.bd-right-button @(navigator.carousel.selector)', slider).click(function() {
                    $(slider).carousel('next');
                    return false;
                });

                $('.carousel-inner > .item:first', slider).addClass('active');
                slider.carousel({ interval: @navigator._interval });
            });
        })($(this));
    });
});