$(document).ready(function(){SI.register("SI.UI.Controls.Topics.Animation","Topics.Animation",function()
{var topics_list=$$.get("topics_list");var topics=[].fill($$.getByTagName("li",topics_list));var topics_width=[];$$.foreach(topics,function(topic){topics_width.push(UI.Dimensions.width(topic));});return{pause:function()
{$("#topics_list").stop();},resume:function()
{$("#topics_list").animate({left:'-=400'},10000,'linear',function(){while(Math.abs(topics_list.style.left.toInt())>topics_width.first())
{$$.appendChild(topics_list,topics[0]);topics_list.style.left=(topics_list.style.left.toInt()+topics_width.first())+"px";topics.push(topics.shift());topics_width.push(topics_width.shift());}
Topics.Animation.resume();});}};}());SI.register("SI.UI.Video","UI.Video",function()
{return{watch:function()
{SI.get("video_container").innerHTML="<object id=\"video_object\" width=\"640\" height=\"505\"><param name=\"movie\" value=\"http://www.youtube.com/v/xpPQD-m6tkY&hl=en_US&fs=1&rel=0&color1=0xe1600f&color2=0xfebd01\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/xpPQD-m6tkY&hl=en_US&fs=1&rel=0&color1=0xe1600f&color2=0xfebd01\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"640\" height=\"505\"></embed></object>";SI.Vis.show("video");}};}());Topics.Animation.resume();$("#post_input").expandable({within:2,by:1});$(".answer").expandable({within:1,by:1});SI.get("post_input").focus();Controls.Dialog.init("topics_dialog",{type:Controls.Dialog.TYPE_BOX,content:"topics_dialog_content",modal:true,width:"590px",outEffect:Controls.Dialog.EFFECT_FADE,buttons:[{id:"cancel",label:"Cancel",type:Controls.Button.TYPE_CANCEL,onclick:function(e){}},{id:"ask",label:"Ask",type:Controls.Button.TYPE_SUBMIT,handlers:{validate:function(e,s){s.topics=SI.getByAttribute([{name:"name",value:"topic[]"},{name:"checked",value:true}],"input","topics_dialog");if(!SI.isNotEmptyArrayOrNodeList(s.topics))
{Controls.Dialog.error('Please select one of the topics first.',{title:'No Topic'});return false;}
return true;},process:function(e,s){var data=[];SI.foreach(s.topics,function(topic){data.push({name:"topic[]",value:topic.value});});Post.Publish.post(data,"recent");}}}]});});

