var timer;
function startTimer() {
    timer = window.setInterval(function () { if ($('#firstTab').hasClass('activeTab')) $('#secondTab').trigger('click'); else if ($('#secondTab').hasClass('activeTab')) $('#thirdTab').trigger('click'); else if ($('#thirdTab').hasClass('activeTab')) $('#fourthTab').trigger('click'); else $('#firstTab').trigger('click'); }, 4000);
}
function toggleSlide(whichSlide) {
    if ($('#' + whichSlide + 'Tab').hasClass('activeTab'))
        return false;
    $('.tab').unbind('click').removeClass('activeTab');
    $('.tabArrow').animate({ 'left': '-63px' }, 'fast');
    $('#' + whichSlide + 'TabArrow').animate({ 'left': '0px' }, 'fast', function () { $(this).animate({ 'left': '-15px' }, 'fast', function () { bindTabHandlers(); }); });
    $('#' + whichSlide + 'Tab').addClass('activeTab');
    $('.image').hide('normal');
    $('#' + whichSlide + 'Image').show('normal');
}
function bindTabHandlers() {
    $('#firstTab').bind('click', function () { toggleSlide('first'); });
    $('#secondTab').bind('click', function () { toggleSlide('second'); });
    $('#thirdTab').bind('click', function () { toggleSlide('third'); });
    $('#fourthTab').bind('click', function () { toggleSlide('fourth'); });
}
function setupLinks() {
    $('#firstImage').bind('click', function () { window.location = 'http://www.ilovemycommunitybank.com/'; });
    $('#secondImage').bind('click', function () { window.location = 'http://firstfedevansville.mortgagewebcenter.com/Default.asp?bhcp=1'; });
    $('#thirdImage').bind('click', function () { window.location = 'http://www.oectours.com/oec/?b=1080&c=9571'; });
    $('#fourthImage').bind('click', function () { window.location = '/personal-banking/deposit-products/checking-accounts/index.html'; });
}
$(window).load(function () { $('#loadingImageHolder').hide(); $('#contentHolder').show(); startTimer(); });
$(function () { loadImages('firstImage.jpg', 'secondImage.jpg', 'thirdImage.jpg', 'fourthImage.jpg'); setupLinks(); bindTabHandlers(); $('#contentHolder').bind('mouseover', function () { clearInterval(timer); }).bind('mouseout', startTimer); $('.tabArrow').css('display', 'block'); $('#firstTab').trigger('click'); });

