﻿var timer;

function AjustarCarousel() {
    $('#divScrollVagasContainer').serialScroll({
        items: 'li',
        prev: '#divScrollVagas a.prev',
        next: '#divScrollVagas a.next',
        offset: -130, //when scrolling to photo, stop 230 before reaching it (from the left)
        start: 1, //as we are centering it, start at the 2nd
        duration: 10000,
        force: true,
        stop: true,
        interval: 5000,
        lock: false,
        cycle: false, //don't pull back once you reach the end
        easing: 'linear', //use this easing equation for a funny effect     easeOutQuart
        jump: false //click on the images to scroll to them
    });
    //StartTimer();
    $('#divScrollVagasContainer').hover(function() {
        StopScroll();
    }, function() {
        StartScroll();
    });
}

var tempFunction;

function StartScroll() {
    clearTimeout(tempFunction);
    tempFunction = window.setTimeout("$('#divScrollVagasContainer').stop().trigger('start');", 800);
}

function StopScroll() {
    $('#divScrollVagasContainer').stop().trigger('stop');
}

function pararAnimacao() {

}

function reAtivarAnimacao() {
    AjustarCarousel();
}
