﻿$(document).ready(function() {
    //When mouse rolls over
    $(".WaysToShopPanel ul li#WaysToShopListItem").mouseover(function() {
        $(this).find(".WaysToShopMenu").stop().animate({ height: '34px' }, { queue: false, duration: 600, easing: 'easeOutBounce' });
        $(this).find(".sublinksWrapper").animate({ height: 'hide' }, { queue: false, duration: 1 });
    });

    $(".WaysToShopPanel ul li#WaysToShopListItem .WaysToShopMenu").mouseover(function(e) {
        $(this).stop().animate({ height: '800px' }, { queue: false, duration: 10, easing: 'easeOutBounce' });
        e.stopPropagation();
    });

    $(".WaysToShopPanel ul li .WaysToShopMenu .categoryPanel").mouseover(function() {
        $(this).find(".sublinksWrapper").stop().animate({ height: 'show' }, { queue: false, duration: 600, easing: 'easeOutBounce' });
    });

    //When mouse is removed
    $(".WaysToShopPanel ul li#WaysToShopListItem").mouseout(function() {
        $(this).find(".WaysToShopMenu").stop().animate({ height: '0px' }, { queue: false, duration: 200 })
    });

    $(".WaysToShopPanel ul li#WaysToShopListItem .WaysToShopMenu").mouseout(function() {
        $(this).stop().animate({ height: '0px' }, { queue: false, duration: 600 })
    });

    $(".WaysToShopPanel ul li .WaysToShopMenu .categoryPanel").mouseout(function() {
        $(this).find(".sublinksWrapper").stop().animate({ height: 'hide' }, { queue: false, duration: 50, easing: 'easeOutBounce', complete: function() { $(this).css("height", "auto"); } })
    });
});