$(function(){

    var options = {
        text : { 
          cancel  : "Katkesta",
          loading : "laen",
          close   : '<span class="shortcut">S</span>ulge',
          next    : '<span class="shortcut">J</span>ärgmine', 
          prev    : '<span class="shortcut">E</span>elmine'
        },
        resizeLgImages:     true,
        displayNav:         true,
        handleUnsupported:  'remove',
        keysClose:          ['s', 27, 'x'], // c or esc
        keysPrev:           ['e', 37],
        keysNext:           ['j', 39],
        autoplayMovies:     false,
        overlayColor:       "#fff",
        overlayOpacity:     0.65,
        initialHeight:      400,
        initialWidth:       160,
        resizeDuration:     0.25,
        fadeDuration:       0.15,
        counterType:        'default',
        loadingImage:       'img/loading-light.gif'
    };

    Shadowbox.init(options);
    
    $("#fAge").keypress(function (e) {
        if(e.which!=8 && e.which!=0 && (e.which<48 || e.which>57))  {
            $("#ageError").show().fadeOut(5000);
            return false;
        }
    });
  
   var video_opened = false;
   $("#demo").click(function() {
      if( ! video_opened) {
        $("#player-demo").show();
      } else {
        $("#player-demo").hide();
      }
      video_opened = !video_opened;
      return false;
    });
});