var BookingForm = {

    init : function()
    {
        if ($('#booking_return_input').length > 0) {
            this.updateInboundFields();

            $('#booking_return_input').click(function() {
                BookingForm.updateInboundFields();
            });
        }
    },

    updateInboundFields : function()
    {
        if ($('#booking_return_input:checked').val()) {
            $('#inbound-fields').removeClass('inactive');
            $('#inbound-fields input, #inbound-fields textarea').removeAttr('disabled');
        } else {
            $('#inbound-fields').addClass('inactive');
            $('#inbound-fields input, #inbound-fields textarea').attr('disabled', 'disabled').val('');
        }
    }
};


$(function() {

    BookingForm.init();

    if ($('.banner li').length > 1) {
        $('.banner ul').cycle({
            delay : 2000,
            timeout : 8000
        });
    }

    $(".tweets").hide().tweet({
        count : 6,
        fetch : 20,
        username : 'Arrowtax',
        template : '<a href="http://twitter.com/Arrowtax">@arrowtax</a>: {text}',
        filter : function(t){ return ! /^@\w+/.test(t["tweet_raw_text"]); }
    }).bind("loaded", function() {
        if ($('li', this).length > 0) {
            $(this).show();
        }
    });

});
