window.addEvent("domready",function(){if(Igloo&&Igloo.asset_twitterlink){var b;$each(Igloo.asset_twitterlink,function(a,d){b=$(d);if(b){b.addEvent("click",function(c){c.preventDefault();var f=new ApiClient({apimethod:"igloo/shorten",method:"get",queryparams:{longUrl:document.location.href},onRequest:function(){},onSuccess:function(e){var n=JSON.decode(e,true);var r=n.response.items[0].value;var p=140;var m=document.title.ellipsize(p-r.length-1)+" "+r;var q="http://twitter.com/home?status="+encodeURIComponent(m);var o=q;o=o.replace(/\//g,"");o=o.replace(/\./g,"");o=o.replace(/:/g,"");document.location.href=q;return false},onFailure:function(){var h="http://twitter.com/";var e=h;e=e.replace(/\//g,"");e=e.replace(/\./g,"");e=e.replace(/:/g,"");document.location.href=h;return false}})})}})}});