$(window).load(function() {
    $(".flex-control-nav li strong").each(function(e) {
        element_width = 0 - $(this).width()-3;
        element_pos =  $(this).width();
        $(this).css("left", element_width);
        if(Browser.Version() != 7){
        	$(this).children().css("left", element_pos);
        }
        if(Browser.Version() != 8){
        	$(this).children().css("width", element_pos+20);
        }
    });
    $('.flexslider').flexslider({
        slideshowSpeed: 7000,
        animationDuration: 700,
        pauseOnAction: true,    
        slideshow : true ,
        keyboardNav: false,
        manualControls: ".flex-control-nav li a",
        start: function(){
            $("#tweener").stop();
            $("#tweener").css("width", "0%");
            tween();
        },
        before: function(){
            $("#tweener").stop();
            $("#tweener").css("width", "0%");
            tween();
        }
    });
    
    function tween(){
        $("#tweener").animate({
            width: "100%"
        }, 6800, 'linear' );
    };
});

