var IFrameObj; // our IFrame object function callToServer() { if (!document.createElement) {return true}; var IFrameDoc; var URL = 'mapserver2.php?filter='; if (!IFrameObj && document.createElement) { // create the IFrame and assign a reference to the // object to our global variable IFrameObj. // this will only happen the first time // callToServer() is called var tempIFrame=document.createElement('iframe'); tempIFrame.setAttribute('id','RSIFrame'); tempIFrame.style.border='0px'; tempIFrame.style.width='0px'; tempIFrame.style.height='0px'; IFrameObj = document.body.appendChild(tempIFrame); if (document.frames) { // this is for IE5 Mac, because it will only // allow access to the document object // of the IFrame if we access it through // the document.frames array IFrameObj = document.frames['RSIFrame']; } } if (navigator.userAgent.indexOf('Gecko') !=-1 && !IFrameObj.contentDocument) { // we have to give NS6 a fraction of a second // to recognize the new IFrame setTimeout('callToServer()',10); return false; } if (IFrameObj.contentDocument) { // For NS6 IFrameDoc = IFrameObj.contentDocument; } else if (IFrameObj.contentWindow) { // For IE5.5 and IE6 IFrameDoc = IFrameObj.contentWindow.document; } else if (IFrameObj.document) { // For IE5 IFrameDoc = IFrameObj.document; } else { return true; } IFrameDoc.location.replace(URL); return false; } function startTimers() { callToServer(); timer=setTimeout('reloadThePage()',60000); } function reloadThePage() { callToServer(); timer=setTimeout('reloadThePage()',60000); } function urlencode(str) { return escape(str).replace(/\+/g,'%2B').replace(/%20/g, '+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40'); } // handleResponse is passed two parameters when called from the onload // event of the pages loaded in the hidden IFRAME: // st: a string indicating which state is being loaded // doc: the document object of the page loaded in the IFRAME function handleResponse(doc) { var mapdiv = document.getElementById('slothmap'); var mapimage = document.getElementById('mapimage'); var dataEl = doc.getElementById('datadiv'); // first remove all dynamically created images var namesColl = mapdiv.childNodes; var numNames = namesColl.length; var q = 0; while(q < numNames) { if (namesColl[q].id == 'circle') { mapdiv.removeChild(namesColl[q]); namesColl = mapdiv.childNodes; numNames = namesColl.length; q = 0; } else { q = q+1; } } namesColl = dataEl.childNodes; numNames = namesColl.length; var imgname; // now add in all the images required by the retrieved data for (q=0; q 0) text = text + '
'; text = text + contents[i].innerHTML; } } el.onmouseover = Function('overlib("' + text + '", CAPTION, "' + title + '")'); el.onmouseout = Function('nd()'); mapdiv.appendChild(el); } } }