var menu_timer = null;
var menu = null;
$(document).ready(function() {
    $("li.button ul").hide();
    $("li.button:contains('last minute')").hover(
                menuHoverIn,
                menuHoverOut
        );
    $("li.button:contains('spa & wellness')").hover(
                menuHoverIn,
                menuHoverOut
        );

    initFaqAnimation();
    initSpaAnimation();
});
function menuHoverIn()
{
    menu = $("ul", this);
    menu_timer = setTimeout("_showMenu()",200);
}
function menuHoverOut()
{
    clearTimeout(menu_timer);
    _hideMenu();
}
function _showMenu()
{
    menu.slideDown("fast");
}
function _hideMenu()
{
    menu.slideUp("fast");
}

function initFaqAnimation()
{
    $('ul#acc_menu li div').hide();
    $('#acc_menu ul:first').show();
    $('p.title_question').click(
    function()
    {
        var checkElement = $(this).next();
        if((checkElement.is('div')) && (checkElement.is(':visible')))
        {
            return false;
        }
        if((checkElement.is('div')) && (!checkElement.is(':visible')))
        {
            $('ul#acc_menu li div:visible').slideUp('fast');
            checkElement.slideDown('fast');
            return false;
        }
    });
}

function initSpaAnimation()
{
    $("a.rollup").click(
        function()
        {
            var checkElement = $(this).parent().next();
            if((checkElement.is('div')) && (checkElement.is(':visible')))
            {
                return false;
            }
            if((checkElement.is('div')) && (!checkElement.is(':visible')))
            {
                $('div.spa_content:visible').slideUp('fast');
                checkElement.slideDown('fast');
                return false;
            }
       });
}
