/** * Content * JavaScript file for CatholicIreland.net Streaming * Version 1 * Created 2013.05.09. * Created by Sandor Gera * All code copyright CatholicIreland.net * */ if(!(window.jQuery)) { var s = document.createElement("script"); s.setAttribute("src", "http://www.catholicireland.net/services/js/jquery.min.js"); s.setAttribute("type", "text/javascript"); document.getElementsByTagName("head")[0].appendChild(s); } // Get Parameters from the URL function getParameterByName(name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new RegExp("[\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); } window.onload = function(){ if (document.getElementById("cifeatures") ){ var s = document.createElement("script"); s.setAttribute("src", "http://www.catholicireland.net/services/js/features/?ID=82"); s.setAttribute("type", "text/javascript"); document.getElementsByTagName("head")[0].appendChild(s); } var link = window.location.href; paramtext = ""; feature = getParameterByName("feature"); ID = getParameterByName("ID"); // Show Today's readings if there is no parameter. if (feature=="" && ID==""){ feature = "today"; var divid = "cifeatures2"; } else if (feature=="sunday" && ID==""){ var divid = "cifeatures2"; } else if (feature=="reflection" && ID==""){ var divid = "cifeatures2"; } else if (feature=="today" && ID==""){ var divid = "cifeatures2"; } else if (feature=="saints-of-the-day" && ID==""){ var divid = "cifeatures2"; } lang = getParameterByName("lang"); if (lang!=""){ paramtext = "&lang="+lang; } if (document.getElementById(divid) && feature != "" ){ var s = document.createElement("script"); s.setAttribute("src", "http://www.catholicireland.net/services/js/features/?ID=82&feature="+feature+paramtext); s.setAttribute("type", "text/javascript"); document.getElementsByTagName("head")[0].appendChild(s); } }