var iTmpHeaderRotator = 1; var actionCompleteRotator = true; $('#header_rotator_arror_left').click(function () { if (actionCompleteRotator == false) return; else actionCompleteRotator = false; $('#header_rotator' + iTmpHeaderRotator + '_content').slideToggle('slow', function () { iTmpHeaderRotator = (iTmpHeaderRotator - 1 < 1) ? 3 : iTmpHeaderRotator - 1; $('#header_rotator' + iTmpHeaderRotator + '_content').slideToggle('slow'); actionCompleteRotator = true; }); }); $('#header_rotator_arror_right').click(function () { if (actionCompleteRotator == false) return; else actionCompleteRotator = false; $('#header_rotator' + iTmpHeaderRotator + '_content').slideToggle('slow', function () { iTmpHeaderRotator = (iTmpHeaderRotator + 1 > 3) ? 1 : iTmpHeaderRotator + 1; $('#header_rotator' + iTmpHeaderRotator + '_content').slideToggle('slow'); actionCompleteRotator = true; }); }); $('#header_rotator1').click(function () { if (actionCompleteRotator == false) return; else actionCompleteRotator = false; $('#header_rotator' + iTmpHeaderRotator + '_content').slideToggle('slow', function () { $('#header_rotator1_content').slideToggle('slow', function () { iTmpHeaderRotator = 1; actionCompleteRotator = true; }); }); }); $('#header_rotator2').click(function () { if (actionCompleteRotator == false) return; else actionCompleteRotator = false; $('#header_rotator' + iTmpHeaderRotator + '_content').slideToggle('slow', function () { $('#header_rotator2_content').slideToggle('slow', function () { iTmpHeaderRotator = 2; actionCompleteRotator = true; }); }); }); $('#header_rotator3').click(function () { if (actionCompleteRotator == false) return; else actionCompleteRotator = false; $('#header_rotator' + iTmpHeaderRotator + '_content').slideToggle('slow', function () { $('#header_rotator3_content').slideToggle('slow', function () { iTmpHeaderRotator = 3; actionCompleteRotator = true; }); }); }); $(document).ready(function() { window.setInterval(function() { $('#header_rotator_arror_right').click(); }, 6500); });