jQuery.fn.bogoDice=function(A){A=jQuery.extend({sides:6,count:1,low:1,resultsTarget:null,verbose:true},A?A:[]);A=jQuery.extend({label:A.count+"d"+A.sides},A);function B(I,D,F,G){if(!F){F=1}var K=G?new Array():null;var J=0;var H=0;for(var E=0;E<F;++E){H=Math.floor(Math.random()*D+I);J+=H;if(K){K[E]=H}}if(G){var C=""+J;if(A.verbose){C=F+"d"+D+": ";if(F==1){C+=J}else{C+=(K.join(" + "))+" = "+J}}if("function"==typeof G){G(C,K)}else{$(G).text(C,K)}}return J}this.text(A.label);this.click(function(){B(A.low,A.sides,A.count,A.resultsTarget)});return this}