layerWidth = 400;
layerHeight = 246;
$(document).ready(function(){ 
  $('#close').click(function() { 
    $('#layer').fadeOut(500);
  });
  window.setTimeout(function() {
    win = $(window);
    $('#layer')
      .css({
        'width': layerWidth + 'px',
        'height': layerHeight + 'px',
        'top': '0px',
        'left': '-' + layerWidth + 'px'
      })
      .animate({
        'top': win.height() / 2 - layerHeight / 2,
        'left': win.width() / 2 - layerWidth / 2
    }, 1500);
  }, 0);
});
