var org = {p3k: ({url:"http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/business/rss.xml", xml:"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<?xml-stylesheet title=\"XSL_formatting\" type=\"text/xsl\" href=\"/shared/bsp/xsl/rss/nolsol.xsl\"?>\n\n<rss xmlns:media=\"http://search.yahoo.com/mrss/\" xmlns:atom=\"http://www.w3.org/2005/Atom\" version=\"2.0\">  \n  <channel> \n    <title>BBC News - Business</title>  \n    <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business/</link>  \n    <description>The latest stories from the Business section of the BBC News web site.</description>  \n    <language>en-gb</language>  \n    <lastBuildDate>Thu, 09 Sep 2010 06:28:57 GMT</lastBuildDate>  \n    <copyright>Copyright: (C) British Broadcasting Corporation, see http://news.bbc.co.uk/2/hi/help/rss/4498287.stm for terms and conditions of reuse.</copyright>  \n    <docs>http://www.bbc.co.uk/syndication/</docs>  \n    <ttl>15</ttl>  \n    <atom:link href=\"http://feeds.bbci.co.uk/news/business/rss.xml\" rel=\"self\" type=\"application/rss+xml\"/>  \n    <item> \n      <title>Goldman Sachs fined \xa320m by FSA</title>  \n      <description>Wall Street banking giant Goldman Sachs is fined \xa320m by the UK's financial watchdog, the BBC learns.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11238897</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11238897</guid>  \n      <pubDate>Wed, 08 Sep 2010 20:24:23 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/48385000/jpg/_48385886_goldmansachssecfineabacus.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49034000/jpg/_49034820_goldmansachssecfineabacus.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/48385000/jpg/_48385887_goldmansachssecfineabacus.jpg\"/> \n    </item>  \n    <item> \n      <title>Spending cuts 'to hit north harder'</title>  \n      <description>Middlesbrough is the area of England least resilient to economic shocks, according to BBC-commissioned research.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/uk-england-11141264</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/uk-england-11141264</guid>  \n      <pubDate>Thu, 09 Sep 2010 06:33:12 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49028000/jpg/_49028137_transporter-bridge.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49028000/jpg/_49028135_transporter-bridge.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49028000/jpg/_49028138_transporter-bridge.jpg\"/> \n    </item>  \n    <item> \n      <title>Rig firms hit back at BP report</title>  \n      <description>Contractors who worked for BP on the ill-fated Deepwater Horizon oil rig criticise the company's report into the Gulf of Mexico oil spill.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/world-us-canada-11239676</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/world-us-canada-11239676</guid>  \n      <pubDate>Wed, 08 Sep 2010 23:55:33 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49035000/jpg/_49035285_010133337-1.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49035000/jpg/_49035541_010133337-1.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49035000/jpg/_49035286_010133337-1.jpg\"/> \n    </item>  \n    <item> \n      <title>Shoppers turning to card payments</title>  \n      <description>The number of cash machines in the UK has fallen and withdrawals have dropped as shoppers turn to cards, figures show.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11233827</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11233827</guid>  \n      <pubDate>Wed, 08 Sep 2010 23:01:01 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49027000/jpg/_49027861_cash.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49031000/jpg/_49031610_cash.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49027000/jpg/_49027862_cash.jpg\"/> \n    </item>  \n    <item> \n      <title>Empty shops highlighting 'divide'</title>  \n      <description>The number of shops closing in Britain is slowing but a north-south divide has emerged, a survey by retail analysts the Local Data Company suggests.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/uk-11239708</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/uk-11239708</guid>  \n      <pubDate>Thu, 09 Sep 2010 01:09:44 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/45428000/jpg/_45428057_006770257-1.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49035000/jpg/_49035566_007748061-1.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49035000/jpg/_49035410_007748061-1.jpg\"/> \n    </item>  \n    <item> \n      <title>US economic growth 'decelerating'</title>  \n      <description>US economic growth showed \"widespread signs of deceleration\" in August, says the Federal Reserve's Beige Book.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11237044</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11237044</guid>  \n      <pubDate>Wed, 08 Sep 2010 20:57:12 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49033000/jpg/_49033350_006571649-1.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49034000/jpg/_49034529_006571649-1.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49033000/jpg/_49033348_006571649-1.jpg\"/> \n    </item>  \n    <item> \n      <title>House giant enters administration</title>  \n      <description>Property giant Connaught formally enters administration, putting thousands of jobs at risk.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11224398</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11224398</guid>  \n      <pubDate>Wed, 08 Sep 2010 16:18:57 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/48192000/jpg/_48192440_000360651-1.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49019000/jpg/_49019222_000360651-1.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/45587000/jpg/_45587927_000360651-1.jpg\"/> \n    </item>  \n    <item> \n      <title>South Korea in surprise rate hold</title>  \n      <description>South Korea's central bank surprised markets by holding interest rates in the face of \"global uncertainties ahead\".</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11240827</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11240827</guid>  \n      <pubDate>Thu, 09 Sep 2010 06:24:54 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/48299000/jpg/_48299594_009770453-1.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49035000/jpg/_49035961_009770453-1.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/48299000/jpg/_48299596_009770453-1.jpg\"/> \n    </item>  \n    <item> \n      <title>Writing off tax is 'unaffordable'</title>  \n      <description>The country \"cannot afford\" to write off underpayments of income tax caused by problems with the calculation system, a minister says.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11230325</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11230325</guid>  \n      <pubDate>Wed, 08 Sep 2010 12:45:37 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49026000/jpg/_49026491_cash.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49027000/jpg/_49027870_budget.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49026000/jpg/_49026485_budget.jpg\"/> \n    </item>  \n    <item> \n      <title>Cable worries over 'casino' banks</title>  \n      <description>Business Secretary Vince Cable expresses \"worry\" about the combination of High Street banks with investment banking, after Bob Diamond is named as Barclays' new boss.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11226888</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11226888</guid>  \n      <pubDate>Wed, 08 Sep 2010 08:51:19 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49022000/jpg/_49022719_investmentbanking.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49022000/jpg/_49022718_investmentbanking.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49022000/jpg/_49022720_investmentbanking.jpg\"/> \n    </item>  \n    <item> \n      <title>Dublin to break up Anglo Irish</title>  \n      <description>The Irish government says it will break up the nationalised Anglo Irish Bank as part of the failed lender's resolution.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/uk-northern-ireland-11235023</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/uk-northern-ireland-11235023</guid>  \n      <pubDate>Wed, 08 Sep 2010 14:56:17 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/48928000/jpg/_48928670__47569248_angloirishbank-1.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49026000/jpg/_49026315__47569248_angloirishbank-1.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/48926000/jpg/_48926831__47569248_angloirishbank-1.jpg\"/> \n    </item>  \n    <item> \n      <title>Google unveils 'instant' searches</title>  \n      <description>Google speeds up its internet search engine by launching a new product, Google Instant, that displays results as soon as users type in queries.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/technology-11239037</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/technology-11239037</guid>  \n      <pubDate>Wed, 08 Sep 2010 21:09:45 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49035000/jpg/_49035018_instant304.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49035000/jpg/_49035019_instant304.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49035000/jpg/_49035016_instant304.jpg\"/> \n    </item>  \n    <item> \n      <title>UK factory output rises by 0.3%</title>  \n      <description>UK manufacturing output rises 0.3% in July from the month earlier, thanks to increased output in the machinery sector.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11227503</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11227503</guid>  \n      <pubDate>Wed, 08 Sep 2010 09:45:22 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49022000/jpg/_49022931_industrialproduction.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49022000/jpg/_49022929_industrialproduction.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49022000/jpg/_49022932_industrialproduction.jpg\"/> \n    </item>  \n    <item> \n      <title>Canada in third bank rate rise</title>  \n      <description>Canada now has interest rates of 1%, after raising its key lending benchmark for the third time this year.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11234156</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11234156</guid>  \n      <pubDate>Wed, 08 Sep 2010 14:41:26 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/47968000/jpg/_47968160_006315033-1.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49025000/jpg/_49025915_006315033-1.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/47967000/jpg/_47967867_006315033-1.jpg\"/> \n    </item>  \n    <item> \n      <title>Greece economy contracts by 1.8%</title>  \n      <description>The debt-laden Greek economy shrank by a surprise 1.8% in the second quarter as households slashed spending.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11229042</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11229042</guid>  \n      <pubDate>Wed, 08 Sep 2010 19:03:56 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49026000/jpg/_49026931_greece.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49026000/jpg/_49026929_greece.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49026000/jpg/_49026932_greece.jpg\"/> \n    </item>  \n    <item> \n      <title>Halifax says house prices stable</title>  \n      <description>UK house prices have stabilised, according to the latest survey from the Halifax.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11226502</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11226502</guid>  \n      <pubDate>Wed, 08 Sep 2010 13:14:10 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49022000/jpg/_49022490_009954534-1.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49022000/jpg/_49022508_009954534-1.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49021000/jpg/_49021907_009954534-1.jpg\"/> \n    </item>  \n    <item> \n      <title>Posties back Royal Mail bike cuts</title>  \n      <description>Union leaders publicly endorse Royal Mail management plans to phase out bikes for postal deliveries.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11234447</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11234447</guid>  \n      <pubDate>Wed, 08 Sep 2010 14:59:32 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49030000/jpg/_49030754_002213289-1.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49030000/jpg/_49030755_002213289-1.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49030000/jpg/_49030752_002213289-1.jpg\"/> \n    </item>  \n    <item> \n      <title>EU ruling opens up German gambling market</title>  \n      <description>German gambling restrictions breach European Union law, the EU's highest court rules</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11234128</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11234128</guid>  \n      <pubDate>Wed, 08 Sep 2010 15:02:05 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49031000/jpg/_49031068_roulettetable.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49031000/jpg/_49031070_roulettetable.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49031000/jpg/_49031067_roulettetable.jpg\"/> \n    </item>  \n    <item> \n      <title>Lycatel to make adverts clearer</title>  \n      <description>Phone card firm Lycatel agrees to make its charges much clearer in its adverts for international phone cards</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11229591</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11229591</guid>  \n      <pubDate>Wed, 08 Sep 2010 11:58:13 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/47513000/jpg/_47513372_lycatel.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49026000/jpg/_49026972_lycamobile.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/47513000/jpg/_47513585_lycamobile.jpg\"/> \n    </item>  \n    <item> \n      <title>Workplace accidents 'unreported'</title>  \n      <description>Union leaders claim some workplace accidents go unreported with 1.2 million people suffering from work-related illnesses.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11217195</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11217195</guid>  \n      <pubDate>Tue, 07 Sep 2010 15:01:12 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49011000/jpg/_49011869_flowers.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49011000/jpg/_49011867_flowers.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49011000/jpg/_49011870_flowers.jpg\"/> \n    </item>  \n    <item> \n      <title>Tax error letters start to arrive</title>  \n      <description>UK tax authorities are bracing themselves for a deluge of complaints and enquiries after sending out fresh tax calculations.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11211658</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11211658</guid>  \n      <pubDate>Tue, 07 Sep 2010 11:45:17 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/46936000/jpg/_46936987_007208765-1.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49007000/jpg/_49007675_007208765-1.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/47179000/jpg/_47179956_007208765-1.jpg\"/> \n    </item>  \n    <item> \n      <title>Job market growth slows in August</title>  \n      <description>Job appointments grew at their slowest rate in 10 months in August, raising questions about the strength of the UK job market, a survey suggests.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11224407</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11224407</guid>  \n      <pubDate>Tue, 07 Sep 2010 23:57:57 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49020000/jpg/_49020573_005393114-1.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49020000/jpg/_49020572_005393114-1.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49020000/jpg/_49020575_005393114-1.jpg\"/> \n    </item>  \n    <item> \n      <title>Japan may intervene to curb yen</title>  \n      <description>The Japanese finance minister says there could be market intervention as the yen hits a new 15-year high.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/world-asia-pacific-11225569</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/world-asia-pacific-11225569</guid>  \n      <pubDate>Wed, 08 Sep 2010 06:16:48 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/48482000/jpg/_48482559_009711410-1.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49021000/jpg/_49021578_japan.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/48065000/jpg/_48065991_japan.jpg\"/> \n    </item>  \n    <item> \n      <title>Huge growth at largest wind farm</title>  \n      <description>A massive expansion is to take place at Europe's largest onshore wind farm in East Renfrewshire.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/uk-scotland-glasgow-west-11215774</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/uk-scotland-glasgow-west-11215774</guid>  \n      <pubDate>Tue, 07 Sep 2010 17:30:47 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49012000/jpg/_49012755_007356259-1.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49012000/jpg/_49012754_007356259-1.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49012000/jpg/_49012756_007356259-1.jpg\"/> \n    </item>  \n    <item> \n      <title>BP spreads blame over oil spill</title>  \n      <description>A BP report says \"a series of failures\" by BP and its contractors were to blame for the massive Gulf of Mexico oil spill.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/world-us-canada-11225623</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/world-us-canada-11225623</guid>  \n      <pubDate>Wed, 08 Sep 2010 22:48:33 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49027000/jpg/_49027827_009158636-1.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49027000/jpg/_49027829_009158636-1.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49027000/jpg/_49027825_009158636-1.jpg\"/> \n    </item>  \n    <item> \n      <title>Vodafone to pay India $2.6bn tax</title>  \n      <description>An Indian court tells Vodafone it has to pay $2.6bn in tax for its takeover of Hutchison Telecom's Indian phone assets.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11227474</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11227474</guid>  \n      <pubDate>Wed, 08 Sep 2010 10:59:42 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49025000/jpg/_49025772_vodafoneshopfront.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49025000/jpg/_49025770_vodafoneshopfront.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49025000/jpg/_49025774_vodafoneshopfront.jpg\"/> \n    </item>  \n    <item> \n      <title>Dana says Korean bid 18% too low</title>  \n      <description>Dana Petroleum tells shareholders independent valuers found Korean oil's bid is too low and should be rejected.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11225985</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11225985</guid>  \n      <pubDate>Wed, 08 Sep 2010 09:32:44 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/48888000/jpg/_48888385_c7d9e2d0-2ced-40ef-8a17-90d7d50c4987.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49021000/jpg/_49021569_2deruyterplatform-aerialview.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/48888000/jpg/_48888386_2deruyterplatform-aerialview.jpg\"/> \n    </item>  \n    <item> \n      <title>FIA rejects new team applications</title>  \n      <description>Formula 1's governing body turns down all the entries from teams hoping to fill the vacant 13th slot in 2011, with former champion Jacques Villeneuve among those to miss out.</description>  \n      <link>http://news.bbc.co.uk/go/rss/int/news/-/sport1/hi/motorsport/formula_one/8980826.stm</link>  \n      <guid isPermaLink=\"false\">http://news.bbc.co.uk/sport1/hi/motorsport/formula_one/8980826.stm</guid>  \n      <pubDate>Wed, 08 Sep 2010 13:16:41 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49029000/jpg/_49029259_villeneuve226.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49029000/jpg/_49029258_villeneuve226.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49029000/jpg/_49029257_villeneuve226.jpg\"/> \n    </item>  \n    <item> \n      <title>Nigeria arrests ex-football heads</title>  \n      <description>Four Nigerian former football officials are arrested amid accusations that some $8m (\xa35m) went missing during the World Cup finals in South Africa.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/world-africa-11213606</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/world-africa-11213606</guid>  \n      <pubDate>Tue, 07 Sep 2010 11:38:38 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49011000/jpg/_49011377_010124104-1.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49011000/jpg/_49011376_010124104-1.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49009000/jpg/_49009852_010124104-1.jpg\"/> \n    </item>  \n    <item> \n      <title>Twitter rant costs Rice sponsor</title>  \n      <description>Triple Olympic gold medal-winning swimmer Stephanie Rice loses a sponsorship deal with Jaguar after making a homophobic remark on Twitter.</description>  \n      <link>http://news.bbc.co.uk/go/rss/int/news/-/sport1/hi/other_sports/swimming/8976165.stm</link>  \n      <guid isPermaLink=\"false\">http://news.bbc.co.uk/sport1/hi/other_sports/swimming/8976165.stm</guid>  \n      <pubDate>Tue, 07 Sep 2010 10:20:59 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49009000/jpg/_49009680_rice.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49009000/jpg/_49009678_rice.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49009000/jpg/_49009679_rice.jpg\"/> \n    </item>  \n    <item> \n      <title>Business basics: Interest rates</title>  \n      <description>The BBC's Declan Curry looks at why interest rates matter</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11238317</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11238317</guid>  \n      <pubDate>Thu, 09 Sep 2010 05:16:45 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49034000/jpg/_49034259_jex_802264_ico27-1.jpg\"/>  \n      <media:thumbnail width=\"640\" height=\"360\" url=\"http://news.bbcimg.co.uk/media/images/49034000/jpg/_49034257_49034256.jpg\"/> \n    </item>  \n    <item> \n      <title>Maurice Saatchi: No Mad Man</title>  \n      <description>Maurice Saatchi: \"We had a romantic belief that it was possible for individuals to change the world by an act of will - a flat refusal to accept the status quo.\"</description>  \n      <link>http://news.bbc.co.uk/go/rss/int/news/-/today/hi/today/newsid_8979000/8979284.stm</link>  \n      <guid isPermaLink=\"false\">http://news.bbc.co.uk/today/hi/today/newsid_8979000/8979284.stm</guid>  \n      <pubDate>Wed, 08 Sep 2010 08:37:03 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49023000/jpg/_49023081_000728795-1.jpg\"/>  \n      <media:thumbnail width=\"512\" height=\"288\" url=\"http://news.bbcimg.co.uk/media/images/49023000/jpg/_49023083_000728795-1.jpg\"/> \n    </item>  \n    <item> \n      <title>Cable concerned over stability of banks</title>  \n      <description>The Business Secretary, Vince Cable, has expressed concern about the appointment of the investment banker, Bob Diamond, as the new chief executive of Barclays.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11226145</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11226145</guid>  \n      <pubDate>Wed, 08 Sep 2010 08:38:03 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49023000/jpg/_49023167_jex_801347_de53-1.jpg\"/>  \n      <media:thumbnail width=\"640\" height=\"360\" url=\"http://news.bbcimg.co.uk/media/images/49023000/jpg/_49023308_jex_801347_de27-1.jpg\"/> \n    </item>  \n    <item> \n      <title>Google revamps search system</title>  \n      <description>The search giant launches a system with web links appearing as soon as characters are typed into the query box.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/technology-11239103</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/technology-11239103</guid>  \n      <pubDate>Wed, 08 Sep 2010 22:55:08 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49029000/jpg/_49029411_google2.jpg\"/>  \n      <media:thumbnail width=\"640\" height=\"360\" url=\"http://news.bbcimg.co.uk/media/images/49034000/jpg/_49034401_google_screen.jpg\"/> \n    </item>  \n    <item> \n      <title>Dublin to break up Anglo Irish</title>  \n      <description>The Irish government has said it will break up the nationalised Anglo Irish Bank.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11238739</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11238739</guid>  \n      <pubDate>Wed, 08 Sep 2010 20:39:30 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49034000/jpg/_49034796_010085182-1.jpg\"/>  \n      <media:thumbnail width=\"640\" height=\"360\" url=\"http://news.bbcimg.co.uk/media/images/49034000/jpg/_49034681_010085182-1.jpg\"/> \n    </item>  \n    <item> \n      <title>Basketball targets emerging markets</title>  \n      <description>The National Basketball Association wants to expand the game and are looking at emerging markets such as India and China to push their products.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11223900</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11223900</guid>  \n      <pubDate>Tue, 07 Sep 2010 21:43:39 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49019000/jpg/_49019550_jex_801155_de27-1.jpg\"/>  \n      <media:thumbnail width=\"640\" height=\"360\" url=\"http://news.bbcimg.co.uk/media/images/49019000/jpg/_49019366_jex_801155_de27-1.jpg\"/> \n    </item>  \n    <item> \n      <title>Obama backs company tax breaks</title>  \n      <description>President Barack Obama is backing new company tax breaks in an attempt to regain the initiative as mid-term polls loom</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11227997</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11227997</guid>  \n      <pubDate>Wed, 08 Sep 2010 10:57:42 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49023000/jpg/_49023479_007069651-1.jpg\"/>  \n      <media:thumbnail width=\"640\" height=\"360\" url=\"http://news.bbcimg.co.uk/media/images/49023000/jpg/_49023473_006178211-1.jpg\"/> \n    </item>  \n    <item> \n      <title>Connaught workers on the future</title>  \n      <description>Pete Key and Marc Woodcock work for Connaught on a Hull City Council contract, carrying out conversions for tenants with disabilities.</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11215985</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11215985</guid>  \n      <pubDate>Tue, 07 Sep 2010 14:10:56 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49014000/jpg/_49014531_jex_800796_de27-1.jpg\"/>  \n      <media:thumbnail width=\"640\" height=\"360\" url=\"http://news.bbcimg.co.uk/media/images/49014000/jpg/_49014533_jex_800796_de27-1.jpg\"/> \n    </item>  \n    <item> \n      <title>Big money</title>  \n      <description>Russia is home to the wealthiest expats</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11229896</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11229896</guid>  \n      <pubDate>Wed, 08 Sep 2010 23:04:00 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49030000/jpg/_49030209_moscowcathedrals.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49030000/jpg/_49030207_moscowcathedrals.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49030000/jpg/_49030206_moscowcathedrals.jpg\"/> \n    </item>  \n    <item> \n      <title>Deep pockets</title>  \n      <description>Finding investors to delve beneath the ocean waves</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11198907</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11198907</guid>  \n      <pubDate>Tue, 07 Sep 2010 23:18:54 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49002000/jpg/_49002569_p1030594.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49008000/jpg/_49008542_tv001052499.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49008000/jpg/_49008545_tv001052499.jpg\"/> \n    </item>  \n    <item> \n      <title>Shale gas revolution</title>  \n      <description>Could this rock be a new major energy source?</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/science-environment-11175386</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/science-environment-11175386</guid>  \n      <pubDate>Wed, 08 Sep 2010 14:41:30 GMT</pubDate>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/48969000/jpg/_48969840_shalecorecomp.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/48965000/jpg/_48965475_shalecorecomp.jpg\"/> \n    </item>  \n    <item> \n      <title>China calling</title>  \n      <description>Can trade with China help the UK economy?</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/business-11152503</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/business-11152503</guid>  \n      <pubDate>Tue, 07 Sep 2010 21:20:35 GMT</pubDate>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49008000/jpg/_49008546_009204832-2.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49008000/jpg/_49008547_009204832-2.jpg\"/> \n    </item>  \n    <item> \n      <title>Winding up</title>  \n      <description>Regional Development Agency on its way out</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/uk-england-11213019</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/uk-england-11213019</guid>  \n      <pubDate>Wed, 08 Sep 2010 08:48:30 GMT</pubDate>  \n      <media:thumbnail width=\"66\" height=\"49\" url=\"http://news.bbcimg.co.uk/media/images/49014000/jpg/_49014463_nigelrussell.jpg\"/>  \n      <media:thumbnail width=\"203\" height=\"152\" url=\"http://news.bbcimg.co.uk/media/images/49014000/jpg/_49014459_advantagewestmidlands.jpg\"/>  \n      <media:thumbnail width=\"226\" height=\"170\" url=\"http://news.bbcimg.co.uk/media/images/49014000/jpg/_49014460_advantagewestmidlands.jpg\"/> \n    </item>  \n    <item> \n      <title>Q&amp;A: Income tax</title>  \n      <description>What should you do if the tax blunder affects you?</description>  \n      <link>http://www.bbc.co.uk/go/rss/int/news/-/news/uk-11186767</link>  \n      <guid isPermaLink=\"false\">http://www.bbc.co.uk/news/uk-11186767</guid>  \n      <pubDate>Tue, 07 Sep 2010 05:56:41 GMT</pubDate> \n    </item> \n  </channel> \n</rss>\n", message:undefined, modified:(new Date(1284015890686)), baseUri:"http://p3k.org/rss/", query:"frameColor=#222291&textColor=#ffffff&_=1223567155257&titleBarColor=#222291&compact=true&fontFace=arial&align=&showXmlButton=&maxItems=7&boxFillColor=#222291&titleBarTextColor=#ffffff&width=430&url=http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/business/rss.xml&", param:{textColor:"#ffffff", width:"430", align:"", fontFace:"arial", url:"http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/business/rss.xml", compact:"true", frameColor:"#222291", showXmlButton:"", boxFillColor:"#222291", _:"1223567155257", titleBarColor:"#222291", maxItems:"7", titleBarTextColor:"#ffffff"}, 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();

