$(document).ready(function()
{
//  Shadowbox.init({ flashParams: {movie:'/flash/player.swf'} });
  Shadowbox.init({ pathFLV:'/flash/', handleOversize:'none', modal:true, flashParams: { movie:'/flash/player.swf' } });

  $(".timetable-body tr").tooltip(
  {
    track:true,
    delay:0,
    showURL:false,
    opacity:1,
    fixPNG:true,
    extraClass: "tooltip-small",
    top: 0,
    left: 15,
    bodyHandler: function()
    {
      return $('#' + $(this).attr('class')).html();
    }
  });

  $(".sidebox-content a").tooltip(
  {
    track:true,
    delay:0,
    showURL:false,
    opacity:1,
    fixPNG:true,
    extraClass: "tooltip-small",
    top: 0,
    left: 15,
    bodyHandler: function()
    {
      return $('#' + $(this).attr('class')).html();
    }
  });

  $('#abs_schulung').change(function ()
  {
    location.href = '/schulungen/buchung/' + $(this).val() + '/';
  });

  $('#list_teilnehmer').hide();
  $('#abs_schulung_teilnehmer').keyup(function ()
  {
    var cnt_rows = $(this).val();

    if (cnt_rows <= 0)
      return false;

    if (cnt_rows > 10)
    {
      alert("Es können max. 10 Teilnehmer angegeben werden.\nWenn Sie mehr Teilnehmer anmelden möchten, schicken füllen Sie das Formular nach der ersten Buchung erneut aus!");
      cnt_rows = 10;
      $(this).val(cnt_rows);
    }

    $('#list_teilnehmer').show().find('.type-text').hide();

    for (var i = 0; i < cnt_rows; i++)
    {
      $('#tn_' + i).show();
    }
  });
  $('#abs_schulung_teilnehmer').keyup();


  $('#showlist').change(function ()
  {
    $('#plan_list').submit();
  });

  $('input', '#plan_schulungen').click(function ()
  {
    $('input:checked', '#plan_produkte').removeAttr('checked');
    $('input:checked', '#plan_schulungen').removeAttr('checked');
    $(this).attr('checked', true);
  });

  $('input', '#plan_produkte').click(function ()
  {
    $('input:checked', '#plan_schulungen').removeAttr('checked');
  });

  $('#head-video').flash({ swf: "/flash/all4cad-intro.swf",width:932,height:150,flashvars:{ autostart:true } });
  $('#videocenter-flash').flash({ swf: "/flash/player.swf",width:520, height:414,flashvars:{ file:"/flash/start.flv", autostart:true } });
});

