$(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();
$("#wait-time").empty();
var hospital ='';
$.ajax({
type: "GET",
url: "/cpm/rss/wfl_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()+'

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