$.fn.jcloud=function(t){jCloud={tags:new Array,container_id:"jcloud",radius:100,size:20,areal:180,iterX:0,iterY:0,iterx:1,itery:1,step:4,flats:1,speed:100,start_speed:1,timer:0,clock:10,stop:!0,splitX:0,splitY:0,colors:new Array,init:function(t,i){$(t).css("display","none");var s=0;if($(t).find("li").each(function(){jCloud.tags[s]=$(this).html(),s++}),void 0!==i)try{void 0!==i.container_id&&(this.container_id=i.container_id),void 0!==i.radius&&(this.radius=i.radius),void 0!==i.size&&(this.size=i.size),void 0!==i.areal&&(this.areal=i.areal),void 0!==i.step&&(this.step=i.step),void 0!==i.flats&&(this.flats=i.flats),void 0!==i.speed&&(i.speed<1&&(i.speed=1),this.speed=i.speed),void 0!==i.clock&&(this.clock=i.clock),void 0!==i.splitX&&Math.abs(i.splitX)<2*this.radius&&(this.splitX=i.splitX),void 0!==i.splitY&&Math.abs(i.splitY)<2*this.radius&&(this.splitY=i.splitY),void 0!==i.colors&&i.colors instanceof Array&&(this.colors=i.colors)}catch(t){}$(t).replaceWith('<div id="'+this.container_id+'"></div>'),$("#"+this.container_id).css({position:"relative",width:2*this.radius,height:2*this.radius,overflow:"hidden",padding:"0px"}),$("#"+this.container_id).mousemove(function(t){var i=$(this).offset().left+jCloud.radius,s=$(this).offset().top+jCloud.radius;jCloud.speed=jCloud.start_speed,jCloud.iterx=(i-t.pageX)/jCloud.radius,jCloud.itery=(s-t.pageY)/jCloud.radius}),$("#"+this.container_id).mouseover(function(){jCloud.stop=!1}),$("#"+this.container_id).mouseout(function(){jCloud.stop=!0}),$("body").append('<div id="jcloud-buffer"></div>'),$("#jcloud-buffer").css({display:"none",padding:"0px","white-space":"nowrap"})},render:function(){$("#"+this.container_id).empty(),this.start_speed=this.speed;for(var t in this.tags)this.draw(t);this.cloud()},draw:function(t){$("#jcloud-buffer").html('<div class="jtag" id="jtag-'+t+'">'+this.tags[t]+"</div>");var i=$("#jcloud-buffer").html(),s=$("#jcloud-buffer").width(),o=$("#jcloud-buffer").height();$("#"+this.container_id).append(i),$("#jtag-"+t).attr("width",s),$("#jtag-"+t).attr("height",o)},cloud:function(t,i,s){var o=this.tags.length,a=Math.ceil(o/this.flats),e=Math.round(360/a),r=0,h=0;void 0!==t&&(r=Math.floor(t)),void 0!==i&&(h=Math.floor(i));var d=Math.floor(this.areal/(this.flats+1))/2+h,l=Math.floor(this.areal/this.flats),n=0;for(var c in this.tags)this.pos(r,c,parseInt($("#jtag-"+c).attr("width")),parseInt($("#jtag-"+c).attr("height")),d,s),r+=e,++n>=a&&(d+=l,n=0,r+=l)},pos:function(t,i,s,o,a,e){var r=t*Math.PI/180,h=a*Math.PI/180,d=this.size+0,l=this.radius+Math.sin(r)*this.radius*Math.cos(h)-s/2,n=this.radius-Math.cos(r)*this.radius-o/2;if((d=(1+Math.cos(r-1.57)*Math.sin(h))*d/2)<1&&(d=1),void 0===e||0==e){if(this.colors.length>0)for(var c in this.colors)if((parseInt(i)+1)%(this.colors.length-c)==0){$("#jtag-"+i).attr("style","color:"+this.colors[this.colors.length-c-1]+" !important"),$("#jtag-"+i).children("a").attr("style","color:"+this.colors[this.colors.length-c-1]+" !important");break}$("#jtag-"+i).css({position:"absolute","white-space":"nowrap","font-weight":"normal"})}var p=1;if((p=(1+Math.cos(r-1.57)*Math.sin(h))*p/2)<.5&&(p=.5),this.splitX){var u=parseInt(this.splitX);i%2==0?l-=u:l+=u}if(this.splitY){var f=parseInt(this.splitY);i%2==0?n-=f:n+=f}$("#jtag-"+i).css({left:Math.round(l),top:Math.round(n),"font-size":Math.floor(d)+"px",opacity:p})},update:function(){this.timer++;var t=Math.floor(5/jCloud.speed);this.timer<t||(this.stop&&(this.speed=this.speed-.1*this.speed),this.timer=0,this.iterX>=360&&(this.iterX=360-this.iterX),this.iterY>=360&&(this.iterY=360-this.iterY),this.iterX+=this.iterx,this.iterY+=this.itery,this.cloud(this.iterY,this.iterX,!0))}},jCloud.init($(this),t),jCloud.render(),jCloudInterval=window.setInterval("jCloud.update()",jCloud.clock)};