function initHover(element)
{
    $(element).bind("mouseenter",function(){
        var src = $(this).find('img').attr('src');
        $(this).find('img').attr('src', src.replace('front', 'frontProducts'));
    }).bind("mouseleave",function(){
        var src = $(this).find('img').attr('src');
        $(this).find('img').attr('src', src.replace('frontProducts', 'front'));
    });
}
function initCarousel(category)
{
    var size=$(category).find('li').size();
    if(size < 4) {
        $(category).parents('.carouselBox').find('.arrow').hide();
    }
    if(size > 2) {
        $(category).jCarouselLite({
            btnNext: ".next",
            btnPrev: ".prev",
            visible: 3
        });
    }
    if(jQuery.browser.msie)
    {
        $('.accessory').height(450);
    }
    $(".carouselLoader").animate({ height: 'hide', opacity: 'hide' }, 'fast', function(){
        $(this).animate({ height: 'show', opacity: 'show' }, 'slow', function(){
            if(jQuery.browser.msie)
            {
                $('.accessory').height(100);
            }  
        });
    });
}
$(document).ready(function(){
    initCarousel($('.carousel'));
    initHover($('.carousel a'));
});
