﻿
Type.registerNamespace("PlainJoeStudios.MediaSocial.WebServer.Controls");var g_Countdown=null;PlainJoeStudios.MediaSocial.WebServer.Controls.Countdown=function(parameters){this.Ctor(parameters);};PlainJoeStudios.MediaSocial.WebServer.Controls.Countdown.prototype={SWF_URL:"/Flash/countdown.swf",TIMER_STATE_COUNTING:"c",TIMER_STATE_ONLINE:"l",TIMER_STATE_HIDDEN:"h",_jqApplet:null,_jqAppletParent:null,Ctor:function(params){var This=this;var rootId=params.RootId;var liveInText=params.LiveInText;var liveNowText=params.LiveNowText;swfobject.embedSWF(This.SWF_URL,rootId,"206","74","9.0.124",false,{livenowlink:"",start:null,time:null,liveintext:liveInText,livenowtext:liveNowText},{wmode:"transparent"},{"class":"headercountdown"});This._jqApplet=$("#"+rootId);This._jqAppletParent=This._jqApplet.parent();g_Countdown=This;},ShowLiveNow:function(){var This=this;this._jqAppletParent.show();if(this.IsFlashLoaded()){window.setTimeout(function(){This._jqApplet[0].js_ShowLiveNow();},100);return;}
window.setTimeout(function(){This.ShowLiveNow();},200);},ShowCountingDown:function(now,next){var This=this;this._jqAppletParent.show();if(typeof(now)!=="number"){now=now.getTime();}
if(typeof(next)!=="number"){next=next.getTime();}
if(this.IsFlashLoaded()){window.setTimeout(function(){This._jqApplet[0].js_ShowCountdown(now/1000,next/1000);},100);return;}
window.setTimeout(function(){This.ShowCountingDown(now,next);},200);},Hide:function(){this._jqAppletParent.hide();},IsFlashLoaded:function(){if(typeof(this._jqApplet[0]["js_ShowLiveNow"])!=="undefined"){return true;}
this._jqApplet=$(this._jqApplet.selector);if(typeof(this._jqApplet[0]["js_ShowLiveNow"])!=="undefined"){return true;}
return false;}};