var org = {p3k: ({url:"http://nowrunning.com/cgi-bin/rss/news_tamil.xml", xml:"<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n<rss version=\"2.0\" xmlns:media=\"http://search.yahoo.com/mrss/\">\n<channel>\n<title>tamil Entertainment News | India</title>\n<link>http://www.nowrunning.com/hindi/</link>\n<description>Visit nowrunning.com for round the clock entertainment news, movie reviews, broadband videos, movie trailers, bollywood parties, events pictures and Vvideos. Movie showtimes for USA, India and UAE</description>\n<language>en-gb</language>\n<lastBuildDate>Thu, 02 Sep 2010 12:39:56 GMT</lastBuildDate>\n<copyright>Copyright: (C) nowrunning.com, see http://www.nowrunning.com/include/privacy.asp for terms and conditions</copyright>\n<docs>http://www.nowrunning.com/rss.aspx</docs>\n<ttl>15</ttl>\n<image>\n<title>nowrunning.com</title>\n<url>http://www.nowrunning.com/images/Net/Common/logoWht.jpg</url>\n<link>http://www.nowrunning.com/rss.aspx</link></image>\n<item>\n<title>Little Bommi to globetrot in 2011  </title>\n<description>Bommi and her pals, Remba, Yip, Taco, Maya and Boris, are likely to take two city-based young entrepreneurs, R. Mathiseelan and K.R. Senthil Kumar, places in 2011.\n</description>\n<link>http://www.nowrunning.com/news/tamil/little-bommi-to-globetrot-in-2011/34390/story.htm</link>\n<guid isPermaLink=\"false\">http://www.nowrunning.com/news/tamil/little-bommi-to-globetrot-in-2011/34390/story.htm</guid>\n<pubDate>Thu, 02 Sep 2010 12:39:56 GMT</pubDate>\n<category>tamil Entertainment</category>\n</item>\n<item>\n<title>Splendid stunt and a super gift...</title>\n<description>R. S Infotainments, who co-produced Goutham Menon's Vinnai Thaandi Varuvaya with Photon Factory, is currently churning out Kho, directed by K V Anand. </description>\n<link>http://www.nowrunning.com/news/tamil/splendid-stunt-and-a-super-gift-/33508/story.htm</link>\n<guid isPermaLink=\"false\">http://www.nowrunning.com/news/tamil/splendid-stunt-and-a-super-gift-/33508/story.htm</guid>\n<pubDate>Thu, 02 Sep 2010 12:39:56 GMT</pubDate>\n<category>tamil Entertainment</category>\n</item>\n<item>\n<title>Ayan team is back!</title>\n<description>AGS Entertainments, an acclaimed production house, that has come out with blockbusters like Thiruttu Payalae, Masilamani, Santosh Subramaniam,  Irumbu Kottai Murattu Singam and the recent hit Madarsapattinam, is all set to bring together two names that have spelt magic at the box-office with Ayan last year.</description>\n<link>http://www.nowrunning.com/news/tamil/ayan-team-is-back/33343/story.htm</link>\n<guid isPermaLink=\"false\">http://www.nowrunning.com/news/tamil/ayan-team-is-back/33343/story.htm</guid>\n<pubDate>Thu, 02 Sep 2010 12:39:56 GMT</pubDate>\n<category>tamil Entertainment</category>\n</item>\n<item>\n<title>Simbu changes name as STR</title>\n<description>Post Vinnai Thandi Varuvaya's phenomenal success, Silambarasan has become the blue-eyed boy of many, including some social welfare organisations.</description>\n<link>http://www.nowrunning.com/news/tamil/simbu-changes-name-as-str/33342/story.htm</link>\n<guid isPermaLink=\"false\">http://www.nowrunning.com/news/tamil/simbu-changes-name-as-str/33342/story.htm</guid>\n<pubDate>Thu, 02 Sep 2010 12:39:56 GMT</pubDate>\n<category>tamil Entertainment</category>\n</item>\n<item>\n<title>Photon Factory acquires Kalavaani rights </title>\n<description>Photon Factory of acclaimed director Gautham Vasudev Menon and his friend Madan, have acquired the all India remake rights for the just-released Block Buster Tamil movie Kalavani. </description>\n<link>http://www.nowrunning.com/news/tamil/photon-factory-acquires-kalavaani-rights/33341/story.htm</link>\n<guid isPermaLink=\"false\">http://www.nowrunning.com/news/tamil/photon-factory-acquires-kalavaani-rights/33341/story.htm</guid>\n<pubDate>Thu, 02 Sep 2010 12:39:56 GMT</pubDate>\n<category>tamil Entertainment</category>\n</item>\n<item>\n<title>Cheran's Dream Theatres presents Muran</title>\n<description>Cheran, the director of Vettrikodi Kattu, Pandavar Bhoomi, Autograph, Thavamai Thavamirundhu and the recent Pokkisham, will start a new project Muran.</description>\n<link>http://www.nowrunning.com/news/tamil/cherans-dream-theatres-presents-muran/33148/story.htm</link>\n<guid isPermaLink=\"false\">http://www.nowrunning.com/news/tamil/cherans-dream-theatres-presents-muran/33148/story.htm</guid>\n<pubDate>Thu, 02 Sep 2010 12:39:56 GMT</pubDate>\n<category>tamil Entertainment</category>\n</item>\n<item>\n<title>In Conversation with Chaya Singh</title>\n<description>Director Shankar's home production, 'Anathapurathu veedu,' starring Nanda and Chaya Singh and directed by popular television serial director Naga is ready for release. For Chaya Singh, this is her 29th film. The 'Thiruda thirudi,' actor was last seen in 'Vallamai thaarayo,' directed by Madhumita Vijay.  In a chat with Mythily Ramachandran, Chaya Singh talks about the film. \n</description>\n<link>http://www.nowrunning.com/news/tamil/in-conversation-with-chaya-singh/32863/story.htm</link>\n<guid isPermaLink=\"false\">http://www.nowrunning.com/news/tamil/in-conversation-with-chaya-singh/32863/story.htm</guid>\n<pubDate>Thu, 02 Sep 2010 12:39:56 GMT</pubDate>\n<category>tamil Entertainment</category>\n</item>\n<item>\n<title>I will direct more films: Kamal Haasan  </title>\n<description>Having completed 50 years in Indian cinema, veteran actor Kamal Haasan has written, acted in and produced numerous movies but directed only two - \"Hey Ram\" and \"Virumandi\". The multi-faceted star now reveals he is craving to wield the megaphone again.</description>\n<link>http://www.nowrunning.com/news/tamil/i-will-direct-more-films-kamal-haasan/32743/story.htm</link>\n<guid isPermaLink=\"false\">http://www.nowrunning.com/news/tamil/i-will-direct-more-films-kamal-haasan/32743/story.htm</guid>\n<pubDate>Thu, 02 Sep 2010 12:39:56 GMT</pubDate>\n<category>tamil Entertainment</category>\n</item>\n<item>\n<title>Ash, Rajnikant's 'Endhiram' set for Sep 3 release? </title>\n<description>Bollywood diva Aishwarya Rai and Tamil superstar Rajnikant's mega-budget \"Endhiran\" is expected to hit the screens Sep 3. </description>\n<link>http://www.nowrunning.com/news/tamil/ash-rajnikants-endhiram-set-for-sep-3-release/32594/story.htm</link>\n<guid isPermaLink=\"false\">http://www.nowrunning.com/news/tamil/ash-rajnikants-endhiram-set-for-sep-3-release/32594/story.htm</guid>\n<pubDate>Thu, 02 Sep 2010 12:39:56 GMT</pubDate>\n<category>tamil Entertainment</category>\n</item>\n<item>\n<title>Kamal Hassan films to be screened in Delhi</title>\n<description>A three-day film festival on veteran actor Kamal Hassan is being organised in the capital July 2-4.</description>\n<link>http://www.nowrunning.com/news/tamil/kamal-hassan-films-to-be-screened-in-delhi/32561/story.htm</link>\n<guid isPermaLink=\"false\">http://www.nowrunning.com/news/tamil/kamal-hassan-films-to-be-screened-in-delhi/32561/story.htm</guid>\n<pubDate>Thu, 02 Sep 2010 12:39:56 GMT</pubDate>\n<category>tamil Entertainment</category>\n</item>\n<item>\n<title>Sun TV Network to launch music show  </title>\n<description>South Indian satellite channel Sun TV Network will launch a music game show on its four popular southern language channels, a top company official said.</description>\n<link>http://www.nowrunning.com/news/tamil/sun-tv-network-to-launch-music-show/32381/story.htm</link>\n<guid isPermaLink=\"false\">http://www.nowrunning.com/news/tamil/sun-tv-network-to-launch-music-show/32381/story.htm</guid>\n<pubDate>Thu, 02 Sep 2010 12:39:56 GMT</pubDate>\n<category>tamil Entertainment</category>\n</item>\n<item>\n<title>Arjun all set for 'Maasi'</title>\n<description>Action king Arjun is all charged up talking about his forthcoming flick Maasi. Maasi is going to be movie about cops fighting goons again, but this time it will be more realistic.</description>\n<link>http://www.nowrunning.com/news/tamil/arjun-all-set-for-maasi/32324/story.htm</link>\n<guid isPermaLink=\"false\">http://www.nowrunning.com/news/tamil/arjun-all-set-for-maasi/32324/story.htm</guid>\n<pubDate>Thu, 02 Sep 2010 12:39:56 GMT</pubDate>\n<category>tamil Entertainment</category>\n</item>\n<item>\n<title>Vikram's challenge in playing Dev &amp; Veera</title>\n<description>Multifaceted actor Vikram is portraying yet another challenging role in Manirathnam's Raavanan.</description>\n<link>http://www.nowrunning.com/news/tamil/vikrams-challenge-in-playing-dev-amp;-veera/32323/story.htm</link>\n<guid isPermaLink=\"false\">http://www.nowrunning.com/news/tamil/vikrams-challenge-in-playing-dev-amp;-veera/32323/story.htm</guid>\n<pubDate>Thu, 02 Sep 2010 12:39:56 GMT</pubDate>\n<category>tamil Entertainment</category>\n</item>\n<item>\n<title>Jeeva's next is 'Vandaan Vendraan'</title>\n<description>Jeeva is going to play the lead in director Kannan's next movie titled 'Vandaan Vendraan'. </description>\n<link>http://www.nowrunning.com/news/tamil/jeevas-next-is-vandaan-vendraan/32322/story.htm</link>\n<guid isPermaLink=\"false\">http://www.nowrunning.com/news/tamil/jeevas-next-is-vandaan-vendraan/32322/story.htm</guid>\n<pubDate>Thu, 02 Sep 2010 12:39:56 GMT</pubDate>\n<category>tamil Entertainment</category>\n</item>\n<item>\n<title>Tamil, Telugu versions of 'Raavan' to release in US  </title>\n<description>The makers of \"Raavan\" are all set to tap Tamil and Telugu speaking audiences in the US by releasing the film in the two languages in over 40 screens in that country Friday.</description>\n<link>http://www.nowrunning.com/news/tamil/tamil-telugu-versions-of-raavan-to-release-in-us/32317/story.htm</link>\n<guid isPermaLink=\"false\">http://www.nowrunning.com/news/tamil/tamil-telugu-versions-of-raavan-to-release-in-us/32317/story.htm</guid>\n<pubDate>Thu, 02 Sep 2010 12:39:56 GMT</pubDate>\n<category>tamil Entertainment</category>\n</item>\n</channel>\n</rss>\n", message:undefined, modified:(new Date(1283438482408)), baseUri:"http://p3k.org/rss/", query:"frameColor=black&textColor=black&_=1213975266687&titleBarColor=lightblue&compact=&fontFace=&align=left&showXmlButton=&maxItems=10&boxFillColor=white&undefined=&titleBarTextColor=black&width=650&url=http://nowrunning.com/cgi-bin/rss/news_tamil.xml&", param:{textColor:"black", width:"650", align:"left", fontFace:"", url:"http://nowrunning.com/cgi-bin/rss/news_tamil.xml", compact:"", frameColor:"black", showXmlButton:"", undefined:"", boxFillColor:"white", _:"1213975266687", titleBarColor:"lightblue", maxItems:"10", titleBarTextColor:"black"}, box:"<table class=\"rssBox\" width=\"${width}\" bgcolor=\"${frameColor}\" \n      style=\"table-layout: fixed; overflow: hidden; font-family: ${fontFace};\" \n      align=\"${align}\" cellspacing=\"1\" cellpadding=\"7\" border=\"0\">\n<tr bgcolor=\"${titleBarColor}\">\n<td>\n   ${xmlButton}\n   <strong>${title}</strong>\n   <div>\n      <small style=\"color: ${titleBarTextColor};\">${date}</small>\n   </div>\n</td>\n</tr>\n<tr bgcolor=\"${boxFillColor}\">\n<td class=\"rssBoxContent\" style=\"color: ${textColor};\">\n   ${image}\n   ${items}\n   ${input}\n   <div class=\"rssBoxPromo\" style=\"margin-top: 0px; text-align: left; \n         font: 9px verdana, sans-serif\">\n      RSS box by <a href=\"http://p3k.org/rss\">p3k.org</a>.\n   </div>\n</td>\n</tr>\n</table>\n\n", image:"<a href=\"${link}\"><img src=\"${source}\" width=\"${width}\" height=\"${height}\" \nalt=\"${title}\" title=\"${title}\" align=\"${align}\" valign=\"${valign}\" \nhspace=\"${hspace}\" vspace=\"${vspace}\" border=\"0\" /></a>\n\n", input:"<form method=\"get\" action=\"${link}\">\n${description}\n<input type=\"text\" name=\"${name}\" size=\"15\" /> <input type=\"submit\" \nvalue=\"${title}\" />\n</form>\n\n", item:"<div class=\"rssBoxItemContent\">\n${title}\n${break}\n${description}\n${buttons}\n</div><br />\n\n", date:"${year}-${month}-${day}, ${hours}:${minutes}h\n\n", link:"<a class=\"${class}\" href=\"${link}\" style=\"${style}\">${text}</a>\n", error:"<?xml version=\"1.0\"?>\n<rss version=\"error\">\n   <channel>\n      <title>RSS Box Error</title>\n      <link>${link}</link>\n      <description>This output was automatically generated to report an error \n      that occurred during a request to the JavaScript RSS Box Viewer.</description>\n      <item>\n         <title>Oops, something went wrong...</title>\n         <description>An error occurred while processing the request to the \n         JavaScript RSS Box Viewer.</description>\n      </item>\n      <item>\n         <title>An error message was returned by the server.</title>\n         <description>${message}</description>\n      </item>\n      <item>\n         <description>Most likely, this might have happened because of a \n         non-existent or invalid RSS feed URL. Please check and possibly correct \n         your input, then try again.</description>\n      </item>\n   </channel>\n</rss>\n\n"})};
function debug(str) {
   return document.write('<p><span style="background-color: yellow;">', 
         str, '</span><p>');
}

