$.fn.center = function(options) {
    var pos = {
        sTop : function() {
            return window.pageYOffset
            || document.documentElement && document.documentElement.scrollTop
            ||  document.body.scrollTop;
        },

        wHeight : function() {
            return window.innerHeight
            || document.documentElement && document.documentElement.clientHeight
            || document.body.clientHeight;
        }
    };

    return this.each(function(index) {
        if (index == 0) {
            var $this = $(this);
            var elHeight = $this.height();
            var elTop = pos.sTop() + (pos.wHeight() / 2) - (elHeight / 2);

            var left = ( $("body").width()-($(this).width()/2) )/2;

            $this.css({ position: 'absolute', marginTop: '0',top: elTop,left:left});
        }
    });
}


$.fn.uniqueId = function(options) {
    options = $.extend({mode:"multiple"},options  )

    var ids=new Array();

    this.each(function(index) {
        if( (options.mode=="single" && index==0) || options.mode=="multiple" ){
            var id = $.data( $(this) );
            $(this).attr("id",id);
            ids.push(id);
        }

        if( options.mode=="single" && index > 0){
            alert("Selector error assiging uniqueId");
        }
    });

    return ids;
}


jQuery.fn.outerHTML = function() {
    return $('<div>').append( this.eq(0).clone() ).html();
};



