$(document).ready(function(){
  
});

$(window).load(function(){
  siteFunction.init();
});

var siteFunction = {
  value: {

  },

  init: function(){
    this.initOnce();

    this.positionSplash();
  },

  initOnce: function(){
    if(this.value.initOnce == 1){
      return false;
    }

    $(window).resize(function() {
      siteFunction.positionSplash();
    });

    this.value.initOnce = 1;
    return true;
  },

  positionSplash: function(){
    var windowHeight = $(window).height();
    var mainHeight = $("#main").height();
    var topMargin = parseInt((windowHeight - mainHeight) / 2);
    $("#main").css({'marginTop' : topMargin + 'px'});
  }
};