org.p3k.RssBox = function() {
   var ref;
   var ISOPATTERN = /([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9:]+).*$/;
   
   var data = org.p3k;
   data.defaults = {
      url: "http://blog.p3k.org/rss",
      maxItems: 7,
      width: 200,
      align: "",
      frameColor: "black",
      titleBarColor: "lightblue",
      titleBarTextColor: "black",
      boxFillColor: "white",
      textColor: "black",
      showXmlButton: "",
      compact: ""
   };
   
   var baseUri = data.baseUri;
    
   var getColor = function(str) {
      if (str.length === 6 && parseInt(str, 16) && str.indexOf("#") !== 0) {
         str = "#" + str;
      }
      return str.toLowerCase();
   }

   var value;
   for (var i in data.defaults) {
      value = data.param[i];
      if (!value || value.length === 0) {
         data.param[i] = data.defaults[i];
      } else if (i.indexOf("Color") > 0) {
         data.param[i] = getColor(value);
      }
   }

   // FIXME: Ugly work-around for many boxes using too small width 
   // values because the former version did not show the exact output.
   if (data.param.javascript && data.param.width < 200) {
      data.param.width = 200;
   }
   // Remove obsolete parameters from param and query
   delete data.param.javascript;
   data.query = data.query.replace("javascript=true", "");   

   var NAMESPACES = {
      dc: "http://purl.org/dc/elements/1.1/",
      rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   };

   var getUrl = function(url) {
      url = baseUri + "proxy.r?" + encodeURIComponent(url);
   
      var HttpRequest = function() {
         return (typeof XMLHttpRequest !== "undefined") ?
            new XMLHttpRequest() : new ActiveXObject("Msxml2.XMLHTTP");
      }
   
      var request = new HttpRequest();
      request.open("GET", url, false);
      request.send(null);   
      if (!request.getResponseHeader("Date")) {
         var cached = request;
         var ifModifiedSince = cached.getResponseHeader("Last-Modified") || 
               new Date(0); // January 1, 1970
         request = new HttpRequest();
         request.open("GET", url, false);
         request.setRequestHeader("If-Modified-Since", ifModifiedSince);
         request.send("");
         if (request.status === 304) {
            request = cached; 
         }
      }
      return request;
   }
   
   var getDocument = function(source) {
      if (source) {
         if (document.implementation.createDocument) {
            var parser = new DOMParser();
            var doc = parser.parseFromString(source, "text/xml");
            return doc;
         } else if (window.ActiveXObject) {
            var doc = new ActiveXObject("Microsoft.XMLDOM");
            doc.async = "false";
            doc.loadXML(source);
            return doc;
         }
      }
      return null;
   }
   
   var getError = function() {
      var msg = null, root;
      if (!xml || data.message) {
         msg = data.message || "Unknown error.";
      } else if (xml.parseError && xml.parseError.errorCode) {
         msg = xml.parseError.reason; // IExplore
      } else if (root = xml.documentElement) {
         var errorNode;
         if (root.nodeName === "parsererror") {
            msg = xml.documentElement.textContent; // Mozilla
         } else if ((errorNode = root.childNodes[0]) && 
               errorNode.nodeName === "parsererror") {
            msg = errorNode.textContent; // Safari
         } else if (!/rss|rdf|scriptingNews/i.test(xml.documentElement.nodeName)) {
            msg = "Incompatible data format. Are you sure this is an RSS feed?";
         }
      }
      return msg;
   }
   
   var getNode = function(parent, name, namespace) {
      if (namespace) {
         if (typeof parent.getElementsByTagNameNS === "undefined") {
            var elements = parent.getElementsByTagName(namespace + ":" + name);
         } else {
            var elements = parent.getElementsByTagNameNS(NAMESPACES[namespace], name);
         }
      } else {
         var elements = parent.getElementsByTagName(name);
      }
      if (elements && elements[0]) {
         return elements[0];
      }
      return null;
   }
   
   var getText = function(node) {
      if (node && node.childNodes && node.childNodes.length > 0) {
         return node.childNodes[0].nodeValue || "";
      }
      return "";
   }
   
   var trim = function(str) {
      if (str) {
         return str.replace(/^\s*(\S*)\s*$/, "$1");
      }
      return "";
   }
   
   var padZero = function(n) {
      if (n < 10) {
         return "0" + n
      }
      return n;
   }

   var encodeXml = function(str) {
      if (!str) {
         return "";
      }
      return str.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/&/g, "&amp;");
   }
      
   var render = function(template, param) {
      if (!template || !param) {
         return template;
      }
      template = template.replace(/\$\{([^}]+)\}/g, function() {
         var key = arguments[1];
         return param[key] || "";
      });
      return template;
   }
   
   var renderDate = function(date) {
      if (date.constructor !== Date) {
         var str = String(date);
         var millis = Date.parse(str.replace(ISOPATTERN, "$1/$2/$3 $4"));
         if (millis) {
            date = new Date(millis);
         } else {
            date = new Date;
         }
      }

      return render(data.date, {
         year: date.getFullYear(),
         month: padZero(date.getMonth() + 1),
         day: padZero(date.getDate()),
         hours: padZero(date.getHours()),
         minutes: padZero(date.getMinutes()),
         seconds: padZero(date.getSeconds()),
         timeZone: "" // date.getTimezoneOffset()
      });
   }
   
   var renderButtons = function(enclosure, source) {
      var result = "";
      if (enclosure && enclosure.link) {
         result += render(data.image, {
            source: baseUri + "enclosure.gif",
            title: enclosure.type,
            link: encodeURI(enclosure.link),
            width: 13,
            height: 16
         });
      }
      if (source && source.link) {
         result += render(data.image, {
            source: baseUri + "source.gif",
            title: source.title,
            link: encodeURI(source.link),
            width: 15,
            height: 15
         });
      }
      return result;         
   }
   
   var param = data.param;
   var rss = data.rss = {items: []};
   var xml = getDocument(data.xml);

   rss.error = getError();
   if (rss.error !== null) {
      xml = getDocument(render(data.error, {
         link: baseUri + "?" + encodeXml(data.query),
         message: encodeXml(rss.error)
      }));
      param.compact = 0;
      param.showXmlButton = 1;
   }

   var root = xml.documentElement;
   var type = root.nodeName;

   if (type === "scriptingNews") {
      var channel = getNode(xml, "header");
      rss.format = "Scripting News";
      rss.version = getText(getNode(channel, "scriptingNewsVersion"));
      rss.title = getText(getNode(channel, "channelTitle"));
      rss.description = getText(getNode(channel, "channelDescription"));
      rss.link = getText(getNode(channel, "channelLink"));
      if (ref = getText(getNode(channel, "imageUrl"))) {
         ref = rss.image = {source: ref};
         ref.title = getText(getNode(channel, "imageTitle"));
         ref.link = getText(getNode(channel, "imageLink"));
         ref.width = getText(getNode(channel, "imageWidth"));
         ref.height = getText(getNode(channel, "imageHeight"));
         ref.description = getText(getNode(channel, "imageCaption"));
      }
   } else {
      var channel = getNode(xml, "channel");
      rss.format = "RSS";
      rss.version = (type === "rdf:RDF") ? "1.0" : 
            root.getAttribute("version");
      rss.title = getText(getNode(channel, "title"));
      rss.description = getText(getNode(channel, "description"));
      rss.link = getText(getNode(channel, "link"));
      var image = getNode(xml, "image");
      if (image) {
         ref = rss.image = {};
         ref.source = getText(getNode(image, "url"));
         ref.title = getText(getNode(image, "title"));
         ref.link = getText(getNode(image, "link"));
         ref.width = getText(getNode(image, "width"));
         ref.height = getText(getNode(image, "height"));
         ref.description = getText(getNode(image, "description"));
      }
   }
   
   if (type === "rdf:RDF") {
      rss.date = renderDate(getText(getNode(channel, "date", "dc")) || data.modified);
      rss.rights = getText(getNode(channel, "creator", "dc"));
      var input = getNode(root, "textinput");
      if (input && !getNode(input, "link")) {
         input = root.getElementsByTagName("textinput")[1];
      }
      if (input) {
         ref = rss.input = {};
         ref.link = getText(getNode(input, "link"));
         ref.description = getText(getNode(input, "description"));
         ref.name = getText(getNode(input, "name"));
         ref.title = getText(getNode(input, "title"));
      }
   } else {
      rss.date = renderDate(getText(getNode(channel, "lastBuildDate") || getText(getNode(channel, "pubDate"))) || data.modified);
      rss.rights = getText(getNode(channel, "copyright"));
   }
   
   var item, text, node;
   var items = xml.getElementsByTagName("item");

   for (var i=0; i<Math.min(items.length, param.maxItems); i+=1) {
      item = items[i];

      if (type === "scriptingNews") {
         ref = {title: ""};
         ref.description = getText(getNode(item, "text")).replace(/\n/g, " ");
         ref.link = getText(getNode(item, "link"));
         if (text = trim(getText(getNode(item, "linetext")).replace(/\n/g, " "))) {
            ref.description = ref.description.replace(new RegExp(text), 
                  '<a href="' + getText(getNode(item, "url")) + '">' + text + '</a>');
         }
      } else {
         ref = {
            title: getText(getNode(item, "title")),
            description: getText(getNode(item, "description")),
            link: getText(getNode(item, "link") || getNode(item, "guid"))
         };
     }

     if (node = getNode(item, "source")) {
        ref.source = {
           link: node.getAttribute("url"),
           title: getText(node)
        }
     }
     
     if (node = getNode(item, "enclosure")) {
        ref.enclosure = {
           link: node.getAttribute("url"),
           length: node.getAttribute("length"),
           type: node.getAttribute("type")
        }
     }
     
     if (node = getNode(item, "category")) {
        ref.category = {
           domain: node.getAttribute("domain") || "",
           content: getText(node)
        }
     }
     
     rss.items.push(ref);
   }
   
   var item, items = "";
   for (var i=0; i<rss.items.length; i+=1) {
      item = rss.items[i];
      items += render(data.item, {
         title: new function() {
            var title = (!param.compact ? "<strong>" : "");
            if (item.link) {
               title += render(data.link, {
                  link: encodeURI(item.link),
                  text: item.title,
                  'class': "rssBoxItemTitle"
               });
            } else {
               title += item.title;
            }
            !param.compact && (title += "</strong>");
            return new String(title); // FIXME: Funny, title alone will be rendered as [object]
         }(),
         'break': item.title && item.description ? "<br />" : "",
         description: (!param.compact || !item.title) && item.description,
         buttons: renderButtons(item.enclosure, item.source)
      });
   }
   
   var box = render(data.box, {
      title: rss.link ? render(data.link, {
         link: encodeURI(rss.link),
         text: rss.title,
         'class': "rssBoxTitle",
         style: "color: " + param.titleBarTextColor
      }) : rss.title,
      description: rss.description,
      items: items,

      xmlButton: param.showXmlButton && render(data.image, {
         link: param.url,
         source: baseUri + "rss.png",
         title: rss.format + " " + rss.version,
         width: 16,
         height: 16,
         align: "right",
         hspace: 3
      }),
      
      image: !param.compact && rss.image && render(data.image, {
         link: encodeURI(rss.image.link),
         source: rss.image.source,
         width: rss.image.width,
         height: rss.image.height,
         title: rss.image.title,
         align: "right",
         valign: "baseline",
         hspace: 5,
         vspace: 5
      }),
      
      input: !param.compact && rss.input && render(data.input, {
         link: encodeURI(rss.input.link),
         description: rss.input.description,
         name: rss.input.name,
         title: rss.input.title
      }),
      
      date: rss.date,
      width: param.width,
      frameColor: param.frameColor,
      fontFace: param.fontFace,
      align: param.align,
      titleBarColor: param.titleBarColor,
      titleBarTextColor: param.titleBarTextColor,
      boxFillColor: param.boxFillColor,
      textColor: param.textColor
   });

   if (!window.rssBoxSetup) {
      document.write(box);
   }
   
   return box;
};

org.p3k.RssBox();

