function onVideoStartPlaying(A){$("viewCount").fade({duration:1,from:0.1,to:1});$("viewCount").update(parseInt($("viewCount").innerHTML,10)+1)}ComCore.Queuer.add(function(){if($("swf")){var C=$("swf").value;var B=new FlashObject(C,"video_player_swf",$("width").value,$("height").value,"7","#fff");B.addParam("allowScriptAccess","always");B.addParam("FlashVars",$("FlashVars").value);B.addParam("menu","false");B.addParam("allowFullScreen","true");B.addParam("wmode","opaque");B.write("video_player");if($("source")){$("source").toggle()}if($("addFavoriteVideo")&&$("deleteFavoriteVideo")){var G=$("addFavoriteVideo").getElementsByTagName("a")[0];if(G){Event.observe(G,"click",function(L){$("addFavoriteVideo").addClassName("loading");var K=$("videoID").value;var I=$("distro").value;var H=ComCore.Page.buildAjaxURL("videos","addFavorite")+"&videoID="+K+"&distro="+I;var J=new Ajax.Request(H,{method:"get",onSuccess:function(N){if(N.responseText.evalJSON()=="1"){$("addFavoriteVideo").removeClassName("loading");$("addFavoriteVideo").hide();$("deleteFavoriteVideo").show();var M=parseInt($$("#fanCount a")[0].innerHTML,10);if(M>-1){$$("#fanCount a")[0].fade({duration:1,from:0.1,to:1});$$("#fanCount a")[0].update(M+1)}}}});Event.stop(L)})}var A=$("deleteFavoriteVideo").getElementsByTagName("a")[0];if(A){Event.observe(A,"click",function(L){$("deleteFavoriteVideo").addClassName("loading");var K=$("videoID").value;var I=$("distro").value;var H=ComCore.Page.buildAjaxURL("videos","deleteFavorite")+"&videoID="+K+"&distro="+I;var J=new Ajax.Request(H,{method:"get",onSuccess:function(N){if(N.responseText.evalJSON()=="1"){$("deleteFavoriteVideo").removeClassName("loading");$("deleteFavoriteVideo").hide();var M=parseInt($$("#fanCount a")[0].innerHTML,10);if(M>0){$$("#fanCount a")[0].fade({duration:1,from:0.1,to:1});$$("#fanCount a")[0].update(M-1)}$("addFavoriteVideo").show()}}});Event.stop(L)})}}}if($("toggleUserVideos")){var E=$("toggleUserVideos").getElementsByTagName("a")[0];var D=$("toggleRelatedVideos").getElementsByTagName("a")[0];if(E){Event.observe(E,"click",function(H){$("relatedVideos").hide();$("toggleRelatedVideos").removeClassName("active");$("userVideos").show();$("toggleUserVideos").addClassName("active");Event.stop(H)})}if(D){Event.observe(D,"click",function(H){$("userVideos").hide();$("toggleUserVideos").removeClassName("active");$("relatedVideos").show();$("toggleRelatedVideos").addClassName("active");Event.stop(H)})}}var F=new ComCore.Controls.Comments("commentsWrapper")});