var lock = false;
$(document).ready(function() {
    $('.bg_index').animate( {
            backgroundPosition:"-"+(4*946)+"px"
            }, {
                duration:0
            } );
});
            
function setTopContentData(title, desc, link, i) {
    $('.top_content').find('a').css({'visibility': 'visible'});
    $('.top_content').find('h1').text(title);
    $('.top_content').find('p').html(desc);
    $('.top_content').find('a').attr("href", link)
    if( !lock ) {
        lock = true;
        $('.top_content').hide().fadeIn("slow");
        setTimeout( function() {
            lock = false;
        }, 600);
    }
    switch( i ) {
        case 'analizy':
            $('.bg_index').animate( {
            backgroundPosition:"-"+(0*946)+"px"
            }, {
                duration:0
            } );
        break;
        case 'geomarketing':
            $('.bg_index').animate( {
            backgroundPosition:"-"+(1*946)+"px"
            }, {
                duration:0
            } );
        break;
        case 'jakosc':
            $('.bg_index').animate( {
            backgroundPosition:"-"+(2*946)+"px"
            }, {
                duration:0
            } );
        break;
        case 'slowniki':
            $('.bg_index').animate( {
            backgroundPosition:"-"+(3*946)+"px"
            }, {
                duration:0
            } );
        break;
    }
    
}
