function AfterVideoInitialize()
{
  var video = Astounding.VideoPlayer.getVideoPlayer('video');
  video.onVideoStart = WR_VideoStart;
  video.onVideoEnd = WR_VideoEnd;
  video.onVideoStop = WR_VideoEnd;
  if(video.isScriptingAvailable())
  {
    Astounding.Utilities.hide('fullScreen');
    Astounding.Utilities.hide('skipVideo');
  }
}

function WR_FullScreen()
{
  var video = Astounding.VideoPlayer.getVideoPlayer('video');
  video.makeFullScreen();
}

function WR_SkipVideo()
{
  var video = Astounding.VideoPlayer.getVideoPlayer('video');
  if(!video.stop())
  {
    WR_VideoEnd();
  }
}

function WR_VideoStart()
{
  Astounding.Utilities.hide('loader');
  Astounding.Utilities.show('video');
  Astounding.Utilities.show('fullScreen');
  Astounding.Utilities.show('skipVideo');
}
function WR_VideoEnd()
{
  Astounding.Utilities.hide('fullScreen');
  Astounding.Utilities.hide('skipVideo');
  Astounding.Utilities.hide('videoBox');
  Astounding.Utilities.hide('videoMask');
  Astounding.Utilities.hide('videoBottomMask');
  Astounding.Utilities.hide('video');
  
  var text = document.getElementById('text');
  text.src = 'main_menu_text.gif';
}

function WR_SetClip(clipUrl)
{
  Astounding.Utilities.show('videoBox');
  Astounding.Utilities.show('videoMask');
  Astounding.Utilities.show('videoBottomMask');
  var video = Astounding.VideoPlayer.getVideoPlayer('video');
  if(video.isScriptingAvailable())
  {
    Astounding.Utilities.hide('video');
    Astounding.Utilities.show('loader');
  }
  else
  {
    Astounding.Utilities.show('video');
  }
  video.setClip(clipUrl);
  video.play();
  
  var text = document.getElementById('text');
  text.src = 'video_text.gif';
}
