function ScheduleWidget(i,j,f,h){var g;this.setScheduleID(i);this.setMediaURI(j);this.setNumRetrieve(f);this.setNumVisible(h);this.setPagerClicked(false);g=Byutv.applyMethod(this,this.loadItems);g();return this}ScheduleWidget.prototype={loadItems:function(){var h,n,j,i,k,l,m;h="{0}&count={1}".format(this.getMediaURI(),this.getNumRetrieve());n=this.getScheduleID();j=this;l=this.getNumVisible();i=Byutv.addLoader("#"+this.getScheduleID(),2);m="";$.ajax({url:h,dataType:"jsonp",success:function(f,g,z){var e;if(f===null){$("#"+n).html('<div class="no-result">No Results Returned</div>')}else{var d=f.Previous;var b=f.Current;var v=f.Future;var a,c,w;var x=100;var A="";var y;for(e=0;e<d.length;e+=1){a=d[e].Title;c=d[e].Description;w=new Date(d[e].Timestamp*1000).format("hh:nn AP");A=d[e].IsVideo?'<a href="{0}"><div class="blue-play"></div></a>'.format(d[e].Link):"";y=c.strsub(0,x);y='<span class="subtitle">{0}</span> {1}'.format(y.substring(0,y.indexOf("-")-1),y.substring(y.indexOf("-"),y.length));m+='<li class="hoverable previous">                                         <h3>{0}</h3>                                         <p title="{1}">{2}</p>                                         <div class="time">{3}</div>{4}                                         </li>                                     '.format(a,c,y,w,A)}a=b.Title;c=b.Description;w=new Date(b.Timestamp*1000).format("hh:nn AP");A=b.IsVideo?'<a href="{0}"><div class="blue-play"></div></a>'.format(b.Link):"";y=c.strsub(0,x);y='<span class="subtitle">{0}</span> {1}'.format(y.substring(0,y.indexOf("-")-1),y.substring(y.indexOf("-"),y.length));m+='<li class="hoverable current caroufredsel">                                     <h3>{0}</h3>                                     <p title="{1}">{2}</p>                                     <div class="time">{3}</div>                                     <div class="on-air"><span class="on">O<br />N</span><span class="air">A<br />I<br />R</span></div>{4}                                     </li>                                 '.format(a,c,y,w,A);for(e=0;e<v.length;e+=1){a=v[e].Title;c=v[e].Description;w=new Date(v[e].Timestamp*1000).format("hh:nn AP");A=v[e].IsVideo?'<a href="{0}"><div class="blue-play"></div></a>'.format(v[e].Link):"";y=c.strsub(0,x);y='<span class="subtitle">{0}</span> {1}'.format(y.substring(0,y.indexOf("-")-1),y.substring(y.indexOf("-"),y.length));m+='<li class="hoverable future">                                         <h3>{0}</h3>                                         <p title="{1}">{2}</p>                                         <div class="time">{3}</div>{4}                                         </li>                                     '.format(a,c,y,w,A)}m+='<li class="hoverable link full-schedule">                                       <h3><a id="full-schedule-link" href="{0}" alt="Full Schedule">View Full Schedule</a></h3>                                    </li>                                 '.format("/schedule");Byutv.killLoader(i);$("#"+n+" ul").append(m);k=new Ribbon({ribbonID:n,type:"Pre_Populated",vertical:true,numDisplay:l});$("#"+n+" ul").trigger("slideTo",[".current",-1]);j.setSchedule(k);j.setScheduleLoaded(true)}},error:function(a,c,b){Byutv.killLoader(i);$("#"+n).html('<div class="no-result">There was an error in retrieving content.</div>');Byutv.log({message:"Error in Schedule",code:"error",filename:"Schedule.js"})}})},setScheduleID:function(b){this.scheduleID=b},setMediaURI:function(b){this.mediaURI=b},setNumRetrieve:function(b){this.numRetrieve=b},setNumVisible:function(b){this.numVisible=b},setSchedule:function(b){this.schedule=b},setScheduleLoaded:function(b){this.ribbonLoaded=b},setPagerClicked:function(b){this.pagerClicked=b},getScheduleID:function(){return this.scheduleID},getMediaURI:function(){return this.mediaURI},getNumRetrieve:function(){return this.numRetrieve},getNumVisible:function(){return this.numVisible},getSchedule:function(){return this.schedule},getPagerClicked:function(){return this.pagerClicked},getScheduleLoaded:function(){return this.ribbonLoaded}};
