
var rtmix={};rtmix.url_jsonp="";rtmix.url_jsonp_twt_mx="";rtmix.url_jsonp_widget="";rtmix.url_action="";rtmix.dialog_index=10;rtmix.dialog_open=function(d_id){w_width=document.documentElement.clientWidth;w_height=document.documentElement.clientHeight;var dialog_screen=$("#dialog_screen");dialog_screen.css({"z-index":(rtmix.dialog_index-1)});dialog_screen.show();var dialog=$(d_id);var d_width=dialog.attr("d_width");var d_height=dialog.attr("d_height");if(d_height=="e"){d_height=w_height-140;}
else{if(d_height>=(w_height-90))
d_height=w_height-90;}
var d_left=Math.round((w_width/2)-(d_width/2));var d_top=Math.round((w_height/2)-(d_height/2))-40;if(d_top<10)
d_top=10;dialog.css({"background-color":"#ffffff","top":d_top,"left":d_left,"position":"fixed","_position":"absolute","width":d_width+"px","height":d_height+"px","z-index":rtmix.dialog_index});dialog.show();rtmix.dialog_index+=2;}
rtmix.dialog_close=function(d_id){var dialog=$(d_id);dialog.hide();rtmix.dialog_index-=2;if(rtmix.dialog_index==10){$("#dialog_screen").hide();$("#dialog_screen").css({"z-index":(rtmix.dialog_index-3)});}
else{$("#dialog_screen").css({"z-index":(rtmix.dialog_index-3)});}}
rtmix.dialog_close_all=function(){$("[dialog]").hide();rtmix.dialog_index=10;}
rtmix.menu_bar_show=function(link){var t=$($(link).attr("menu_window"));t.css("left",($(link).offset().left+parseInt(t.attr("offset_x")))+"px");t.css("top",($(link).offset().top+parseInt(t.attr("offset_y")))+"px");t.show();}
rtmix.menu_bar_close=function(m_id){$(t_id).hide();}
rtmix.tooltip_close=function(t_id){$(t_id).hide();}
rtmix.tooltip_close_all=function(){$("[tooltip_click]").hide("slow");$("[tooltip_hover]").hide("slow");}
rtmix.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options=$.extend({},options);options.expires=-1;}
var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
expires='; expires='+date.toUTCString();}
var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
return cookieValue;}};rtmix.disable_enter=function(e){var key;if(window.event)
key=window.event.keyCode;else
key=e.which;if(key==13)
return false;else
return true;}
rtmix.test_alphanum=function(str){if(str.match(/[^a-zA-Z0-9 ]/))
return false;else
return true;}
rtmix.test_alphanum_strict=function(str){if(str.match(/[^a-zA-Z0-9]/))
return false;else
return true;}
rtmix.test_int=function(str){if(str.match(/[^0-9]/))
return false;else
return true;}
rtmix.jsonp_send=function(param,callback){param.jtoken=rtmix.cookie("rtmix_jtoken");$.getJSON(rtmix.url_jsonp+'?jcb=?',param,function(ret){callback(ret,param);});};rtmix.jsonp_send_twt_mx=function(param,callback){param.jtoken=rtmix.cookie("rtmix_jtoken");$.getJSON(rtmix.url_jsonp_twt_mx+'?jcb=?',param,function(ret){callback(ret,param);});};rtmix.jsonp_send_widget=function(param,callback){param.jtoken=rtmix.cookie("rtmix_jtoken");$.getJSON(rtmix.url_jsonp_widget+'?jcb=?',param,function(ret){callback(ret,param);});};rtmix.img_error=function(source){source.src="http://twitiq.com/_/images/twit_default_profile.png";source.onerror="";return true;}
rtmix.img_error_blank=function(source){source.src="http://twitiq.com/_/images/blank_1x1.png";source.onerror="";return true;}
rtmix.fb_share=function(uri){window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(uri),'Share_on_Facebook','toolbar=0, status=0, width=626, height=436');}
rtmix.number_format=function(a){var b=0;var c=".";var d=",";var k='';if(a.indexOf('-')==0){k='-';a=a*-1;}
a=Math.round(a*Math.pow(10,b))/Math.pow(10,b);var e=a+'';var f=e.split('.');if(!f[0])f[0]='0';if(!f[1])f[1]='';if(f[1].length<b){var g=f[1];for(var i=f[1].length+1;i<=b;i++){g+='0';}
f[1]=g;}
if(d!=''&&f[0].length>3){var h=f[0];f[0]='';for(var j=3;j<h.length;j+=3){i=h.slice(h.length-j,h.length-j+3);f[0]=d+i+f[0]+'';}
j=h.substr(0,(h.length%3==0)?3:(h.length%3));f[0]=j+f[0];}
c=(b<=0)?'':c;if(f[1]!="")
return k+f[0]+c+f[1];else
return k+f[0];}
rtmix.round_k=function(num){if(num>=1000000){num/=1000000.0;num=Math.round(num);return num+"M";}
else if(num>=1000){num/=1000.0;num=Math.round(num);return num+"K";}
else
return num;}
rtmix.escape_html=function(str){return str.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;")}
rtmix.strip_quotes=function(str){str=str.replace(/['"]/g,'');return str;}
rtmix.nl2br=function(str){return str.replace(/\n/ig,"<br/>");}
rtmix.php_urlencode=function(str){var histogram={},unicodeStr='',hexEscStr='';var ret=(str+'').toString();var replacer=function(search,replace,str){var tmp_arr=[];tmp_arr=str.split(search);return tmp_arr.join(replace);};histogram["'"]='%27';histogram['(']='%28';histogram[')']='%29';histogram['*']='%2A';histogram['~']='%7E';histogram['!']='%21';histogram['%20']='+';histogram['\u00DC']='%DC';histogram['\u00FC']='%FC';histogram['\u00C4']='%D4';histogram['\u00E4']='%E4';histogram['\u00D6']='%D6';histogram['\u00F6']='%F6';histogram['\u00DF']='%DF';histogram['\u20AC']='%80';histogram['\u0081']='%81';histogram['\u201A']='%82';histogram['\u0192']='%83';histogram['\u201E']='%84';histogram['\u2026']='%85';histogram['\u2020']='%86';histogram['\u2021']='%87';histogram['\u02C6']='%88';histogram['\u2030']='%89';histogram['\u0160']='%8A';histogram['\u2039']='%8B';histogram['\u0152']='%8C';histogram['\u008D']='%8D';histogram['\u017D']='%8E';histogram['\u008F']='%8F';histogram['\u0090']='%90';histogram['\u2018']='%91';histogram['\u2019']='%92';histogram['\u201C']='%93';histogram['\u201D']='%94';histogram['\u2022']='%95';histogram['\u2013']='%96';histogram['\u2014']='%97';histogram['\u02DC']='%98';histogram['\u2122']='%99';histogram['\u0161']='%9A';histogram['\u203A']='%9B';histogram['\u0153']='%9C';histogram['\u009D']='%9D';histogram['\u017E']='%9E';histogram['\u0178']='%9F';ret=encodeURIComponent(ret);for(unicodeStr in histogram){hexEscStr=histogram[unicodeStr];ret=replacer(unicodeStr,hexEscStr,ret);}
return ret.replace(/(\%([a-z0-9]{2}))/g,function(full,m1,m2){return"%"+m2.toUpperCase();});}
rtmix.php_urldecode=function(str){var histogram={},ret=str.toString(),unicodeStr='',hexEscStr='';var replacer=function(search,replace,str){var tmp_arr=[];tmp_arr=str.split(search);return tmp_arr.join(replace);};histogram["'"]='%27';histogram['(']='%28';histogram[')']='%29';histogram['*']='%2A';histogram['~']='%7E';histogram['!']='%21';histogram['%20']='+';histogram['\u00DC']='%DC';histogram['\u00FC']='%FC';histogram['\u00C4']='%D4';histogram['\u00E4']='%E4';histogram['\u00D6']='%D6';histogram['\u00F6']='%F6';histogram['\u00DF']='%DF';histogram['\u20AC']='%80';histogram['\u0081']='%81';histogram['\u201A']='%82';histogram['\u0192']='%83';histogram['\u201E']='%84';histogram['\u2026']='%85';histogram['\u2020']='%86';histogram['\u2021']='%87';histogram['\u02C6']='%88';histogram['\u2030']='%89';histogram['\u0160']='%8A';histogram['\u2039']='%8B';histogram['\u0152']='%8C';histogram['\u008D']='%8D';histogram['\u017D']='%8E';histogram['\u008F']='%8F';histogram['\u0090']='%90';histogram['\u2018']='%91';histogram['\u2019']='%92';histogram['\u201C']='%93';histogram['\u201D']='%94';histogram['\u2022']='%95';histogram['\u2013']='%96';histogram['\u2014']='%97';histogram['\u02DC']='%98';histogram['\u2122']='%99';histogram['\u0161']='%9A';histogram['\u203A']='%9B';histogram['\u0153']='%9C';histogram['\u009D']='%9D';histogram['\u017E']='%9E';histogram['\u0178']='%9F';for(unicodeStr in histogram){hexEscStr=histogram[unicodeStr];ret=replacer(hexEscStr,unicodeStr,ret);}
ret=decodeURIComponent(ret);return ret;}
rtmix.text_counter=function(field,maxlimit){countfield=field+"_counter";if($(field).val().length>maxlimit){char_left=maxlimit-$(field).val().length;if(char_left>1)
$(countfield).html((maxlimit-$(field).val().length)+' Chars Left');else
$(countfield).html('<span style="background-color:#ff0000; color:#ffffff; padding: 2px 5px; font-weight: bold;">'+(maxlimit-$(field).val().length)+' Chars Left</span>');}
else{char_left=maxlimit-$(field).val().length;if(char_left>1)
$(countfield).html((maxlimit-$(field).val().length)+' Chars Left');else
$(countfield).html('<span style="background-color:#ff0000; color:#ffffff; padding: 2px 5px; font-weight: bold;">'+(maxlimit-$(field).val().length)+' Chars Left</span>');}}
rtmix.short_url="askp.me beam.to bit.ly bitly.com bte.tc canurl.com cli.gs durl.us durl.kr ff.im is.gd j.mp moourl.com nvg.me om.ly ping.fm simurl.com snurl.com snipr.com snipurl.com spedr.com su.pr tinyurl.com tr.im trim.li tumblr.com twurl.nl twt.mx";rtmix.resolve_url_check=function(tid,show_flag){param={};param.action_jsonp="resolve_url";param.tid=tid;var url_regex=new RegExp(/="(https?:\/\/\S+)"/img);var text=$("#twit_text_"+tid).html();if(text==null)
alert(tid+"");var urls=text.match(url_regex);if(urls===null)
return false;var ucount=0;for(var i=0;i<urls.length;i++){var u=$.trim(urls[i]);u=u.substring(2,u.length-1);ut=u.replace('http://','');ut=ut.replace('https://','');ut_split=ut.split("/");ut_host=ut_split[0];if(rtmix.short_url.indexOf(ut_host)>-1){param["url"+ucount]=u;ucount++;}}
if(ucount>0){if(show_flag==true){var url_b_html='<div class="url_listing_b">';for(var i=0;i<ucount;i++){url_b_html+='<div class="url_listing_r"><div class="url_entry" style="color:#999999;">URL ...</div></div>';}
$("#twit_url_b_"+param.tid).html(url_b_html);$("#twit_url_b_"+param.tid).show();rtmix.jsonp_send_twt_mx(param,rtmix.process_resolve_url);}
else{t_html='<a href="#" onclick="rtmix.resolve_url('+"'"+tid+"'"+'); return false;">+URLS</a>';$("#twit_url_expand_link_"+tid).html(t_html);$("#twit_url_expand_link_"+tid).show();}}}
rtmix.resolve_url=function(tid){param={};param.action_jsonp="resolve_url";param.tid=tid;var url_regex=new RegExp(/="(https?:\/\/\S+)"/img);var text=$("#twit_text_"+tid).html();var urls=text.match(url_regex);if(urls===null)
return false;var ucount=0;for(var i=0;i<urls.length;i++){var u=$.trim(urls[i]);u=u.substring(2,u.length-1);ut=u.replace('http://','');ut=ut.replace('https://','');ut_split=ut.split("/");ut_host=ut_split[0];if(rtmix.short_url.indexOf(ut_host)>-1){param["url"+ucount]=u;ucount++;}}
if(ucount>0){rtmix.jsonp_send(param,rtmix.process_resolve_url);}
$("#twit_url_expand_link_"+param.tid).html("<span style='margin-left: 15px;color:#999999;'>...</span>");return false;}
rtmix.process_resolve_url=function(ret,param){if(ret.status=="OK"){$("#twit_url_b_"+param.tid).html(ret.html);$("#twit_url_b_"+param.tid).show();$("#twit_url_expand_link_"+param.tid).hide();}}
rtmix.resolve_pic_url=function(text,ret_id){var url_regex=new RegExp(/="(https?:\/\/\S+)"/img);urls=text.match(url_regex);if(urls===null)
return false;var img_urls=new Array;var img_urls_orig=new Array;var yt_codes=new Array;for(var i=0;i<urls.length;i++){var u=$.trim(urls[i]);u=u.substring(2,u.length-1);ut=u.replace('http://','');ut=ut.replace('https://','');ut_split=ut.split("/");ut_host=ut_split[0];ut_code=ut_split[1];if(ut_host=="twitpic.com"){img_url="http://"+ut_host+"/show/thumb/"+ut_code;img_urls.push(img_url);img_urls_orig.push(u);}
else if(ut_host=="yfrog.com"){img_url=u+".th.jpg";img_urls.push(img_url);img_urls_orig.push(u);}
else if(ut_host=="tweetphoto.com"||ut_host=="pic.gd"){img_url="http://TweetPhotoAPI.com/api/TPAPI.svc/imagefromurl?size=thumbnail&url="+u;img_urls.push(img_url);img_urls_orig.push(u);}
else if(ut_host=="moby.to"){img_url="http://api.mobypicture.com?t=http://moby.to/"+ut_code+"&s=small&k=rdL2MOx7PPQjKqbF"+"&format=plain";img_urls.push(img_url);img_urls_orig.push(u);}
else if(ut_host=="twitgoo.com"){img_url="http://twitgoo.com/show/thumb/"+ut_code;img_urls.push(img_url);img_urls_orig.push(u);}
else if(ut_host=="youtube.com"||ut_host=="www.youtube.com"){var yt_regex=new RegExp(/v=([^&"]+)/img);var yt_url=$.trim(urls[i]);yt_match=yt_url.match(yt_regex);if(yt_match!=null){yt_code=yt_match[0].substring(2);yt_codes.push(yt_code);}}}
if(img_urls.length>0){img_html='<div class="channel_pic_b">';for(var i=0;i<img_urls.length;i++){img_html+='<div class="channel_pic_r"><a href="'+rtmix.strip_quotes(img_urls_orig[i])+'" target="_blank"><img src="'+rtmix.strip_quotes(img_urls[i])+'" onerror="rtmix.img_error_blank(this);"/></a></div>';}
img_html+='</div>';$(ret_id).html(img_html);$(ret_id).show();}
if(yt_codes.length>0){yt_html='<div class="channel_pic_b">';for(var i=0;i<yt_codes.length;i++){yt_html+='<div class="channel_pic_r">'+'<object width="384" height="236"><param name="movie" value="http://www.youtube.com/v/'+rtmix.strip_quotes(yt_codes[i])+'&hl=en&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'+yt_codes[i]+'&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="384" height="236"></embed></object>';yt_html+="</div>";}
yt_html+='</div>';$(ret_id).after(yt_html);}}
rtmix.shrink_url=function(text_id,username,maxlimit){param={};param.action_jsonp="shorten";param.ret_id=text_id;param.cluster="R";param.sid=username;param.maxlimit=maxlimit;var status=$.trim($(text_id).val());if(status.length<=9)
return false;var url_regex=new RegExp(/(https?:\/\/\S+)/img);var urls=new Array();status.replace(url_regex,function($0){urls.push($0);});if(urls.length==0)
return false;var ucount=0;for(var i=0;i<urls.length;i++){var u=$.trim(urls[i]);if(u.length>7){param["u"+ucount]=u;ucount++;}}
if(ucount>0)
rtmix.jsonp_send_twt_mx(param,rtmix.process_shrink_url);return false;}
rtmix.process_shrink_url=function(ret,param){var r=$(param.ret_id);if(ret.status=="OK"){for(var u in ret.url){r.val(r.val().replace(ret.url[u]['orig'],ret.url[u]['short'],'gim'));}
rtmix.text_counter(param.ret_id,param.maxlimit);}}
rtmix.channel_twit_mouse_enter=function(tid){$("#twit_action_"+tid).show();}
rtmix.channel_twit_mouse_leave=function(tid){if($("#twit_respond_"+tid).css("display")=="none")
$("#twit_action_"+tid).hide();$("#channel_twit_time_ago_"+tid).css("background-color","inherit");}
rtmix.channel_twit_respond_show=function(tid,mode){if(mode=="reply"){if($("#channel_twit_reply_link_"+tid).hasClass("channel_twit_action_selected")){$("#channel_twit_reply_link_"+tid).removeClass("channel_twit_action_selected");$("#twit_respond_"+tid).hide();}
else{$("#channel_twit_reply_link_"+tid).addClass("channel_twit_action_selected");$("#channel_twit_retweet_link_"+tid).removeClass("channel_twit_action_selected");$("#twit_respond_"+tid).show();reply_prefix="@"+$("#twit_username_"+tid).text()+" ";$("#twit_respond_text_"+tid).val(reply_prefix);$("#twit_respond_reply_id_"+tid).val(tid);rtmix.text_counter("#twit_respond_text_"+tid,140);}}
else if(mode=="retweet"){if($("#channel_twit_retweet_link_"+tid).hasClass("channel_twit_action_selected")){$("#channel_twit_retweet_link_"+tid).removeClass("channel_twit_action_selected");$("#twit_respond_"+tid).hide();}
else{$("#channel_twit_retweet_link_"+tid).addClass("channel_twit_action_selected");$("#channel_twit_reply_link_"+tid).removeClass("channel_twit_action_selected");$("#twit_respond_"+tid).show();retweet_prefix="RT @"+$("#twit_username_"+tid).text()+" "+$("#twit_text_"+tid).text();$("#twit_respond_text_"+tid).val(retweet_prefix);$("#twit_respond_reply_id_"+tid).val(tid);rtmix.text_counter("#twit_respond_text_"+tid,140);}}
$("#twit_respond_text_"+tid).focus();}
rtmix.channel_twit_respond_cancel=function(tid){$("#channel_twit_retweet_link_"+tid).removeClass("channel_twit_action_selected");$("#channel_twit_reply_link_"+tid).removeClass("channel_twit_action_selected");$("#twit_respond_"+tid).hide();}
rtmix.channel_twit_favorite=function(tid){fav_mode=$("#channel_twit_favorite_link_"+tid).html();if(fav_mode=="Favorite")
mode="favorite_set";else
mode="favorite_unset";param={};param.action_jsonp="channel_twit_favorite";param.mode=mode;param.tid=tid;$("#channel_twit_favorite_loader_"+param.tid).show();$("#channel_twit_favorite_link_b_"+param.tid).hide();rtmix.jsonp_send(param,rtmix.process_channel_twit_favorite);}
rtmix.process_channel_twit_favorite=function(ret,param){$("#channel_twit_favorite_loader_"+param.tid).hide();$("#channel_twit_favorite_link_b_"+param.tid).show();if(ret.status=="OK"){if(param.mode=="favorite_set"){$("#channel_twit_favorite_link_"+param.tid).html("<span style='color:#cc0000;'>UnFavorite</span>")
$("#channel_twit_favorite_mark_"+param.tid).show();}
else{$("#channel_twit_favorite_link_"+param.tid).html("Favorite");$("#channel_twit_favorite_mark_"+param.tid).hide();}}
else
console.log(ret.error);}
rtmix.channel_twit_show_reply=function(tid,reply_id){param={};param.action_jsonp="twit_get_reply";param.tid=tid;param.reply_id=reply_id;rtmix.jsonp_send(param,rtmix.process_channel_twit_show_reply);}
rtmix.process_channel_twit_show_reply=function(ret,param){if(ret.status=="OK"){$("#twit_reply_b_"+param.tid).html(ret.html);$("#twit_reply_b_"+param.tid).show();}}
rtmix.channel_get_more=function(cid,more_uri,current_page){param={};param.action_jsonp="channel_get_more";param.cid=cid;param.more_uri=more_uri;param.current_page=current_page;param.next_page=current_page+1;$("#channel_more_link_"+current_page).hide();$("#channel_more_loader_"+current_page).show();$("#channel_middle_ad").show();rtmix.jsonp_send(param,rtmix.process_channel_get_more);}
rtmix.process_channel_get_more=function(ret,param){$("#channel_more_link_"+param.current_page).show();$("#channel_more_loader_"+param.current_page).hide();if(ret.status=="OK"){$("#channel_more_"+param.current_page).hide();$("#channel_next_"+param.current_page).after(ret.html);}}
rtmix.channel_get_new=function(cid,more_uri){param={};param.action_jsonp="channel_get_new";param.cid=cid;param.more_uri=more_uri;if(rtmix.channel_get_new_mode==true)
rtmix.jsonp_send(param,rtmix.process_channel_get_new);}
rtmix.process_channel_get_new=function(ret,param){if(ret.status=="OK"){$("#twit_listing_new_head").prepend(ret.html);}}
rtmix.channel_get_new_mode=true;rtmix.channel_get_new_set_mode=function(mode){if(mode==true){$("#auto_refresh_on").show();$("#auto_refresh_off").hide();rtmix.cookie("rtmix_refresh","Y",{"path":"/"});}
else{$("#auto_refresh_on").hide();$("#auto_refresh_off").show();rtmix.cookie("rtmix_refresh","N",{"path":"/"});}
rtmix.channel_get_new_mode=mode;}
rtmix.channel_get_new_detect_mode=function(){if(rtmix.cookie("rtmix_refresh")=="N")
rtmix.channel_get_new_set_mode(false);else
rtmix.channel_get_new_set_mode(true);}
rtmix.watchlist_get_new=function(){if(rtmix.channel_get_new_mode==true)
rtmix.twit_get_my_watchlist();setTimeout('rtmix.watchlist_get_new()',300000);}
rtmix.channel_twit_respond_submit=function(tid,hide_flag){param={};param.action_jsonp="channel_twit_new_tweet";param.reply_to_tid=tid;param.text=$('#twit_respond_text_'+tid).val();param.username=$('#twit_respond_username_'+tid).val();param.hide_flag=hide_flag;$("#twit_respond_button_"+param.reply_to_tid).hide();$("#twit_respond_button_loader_"+param.reply_to_tid).show();$("#twit_respond_error_"+param.reply_to_tid).html("");$("#twit_respond_error_"+param.reply_to_tid).hide();rtmix.jsonp_send(param,rtmix.process_channel_twit_respond_submit);}
rtmix.process_channel_twit_respond_submit=function(ret,param){$("#twit_respond_button_"+param.reply_to_tid).show();$("#twit_respond_button_loader_"+param.reply_to_tid).hide();if(ret.status=="OK"){$('#twit_respond_text_'+param.reply_to_tid).val("");$("#channel_twit_retweet_link_"+param.reply_to_tid).removeClass("channel_twit_action_selected");$("#channel_twit_reply_link_"+param.reply_to_tid).removeClass("channel_twit_action_selected");if(param.hide_flag=="Y")
$("#twit_respond_"+param.reply_to_tid).hide();$("#twit_respond_twit_new_"+param.reply_to_tid).after(ret.html);}
else{$("#twit_respond_error_"+param.reply_to_tid).html(ret.error);$("#twit_respond_error_"+param.reply_to_tid).show();}}
rtmix.get_twit_trend_topics=function(ret_id){param={};param.action_jsonp="twit_trend_topics";param.ret_id=ret_id;rtmix.jsonp_send(param,rtmix.process_get_twit_trend_topics);}
rtmix.process_get_twit_trend_topics=function(ret,param){if(ret.status=="OK"){$(param.ret_id).html(ret.html);}}
rtmix.get_twit_trend_topics_all=function(ret_id){param={};param.action_jsonp="twit_trend_topics_all";param.ret_id=ret_id;rtmix.jsonp_send(param,rtmix.process_get_twit_trend_topics_all);}
rtmix.process_get_twit_trend_topics_all=function(ret,param){if(ret.status=="OK"){$(param.ret_id).html(ret.html);}}
rtmix.channel_twit_dm_reply_show=function(tid){if($("#channel_twit_dm_reply_link_"+tid).hasClass("channel_twit_action_selected")){$("#channel_twit_dm_reply_link_"+tid).removeClass("channel_twit_action_selected");$("#twit_dm_form_"+tid).hide();}
else{$("#channel_twit_dm_reply_link_"+tid).addClass("channel_twit_action_selected");$("#twit_dm_form_"+tid).show();rtmix.text_counter("#twit_dm_text_"+tid,140);}}
rtmix.channel_twit_dm_cancel=function(tid){$("#channel_twit_dm_reply_link_"+tid).removeClass("channel_twit_action_selected");$("#twit_dm_form_"+tid).hide();}
rtmix.channel_twit_dm_submit=function(tid,mode_flag){param={};param.action_jsonp="channel_twit_new_dm";param.reply_to_tid=tid;param.text=$('#twit_dm_text_'+tid).val();param.username=$('#twit_dm_username_'+tid).val();param.mode=mode_flag;if($.trim(param.username)==""){$("#twit_dm_error_"+param.reply_to_tid).html("Missing To @Username");$("#twit_dm_error_"+param.reply_to_tid).show();return;}
$("#twit_dm_button_"+param.reply_to_tid).hide();$("#twit_dm_button_loader_"+param.reply_to_tid).show();$("#twit_dm_error_"+param.reply_to_tid).html("");$("#twit_dm_error_"+param.reply_to_tid).hide();rtmix.jsonp_send(param,rtmix.process_channel_twit_dm_submit);}
rtmix.process_channel_twit_dm_submit=function(ret,param){$("#twit_dm_button_"+param.reply_to_tid).show();$("#twit_dm_button_loader_"+param.reply_to_tid).hide();if(ret.status=="OK"){$('#twit_dm_text_'+param.reply_to_tid).val("");$('#twit_dm_username_'+param.reply_to_tid).val("");$("#channel_dm_retweet_link_"+param.reply_to_tid).removeClass("channel_twit_action_selected");$("#channel_dm_reply_link_"+param.reply_to_tid).removeClass("channel_twit_action_selected");if(param.mode=="reply")
$("#twit_dm_form_"+param.reply_to_tid).hide();$("#twit_dm_twit_new_"+param.reply_to_tid).after(ret.html);}
else{$("#twit_dm_error_"+param.reply_to_tid).html(ret.error);$("#twit_dm_error_"+param.reply_to_tid).show();}}
rtmix.follow_user=function(username){var param={};param.action_jsonp="follow_user";param.username=username;$('#a_follow_'+username).hide();$('#l_follow_'+username).show();rtmix.jsonp_send(param,rtmix.process_follow_user);}
rtmix.process_follow_user=function(ret,param){$('#a_follow_'+param.username).show();$('#l_follow_'+param.username).hide();if(ret.status=="OK"){$('#b_follow_'+param.username).hide();$('#b_unfollow_'+param.username).show();}}
rtmix.unfollow_user=function(username){var param={};param.action_jsonp="unfollow_user";param.username=username;$('#a_unfollow_'+username).hide();$('#l_unfollow_'+username).show();rtmix.jsonp_send(param,rtmix.process_unfollow_user);}
rtmix.process_unfollow_user=function(ret,param){$('#a_unfollow_'+param.username).show();$('#l_unfollow_'+param.username).hide();if(ret.status=="OK"){$('#b_unfollow_'+param.username).hide();$('#b_follow_'+param.username).show();}}
rtmix.block_user=function(username){var param={};param.action_jsonp="block_user";param.username=username;$('#a_block_'+username).hide();$('#l_block_'+username).show();rtmix.jsonp_send(param,rtmix.process_block_user);}
rtmix.process_block_user=function(ret,param){$('#a_block_'+param.username).show();$('#l_block_'+param.username).hide();if(ret.status=="OK"){$('#b_block_'+param.username).hide();$('#b_unblock_'+param.username).show();$('#b_follow_'+param.username).hide();$('#b_unfollow_'+param.username).hide();}}
rtmix.unblock_user=function(username){var param={};param.action_jsonp="unblock_user";param.username=username;$('#a_unblock_'+username).hide();$('#l_unblock_'+username).show();rtmix.jsonp_send(param,rtmix.process_unblock_user);}
rtmix.process_unblock_user=function(ret,param){$('#a_unblock_'+param.username).show();$('#l_unblock_'+param.username).hide();if(ret.status=="OK"){$('#b_unblock_'+param.username).hide();$('#b_block_'+param.username).show();$('#b_follow_'+param.username).show();$('#b_unfollow_'+param.username).hide();}}
rtmix.get_recent_mentions=function(username){var param={};param.action_jsonp="get_recent_mentions";param.username=username;rtmix.jsonp_send(param,rtmix.process_get_recent_mentions);}
rtmix.process_get_recent_mentions=function(ret,param){if(ret.status=="OK"){$('#mentions_'+param.username).html(ret.html);}
else{$('#mentions_'+param.username).html('<span style="color:#ff0000;">'+ret.error+'</span>');}}
rtmix.channel_sub=function(cid){var param={};param.action_jsonp="channel_sub";param.cid=cid;$('#ca_sub_link_'+cid).hide();$('#ca_sub_loader_'+cid).show();rtmix.jsonp_send(param,rtmix.process_channel_sub);}
rtmix.process_channel_sub=function(ret,param){$('#ca_sub_link_'+param.cid).show();$('#ca_sub_loader_'+param.cid).hide();if(ret.status=="OK"){$('#ca_sub_b_'+param.cid).hide();$('#ca_unsub_b_'+param.cid).show();}}
rtmix.channel_unsub=function(cid){var param={};param.action_jsonp="channel_unsub";param.cid=cid;$('#ca_unsub_link_'+cid).hide();$('#ca_unsub_loader_'+cid).show();rtmix.jsonp_send(param,rtmix.process_channel_unsub);}
rtmix.process_channel_unsub=function(ret,param){$('#ca_unsub_link_'+param.cid).show();$('#ca_unsub_loader_'+param.cid).hide();if(ret.status=="OK"){$('#ca_unsub_b_'+param.cid).hide();$('#ca_sub_b_'+param.cid).show();}}
rtmix.twit_get_my_watchlist=function(){var param={};param.action_jsonp="twit_get_my_watchlist";rtmix.jsonp_send(param,rtmix.process_twit_get_my_watchlist);}
rtmix.process_twit_get_my_watchlist=function(ret,param){if(ret.status=="OK"){$('#twit_my_watchlist_b').html(ret.html);}}
rtmix.twit_get_my_watchlist_dialog=function(mode){var param={}
param.action_jsonp="twit_get_my_watchlist_dialog";param.mode=mode;$('#wl_dialog_content_loader_b').show();$('#wl_dialog_content_b').html("");$('#wl_dialog_content_error_b').hide();rtmix.jsonp_send(param,rtmix.process_twit_get_my_watchlist_dialog);}
rtmix.process_twit_get_my_watchlist_dialog=function(ret,param){$('#wl_dialog_content_loader_b').hide();if(ret.status=="OK"){$('#wl_dialog_content_b').html(ret.html);}
else{$('#wl_dialog_content_error_b').html(ret.error);$('#wl_dialog_content_error_b').show();}
rtmix.dialog_open("#d_my_watchlist");}
rtmix.twit_update_my_watchlist=function(mode){$('#wl_error').html("");var wid=$('#wl_wid').val();var twit_search_q=$('#wl_twit_search_q').val();var count=$("input[ 'wlcount' ]:checked").val();if(($.trim(twit_search_q)).length>140){$('#wl_error').html("Search Query must be Under 140 Characters");return;}
if(count==null){$('#wl_error').html("Select Number of Tweets to Show in Watchlist");return;}
var param={}
param.action_jsonp="twit_update_my_watchlist"
param.wid=wid;param.twit_search_q=twit_search_q;param.count=count;param.mode=mode;$('#wl_submit_b').hide();$('#wl_loader_b').show();rtmix.jsonp_send(param,rtmix.process_twit_update_my_watchlist);}
rtmix.process_twit_update_my_watchlist=function(ret,param){$('#wl_submit_b').show();$('#wl_loader_b').hide();if(ret.status=="OK"){rtmix.dialog_close_all();if(param.mode=="page"){window.location.reload(true);}
else
rtmix.twit_get_my_watchlist();}
else{$('#wl_error').html(ret.error);}}
rtmix.menu_action_new_tweet=function(action){$('#new_tweet_dialog_text_new_tweet').val("");rtmix.text_counter('#new_tweet_dialog_text_new_tweet',140);$("#new_tweet_dialog_twit_new_new_tweet").html("");rtmix.dialog_open('#d_twit_new_tweet');}
rtmix.channel_new_tweet_dialog_submit=function(tid,hide_flag){param={};param.action_jsonp="channel_twit_new_tweet";param.reply_to_tid=tid;param.text=$('#new_tweet_dialog_text_'+tid).val();param.username=$('#new_tweet_dialog_username_'+tid).val();param.hide_flag=hide_flag;$("#new_tweet_dialog_button_"+param.reply_to_tid).hide();$("#new_tweet_dialog_button_loader_"+param.reply_to_tid).show();$("#new_tweet_dialog_error_"+param.reply_to_tid).html("");$("#new_tweet_dialog_error_"+param.reply_to_tid).hide();rtmix.jsonp_send(param,rtmix.process_channel_new_tweet_dialog_submit);}
rtmix.process_channel_new_tweet_dialog_submit=function(ret,param){$("#new_tweet_dialog_button_"+param.reply_to_tid).show();$("#new_tweet_dialog_button_loader_"+param.reply_to_tid).hide();if(ret.status=="OK"){$('#new_tweet_dialog_text_'+param.reply_to_tid).val("");$("#new_tweet_dialog_twit_new_"+param.reply_to_tid).html(ret.html);}
else{$("#new_tweet_dialog_error_"+param.reply_to_tid).html(ret.error);$("#new_tweet_dialog_error_"+param.reply_to_tid).show();}}
rtmix.channel_new_tweet_dialog_cancel=function(tid){rtmix.dialog_close_all();}
rtmix.discover_get_more=function(current_page){param={};param.action_jsonp="discover_get_more";param.current_page=current_page;param.next_page=current_page+1;$("#more_link_"+current_page).hide();$("#more_loader_"+current_page).show();rtmix.jsonp_send(param,rtmix.process_discover_get_more);}
rtmix.process_discover_get_more=function(ret,param){$("#more_link_"+param.current_page).show();$("#more_loader_"+param.current_page).hide();if(ret.status=="OK"){$("#more_"+param.current_page).hide();$("#more_next_"+param.current_page).after(ret.html);}}
rtmix.discover_listing_get_more=function(mode,more_uri,current_page){param={};param.action_jsonp="discover_listing_get_more";param.mode=mode;param.more_uri=more_uri;param.current_page=current_page;param.next_page=current_page+1;$("#more_link_"+current_page).hide();$("#more_loader_"+current_page).show();rtmix.jsonp_send(param,rtmix.process_discover_listing_get_more);}
rtmix.process_discover_listing_get_more=function(ret,param){$("#more_link_"+param.current_page).show();$("#more_loader_"+param.current_page).hide();if(ret.status=="OK"){$("#more_"+param.current_page).hide();$("#more_next_"+param.current_page).after(ret.html);}}
rtmix.search_listing_get_more=function(mode,more_uri,current_page){param={};param.action_jsonp="search_listing_get_more";param.mode=mode;param.more_uri=more_uri;param.current_page=current_page;param.next_page=current_page+1;$("#more_link_"+current_page).hide();$("#more_loader_"+current_page).show();rtmix.jsonp_send(param,rtmix.process_search_listing_get_more);}
rtmix.process_search_listing_get_more=function(ret,param){$("#more_link_"+param.current_page).show();$("#more_loader_"+param.current_page).hide();if(ret.status=="OK"){$("#more_"+param.current_page).hide();$("#more_next_"+param.current_page).after(ret.html);}}
rtmix.delete_channel_confirm=function(){rtmix.dialog_open("#d_delete_channel");}
rtmix.delete_channel_submit=function(cid){window.location.href=rtmix.url_action+"delete_channel/cid="+cid;}
rtmix.channel_side_twit_respond=function(tid){var photo_src=$('#channel_side_twit_photo_'+tid).attr("src");var username=$('#channel_side_twit_username_'+tid).html();var username_text=$('#twit_side_username_'+tid).text();var twit_text=$('#channel_side_twit_text_'+tid).html();var time_ago=$('#channel_side_twit_time_ago_'+tid).html();$('#dialog_new_tweet_respond_photo').attr("src",photo_src);$('#dialog_new_tweet_respond_username').html(username);$('#dialog_new_tweet_respond_username_text').val(username_text);$('#dialog_new_tweet_respond_text').html(twit_text);$('#dialog_new_tweet_respond_time_ago').html(time_ago);$('#dialog_new_tweet_respond_tid').val(tid);rtmix.dialog_new_tweet_respond_show_tab('reply');$('#new_tweet_respond_dialog_error_tweet_respond').html("");$('#new_tweet_respond_dialog_twit_new_tweet_respond').html("");rtmix.dialog_open('#d_twit_new_tweet_respond');$('#new_tweet_respond_dialog_text_tweet_respond').focus();}
rtmix.dialog_new_tweet_respond_show_tab=function(mode){$('#new_tweet_respond_dialog_text_tweet_respond').focus();if(mode=="reply"){$("#dialog_new_tweet_respond_reply_link").addClass("channel_twit_action_selected");$("#dialog_new_tweet_respond_retweet_link").removeClass("channel_twit_action_selected");reply_prefix="@"+$("#dialog_new_tweet_respond_username_text").val()+" ";$("#new_tweet_respond_dialog_text_tweet_respond").val(reply_prefix);rtmix.text_counter('#new_tweet_respond_dialog_text_tweet_respond',140);}
else if(mode=="retweet"){$("#dialog_new_tweet_respond_reply_link").removeClass("channel_twit_action_selected");$("#dialog_new_tweet_respond_retweet_link").addClass("channel_twit_action_selected");reply_prefix="RT @"+$("#dialog_new_tweet_respond_username_text").val()+" "+$('#dialog_new_tweet_respond_text').text();$("#new_tweet_respond_dialog_text_tweet_respond").val(reply_prefix);rtmix.text_counter('#new_tweet_respond_dialog_text_tweet_respond',140);}}
rtmix.channel_new_tweet_respond_dialog_submit=function(tid,hide_flag){param={};param.action_jsonp="channel_twit_new_tweet";param.reply_to_tid=$('#dialog_new_tweet_respond_tid').val();param.text=$('#new_tweet_respond_dialog_text_'+tid).val();param.username=$('#new_tweet_respond_dialog_username_'+tid).val();param.hide_flag=hide_flag;$("#new_tweet_respond_dialog_button_"+param.reply_to_tid).hide();$("#new_tweet_respond_dialog_button_loader_"+param.reply_to_tid).show();$("#new_tweet_respond_dialog_error_"+param.reply_to_tid).html("");$("#new_tweet_respond_dialog_error_"+param.reply_to_tid).hide();rtmix.jsonp_send(param,rtmix.process_channel_new_tweet_respond_dialog_submit);}
rtmix.process_channel_new_tweet_respond_dialog_submit=function(ret,param){$("#new_tweet_respond_dialog_button_tweet_respond").show();$("#new_tweet_respond_dialog_button_loader_tweet_respond").hide();if(ret.status=="OK"){$("#new_tweet_respond_dialog_text_tweet_respond").val("");$("#new_tweet_respond_dialog_twit_new_tweet_respond").html(ret.html);}
else{$("#new_tweet_respond_dialog_error_tweet_respond").html(ret.error);$("#new_tweet_respond_dialog_error_tweet_respond").show();}}
rtmix.channel_new_tweet_respond_dialog_cancel=function(tid){rtmix.dialog_close_all();}
rtmix.account_remove=function(username){$('#dialog_account_remove_username').html(username);rtmix.dialog_open('#d_account_remove');}
rtmix.account_remove_submit=function(){var username=$('#dialog_account_remove_username').text();window.location.href=rtmix.url_action+"remove_account/username="+rtmix.php_urlencode(rtmix.php_urlencode(username));}
rtmix.share_twitter=function(seo_url,username,mode){var channel_desc=$('#channel_description').text();if(channel_desc==""||channel_desc==null)
channel_desc=$('#channel_name').text();if(mode=="session"){$('#new_tweet_dialog_text_new_tweet').val(channel_desc+" "+seo_url);rtmix.text_counter('#new_tweet_dialog_text_new_tweet',140);$("#new_tweet_dialog_twit_new_new_tweet").html("");rtmix.dialog_open('#d_twit_new_tweet');rtmix.shrink_url('#new_tweet_dialog_text_new_tweet',username,140);}
else{var param={};param.action_jsonp="shrink_url";param.url0=seo_url;rtmix.jsonp_send(param,rtmix.share_twitter_anon_process);}}
rtmix.share_twitter_anon_process=function(ret,param){var channel_desc=$('#channel_description').text();if(channel_desc==""||channel_desc==null)
channel_desc=$('#channel_name').text();if(ret.status=="OK"){var results=ret.results;for(var url in results){if(typeof(results[url]['errorCode'])=="undefined")
var url=results[url]['shortUrl'];}
var redir='http://twitter.com?status='+rtmix.php_urlencode(channel_desc+" "+url);window.location.href=redir;}}
rtmix.beta_access=function(mode){$('#beta_error_signup').html("&nbsp;");$('#beta_error_login').html("&nbsp;");var param={};param.action_jsonp="beta_access";param.mode=mode;param.email=$('#beta_email_'+mode).val();rtmix.jsonp_send(param,rtmix.process_beta_access);}
rtmix.process_beta_access=function(ret,param){if(ret.status=="OK"){if(param.mode=="login")
window.location.href=ret.url;else{$("#beta_signup").hide();$("#beta_confirm").show();}}
else{$('#beta_error_'+param.mode).html(ret.error);}}
rtmix.beta_welcome=function(){var param={};param.action_jsonp="beta_welcome";rtmix.jsonp_send(param,rtmix.process_beta_welcome);}
rtmix.process_beta_welcome=function(ret,param){if(ret.status=="OK"){window.location.href=ret.url;}
else{$('#beta_welcome_error').html(ret.error);}}
rtmix.my_twit_list_get_more=function(mode,cursor){param={};param.action_jsonp="my_twit_list_get_more";param.mode=mode;param.cursor=cursor;$("#channel_more_link_"+mode+cursor).hide();$("#channel_more_loader_"+mode+cursor).show();rtmix.jsonp_send(param,rtmix.process_my_twit_list_get_more);}
rtmix.process_my_twit_list_get_more=function(ret,param){$("#channel_more_link_"+param.mode+param.cursor).show();$("#channel_more_loader_"+param.mode+param.cursor).hide();if(ret.status=="OK"){$("#channel_more_"+param.mode+param.cursor).hide();$("#channel_next_"+param.mode+param.cursor).after(ret.html);}}
rtmix.create_new_twit_list=function(){$('#new_list_error').html("&nbsp;");var name=$('#new_list_name').val();var privacy=$("input[name='new_list_privacy']:checked").val();var description=$('#new_list_description').val();if($.trim(name).length==0){$('#new_list_error').html("Enter List Name");return;}
if(privacy!="public"&&privacy!="private"){$('#new_list_error').html("Select Privacy");return;}
var param={};param.action_jsonp="create_new_twit_list";param.name=name;param.privacy=privacy;param.description=description;$('#new_list_button').hide();$('#new_list_loader').show();rtmix.jsonp_send(param,rtmix.process_create_new_twit_list);}
rtmix.process_create_new_twit_list=function(ret,param){if(ret.status=="OK"){window.location.href=rtmix.url_action+"my_twit_lists";}
else{$('#new_list_button').show();$('#new_list_loader').hide();$('#new_list_error').html(ret.error);}}
rtmix.edit_twit_list=function(list_id){$('#edit_list_error').html("&nbsp;");var name=$('#edit_list_name').val();var privacy=$("input[name='edit_list_privacy']:checked").val();var description=$('#edit_list_description').val();if($.trim(name).length==0){$('#edit_list_error').html("Enter List Name");return;}
if(privacy!="public"&&privacy!="private"){$('#edit_list_error').html("Select Privacy");return;}
var param={};param.action_jsonp="edit_twit_list";param.id=list_id;param.name=name;param.description=description;param.privacy=privacy;$('#edit_list_button').hide();$('#edit_list_cancel').hide();$('#edit_list_loader').show();rtmix.jsonp_send(param,rtmix.process_edit_twit_list);}
rtmix.process_edit_twit_list=function(ret,param){if(ret.status=="OK"){window.location.reload(true);}
else{$('#edit_list_button').show();$('#edit_list_cancel').show();$('#edit_list_loader').hide();$('#edit_list_error').html(ret.error);}}
rtmix.delete_twit_list=function(list_id){$('#delete_twit_list_error').html("");$('#delete_twit_list_error').hide();var param={};param.action_jsonp="delete_twit_list";param.id=list_id;rtmix.jsonp_send(param,rtmix.process_delete_twit_list);}
rtmix.process_delete_twit_list=function(ret,param){if(ret.status=="OK"){window.location.href=rtmix.url_action+"my_twit_lists";}
else{$('#delete_twit_list_error').html(ret.error);$('#delete_twit_list_error').show();}}
rtmix.follow_twit_list=function(username,list_id){var param={};param.action_jsonp="follow_twit_list";param.username=username;param.id=list_id;$('#a_follow_'+username+list_id).hide();$('#l_follow_'+username+list_id).show();rtmix.jsonp_send(param,rtmix.process_follow_twit_list);}
rtmix.process_follow_twit_list=function(ret,param){$('#a_follow_'+param.username+param.id).show();$('#l_follow_'+param.username+param.id).hide();if(ret.status=="OK"){$('#b_unfollow_'+param.username+param.id).show();$('#b_follow_'+param.username+param.id).hide();}}
rtmix.unfollow_twit_list=function(username,list_id){var param={};param.action_jsonp="unfollow_twit_list";param.username=username;param.id=list_id;$('#a_unfollow_'+username+list_id).hide();$('#l_unfollow_'+username+list_id).show();rtmix.jsonp_send(param,rtmix.process_unfollow_twit_list);}
rtmix.process_unfollow_twit_list=function(ret,param){$('#a_unfollow_'+param.username+param.id).show();$('#l_unfollow_'+param.username+param.id).hide();if(ret.status=="OK"){$('#b_unfollow_'+param.username+param.id).hide();$('#b_follow_'+param.username+param.id).show();}}
rtmix.twit_list_add_show=function(person_id,username,profile_image){$('#twit_list_add_loader').show();$('#twit_list_add_content').html("");$('#twit_list_add_content').hide();$('#twit_list_add_error').html("&nbsp;");$('#twit_list_add_name').text(username);$('#twit_list_add_image').attr("src",profile_image);rtmix.dialog_open('#d_twit_list_add');var param={};param.action_jsonp="get_twit_list_add_dialog";param.id=person_id;param.username=username;rtmix.jsonp_send(param,rtmix.process_twit_list_add_show);}
rtmix.process_twit_list_add_show=function(ret,param){$('#twit_list_add_loader').hide();if(ret.status=="OK"){$('#twit_list_add_content').html(ret.html);$('#twit_list_add_content').show();}
else{$('#twit_list_add_error').html(ret.error);$('#twit_list_add_error').show();}}
rtmix.twit_list_add=function(list_id,person_id){$('#twit_list_add_link_'+list_id).hide();$('#twit_list_add_loader_'+list_id).show();var param={};param.action_jsonp="twit_list_add";param.list_id=list_id;param.person_id=person_id;rtmix.jsonp_send(param,rtmix.process_twit_list_add);}
rtmix.process_twit_list_add=function(ret,param){$('#twit_list_add_link_'+param.list_id).show();$('#twit_list_add_loader_'+param.list_id).hide();if(ret.status=="OK"){$('#twit_list_add_'+param.list_id).hide();$('#twit_list_remove_'+param.list_id).show();$('#twit_list_added_'+param.list_id).show();}}
rtmix.twit_list_remove=function(list_id,person_id){$('#twit_list_remove_link_'+list_id).hide();$('#twit_list_remove_loader_'+list_id).show();var param={};param.action_jsonp="twit_list_remove";param.list_id=list_id;param.person_id=person_id;rtmix.jsonp_send(param,rtmix.process_twit_list_remove);}
rtmix.process_twit_list_remove=function(ret,param){$('#twit_list_remove_link_'+param.list_id).show();$('#twit_list_remove_loader_'+param.list_id).hide();if(ret.status=="OK"){$('#twit_list_add_'+param.list_id).show();$('#twit_list_remove_'+param.list_id).hide();$('#twit_list_added_'+param.list_id).hide();}}
rtmix.channel_twit_list_select_show=function(){$('#channel_twit_list_select_content').hide();$('#channel_twit_list_select_loader').show();$('#channel_twit_list_select_error').html("&nbsp;");var twit_account=$('#c_twit_account').val();var list_selected_name=$('#twit_list_name').val();var list_selected_id=$('#twit_list_id').val();rtmix.dialog_open("#d_channel_twit_list_select");var param={};param.action_jsonp="get_channel_twit_list_select_content";param.account=twit_account;param.list_selected_name=list_selected_name;param.list_selected_id=list_selected_id;rtmix.jsonp_send(param,rtmix.process_channel_twit_list_select_show);}
rtmix.process_channel_twit_list_select_show=function(ret,param){$('#channel_twit_list_select_loader').hide();if(ret.status=="OK"){$('#channel_twit_list_select_content').html(ret.html);$('#channel_twit_list_select_content').show();}
else{$('#channel_twit_list_select_error').html(ret.error);}}
rtmix.channel_twit_list_select=function(list_username,list_id,list_name){$('#twit_list_username').val(list_username);$('#twit_list_id').val(list_id);$('#twit_list_name').val(list_name);$('#twit_list_selected_name').text(list_name);$('#twit_list_select_b').hide();$('#twit_list_selected_b').show();rtmix.dialog_close_all();}
rtmix.channel_twit_list_select_get_more=function(list_mode,cursor){$('#channel_more_link_'+list_mode+cursor).hide();$('#channel_more_loader_'+list_mode+cursor).show();var twit_account=$('#c_twit_account').val();var list_selected_name=$('#twit_list_name').val();var list_selected_id=$('#twit_list_id').val();var param={};param.action_jsonp="get_channel_twit_list_select_more";param.mode=list_mode;param.account=twit_account;param.cursor=cursor;param.list_selected_name=list_selected_name;param.list_selected_id=list_selected_id;rtmix.jsonp_send(param,rtmix.process_channel_twit_list_select_get_more);}
rtmix.process_channel_twit_list_select_get_more=function(ret,param){$('#channel_more_link_'+param.mode+param.cursor).show();$('#channel_more_loader_'+param.mode+param.cursor).hide();if(ret.status=="OK"){$('#channel_twit_list_more_'+param.mode+param.cursor).hide();$('#channel_twit_list_next_'+param.mode+param.cursor).after(ret.html);}}
rtmix.w_width="auto";rtmix.w_height="300";rtmix.w_refresh="Y";rtmix.w_photo="Y";rtmix.w_font="helvetica";rtmix.w_font_size="13px";rtmix.w_header_bg_color="#002233";rtmix.w_header_color="#FFFFFF";rtmix.w_content_bg_color="#FFFFFF";rtmix.w_content_color="#333333";rtmix.w_link_color="#2277BB";rtmix.channel_widget_create=function(cid){rtmix.w_wid=Math.floor(Math.random()*1000000);rtmix.w_cid=cid;$("#w_title").val("");if(rtmix.w_width=="auto"){$("#w_width").val("");$("#w_width_auto").attr('checked',true);}
else{$("#w_width").val(rtmix.w_width);$("#w_width_auto").attr('checked',false);}
$("#w_height").val(rtmix.w_height);if(rtmix.w_refresh=="Y")
$("#w_auto_refresh_y").click();else
$("#w_auto_refresh_n").click();$("#w_font").val(rtmix.w_font);$("#w_font_size").val(rtmix.w_font_size);$("#w_header_bg_color").val(rtmix.w_header_bg_color);$("#w_header_color").val(rtmix.w_header_color);$("#w_content_bg_color").val(rtmix.w_content_bg_color);$("#w_content_color").val(rtmix.w_content_color);$("#w_link_color").val(rtmix.w_link_color);$("#pv_b").css({'border':"1px solid "+rtmix.w_header_bg_color,'font-family':rtmix.font_to_family(rtmix.w_font),'font-size':rtmix.w_font_size});$("#pv_header_b").html("&nbsp;");$("#pv_header_b").css({'background-color':rtmix.w_header_bg_color,'color':rtmix.w_header_color});$("#pv_content_b").text("");$("#pv_footer_b").css({'background-color':rtmix.w_header_bg_color,'color':rtmix.w_header_color});$("#pv_footer_link").css({'color':rtmix.w_header_color});rtmix.widget_preview_content(rtmix.w_wid,rtmix.w_cid);}
rtmix.widget_preview_content=function(wid,cid){var param={};param.action_jsonp="widget_get";param.mode="preview";param.wid=wid;param.cid=cid;rtmix.jsonp_send_widget(param,rtmix.widget_preview_content_process);}
rtmix.widget_preview_content_process=function(ret,param){if(ret.status=="OK"){$("#pv_content_b").html(ret.html);}
rtmix.widget_gen_code(rtmix.w_wid,rtmix.w_cid);rtmix.dialog_open('#d_channel_embed');}
rtmix.widget_gen_code=function(wid,cid){w_code='<script src="'+rtmix.w_js_url+'"></script>\n'+'<div id="rtmixw_b_'+wid+'" class="rtmixw_b_'+wid+'">\n'+'<div id="rtmixw_header_'+wid+'" class="rtmixw_header_'+wid+'"><a href="'+rtmix.w_seo_url+'">'+rtmix.escape_html($("#w_title").val())+'</a></div>\n'+'<div id="rtmixw_footer_'+wid+'" class="rtmixw_footer_'+wid+'"><a href="http://TwitIQ.com/">TwitIQ.com</a></div>\n'+'</div>\n'+'<script type="text/javascript">\n';if(rtmix.w_width=="auto"){if($("#w_width_auto").attr("checked")==false)
w_code+='rtmix.w_width_'+wid+' = "'+$("#w_width").val()+'";\n';}
else{if($("#w_width_auto").attr("checked")==true)
w_code+='rtmix.w_width_'+wid+' = "auto"\n';}
if($("#w_height").val()!=rtmix.w_height)
w_code+='rtmix.w_height_'+wid+' = "'+$("#w_height").val()+'";\n';if(rtmix.w_refresh=="Y"){if($("#w_auto_refresh_y").attr("checked")==false)
w_code+='rtmix.w_refresh_'+wid+' = "N";\n';}
else{if($("#w_auto_refresh_y").attr("checked")==true)
w_code+='rtmix.w_refresh_'+wid+' = "Y";\n';}
if(rtmix.w_photo=="Y"){if($("#w_photo_y").attr("checked")==false)
w_code+='rtmix.w_photo_'+wid+' = "N";\n';}
else{if($("#w_photo_y").attr("checked")==true)
w_code+='rtmix.w_photo_'+wid+' = "Y";\n';}
if($("#w_font").val()!=rtmix.w_font)
w_code+='rtmix.w_font_'+wid+' = "'+$("#w_font").val()+'";\n';if($("#w_font_size").val()!=rtmix.w_font_size)
w_code+='rtmix.w_font_size_'+wid+' = "'+$("#w_font_size").val()+'";\n';if($("#w_header_bg_color").val()!=rtmix.w_header_bg_color)
w_code+='rtmix.w_header_bg_color_'+wid+' = "'+$("#w_header_bg_color").val()+'";\n';if($("#w_header_color").val()!=rtmix.w_header_color)
w_code+='rtmix.w_header_color_'+wid+' = "'+$("#w_header_color").val()+'";\n';if($("#w_content_bg_color").val()!=rtmix.w_content_bg_color)
w_code+='rtmix.w_content_bg_color_'+wid+' = "'+$("#w_content_bg_color").val()+'";\n';if($("#w_content_color").val()!=rtmix.w_content_color)
w_code+='rtmix.w_content_color_'+wid+' = "'+$("#w_content_color").val()+'";\n';if($("#w_link_color").val()!=rtmix.w_link_color)
w_code+='rtmix.w_link_color_'+wid+' = "'+$("#w_link_color").val()+'";\n';w_code+='rtmix.widget_init("'+wid+'", "'+cid+'");\n';w_code+='</script>';$("#w_code").val(w_code);}
rtmix.widget_preview_update=function(w_field){if(w_field=="w_title"){if($("#w_title").val()!="")
$("#pv_header_b").text($("#w_title").val());else
$("#pv_header_b").html("&nbsp;");}
else if(w_field=="w_width"){w=$("#w_width").val();if(!w.match(/^[0-9]+$/)){if(rtmix.w_width=="auto"){$("#w_width").val("");$("#w_width_auto").attr('checked',true);}
else{$("#w_width").val(rtmix.w_width);$("#w_width_auto").attr('checked',false);}}}
else if(w_field=="w_height"){h=$("#w_height").val();if(!h.match(/^[0-9]+$/))
$("#w_height").val(rtmix.w_height);}
else if(w_field=="w_photo_y"){$("[w_pv='twit_photo']").show();$("[w_pv='twit_content']").css("margin-left","60px");}
else if(w_field=="w_photo_n"){$("[w_pv='twit_photo']").hide();$("[w_pv='twit_content']").css("margin-left","0px");}
else if(w_field=="w_font"){var w_font_family=rtmix.font_to_family($("#w_font").val());$("#pv_b").css("font-family",w_font_family);}
else if(w_field=="w_font_size"){s=$("#w_font_size").val();if(!s.match(/^[0-9\.]+(px|pt|em)$/))
$("#w_font_size").val(rtmix.w_font_size);else
$("#pv_b").css("font-size",$("#w_font_size").val());}
else if(w_field=="w_header_bg_color"){$("#pv_b").css("border","1px solid "+$("#w_header_bg_color").val());$("#pv_header_b").css("background-color",$("#w_header_bg_color").val());$("#pv_footer_b").css("background-color",$("#w_header_bg_color").val());}
else if(w_field=="w_header_color"){$("#pv_header_b").css("color",$("#w_header_color").val());$("#pv_footer_b").css("color",$("#w_header_color").val());$("#pv_footer_link").css("color",$("#w_header_color").val());}
else if(w_field=="w_content_bg_color"){$("#pv_content_b").css("background-color",$("#w_content_bg_color").val());}
else if(w_field=="w_content_color"){$("#pv_content_b").css("color",$("#w_content_color").val());}
else if(w_field=="w_link_color"){$("[w_pv='link']").css("color",$("#w_link_color").val());$("[w_pv='text'] a").css("color",$("#w_link_color").val());}
rtmix.widget_gen_code(rtmix.w_wid,rtmix.w_cid);}
rtmix.font_to_family=function(font_name){if(font_name=="arial")
return'arial, helvetica, sans-serif';else if(font_name=="courier new")
return'"courier new", courier, sans-serif';else if(font_name=="georgia")
return'georgia, times, serif';else if(font_name=="helvetica")
return'helvetica, arial, sans-serif';else if(font_name=="times new roman")
return'"times new roman", times, serif';else if(font_name=="lucida grande")
return'"lucida grande", helvetica, arial, sans-serif';else if(font_name=="trebuchet ms")
return'"trebuchet ms", helvetica, arial, sans-serif';else if(font_name=="verdana")
return'verdana, helvetica, arial, sans-serif';else
return'impact';}
rtmix.analytics_get_stats=function(tab,tid,code){var param={};param.action_jsonp="analytics_get_stats";param.tab=tab;param.tid=tid;param.code=code;rtmix.jsonp_send(param,rtmix.analytics_get_stats_process);}
rtmix.analytics_get_stats_process=function(ret,param){if(ret.status=="OK"){$("#analytics_b_"+param.tid+param.code).html(ret.html);$("#analytics_b_"+param.tid+param.code).show();}
else if(ret.status=="INVALID_PERMISSION"){}
else{$("#analytics_b_"+param.tid+param.code).html('<div style="color:#ff0000">'+ret.error+'</div>');$("#analytics_b_"+param.tid+param.code).show();}}
rtmix.analytics_get_more=function(tab,more_uri,current_page){param={};param.action_jsonp="analytics_get_more";param.tab=tab;param.more_uri=more_uri;param.current_page=current_page;param.next_page=current_page+1;$("#channel_more_link_"+current_page).hide();$("#channel_more_loader_"+current_page).show();rtmix.jsonp_send(param,rtmix.analytics_get_more_process);}
rtmix.analytics_get_more_process=function(ret,param){$("#channel_more_link_"+param.current_page).show();$("#channel_more_loader_"+param.current_page).hide();if(ret.status=="OK"){$("#channel_more_"+param.current_page).hide();$("#channel_next_"+param.current_page).after(ret.html);}}
rtmix.promote_tweet=function(){rtmix.dialog_open("#d_twit_new_tweet_promote");rtmix.promote_tweet_new_message();}
rtmix.promote_tweet_new_message=function(){n_mesg=rtmix.promote_mesg.length;i_mesg=Math.floor(Math.random()*(n_mesg));$("#new_tweet_dialog_text_promote_tweet").val(rtmix.promote_mesg[i_mesg]);rtmix.text_counter('#new_tweet_dialog_text_promote_tweet',140);}
rtmix.promote_mesg=new Array("TwitIQ just changed my Twitter Life - http://TwitIQ.com","Just about the Best Twitter Client out there http://TwitIQ.com","Awesome inline viewing of images and video with this Twitter client http://TwitIQ.com","One Twitter Client to rule them all - http://TwitIQ.com","Cool website for Syndicating Tweets as Channels http://TwitIQ.com","Want to Publish Tweets as Widgets? Check out http://TwitIQ.com","Cool integrated Search for Searching Twitter, News, and Blogs http://TwitIQ.com","Accept no Substitutes - You gotta check out http://TwitIQ.com","Nobody paid me to say this, but TwitIQ is really Cool - http://TwitIQ.com","Forget what all those A-List Bloggers say, TwitIQ is THE way to Tweet - http://TwitIQ.com","I've tried them all but I keep coming back to TwitIQ for Twitter - http://TwitIQ.com","You haven't really used Twitter until you try TwitIQ - http://TwitIQ.com","Nothing like TwitIQ in the Mornings to track what's happening - http://TwitIQ.com","Help! I'm addicted to Twitter and TwitIQ just took it to the next Level - http://TwitIQ.com");rtmix.ad_click=function(adid,channel,source){param={};param.action_jsonp="ad_click";param.adid=adid;param.source=source;param.channel=channel;rtmix.jsonp_send(param,rtmix.ad_click_process);}
rtmix.ad_click_process=function(ret,param){}