$(function() {
  $('#skip').css({ 'opacity': 0, 'display': 'block' });
  $('#copyright, #enter').css({ 'display' : 'none' });
  $('#slideshow1, #slideshow2').css( { 'opacity': 0, 'height': '0px', 'width': '0px' } );
  $('#slideshow1').animate({ width: '458px', height: '198px', opacity: 1 }, "slow", function(){$('#slideshow2').animate({ width: '458px', height: '198px', opacity: 1 }, "slow", function(){$('#skip').animate({ 'opacity' : 1 });});});
  $('#contents').css({ 'display' : 'block' });
});
$(window).bind("load", function() {
  $('a').mouseover(function(){
    $(this).stop().animate({ opacity: 0 }, 'normal');
  }).mouseout(function(){
    $(this).stop().animate({ opacity: 1 }, 'normal');
  });
  $('#skip').bind('click', function(evt) {
    $('#slideshow1, #slideshow2').cycle('pause');
    $('#slideshow1 img:last').css({ 'z-index': 100, 'display': 'block' }).animate({ 'opacity': 1 }, 
      function() {
        $('#slideshow2 img:last').css({ 'z-index': 100, 'display': 'block' }).animate({ 'opacity': 1 });
      });
    $('#skip').fadeOut(400, function () { $('#copyright').fadeIn(400, function () { $('#enter').fadeIn(400); })});
  })
  $('#slideshow1, #slideshow2').css( { 'background': '#000000' } );
  $('#slideshow1').cycle({
    delay: 500,
    speed: 1200,
    autostop: 1
  });
  $.timer(250, function (timer) {
    timer.stop();
    $('#slideshow2').cycle({
      delay: 500,
      speed: 1200,
      autostop: 1,
      end: onEnd
    });
  });
  function onEnd() {
    $('#skip').fadeOut(400, function () { $('#copyright').fadeIn(400, function () { $('#enter').fadeIn(400); })});
  };
});
