﻿    jQuery.fn.center = function (height) { 
        this.css({"position":"absolute"});
        $(this).each(function(e){
                $(this).css("top", ( $(height+":nth("+e+")").height() - $(this).height() ) / 2+$(height+":nth("+e+")").scrollTop() + "px"); 
                $(this).css("left", ( $(height+":nth("+e+")").width() - $(this).width() ) / 2+$(height+":nth("+e+")").scrollLeft() + "px");                    
        });
        return this; 
    }
