﻿// On load
$(document).ready(function()
{
    // Itinerary jquery tabs initialize.
    $(".TabControl").tabs();
    $("#ItineraryNestedTabs").tabs({ selected: 1 });    
});

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Translates a Javascript date to match format .NET code expects.
function formatDateForDotNet(day, month, year)
{
    return (month + 1) + "/" + day + "/" + year;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Updates the Itinerary Date Range title when switching between multiple itineraries.
function updateItineraryDateRangeTitle(title, subtititle, itineraryId, dvdUrl)
{
    $('#ItineraryTitle').html(title);
    $('#ItinerarySubTitle').html(subtititle);
        
    $('.ItineraryContainer').each(function()
    {
        $(this).css('display', 'none');
    });
    
    // Show the selected itinerary
    $('#Itinerary' + itineraryId).show();
    
    // Update the DVD Share link
    $('#DvdShare').css('display', 'none');
    if (dvdUrl != '')
    {
        $('#DvdShare').attr('href', dvdUrl)
        $('#DvdShare').show();
    }
    
}

