﻿$(document).ready(function () {
    $(".paging").show(); $(".paging a:first").addClass("active"); var imageWidth = $(".window").width(); var imageSum = 790; var imageReelWidth = imageWidth * imageSum; $(".image_reel").css({ 'width': imageReelWidth }); rotate = function () { var triggerID = $active.attr("rel") - 1; var image_reelPosition = triggerID * imageWidth; $(".paging a").removeClass('active'); $active.addClass('active'); $(".image_reel").animate({ left: -image_reelPosition }, 500); }; rotateSwitch = function () {
        play = function () {
            $active = $('.paging a.active').next(); if ($active.length === 0) { $active = $('.paging a:first'); }
            rotate();
        };
    }; rotateSwitch(); $(".image_reel a").hover(function () { clearInterval(play); }, function () { rotateSwitch(); }); $(".paging a").click(function () { $active = $(this); clearInterval(play); rotate(); rotateSwitch(); return false; });
});
