function topsyAddDataToWidget(e,g,d){if(topsyTypeof(d)=="string"){d=document.getElementById(d)}var f=topsyGetWidgetData(d);f[e]=g;topsySaveWidgetData(f,d);return f}function topsyAddUrlParam(e,g,f){var d="?";if(e.search(/\?/)!=-1){d="&amp;"}return e+d+g+"="+topsySinglyEncode(f)}function topsyArrayIncludes(d,f){for(var e=0;e<d.length;e++){if(d[e]==f){return true}}return false}function topsyBuildRetweetString(d){var e="";if(d.title){e=d.title}if(d.nick){e="RT @"+d.nick+" "+e}if(d.shorturl){return e+" "+d.shorturl}if(d.url){return e+" "+d.url}return e}function topsyBuildRetweetHref(f){if(f.preloading){return"http://twitter.com/home?status="+topsyBuildRetweetString(f)}var e="http://button.topsy.com/retweet?";var d=[];var h=["nick","url","shorturl","title","shorturl_service","shorturl_user","shorturl_auth"];if(f.url=="topsy:ref.plus.one"){f.url=window.location.href}for(var g in h){if(topsyTypeof(f[h[g]])=="string"&&f[h[g]].length){d.push(h[g]+"="+topsySinglyEncode(f[h[g]]))}}if(!f.nick){d.unshift("nick=TopsyRT")}return e+d.join("&")}function topsyButtonize(f,g,e){if(!(e&&e.theme)){e=topsyGetWidgetData(f)}if(f.className.search(/topsy_theme_\w+/)==-1){f.className+=" topsy_theme_"+e.theme}topsyLoadCssFile(e.theme);g.retweet_url=topsyBuildRetweetHref(e);var d=topsyGetWidgetCount(f);if(d!=-1&&d!=parseInt(g.count.replace(/\D/g,""),10)){topsy_widgets.updated=true;topsy_widgets.delay=5;e.flashcolor="#fafafa";e.flash=true}while(f.childNodes.length){f.removeChild(f.childNodes[0])}if(!g.trackback_url){g.trackback_url="http://topsy.com/link?url="+topsySinglyEncode(e.url)}g.trackback_url+=((g.trackback_url.search(/\?/)==-1)?"?":"&")+"utm_source=button";if(e.style=="big"){if(g.badge&&e.order.search(/badge/)!=-1){topsyButtonBigBadge(f,g,e)}else{topsyButtonBig(f,g,e)}}else{topsyButtonSmall(f,g,e)}}function topsyButtonBig(g,j,d){var l,k,m,f;if(d.preloading){m="&nbsp;&nbsp;";f="&nbsp;&nbsp;&nbsp;&nbsp;"}else{m=j.count;f=(j.count==1)?"tweet":"tweets"}var e=topsyInsertNode("span",{"class":"topsy-big-count"},[topsyInsertNode("span",{"class":"topsy-big-num"},m),topsyInsertNode("span",{"class":"topsy-big-unit"},f)]);if(d.order.search(/count/)!=-1){l=topsyInsertNode("a",{"class":"topsy-big-total snap_noshots",href:j.trackback_url},e)}if(d.order.search(/retweet/)!=-1){k=topsyInsertNode("a",{"class":"topsy-big-retweet snap_noshots",target:"_blank",href:j.retweet_url},d.retweet_text)}topsyInsertNode("div",{"class":"topsy-big"},[l,k],g,"end");if(parseInt(j.count,10)&&d.flash&&l){var h=new topsyFadeObj(e,d.flashcolor,"",2500)}}function topsyButtonBigBadge(h,k,d){var e="";var m,o,l,n,g;if(d.preloading){n="&nbsp;&nbsp;";g="&nbsp;&nbsp;&nbsp;&nbsp;"}else{n=k.count;g=(k.count==1)?"tweet":"tweets"}var f=topsyInsertNode("span",{"class":"topsy-big-count"},[topsyInsertNode("span",{"class":"topsy-big-num"},n),topsyInsertNode("span",{"class":"topsy-big-unit"},g)]);if(d.order.search(/count/)!=-1){m=topsyInsertNode("a",{"class":"topsy-big-total-badge snap_noshots",href:k.trackback_url},f)}else{e=" no-count"}if(d.order.search(/badge/)!=-1){o=topsyInsertNode("a",{"class":"topsy-big-badge"+e,href:k.toplink_url},["TOP",topsyInsertNode("span",{"class":"topsy-big-lvl"},k.badge.toString().toUpperCase())])}if(d.order.search(/retweet/)!=-1){l=topsyInsertNode("a",{"class":"topsy-big-retweet snap_noshots",target:"_blank",href:k.retweet_url},d.retweet_text)}topsyInsertNode("div",{"class":"topsy-big"},[m,o,l],h,"end");if(parseInt(k.count,10)&&d.flash&&m){var j=new topsyFadeObj(f,d.flashcolor,"",2500)}}function topsyButtonSmall(elem,data,opts){var retweet=topsyInsertNode("a",{"class":"topsy-sm-retweet snap_noshots",target:"_blank",href:data.retweet_url},opts.retweet_text);var count=null;var count_txt=(opts.preloading)?"&nbsp;&nbsp;&nbsp;":data.count;if(parseInt(data.count,10)&&opts.order.search(/count/)!=-1){count=topsyInsertNode("a",{"class":"topsy-sm-total snap_noshots",href:data.trackback_url},count_txt)}var badge=null;if(data.badge){badge=topsyInsertNode("a",{"class":"topsy-sm-badge snap_noshots",href:data.toplink_url},["TOP",topsyInsertNode("span",{"class":"topsy-big-lvl"},data.badge.toString().toUpperCase())])}var order=opts.order.split(/,\s*/);var nodes=[];for(var i=0;i<order.length;i++){nodes.push(eval(order[i]))}topsyInsertNode("div",{"class":"topsy-sm"},nodes,elem,"end");if(parseInt(data.count,10)&&opts.flash&&count){var fade=new topsyFadeObj(count,opts.flashcolor,"",2500)}}function topsyCleanupTempElems(h){return;if(topsyBetaFlagIsSet()){return}var d="topsy_json_return-"+h;var e="topsy_json_request-"+h;var g=document.getElementById(d);if(g){g.parentNode.removeChild(g)}var f=document.getElementById(e);if(f){f.parentNode.removeChild(f)}}function topsyCorrectCss(d){if(d=="float"){return"cssFloat"}if(d=="class"){return"className"}d=d.replace(/-([a-z])/,function(e,f){return f.toUpperCase()});return d}function fixRetweetButtons(){if(window.topsyRetweetButtonsFixed){return}else{window.topsyRetweetButtonsFixed=true}var d=document.getElementsByTagName("script");for(var g=0;g<d.length;g++){if(d[g].src.search(/retweet-(small|big)/)!=-1){var h=d[g];var f=h.parentNode;var e=f.nextSibling;if(e!==null&&e.tagName&&e.tagName.toLowerCase()=="div"&&e.className.search(/topsy-(sm|big)/)!=-1){f.insertBefore(e,h.nextSibling)}}}}function topsyGetAllOurDivs(){var d=topsyObjToArray(topsyGetElemsByClass("topsy_widget_data"));d=d.concat(topsyObjToArray(topsyGetElemsByClass("topsy_widget_shortcode")));return d}function topsyGetArrayPosition(d,f){for(var e=0;e<d.length;e++){if(d[e]===f){return e}}return -1}function topsyGetCssProperty(e,f){if(typeof e=="string"){e=document.getElementById(e)}var d;if(e.currentStyle){d=e.currentStyle[topsyCorrectCss(f)]}else{if(window.getComputedStyle){d=window.getComputedStyle(e,null).getPropertyValue(f)}}while(d=="transparent"){e=e.parentNode;if(e.currentStyle){d=e.currentStyle[topsyCorrectCss(f)]}else{if(window.getComputedStyle){d=window.getComputedStyle(e,null).getPropertyValue(f)}}}return d}function topsyGetElemsByClass(d){try{return document.getElementsByClassName(d)}catch(j){var k=[];var h=document.getElementsByTagName("*");var g=new RegExp("\\b"+d+"\\b");for(var f=0;f<h.length;f++){if(h[f].className.search(g)!=-1){k.push(h[f])}}return k}}function topsyGetUidFromDom(d){if(d.tagName.toLowerCase()=="body"){return 1}else{return topsyGetArrayPosition(topsyObjToArray(d.parentNode.childNodes),d)+"-"+topsyGetUidFromDom(d.parentNode)}}function topsyGetWidgetCount(e){if(e.innerHTML.search(/class(?:[nN]ame)?="(?:topsy-sm-total|topsy-big-num)(?: snap_noshots)?"[^>]*>([\d,]+K?)</)!=-1){var d=e.innerHTML.match(/class(?:[nN]ame)?="(?:topsy-sm-total|topsy-big-num)(?: snap_noshots)?"[^>]*>([\d,]+K?)</)[1];return parseInt(d.replace(/\D/g,""),10)}return -1}function topsyGetWidgetData(elem){var json;var data={url:"",shorturl:"",title:"",style:(typeof topsy_style=="string"?topsy_style:"small"),nick:(typeof topsy_nick=="string")?topsy_nick.replace(/^@/,""):"TopsyRT",order:(typeof topsy_order=="string"&&topsy_order.length>1)?topsy_order:"count,retweet,badge",theme:(typeof topsy_theme=="string")?topsy_theme:"blue",tweet_text:(typeof topsy_tweet_text=="string")?topsy_tweet_text:"tweet",retweet_text:(typeof topsy_retweet_text=="string")?topsy_retweet_text:"retweet",shorturl_service:(typeof topsy_shorturl_service=="string")?topsy_shorturl_service:"",shorturl_user:(typeof topsy_shorturl_user=="string")?topsy_shorturl_user:"",shorturl_auth:(typeof topsy_shorturl_auth=="string")?topsy_shorturl_auth:"",host:(topsyBetaFlagIsSet())?"beta.":""};if(topsyTypeof(elem)!="element"){json=elem;json.title=json.title.replace(/\\"/g,'"').replace(/"/g,'\\"')}else{if(elem.className.match(/topsy_theme_([-\w]+)/)){data.theme=elem.className.match(/topsy_theme_([-\w]+)/)[1]}var scr=elem.getElementsByTagName("script")[0];if(elem.style&&elem.style.backgroundImage){json=elem.style.backgroundImage;json=json.replace(/^url\(\"?data:([^,]+)?,/,"");json=json.substr(0,json.indexOf(")")).replace(/"$/,"");json=unescape(json)}else{if(elem.innerHTML.search(/<!--\s*\{/)!=-1&&elem.innerHTML.search(/\};?\s*-->/)!=-1){json=elem.innerHTML.substr(elem.innerHTML.indexOf("<!--")+4);json=json.substr(0,json.indexOf("-->"));topsySaveWidgetData(json,elem)}else{if(scr){if(scr.text.search(/topsyWidgetPreload/)!=-1){json=scr.text.substr(scr.text.indexOf("{"));json=json.substr(0,json.indexOf("}")+1);topsySaveWidgetData(json,elem)}else{json=scr.text.substr(scr.text.indexOf("{")).replace(/;\s*$/,"")}}else{return false}}}json=eval("("+json+")")}for(var key in json){if(json[key]=="null"){continue}var de_topsified=key.replace(/^topsy_/,"");data[de_topsified]=json[key]}return data}function insertNode(e,h,d,f,g){topsyInsertNode(e,h,d,f,g)}function topsyInsertNode(q,l,g,o,h){var e=document.createElement(q);for(var k in l){var r=topsyCorrectCss(k);if(r=="style"&&!!document.all){var m=l[k].match(/(^|\s)(top|bottom|left|right|width|height|display|visibility)\s*:\s*([^;\s]+)/g);if(topsyTypeof(m)!="null"){for(var p=0;p<m.length;p++){var d=m[p].replace(/^\s+/,"");var n=d.split(/\s*:\s*/);e.style[n[0]]=n[1]}}else{e.setAttribute(r,l[k])}}else{e.setAttribute(r,l[k])}if(r=="className"){e.setAttribute("class",l[k])}}if(typeof g=="undefined"){g=" "}if(!(g instanceof Array)){g=[g]}for(var f=0;f<g.length;f++){if(topsyTypeof(g[f])=="element"){e.appendChild(g[f])}else{if(topsyTypeof(g[f])=="string"){if(g[f].length&&g[f]!==" "){e.innerHTML+=g[f]}}else{if(topsyTypeof(g[f])=="number"){e.innerHTML+=g[f].toString()}}}}switch(h){case"before":o.parentNode.insertBefore(e,o);break;case"after":o.parentNode.insertBefore(e,o.nextSibling);break;case"start":if(o.hasChildNodes()){o.insertBefore(e,o.firstChild);break}break;case"end":o.appendChild(e,o);break}return e}function topsyBetaFlagIsSet(){if(typeof topsy_beta=="number"&&topsy_beta==1){return true}if(window.location.href.search(/[\?&]topsy_?beta=1/)!=-1){return true}return false}function topsyLoadCssFile(g){var e="http://cdn.topsy.com/css/widget."+g+".css";if(topsyBetaFlagIsSet()){e=e.replace(/cdn/,"beta.static")}var d=document.getElementsByTagName("link");for(var f=0;f<d.length;f++){if(d[f].rel=="stylesheet"&&d[f].href==e){return}}topsyInsertNode("link",{rel:"stylesheet",type:"text/css",href:e},"",document.getElementsByTagName("head")[0],"end")}function topsyObjToArray(f){if(f instanceof Array){return f}var d=[];for(var e=0;e<f.length;e++){d.push(f[e])}return d}function topsyNewJsElem(k,g){var d=document.getElementsByTagName("script");for(var f=0;f<d.length;f++){if(d[f].type&&d[f].src==k){return}}var h={type:"text/javascript",src:k};if(g!==null){for(var e in g){h[e]=g[e]}}topsyInsertNode("script",h,"",document.getElementsByTagName("head")[0],"end")}function topsyObjIncludes(e,d){return !!(typeof e[d]!="undefined")}function topsyObjToJsonString(f){if(topsyTypeof(f)=="string"){return f}var d=[];for(var e in f){d.push('"'+e+'": "'+f[e]+'"')}return"{ "+d.join(", ")+" }"}function topsyRestrictString(d){d=d+"";return d.replace(/[^\w-]/g,"-").replace(/-+/g,"-")}function topsySaveWidgetData(e,d){if(topsyTypeof(e)=="object"){e=topsyObjToJsonString(e)}e=topsySinglyEncode(e);e=e.replace(/'/g,"%27").replace(/!/,"%21").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/~/g,"%7E");e="url(data:text/plain,"+e+")";d.style.backgroundImage=e}function topsySetDivId(f){var e;switch(topsyTypeof(f)){case"string":e=document.getElementById(f);break;case"element":e=f;break;default:return false}while(e.className.search(/topsy_widget_(data|shortcode)/)==-1){e=e.parentNode;if(e.tagName.toUpperCase()=="BODY"){return false}}if(typeof e.id!="string"||e.id.length<1){var d=topsyGetUidFromDom(e);e.id="topsy_id"+d}return e.id}function topsySinglyEncode(h){var e=new RegExp("%(?![\\dA-F]{2})","gi");var g,f;if(/^http:\/\//.test(h)){g=decodeURIComponent;f=encodeURIComponent}else{g=unescape;f=escape}for(var d=0;d<5;d++){h=g(h.replace(e,"%25"))}return f(h)}function topsyTypeof(e){var d=typeof e;if(d==="object"){if(e){if(e instanceof Array){d="array"}else{if(e.nodeType){d="element"}}}else{d="null"}}return d}function topsyButtonFixer(){fixRetweetButtons()}function topsyWidgetCreator(){if(typeof topsy_widgets=="undefined"){topsy_widgets={elems:{},lastupdate:Math.floor(new Date().getTime()/1000),updated:false}}topsy_widgets.delay=-1;var d=topsyGetAllOurDivs();for(var e=0;e<d.length;e++){topsySetDivId(d[e]);topsy_widgets.elems[d[e].id]={elem:d[e],refresh:0}}topsyWidgetUpdater()}function topsyWidgetPreload(json){
/*@cc_on @if (@_jscript_version < 5.7) return; @end @*/
var data=topsyGetWidgetData(json);topsyLoadCssFile(data.theme);data.preloading=true;var hook_uid="topsy_hook"+topsyRestrictString((new Date().getMilliseconds())+json.title);document.write('<span id="'+hook_uid+'"></span>');var topsy_div=document.getElementById(hook_uid).parentNode;var topsy_id=topsySetDivId(topsy_div);topsySaveWidgetData(topsyObjToJsonString(json),topsy_div);topsyButtonize(topsy_div,{},data);topsyUpdateSingleWidget(topsy_id)}function topsyWidgetUpdater(){var d=Math.floor(new Date().getTime()/1000);var e="none";if(topsy_widgets.lastupdate+topsy_widgets.delay<=d){if(topsy_widgets.delay<0){topsy_widgets.delay=0}topsy_widgets.lastupdate=d;topsy_widgets.delay+=5;if(topsy_widgets.delay>60){topsy_widgets.delay=60}e=0;for(var f in topsy_widgets.elems){e++;topsyUpdateSingleWidget(f)}}if(typeof topsy_streaming=="string"&&topsy_streaming=="on"&&e){setTimeout(topsyWidgetUpdater,5000+Math.floor(1000*Math.random()))}}function topsyUpdateSingleWidget(h){var g,d;if(typeof topsy_widgets=="undefined"){g=document.getElementById(h);d=0}else{g=topsy_widgets.elems[h].elem;d=topsy_widgets.elems[h].refresh}var f=topsyGetWidgetData(g);if(!f.url){return}var e="button.topsy.com";if(topsyBetaFlagIsSet()){e="beta."+e}topsyNewJsElem("http://"+e+"/widget/retweet-json?id="+g.id+"&url="+topsySinglyEncode(f.url)+"&callback=topsyWidgetCallback#refresh="+d,{id:"topsy_json_request-"+g.id});if(typeof topsy_widgets!="undefined"&&topsy_widgets.elems[h]){topsy_widgets.elems[h].refresh++}}function topsyWidgetCallback(e){var f=document.getElementById(e.html_id);topsyButtonize(f,e);topsyCleanupTempElems(e.html_id);var d=Math.floor(new Date().getTime()/1000);if((d-e.firstpost)>(86400*3)){if(typeof topsy_widgets!="undefined"){delete (topsy_widgets.elems[e.html_id])}}}function topsy_core_init(){if(window.topsyCoreInit){return}else{window.topsyCoreInit=true}switch(topsyTypeof(topsy_init)){case"function":case"string":topsy_init=[topsy_init];break;default:var topsy_init=[]}var this_script;var scripts=document.getElementsByTagName("script");for(var i=0;i<scripts.length;i++){if(scripts[i].src.search(/\/topsy.js\?init=/)!=-1){this_script=scripts[i];var params=this_script.src.substr(this_script.src.indexOf("?")+1).split(/&(amp;)?/);for(var j=0;j<params.length;j++){if(params[j].search(/^init=/)!=-1){var inits=params[j].split("=")[1].split(/[;,]/);for(var k=0;k<inits.length;k++){if(inits[k].search(/\W/)==-1){inits[k]+="();"}}if(topsy_init instanceof Array){topsy_init=topsy_init.concat(inits)}else{topsy_init=inits}}}break}}if(typeof topsy_init=="function"){topsy_init()}if(topsy_init instanceof Array){for(var x=0;x<topsy_init.length;x++){switch(typeof topsy_init[x]){case"string":eval(topsy_init[x]);break;case"function":topsy_init[x].call();break}}}}function topsyFadeObj(e,d,h,j,f,k){this.id=e;this.startColour=d;this.endColour=h||"";this.duration=j||1500;this.fps=f||40;this.delay=k||0;if(typeof this.id=="string"){this.obj=document.getElementById(e)}else{this.obj=this.id}if(!this.endColour){this.endColour=topsyGetCssProperty(this.obj,"background-color")}this.colour=[];this.steps=0;this.msec=Math.floor(1000/this.fps);this.count=Math.ceil((this.duration/1000)*this.fps);this.init=m;this.fade=g;this.parseColour=l;function m(){first=this.parseColour(this.startColour,"hex");last=this.parseColour(this.endColour,"hex");this.colour=[];this.colour[this.count]=this.startColour;for(i=0;i<this.count;i++){temp="rgb(";temp+=parseInt(first[0]+(last[0]-first[0])/this.count*i,10);temp+=",";temp+=parseInt(first[1]+(last[1]-first[1])/this.count*i,10);temp+=",";temp+=parseInt(first[2]+(last[2]-first[2])/this.count*i,10);temp+=")";this.colour[this.count-i]=temp}this.colour[0]=this.endColour;var n=this;setTimeout(function(){n.fade()},this.delay)}function g(){if(this.count>=0){this.obj.style.backgroundColor=this.colour[this.count--];var n=this;setTimeout(function(){n.fade()},this.msec)}}function l(s,q){var n=1;var p,r;col=s.replace(/[\#rgb\(]*/,"");if(q=="hex"){if(col.length==3){a=col.substr(0,1);b=col.substr(1,1);c=col.substr(2,1);col=a+a+b+b+c+c}p=[col.substr(0,2),col.substr(2,2),col.substr(4,2)];r=16}else{p=col.split(",");r=10}if(q=="rgbp"){n=2.55}var o=[parseInt(p[0],r)*n,parseInt(p[1],r)*n,parseInt(p[2],r)*n];return(o)}this.init.call(this)}(function(i){var u=navigator.userAgent;var e=
/*@cc_on!@*/
false;var st=setTimeout;if(/webkit/i.test(u)){st(function(){var dr=document.readyState;if(dr=="loaded"||dr=="complete"){i()}else{st(arguments.callee,10)}},10)}else{if((/mozilla/i.test(u)&&!(/(compati)/.test(u)))||(/opera/i.test(u))){document.addEventListener("DOMContentLoaded",i,false)}else{if(e){(function(){var t=document.createElement("doc:rdy");try{t.doScroll("left");i();t=null}catch(e){st(arguments.callee,0)}})()}else{window.onload=i}}}})(topsy_core_init);