(function($) {

   $.fn.noSelect = function() {
      return $(this).each(function() {
         if ($.browser.mozilla) {
            $(this).css('MozUserSelect','none');
         } else if ($.browser.msie) {
            $(this).bind('selectstart', function(e) {
               return false;
            });
         } else {
            $(this).mousedown(function(e) {
               return false;
            });
         }
      });
   };

   $.fn.fullScreen = function (zIndex) {
      return $(this).each(function(){
         $(this).css({
            'position':'fixed',
            'z-index': zIndex || 1000,
            'width':'100%',
            'height':'100%',
            'left':'0px',
            'top':'0px'
         });
      });
   };

   $.fn.center = function () {
      return $(this).each(function(){
         $(this).css({					 	
            position: "absolute",
            left: "50%",
            top: "50%"
         })
         .css({
            marginLeft: -$(this).width()/2,
            marginTop: -$(this).height()/2
         });
      });
   };

   $.fn.wait = function (ms,cb) {
      return $(this).animate({
         opacity: '+=0'
      }, ms, cb);
   };

   $.fn.shuffle = function() {
      var elems = $(this);
      var newElems = $();
      var allLen = elems.size();
      do {
         var elem = elems.eq(Math.floor(Math.random()*(elems.size()-1)));
         elems = elems.not(elem);
         newElems = newElems.add(elem.clone());
      } while (newElems.size() < allLen);
      return newElems;
   };

}(WP.$));
