$(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); }); //ER Feed function autoupdate(){ $("#pubdate").empty(); $("#time1").empty(); $("#time2").empty(); $("#time3").empty(); $.ajax({ type: "GET", url: "/cpm/rss/rss_feed.xml", dataType: "xml", success: function(xml){ var hospital = $(xml).find("item:eq(0)").find("description").text(); var hospital2 = $(xml).find("item:eq(1)").find("description").text(); var hospital3 = $(xml).find("item:eq(2)").find("description").text(); var pub = $(xml).find("item:eq(0)").find("pubDate").text(); $("#pubdate").append(pub); $("#time1").append(hospital+' Trident'); $("#time2").append(hospital2+' Summerville'); $("#time3").append(hospital3+' Moncks Corner'); } }); }