/* // +----------------------------------------------------------------------+ // | 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 = "Einen Moment Geduld bitte ..."; // 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 rssLiveReq = new XMLHttpRequest(); } 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 if (document.documentElement && typeof document.documentElement.style.maxHeight!="undefined") { // IE 7 } 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; } } /* * (c)2006 Dean Edwards/Matthias Miller/John Resig * Special thanks to Dan Webb's domready.js Prototype extension * and Simon Willison's addLoadEvent * * For more info, see: * http://dean.edwards.name/weblog/2006/06/again/ * http://www.vivabit.com/bollocks/2006/06/21/a-dom-ready-extension-for-prototype * http://simon.incutio.com/archive/2004/05/26/addLoadEvent * * Thrown together by Jesse Skinner (http://www.thefutureoftheweb.com/) * * * To use: call addDOMLoadEvent one or more times with functions, ie: * * function something() { * // do something * } * addDOMLoadEvent(something); * * addDOMLoadEvent(function() { * // do other stuff * }); * */ function addDOMLoadEvent(func) { if (!window.__load_events) { var init = function () { // quit if this function has already been called if (arguments.callee.done) return; // flag this function so we don't do the same thing twice arguments.callee.done = true; // kill the timer if (window.__load_timer) { clearInterval(window.__load_timer); window.__load_timer = null; } // execute each function in the stack in the order they were added for (var i=0;i < window.__load_events.length;i++) { window.__load_events[i](); } window.__load_events = null; }; // for Mozilla/Opera9 if (document.addEventListener) { document.addEventListener("DOMContentLoaded", init, false); } // for Internet Explorer /*@cc_on @*/ /*@if (@_win32) document.write("<\/scr"+"ipt>"); var script = document.getElementById("__ie_onload"); script.onreadystatechange = function() { if (this.readyState == "complete") { init(); // call the onload handler } }; /*@end @*/ // for Safari if (/WebKit/i.test(navigator.userAgent)) { // sniff window.__load_timer = setInterval(function() { if (/loaded|complete/.test(document.readyState)) { init(); // call the onload handler } }, 10); } // for other browsers window.onload = init; // create event function stack window.__load_events = []; } // add function to event stack window.__load_events.push(func); } addDOMLoadEvent(rssLiveReqInit);