(function($){
   $.fn.vCenter = function(options) {
     var pos = {
       sTop : function() {
         return window.pageYOffset || $.boxModel &&
document.documentElement.scrollTop ||   document.body.scrollTop;
       },
       wHeight : function() {
         if ( $.browser.opera || ($.browser.safari && parseInt
($.browser.version) > 520) ) {
return window.innerHeight;
                } else if ( $.browser.safari ) {
                        return window.innerHeight;
                }       else {
           return $.boxModel && document.documentElement.clientHeight
|| document.body.clientHeight;
         }
       }
     };
     return this.each(function(index) {
       if (index == 0) {
         var $this = $(this);
         var elHeight = $this.height();
         $this.css({
           position: 'absolute',
           marginTop: '0',
           top: pos.sTop() + (pos.wHeight() / 2) - (elHeight / 2)

         });
       }
     });
   };

})(jQuery);


(function($){
   $.fn.hCenter = function(options) {
     var pos = {
       wWidth: function() {
         if ( $.browser.opera || ($.browser.safari && parseInt
($.browser.version) > 520) ) {
return window.innerWidth;
                } else if ( $.browser.safari ) {
                        return window.innerWidth;
                }       else {
           return $.boxModel && document.documentElement.clientWidth
|| document.body.clientWidth;
         }
       }
     };
     return this.each(function(index) {
       if (index == 0) {
         var $this = $(this);
         var elWidth = $this.width();
         $this.css({
           marginLeft: '0',
           left: (pos.wWidth() / 2) - (elWidth / 2)
         });
       }
     });
   };
   
})(jQuery);


(function($){
   $.fn.vCenterPhoto = function(options) {
     var pos = {
       sTop : function() {
         return window.pageYOffset || $.boxModel &&
document.documentElement.scrollTop ||   document.body.scrollTop;
       },
       wHeight : function() {
         if ( $.browser.opera || ($.browser.safari && parseInt
($.browser.version) > 520) ) {
return window.innerHeight;
                } else if ( $.browser.safari ) {
                        return window.innerHeight;
                }       else {
           return $.boxModel && document.documentElement.clientHeight
|| document.body.clientHeight;
         }
       }
     };
     return this.each(function(index) {
       if (index == 0) {
         var $this = $(this);
         var elHeight = $this.height();
         $this.css({
           position: 'absolute',
           marginTop: '0',
           top: pos.sTop() + (pos.wHeight() / 2) - (elHeight / 2),
           left: (($(window).width() - $this.outerWidth()) / 2) + 'px'

         });
       }
     });
   };

})(jQuery);


(function($){
   $.fn.alwaysTop = function(options) {
     var pos = {
       sTop : function() {
         return window.pageYOffset || $.boxModel &&
document.documentElement.scrollTop ||   document.body.scrollTop;
       },
       wHeight : function() {
         if ( $.browser.opera || ($.browser.safari && parseInt
($.browser.version) > 520) ) {
return window.innerHeight;
                } else if ( $.browser.safari ) {
                        return window.innerHeight;
                }       else {
           return $.boxModel && document.documentElement.clientHeight
|| document.body.clientHeight;
         }
       }
     };
     return this.each(function(index) {
       if (index == 0) {
         var $this = $(this);
         var elHeight = $this.height();
         $this.css({
           position: 'absolute',
           marginTop: '0',
           top: pos.sTop() - elHeight
         });
       }
     });
   };

})(jQuery);

