$(function(){ //Banner rotate $('#fadeshow').cycle({ fx: 'fade', speed: 1000, timeout: 6000, pause: 1 }); //Refreshes ER Feed content every 5 mins autoupdate(); setInterval("autoupdate()", 300 * 1000); //Video homepage scroll $.ajax({ type: "GET", url: "/cpm/playlist-east.xml", dataType: "xml", success: function(xml){ //Video Scroller var api = $("div.scrollable").scrollable(); $(xml).find("item:lt(8)").each(function(){ var cats = []; $(this).find("category").each(function(){ cats.push($(this).text()); }); var link = $(this).find('link').text(); var scroller = '' +'' +'
'+$(this).find("title").text()+'
'; api.getItemWrap().append(scroller); api.reload().next(0); /*Market filter var filter = $.inArray('division', cats) > -1; if(filter){ api.getItemWrap().append(scroller); api.reload().next(0); } */ }); $("div.scrollable").scrollable().begin(); } }); $("#browsable").scrollable({size: 2}).navigator(); var present = $(document).getUrlParam("id"); $.ajax({ type: "GET", url: "/cpm/playlist-east.xml", dataType: "xml", success: function(xml){ //Populate playlist $(xml).find("item:lt(15)").each(function(){ var cats = []; $(this).find("category").each(function(){ cats.push($(this).text()); }); var link = $(this).find('link').text(); var playItem = '
' +'' +'' +'
'+$(this).find("title").text()+'
' +'
' +'
'; $('.market').append(playItem); /* Market filter var market = $.inArray('division', cats) > -1; if(market) { $('.market').append(playItem); } */ }); //Check for URL ID or first video in RSS if($(document).getUrlParam("id") > 0){ ftitle = $(xml).find("item[id='"+present+"']").find("title").text(); ftext = $(xml).find("item[id='"+present+"']").find("description").text(); fsrc = $(xml).find("item[id='"+present+"']").find("[nodeName=media:content]").attr("url"); } else { var playtop = $(xml).find("item:first"); fsrc = playtop.find("[nodeName=media:content]").attr("url"); ftitle = playtop.find("title").text(); ftext = playtop.find("description").text(); } $('#vidtitle').html(ftitle); $('#videscr').html(ftext); //Embed flash player, ready to receive from the previous conditions $("#flashhere").flashembed("/cpm/videoplayer.swf", { specifiedFile: fsrc }); } }); }); //ER Feed function autoupdate(){ $("#pubdate").empty(); $("#wait-time").empty(); var hospital =''; $.ajax({ type: "GET", url: "/cpm/rss/rss_feed.xml", dataType: "xml", success: function(xml){ var pub = $(xml).find("item:first").find("pubDate").text(); $("#pubdate").append('As of '+pub); $(xml).find("item").each(function(){ var errorCheck = $(this).find("description").text(); if(errorCheck == '---'){ $("#wait-time").append(''+$(this).find("title").text()+'

'); $(".mobile-app").empty().append(' Currently updating the feed'); } else { $("#wait-time").append(''+$(this).find("title").text()+'
'+$(this).find("description").text()+'
'); } }); } }); }