*/
var TumblrTagClouds = function(id,options){
var d = { // options default
css: 'default', //'default': minimal styles, 'custom': no style
minsize: 100, //integer: font size of min by %
maxsize: 250, //integer: font size of max by %
limit: 'none', //'none', integer
order: 'alphabetical', //'none', 'frequency', 'alphabetical'
math: 'log' //'log', 'linear'
}
if(f(options)){
$.each(options, function(k,v) {
d[k] = v;
});
}
var el = $('#'+id);
var o = document;
function f(i){
return typeof(i)!=="undefined";
}
function p(q,i){
return(q-i);
}
function m(i,q){
return i.sort(
function(s,r){
return q[s]-q[r];
}
);
}
function c(r){
var i=[];
var q;
for(q in r){
if(r.hasOwnProperty(q)){
i.push(q);
}
}
return i;
}
var h=o.domain;
var j="http://"+h+"/";
var box='
';
if(d.css==='default'){
box+='';
}
box+='
Loading tags...
';
el.html(box);
$(o).ready(
function(){
var u=0;
var q=[];
var i=[];
var r={};
$("#loading_tag_cloud").ajaxError(function(e, jqxhr, settings, exception){
$(this).html('Tumblr API Error: '+jqxhr.status+' '+jqxhr.statusText)
});
function s(){
var v=j+"api/read/json?callback=?&filter=text&num=50&start="+u;
$.getJSON(v,
function(w,ts,xhr){
$(w.posts).each(
function(y,x){
$(x.tags).each(
function(A,z){
if(typeof(z)==="string"){
q.push(z);
}
}
);
}
);
if(u+50C){
return 1;
}
if(Ed.limit){
break;
}
var wl=w.toLowerCase();
if($.inArray(wl,tags)===-1){
tags.push(wl);
fontSize=Math.round(slope*r[w]-(slope*minCount-d.minsize));
title=(A[w]===1?A[w]+" post":A[w]+" posts");
link=''+w+"";
output='