// JavaScript Document



$(window).load(function() {

    // set menu highlight
    if ( pageName != '')
        $('#id' + pageName).css( 'color', '#ffcc99');
    if ( pageName == 'Reap' || pageName == 'Crisis' || pageName == 'Iotp' || pageName == 'Tirrell' )
        {
        $('#idServicesSub').show();
        $('#idServices').css( 'color', '#ffcc99');
        $('#idServicesCaret').css( 'background-image', 'url(_images/caret-down-on.jpg) ');
        }
    else if ( pageName == 'Benz' || pageName == 'Support' || pageName == 'Gift')
        {
        $('#idSupportSub').show();
        $('#idSupport1').css( 'color', '#ffcc99');
        $('#idSupportCaret').css( 'background-image', 'url(_images/caret-down-on.jpg) ');
        }

    $('#idServicesDiv').hover( function() {
        $('#idServicesCaret').css( 'background-image', 'url(_images/caret-down-on.jpg) ');
        $('#idServices').css( 'color', '#ffcc99');
        return false;
    },
                                function() {
        if ( pageName != 'Reap' && pageName != 'Crisis' && pageName != 'Iotp' && pageName != 'Tirrell' )
        {
            $('#idServicesCaret').css( 'background-image', 'url(_images/caret-down-off.jpg) ');
            $('#idServices').css( 'color', 'white');
        }
        return false;
    });


    $('#idSupportDiv').hover( function() {
        $('#idSupportCaret').css( 'background-image', 'url(_images/caret-down-on.jpg) ');
        $('#idSupport1').css( 'color', '#ffcc99');
        return false;
    },
                                function() {
        if ( pageName != 'Benz' && pageName != 'Support' && pageName != 'Gift')
        {
            $('#idSupportCaret').css( 'background-image', 'url(_images/caret-down-off.jpg) ');
            $('#idSupport1').css( 'color', 'white');
        }
        return false;
    });


    // Menu Controls
    $('.classClickServices').click(function() {

        // hide all other menus
        HideMenu( '#idSupportSub');

        $('#idServicesSub').slideToggle();
        return false;
    });

    // Menu Controls
    $('.classClickSupport').click(function() {

        // hide all other menus
        HideMenu( '#idServicesSub');

        $('#idSupportSub').slideToggle();
        return false;
    });

    function HideMenu( id)
    {
        $(id).slideUp();
    }


    // doesn't work with Toggle
    function HideAllMenus()
    {
        $('.classDivMenuSub').slideUp();
    }

});

