﻿// JScript File

$(document).ready(function() {
/*    $('.tab-820 .top-pane .promotional-content-pane')
        .animate({ opacity: '0.5' }, 100)
        .mouseover(function() {
            $(this).animate({ opacity: '1' }, 100);
        })
        .mouseout(function() {
            $(this).animate({ opacity: '0.5' }, 100);
        });*/
/*    $()
        .mousemove(function(e) {
            var offset = (e.pageX - $('.tab-820 .top-pane').offset().left) / 880;
            offset = Math.max(Math.min(offset, 1), 0);
            var newBgX = -offset * 30;
            $('.tab-820 .top-pane').css({ backgroundPosition: newBgX + 'px 0' });
            var newContentX = offset * 20 -20;
            var newContentOpacity = Math.min(Math.max(offset, 0.4) * 2, 1);
            var newContentOpacity2 = Math.min(Math.max(1-offset, 0.4) * 2, 1);
            $('.tab-820 .promotional-content-pane').css({ paddingRight: newContentX + 'px', opacity: newContentOpacity });
            $('.tab-820 .mini-contact-form').css({ paddingRight: newContentX + 'px', opacity: newContentOpacity2 });
        });    */
        
    $('.tabbed-content-tabs .title').each(function() {
        $('.tabbed-content-tab-headers').append('<div class="tab-header">' + $(this).html() + '</div>');
        //$(this).parent().find('.content div div div').prepend($(this).html());
        $(this).remove();
    });
    $('.tabbed-content-tab-headers .tab-header')
        .click(function(e){
            e.preventDefault();
            var aindex = $('.tabbed-content-tab-headers .tab-header').index(this);
            $('.tabbed-content-tabs .container-pane').eq(aindex).addClass('next');
            $('.tabbed-content-tabs .container-pane.active').fadeOut(100, function() {
                $(this).removeClass('active');
                $('.tabbed-content-tabs .container-pane.next').fadeIn(100).removeClass('next').addClass('active');
            });
            $('.tabbed-content-tab-headers .tab-header.active').removeClass('active').animate({ right: '0', opacity: '1' }, 200);
            $(this).addClass('active').animate({ right: '20px', opacity: '0.5' }, 200);
        });
    $('.tabbed-content-tabs .container-pane').not(':first').hide();
    $('.tabbed-content-tabs .container-pane:first').addClass('active');
    $('.tabbed-content-tab-headers .tab-header:first').addClass('active').css({ right: '20px', opacity: '0.5' }).trigger('click');

        
    $('.CatalogWrapper br:last').remove();
});
