var SBTBrasilia = { config: { sbt_u:'http://api.sbt.com.br', sbt_v:'1.5.0', sbt_k:'AE8C984EECBA4F7F835C585D5CB6AB4B', diretorio:'tv/brasilia/sbtbrasilia', cod_site:'139', sbt_idS_Videos:'211', sbt_idS:'244', sbt_idSA_Home:'1228', sbt_idSA_Videos:'1068', sbt_idSA_Sobre:'1229', sbt_idSA_Apresentador:'1230', sbt_idP_Mediabox:'', sbt_idp_Destaques:'4058', sbt_idP_Videos:'4057', sbt_idP_VideoRegional: '357', sbt_idP_ChannelRegional: '3451', }, getPgmHorario: function(container, site){ SBTAPI.getProgram('showtimes',{ id:site, limit:1, sort:"desc" },function(json){ var retorno; if( json.programs ){ var showtimes = json.programs[0].showtimes; var horarios = showtimes; if( showtimes != '' ){ showtimes = showtimes.split(" - "); if(Array.isArray(showtimes) && showtimes.length > 1){ var itemDiario; for(i=0;i < showtimes.length;i++){ itemDiario = showtimes[i].split('|'); if(itemDiario.length == 2){ $(container).append('
'+ itemDiario[0] +'|'+ itemDiario[1] +'
'); } } }else{ $(container).append('
'+ horarios +'
'); } } } },{v: this.config.sbt_v,u: this.config.sbt_u,k: this.config.sbt_k}); }, getDestaqueTopo: function(container){ var config = this.config; SBTAPI.getMedia('title,author,image,description',{ idsite: this.config.sbt_idS, idSiteArea: this.config.sbt_idSA_Home, idplaylist: this.config.sbt_idp_Destaques, limit:100, orderBy:"ordem", sort:"desc" },function(json){ if( json.medias ){ var title, lnk, img; var cssmargin = ''; $.each(json.medias, function(i,item){ title = item.title; lnk = item.author; img = item.image; desc = item.description; $(".destaqueTopo").append('
'+ title +'

'+ title +'

'+ desc +'

'); }); if(json.medias.length == 1){ $('.destaqueTopo .slidesjs-pagination').hide(); $('.destaqueTopo h3').hide(); $('.destaqueTopo p').hide(); }else{ $(".destaqueTopo").slidesjs({height: 315, navigation:{ active:true, effect:"fade" }}); } } },{v: this.config.sbt_v,u: this.config.sbt_u,k: this.config.sbt_k}); }, getVideosHome: function(){ var config = this.config; SBTAPI.getVideo('id,thumbnailsite,thumbnail,title',{ program:this.config.sbt_idP_VideoRegional, category:this.config.sbt_idP_ChannelRegional, limit:20, orderBy:"publishdate", sort:"desc" },function(json){ if( json.videos ){ var idMedia, titleMedia, thumbMedia, linkVideo; $.each(json.videos, function(i,item){ idMedia = item.id; titleMedia = item.title; thumbMedia = (item.thumbnailsite == '')?item.thumbnail:item.thumbnailsite; linkVideo = SBTAPI.makeLinkPageHTML ('http://www.sbt.com.br/'+ config.diretorio +'/sbtvideos/categoria/0/', idMedia, titleMedia); $("
  • ").addClass("BOX W222 H127 POSREL OH").append('
    ').appendTo(".ContentVideos ul"); if(i == (json.videos.length-1)){ $('.playlistVideos .carousel-navigation').jcarousel(); $('.playlistVideos .prev-navigation') .on('jcarouselcontrol:active', function(){$(this).removeClass('inactive');}) .on('jcarouselcontrol:inactive', function(){$(this).addClass('inactive');}) .jcarouselControl({target: '-=5'}); $('.playlistVideos .next-navigation') .on('jcarouselcontrol:active', function(){$(this).removeClass('inactive');}) .on('jcarouselcontrol:inactive', function(){$(this).addClass('inactive');}) .jcarouselControl({target: '+=5'}); } }); } },{v: config.sbt_v,u: config.sbt_u,k: config.sbt_k}); }, getSobre: function(container){ var config = this.config; SBTAPI.getMedia('title,description',{ idsite: this.config.sbt_idS, idSiteArea: this.config.sbt_idSA_Sobre, limit:1, orderBy:"ordem", sort:"desc" },function(json){ if( json.medias ){ var title, lnk; $.each(json.medias, function(i,item){ title = item.title.toString(); desc = item.description.toString(); $(".DescriptionProgram").append('

    '+ title +'

    '+ desc +'
    '); return false; }); } },{v: this.config.sbt_v,u: this.config.sbt_u,k: this.config.sbt_k}); }, getApresentador: function(container){ var config = this.config; SBTAPI.getMedia('title,description,author,image',{ idsite: this.config.sbt_idS, idSiteArea: this.config.sbt_idSA_Apresentador, limit:2, orderBy:"ordem", sort:"desc" },function(json){ if( json.medias ){ var title, desc, thumb, nameap; $.each(json.medias, function(i,item){ desc = item.description.toString(); nameap = item.title.toString(); imagem = item.image; $(".DescriptionApresentador").append('

    '+ nameap +'

    '+ desc +''); }); } },{v: this.config.sbt_v,u: this.config.sbt_u,k: this.config.sbt_k}); } }