﻿(function ($) {
    $(function () {
        $('#basket.active').setHoverClass("hover");
    });

    $('.widebasketExtraChannels .name').live('click', function () {
        if ($(this).parents('.widebasketExtraChannels').hasClass('on')) {
            $(this).parents('.info').animate({ height: '43px' }, 200, function () {
                $(this).parents('.widebasketExtraChannels').removeClass('on').addClass('off');
            })
        }
        else {
            $(this).parents('.widebasketExtraChannels').removeClass('off').addClass('on');
            var fullHeight = $(this).parents('.info').find('.description').height();

            if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { //test for MSIE x.x;
                $(this).parents('.info').animate({ height: fullHeight + 65 }, 200, function () {
                })
            }
            else {
                $(this).parents('.info').animate({ height: fullHeight + 55 }, 200, function () {
                })
            }
        }
    })

    $('.widebasketExtraPackage .name').live('click', function () {
        if ($(this).parents('.widebasketExtraPackage').hasClass('on')) {
            $(this).parents('.info').animate({ height: '43px' }, 200, function () {
                $(this).parents('.widebasketExtraPackage').removeClass('on').addClass('off');
            })
        }
        else {
            $(this).parents('.widebasketExtraPackage').removeClass('off').addClass('on');
            var fullHeight = $(this).parents('.info').find('.description').height();

            if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { //test for MSIE x.x;
                $(this).parents('.info').animate({ height: fullHeight + 65 }, 200, function () {
                })
            }
            else {
                $(this).parents('.info').animate({ height: fullHeight + 55 }, 200, function () {
                })
            }
        }
    })
})(jQuery);
