var twitter_loaded=false;function Twitter(_consumer)
{var consumer='';if(typeof(_consumer)!="undefined")
consumer=_consumer;var timeout=500;var user=null;var dom=new Dom();var condition_function=function(){return typeof(twttr)!="undefined";};var loop=function(callback){var result=async_loop(condition_function,callback,timeout);};var send=function(url){$.ajax({type:"GET",contentType:"application/x-www-form-urlencoded",url:url});};jQuery(document).ready(function(){if(twitter_loaded)
return;twitter_loaded=true;$.getJSON("/appAuth/key/twitter/"+consumer,function(data){if(data.request=='success')
{var script=dom.new_script("http://platform.twitter.com/anywhere.js?id="+data.key+"&v=1.1");dom.add_to_head(script);}});});this.set_hovercards=function(object_id){loop(function(){twttr.anywhere(function(T){T(object_id).hovercards({expanded:true});T(object_id+" img").hovercards({expanded:true,username:function(node){return node.alt;}});});});};this.set_connect=function(object_id,on_connect,on_click){loop(function(){twttr.anywhere(function(T){if(T.isConnected()){on_connect(T.currentUser);return;}
T.bind("authComplete",function(e,currentUser){on_connect(currentUser);});$(object_id).click(function(){T.signIn();on_click();});});});};this.set_retweet_box=function(object_id,tweet,on_tweet,on_complete){loop(function(){twttr.anywhere(function(T){T(object_id).tweetBox({counter:false,height:"35px",width:"400px",defaultContent:tweet,label:"",onTweet:function(text_tweet,html_tweet){on_tweet(text_tweet,html_tweet);},complete:function(tb){on_complete();}});});});};this.get_user=function(){return user;};this.get_error_log=function(){return"";};}
