
var BookaTripClick = function(arg1, arg2, arg3)
{
    // This fixes a bug with IE and nested tabs
    if (arg1.className == "bookatrip")
    {
        $('#bookatrip_internal').removeClass('tabs-hide');
    }
};

$(function()
{
    if ($.cookie('tab_main_cookie') != null && location.hash != "")
        var tab = parseInt($.cookie('tab_main_cookie'));
    else
        var tab = 1;

    if ($.cookie('bookatrip_tab_main_cookie') != null && location.hash != "")
        var bookatrip_tab = parseInt($.cookie('bookatrip_tab_main_cookie'));
    else
        var bookatrip_tab = 1;

    if ($.browser.msie == true && $.browser.version < 7)
    {
        // This is a workaround to fix nested tabs in IE (bug 413)
        $('#bookatrip').attr("id","bookatrip_internal");
        $('#bookatrip_internal').removeClass('tabcontent');
        $('#bookatrip_out').attr("id","bookatrip");
        $('#maintab1').tabs(tab,{fxFade:true,onShow:BookaTripClick});
        //Internal Tab
        $('#bookatrip_internal').tabs(bookatrip_tab,{fxFade:true});
    }
    else
    {
        $('#maintab1').tabs(tab,{fxFade:true});
        //Internal Tab
        $('#bookatrip').tabs(bookatrip_tab,{fxFade:true});
    }

    $('#maintab2').tabs(1,{fxFade:true});
    $('#maintab3').tabs(1,{fxFade:true});
    ClearAllCookies();
});

function HomeMyReservationControl_initialize(){}

function ClearAllCookies()
{
    $.cookie('nextMarket', null);
    $.cookie('marketing_opt_in', null);
    $.cookie('juniperoptout', null);
    $.cookie('Payment', null);
    $.cookie('popcornPayment', null);
    $.cookie('showPaymentTabs', null);
    $.cookie('paymentTab', null);
    $.cookie('emailCompare', null);
    $.cookie('confirmEmail', null);
}