﻿function ShowCalendar()
{
  var button = $('#episodeCalendarSubmit');
  if (button.length == 1)
  {
    var container = $('#episodeCalendarContainer');
    if (container.length == 1)
    {
      $(container[0]).toggle();
      $(button[0]).trigger('click');
    }
  }
}

function HideCalendar()
{
  var button = $('#episodeCalendarSubmit');
  if (button.length == 1)
  {
    var container = $('#episodeCalendarContainer');
    if (container.length == 1)
    {
      $(container[0]).hide();
    }
  }
}

// Keep user from entering more than maxLength characters
function maxLength(field, maxChars) {
    return (field.value.length <= maxChars);
}
// Keep user from entering more than maxLength pasted characters
function maxLengthPaste(field, maxChars) {
    event.returnValue = false;
    if ((field.value.length + window.clipboardData.getData("Text").length) > maxChars) {
        return false;
    }
    event.returnValue = true;
}

function tb_remove() {
    $("#TB_imageOff").unbind("click");
    $("#TB_closeWindowButton").unbind("click");
    $("#TB_window").fadeOut("fast", function() { $('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove(); });
    $("#TB_load").remove();
    if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
        $("body", "html").css({ height: "auto", width: "auto" });
        $("html").css("overflow", "");
    }
    document.onkeydown = "";
    document.onkeyup = "";
    
    return false;
}

$(document).ready(function()
{
    $('#TitreDerniereEmission').supersleight({ shim: '/Volt/Content/Images/spacer.gif' });
    $('#TitreEmissionsPrecedentes').supersleight({ shim: '/Volt/Content/Images/spacer.gif' });
    $('#TitreProchaineEmission').supersleight({ shim: '/Volt/Content/Images/spacer.gif' });
});
