(function ($) {
// VERTICALLY ALIGN FUNCTION
$.fn.vAlign = function() {
	return this.each(function(i){
	var ah = $(this).height();
	var ph = $(window).height();

    if( ph > 800 )
    {
        // hide window scrollbars
        $(document).css('overflow', 'hiden');
    }
    else
    {
        // show window scrollbars
        $(document).css('overflow', 'auto');
    }

	var mh = (ph - ah) / 2;
	$(this).css('padding-top', mh);
	});
};
})(jQuery);


function alignWrapper()
{
    var isMSIE/*@cc_on=1@*/;
    if( !isMSIE )
        $('#wrapper').vAlign();
}

//$(window).ready(alignWrapper);
//$(window).resize(alignWrapper);
