﻿function FlashSlider() {

    var images = $('.flash_slider img');
    $.each(images, function (i) {
        $(this).css({
            visibility: 'visible',
            zIndex: (i + 1),
            opacity: 0
        });
        if (i == 0) {
            $(this).animate({
                opacity: 1
            }, 1000);
        }

        $(this).attr('index', i);
    });
}

function slideAll(index) {
    var images = $('.flash_slider img');

    if (index != 0) {
        var item = $('[index=' + index + ']');
        $(item).animate({
            opacity: 1
        }, 1000, function () {
            $('[index=' + (index - 1) + ']').css('opacity', '0');
        });
    }
    else {
        $('[index=' + index + ']').css('opacity', '1');
        var item = $('[index=' + (images.length - 1) + ']');
        $(item).animate({
            opacity: 0
        }, 1000);
    }


}
