/* // +----------------------------------------------------------------------+ // | Orginial Code Care Of: | // +----------------------------------------------------------------------+ // | Copyright (c) 2004 Bitflux GmbH | // +----------------------------------------------------------------------+ // | Licensed under the Apache License, Version 2.0 (the "License"); | // | you may not use this file except in compliance with the License. | // | You may obtain a copy of the License at | // | http://www.apache.org/licenses/LICENSE-2.0 | // | Unless required by applicable law or agreed to in writing, software | // | distributed under the License is distributed on an "AS IS" BASIS, | // | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | // | implied. See the License for the specific language governing | // | permissions and limitations under the License. | // +----------------------------------------------------------------------+ // | Author: Bitflux GmbH | // | http://blog.bitflux.ch/p1735.html | // +----------------------------------------------------------------------+ // +----------------------------------------------------------------------+ // | Heavily Modified by Jeff Minard (07/09/04) | // +----------------------------------------------------------------------+ // | Author: Jeff Minard | // | http://www.creatimation.net | // +----------------------------------------------------------------------+ // +----------------------------------------------------------------------+ // | Heavily Modified by Jonas Rabbe (2005-05-08) | // +----------------------------------------------------------------------+ // | Author: Jonas Rabbe | // | http://www.jonas.rabbe.com | // +----------------------------------------------------------------------+ // +----------------------------------------------------------------------+ // | Heavily Modified Again by Rob Sable (05/10/05) | // +----------------------------------------------------------------------+ // | Author: Rob Sable | // | http://www.wilshireone.com | // +----------------------------------------------------------------------+ */ var rssLiveReq = false; var rssLiveReqLast = "-"; var rssYear = 0; var rssMonth = 0; var rssIsIE = false; var rssLoadingMsg = "Loading Article Archives..."; // on !IE we only have to initialize it once if (window.XMLHttpRequest) { rssLiveReq = new XMLHttpRequest(); } function rssLiveReqDoReq(query) { if (rssLiveReqLast != query) { if (rssLiveReq && rssLiveReq.readyState < 4) { rssLiveReq.abort(); } if (window.XMLHttpRequest) { // branch for IE/Windows ActiveX version } else if (window.ActiveXObject) { rssLiveReq = new ActiveXObject("Microsoft.XMLHTTP"); } rssLiveReq.onreadystatechange = rssLiveReqProcessReqChange; rssLiveReq.open("GET", "?larch=1&" + query); rssLiveReqLast = query; rssLiveReq.send(null); } } function rssLiveReqProcessReqChange() { if (rssLiveReq.readyState == 4) { try { var loadingDiv = document.getElementById('rssLiveArchiveLoading'); loadingDiv.style.display = 'none'; var rssText = rssLiveReq.responseText; var resultID = rssText.substring(0, rssText.indexOf('|')); rssText = rssText.substring(rssText.indexOf('|') + 1, rssText.length); document.getElementById(resultID).innerHTML = rssText; var year_list = document.getElementById(resultID+'-year').childNodes; for( var i = 0; i < year_list.length; i++ ) { if( year_list[i].nodeName == 'LI' ) { year_list[i].style.cursor = 'pointer'; var tf = function(e) { var rssID = rssEventElement(e).id; rssYear = rssID.substring(rssID.lastIndexOf('-') + 1, rssID.length); rssSelectYear(); } if( rssIsIE ) { year_list[i].attachEvent('onclick',tf); } else { year_list[i].addEventListener('click', tf, false); } } } var month_list = document.getElementById(resultID+'-month').childNodes; for( var i = 0; i < month_list.length; i++ ) { if( month_list[i].nodeName == 'LI' ) { month_list[i].style.cursor = 'pointer'; var tf = function(e) { var rssID = rssEventElement(e).id; rssMonth = rssID.substring(rssID.lastIndexOf('-') + 1, rssID.length); rssSelectMonth(); } if( rssIsIE ) { month_list[i].attachEvent('onclick',tf); } else { month_list[i].addEventListener('click', tf, false); } } } } catch (exception) { } } } function rssLiveReqInit() { if (navigator.userAgent.indexOf("Safari") > 0) { // branch to get to internet explorer } else if (navigator.product == "Gecko") { // branch to get to internet explorer } else { rssIsIE = true; } var notlive = document.getElementById('notlive'); var newDiv = document.createElement('div'); newDiv.id = 'rssLiveArchiveLoading'; newDiv.style.display = 'none'; newDiv.innerHTML = rssLoadingMsg; newDiv.style.display = 'block'; try { document.getElementById('livearchives').appendChild(newDiv); document.getElementById('livearchives').removeChild(notlive); } catch (exception) { } rssLiveReqDoReq(''); } function rssSelectYear() { rssLiveReqDoReq('year=' + rssYear); } function rssSelectMonth() { rssLiveReqDoReq('year=' + rssYear + '&month=' + rssMonth); } function rssEventElement(e) { if( rssIsIE ) { return e.srcElement; } else { return e.currentTarget; } } function addrssLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { oldonload(); func(); } } } addrssLoadEvent(function() { rssLiveReqInit(); });