$(function(){ //remove theme stylesheet /* document.getElementsByTagName("link")[0].setAttribute("href",""); */ var deviceBB = "blackberry"; var uagent = navigator.userAgent.toLowerCase(); if ($(document).getUrlParam("redirect")=="mobile"){ /*Do nothing*/ } else { if(navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i)){ window.location = "http://m.nfrmc.com/"; } else if(navigator.userAgent.match(/iPad/i)){ /*Nada*/; } else if(uagent.search(deviceBB) > -1){ window.location = "http://m.nfrmc.com"; } } //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(); $.ajax({ type: "GET", url: "/cpm/rss/rss_feed.xml", dataType: "xml", success: function(xml){ var hospital = $(xml).find("item:eq(10)"); var pub = hospital.find("pubDate").text(); var wait = hospital.find("description").text(); if(wait == '---'){ $("#er-wait span.headline").empty(); $("#pubdate").css("display","none"); $("#wait-time").css("display","none"); $("span.headline").append('Currently updating ER Wait Time') }else{ $("#pubdate").append(pub); $("#wait-time").append(wait); } } }); }