$(function () {
  var splash = $('<div>').attr('id', 'splash').css({'position': 'absolute', 'top': -400, 'opacity': 0, 'left': 0, 'z-index': 20000})
  var wrapper = $('<div>').attr('id', 'splash-wrapper').css({'position': 'relative', 'z-index': 20000}).appendTo(splash)
  var img = new Image()
  img.src = 'img/splash.png'
  img.onload = function () {
    $('<a>').attr('id', 'btn-splash-close').attr('href', '#').click(function () {
      $(splash).animate({top: -400, 'opacity': 0}, 500, function () {
        $('#splash').remove()
      })
      $(this).blur()
      return false
    }).html('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;').css({'position': 'absolute', 'bottom': 12, 'right': 12, 'width': 30, 'height': 30}).appendTo(wrapper)
    $(splash).css({'left': $(splash).width()/2+img.width/2})
    $(img).appendTo(wrapper)
    $(splash).appendTo('body')
    $(splash).animate({top: 100, 'opacity': 1}, 1200)
  }
})