 var center_first_loop = true;

 $(document).ready(function() {

jQuery.fn.centerScreen = function(loaded) {

  if(center_first_loop) {

  center_first_loop = false;
  var obj = this;

  var wheight = $(window).height();
  var mheight = this.height() + 50;

  if(wheight < mheight) {
	return;
  }

  $("#footer").css('top', wheight - 25);
/*
  obj.css('top', wheight/2-
	mheight/2-10);
*/
   $(window).resize(function()
	{ obj.centerScreen(!loaded); });

        } else {
//     obj.stop();
//     obj.animate({ top: wheight/2-
//	mheight/2}, 200, 'linear');
         }
      }
$("#wrapper").centerScreen();
});
