(function(a){a.fn.rand=function(d){var c=this,g=c.size(),d=d?parseInt(d):1;if(d>g){return c.pushStack(c)}else{if(d==1){return c.filter(":eq("+Math.floor(Math.random()*g)+")")}}r=c.get();for(var e=0;e<g-1;e++){var f=Math.floor(Math.random()*(g-e))+e;r[f]=r.splice(e,1,r[f])[0]}r=r.slice(0,d);return c.filter(function(b){return a.inArray(c.get(b),r)>-1})}})(jQuery);
