﻿function seyesUp() {
    var targetOffset = $target.offset().top;
    $('html,body').animate({ scrollTop: targetOffset }, 1000);
}

jQuery(document).ready(function($) {
        $("div#slider1").codaSlider()
});

function openinfo(id) {
    $('#more' + id).each(function () {
        $(this).toggleClass("example");
    });

    $('#more' + id).slideToggle('slow');
}


$(document).ready(function () {
    $("ul.smarteyes_dropdown li span").click(function () {
        $(this).parent().find("ul.subnav").slideDown('fast').show();

        $(this).parent().hover(function () {
        }, function () {
            $(this).parent().find("ul.subnav").slideUp('slow');
        });
    }).hover(function () {
        $(this).addClass("subhover");
    }, function () {
        $(this).removeClass("subhover");
    });
});


$(document).ready(function () {
    $(".paging").show();
    $(".paging a:first").addClass("active");

    var imageWidth = $(".window").width();
    var imageSum = $(".image_reel img").size();
    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 = setInterval(function () {
            $active = $('.paging a.active').next();
            if ($active.length === 0) {
                $active = $('.paging a:first');
            }
            rotate();
        }, 7000);
    };

    rotateSwitch();


    $(".image_reel a").hover(function () {
        clearInterval(play);
    }, function () {
        rotateSwitch();
    });


    $(".paging a").click(function () {
        $active = $(this);

        clearInterval(play);
        rotate();
        rotateSwitch();
        return false;
    });

});

