/*********************************************** * Dynamic Ajax Content- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code ***********************************************/ var bustcachevar = 1;//bust potential caching of external pages after initial request? (1=yes, 0=no) var loadedobjects = ""; var rootdomain = "http://" + window.location.hostname; var bustcacheparameter = ""; var OSSI_ID_LABEL = "toggle-ssi"; var OSSI_ID_CONTENT = "ssi-content"; var OSSI_LABEL_TXT = "SERVICE STATUS"; //Run //var OSSI_DIV_ID = "ajaxBlock"; //refreshData(URL_OSSI_level1,OSSI_level1_div_id, null); setInterval('refreshData(URL_OSSI_level1,OSSI_level1_div_id, null);', OSSI_LEVEL1_TIME_INTERVAL); //setTimeout('refreshData(URL_OSSI_level1,OSSI_level1_div_id, null);', 1000); var ossiLabelCycle = 0; runOssiLabelCycle(100);//start fast function ajaxpage(url, containerid, dataTableId) { var page_request = false if (window.XMLHttpRequest)// if Mozilla, Safari etc { page_request = new XMLHttpRequest() } else if (window.ActiveXObject) { // if IE try { page_request = new ActiveXObject("Msxml2.XMLHTTP") } catch (e) { try { page_request = new ActiveXObject("Microsoft.XMLHTTP") } catch (e) { } } } else { return false; } page_request.onreadystatechange = function () { loadpage(page_request, containerid, dataTableId); } if (bustcachevar)//if bust caching of external page { bustcacheparameter = (url.indexOf("?") != - 1) ? "&NOCACHE_TS=" + new Date().getTime() : "?NOCACHE_TS=" + new Date().getTime(); } page_request.open('GET', url + bustcacheparameter, true); page_request.send(null); } //Loads a remote HTML page into a DIV, given an ID function loadpage(page_request, containerid, dataTableId) { if (page_request.readyState == 4 && (page_request.status == 200 || window.location.href.indexOf("http") == - 1)) { //Get the current URL var url = new String(window.location); var bIsLevel3Table = dataTableId != null; var bIsPopupStandalone = url.indexOf('refresh.html') != -1; var bodyContent = page_request.responseText; var bodyTag = ""; var bodyTagEND = ""; var hasBody = bodyContent.indexOf(bodyTag)!==-1; //Only BODY content if(hasBody && !bIsLevel3Table && !bIsPopupStandalone && bodyContent){ bodyContent = bodyContent.substring(bodyContent.indexOf(bodyTag) + bodyTag.length, bodyContent.indexOf(bodyTagEND)); } //if(bodyContent == null) return; //alert("bodyContent: "+bodyContent);//.getElementsByTagName("body") if(0){ document.getElementById(containerid).innerHTML = bodyContent; }else{ $('#'+containerid).html(bodyContent); } if (bIsLevel3Table) { //It's an OSSI Level 3 table //Set the default view after the page has been fully loaded setupLevel3DefaultView('radiobutton1', 'radiobutton2', dataTableId, containerid); } else { if (bIsPopupStandalone) { //It's either OSSI Level 1 or OSSI Level 2 called to open a standalone popup window var theDivElement = document.getElementById(containerid); //Get all the anchors found under this DIV element var theLinks = theDivElement.getElementsByTagName('a'); //Loop through the links and set 'target' attribute to "_blank" so that it will open in a new window for (var i = 0;i < theLinks.length;i++) { if (theLinks[i].parentNode.className == 'OSSILegend') { //Do not update the target for the Legend element, since there is a Javascript call in the href attribute } else { theLinks[i].target = '_blank'; } } } else { //It's either OSSI Level 1 or OSSI Level 2 called from a "normal" page //NOOP } } } } //This function refreshes the data function refreshData(url, div, dataTableId) { ajaxpage(url, div, dataTableId); } //Updates the radioButton settings and the Table View function setupLevel3DefaultView(radioButtonOneID, radioButtonTwoID, dataTableID, OSSI_level3_div_id) { if (document.getElementById(radioButtonOneID) && document.getElementById(radioButtonTwoID) && document.getElementById(dataTableID)) { //TODO: Depending on a cookie value, update the button to show ALL or NON-NOMINAL theDisplayOptionFromCookie = getOSSILevel3DisplayOption(); if (theDisplayOptionFromCookie == 'ALL') { document.getElementById(radioButtonOneID).checked = true; document.getElementById(radioButtonOneID).click(); } else if (theDisplayOptionFromCookie == 'NONNOMINAL') { document.getElementById(radioButtonTwoID).checked = true; document.getElementById(radioButtonTwoID).click(); } } } function runOssiLabelCycle(intv){ //checkPrependLabel(); ossiLabelCycle = setInterval("checkPrependLabel()", intv); } function checkPrependLabel(){ var ssiLabelObject = document.getElementById(OSSI_ID_LABEL); var ssiContentObject = document.getElementById(OSSI_ID_CONTENT); if(ssiLabelObject){ //Nothing todo - OR hidden? if( $('#'+OSSI_ID_LABEL).is(':hidden') ){ //alert("Label bar is there - gonna unhide"); $('#'+OSSI_ID_LABEL).show();//ultimate goal //clearInterval(ossiLabelCycle); } }else if(ssiContentObject){ //alert("Inserting"); drawOSSILabelBar(); clearInterval(ossiLabelCycle); runOssiLabelCycle(300);//continue slow } } function drawOSSILabelBar(){ var myH2 = document.createElement("h2"); var idName = document.createAttribute("id"); idName.nodeValue = OSSI_ID_LABEL; myH2.setAttributeNode(idName); var myText = document.createTextNode(OSSI_LABEL_TXT); myH2.appendChild(myText); $('#'+OSSI_ID_CONTENT).before(myH2);//"

SERVICE STATUS

" }