//////////////////////////////////////////////////////////////////// Web Rockstars Speedy Feed Reader// --------------------------------------------------------------// Published at dmxzone.com// Author: Aarron Walter, http://aarronwalter.com// File: ajaxRSS.js//// Requires the use of Prototype (http://prototype.conio.net/)//////////////////////////////////////////////////////////////////// Create an event listener to initialize the Ajax call to the serverEvent.observe(window, 'load', initRSS, false);// Initialize RSS feed readerfunction initRSS() {  if (document.getElementsByTagName) {    var divs = document.getElementsByTagName("div");    for (var i=0; i < divs.length; i++) {		if (divs[i].className == "loadingfeed") {		  getFeed(divs[i].getAttribute("title"),divs[i].getAttribute("id"));        };    }  }}// Fetch parsed RSS using Ajax, and refresh every minutefunction getFeed(params,boxId) {  // Update user interface with loading animation  $(boxId).innerHTML = '<center><img src="i/loading.gif" alt="Зареждане на RSS канал..." class="loading" /></center>';    // Prepare GET variables needed for PHP to parse RSS (split into an array)  splitParams = params.split(',.,');  var pars = 'url=' + escape(splitParams[0])+'&numHeadlines='+escape(splitParams[1]);  // Go-go gadget Ajax call using Prototype  var myAjax = new Ajax.Updater(boxId, 'parse_rss.php', {method: 'get', parameters: pars});  // Auto-update feeds every minute (300 seconds)  var MyAjaxUpdater = new Ajax.PeriodicalUpdater(boxId, 'parse_rss.php', {method:'get', parameters:pars, asynchronous:true, frequency:300});}
