//$(window).scroll(function() { $("#top").css("top", $(window).scrollTop() + "px"); });

$(document).ready(function() {
    //remove on enabled js
    $(".collapse").removeClass("collapse");

    $('#floating_box').makeFloat({ x: 'current', y: 'current', speed: 'normal' });

    var sliders = $(".image_slider");
    for (var i = 0; i < sliders.length; i++) {
        if (i < 10) { //script breaks if id equal to two digits e.g. 10, 20 etc
            $(sliders[i]).easySlider({ numeric: true, numericId: 'controls' + i });
        } else {
            $(sliders[i]).easySlider({ numeric: true, numericId: 'controls2' + i });
        }
    }

    var casenames = SWFAddress.getPathNames();
    if (casenames != undefined) {
        $.scrollTo('#case_' + casenames[1] + '_target', 1000, { axis: 'y' });
    }

    $('.case_grid.caption').hover(function() {
        $(".cover", this).stop().animate({ top: '-3px' }, { queue: false, duration: 260 });
    }, function() {
        $(".cover", this).stop().animate({ top: '100px' }, { queue: false, duration: 600 });
    });


});

function SwitchCase(target, rel) {
    $.scrollTo(target, 1300, { axis:'y' });
    SWFAddress.setValue(rel);
    _gaq.push(['_trackPageview', '/' + rel]); 
    //_gaq._trackPageview('/' + rel);
    return false;
}
