// JavaScript Document

function solveDimensions()
{
  var resultado = $(window).height() - $('body').height();
  if (resultado > 0) {

    var media = resultado/2
    $('body').css('margin-top', media +'px');
  } else {
    $('body').css('padding-top', '20px');
  }
}

$(document).ready(function(){

  var resultado = $(window).height() - $('body').height();
    //alert(resultado);
  if (resultado > 0) {

    var media = resultado/2
    $('body').css('margin-top', media +'px');
  } else if(resultado < 0) {
    var t=setTimeout("solveDimensions()",100);

  }


});

//            $(document).ready(function() {
//                (function ($) {
//                    // VERTICALLY ALIGN FUNCTION
//                    $.fn.vAlign = function() {
//                      return this.each(function(i){
//                          var ah = $(this).height();
//                          var ph = $(this).parent().height();
//                          var mh = (ph - ah) / 2;
//                          $(this).css('margin-top', mh);
//                          // alert(''+$(document).height()+'');
//                      });
//                    };
//                })(jQuery);
//
//                if($(document).height() > '670') {
//                    $('body').vAlign();
//                }
//            });

