/*!
 * 标签云插件
 * @copyright (c) JSPGen.com
 * @version 1.0
 */
;(function($){$.fn.tagCloud=function(options){var settings={count:'count',smallest:12,largest:25,step:0.5,unit:'px',color:['#7FBA00','#FFB900','#00A4EF','#F74E1E']};$.extend(settings,options);var min_count=0,max_count=0;this.each(function(){var temp=parseInt($(this).attr(settings.count));var count=Math.round(grapes.log(10,temp)*100);max_count=count>max_count?count:max_count;min_count=count<min_count?count:min_count;});var spread=max_count-min_count;if(spread<=0)spread=1;var font_spread=settings.largest-settings.smallest;if(font_spread<0)font_spread=1;var font_step=font_spread/spread;var color_index=0;this.each(function(){var $this=$(this);if(settings.color.length>0)color_index=Math.floor(Math.random()*settings.color.length);var color=settings.color[color_index];var count=$this.attr(settings.count);var font_size=settings.smallest+(((count-min_count)*font_step)*settings.step);$this.css({'color':color,'font-size':font_size+settings.unit+''});$this.removeAttr('count');});}})(jQuery);