var vieblogger_rss = '<?xml version="1.0" encoding="utf-8"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"   > <channel> <title>Postings of VieBlogger.com userGlobal Radio News</title> <atom:link href="http://www.vieblogger.com/RSS/Blog/29/Global Radio News/" rel="self" type="application/rss+xml" /> <link>http://www.vieblogger.com/RSS/Blog/29/Global Radio News/</link> <description><![CDATA[RSS feed of the postings on VieBlogger.com of the user Global Radio News]]></description> <lastBuildDate>Tue, 09 Feb 2010 11:03:25 GMT</lastBuildDate> <image><title>Postings of VieBlogger.com userGlobal Radio News</title> <link>http://www.vieblogger.com/RSS/Blog/29/Global Radio News/</link> <url>http://www.vieblogger.com/data/media/profiles/GRNVB_1.jpg</url> </image> <item> <title>The Art of the 2 Way Interview</title> <link>http://www.vieblogger.com/Posting/216/The_Art_of_the_2_Way_Interview/</link> <pubDate>Wed, 07 Oct 2009 01:34:00 +0100</pubDate> <description><![CDATA[The Art of the 2 Way Interview]]></description> <guid>http://www.vieblogger.com/Posting/216/The_Art_of_the_2_Way_Interview/</guid> <comments>http://www.vieblogger.com/Posting/216/The_Art_of_the_2_Way_Interview/</comments> <enclosure url="http://www.vieblogger.com/data/media/29/B5C492A0-AC7A-11DE-B611-001FF3C9EFC6/s-thb.jpg"  length="2304"  type="image/jpeg" ></enclosure> </item> <item> <title>Sights &amp; Sounds of Victoria</title> <link>http://www.vieblogger.com/Posting/213/Sights_Sounds_of_Victoria/</link> <pubDate>Wed, 23 Sep 2009 17:16:00 +0100</pubDate> <description><![CDATA[Video was shot around Victoria Station within London. It includes different sights and sounds around town, both in and outside the tube.]]></description> <guid>http://www.vieblogger.com/Posting/213/Sights_Sounds_of_Victoria/</guid> <comments>http://www.vieblogger.com/Posting/213/Sights_Sounds_of_Victoria/</comments> <enclosure url="http://www.vieblogger.com/data/media/29/92F6DE98-49A8-DE11-9C2C-0017F22C183A/s-thb.jpg"  length="2492"  type="image/jpeg" ></enclosure> </item> <item> <title>UgandaPackage.mov</title> <link>http://www.vieblogger.com/Posting/205/UgandaPackage.mov/</link> <pubDate>Thu, 27 Aug 2009 18:15:00 +0100</pubDate> <description><![CDATA[Uganda Environmental Health Crisis - package  NOT FOR BROADCAST  To buy this package - please contact GRN or Getty Images]]></description> <guid>http://www.vieblogger.com/Posting/205/UgandaPackage.mov/</guid> <comments>http://www.vieblogger.com/Posting/205/UgandaPackage.mov/</comments> <enclosure url="http://www.vieblogger.com/data/media/29/2B895DD9-2293-DE11-B1D3-0017F22C183A/s-thb.jpg"  length="3780"  type="image/jpeg" ></enclosure> </item> <item> <title>China Army rushes - part 1</title> <link>http://www.vieblogger.com/Posting/204/China_Army_rushes_part_1/</link> <pubDate>Thu, 27 Aug 2009 16:53:00 +0100</pubDate> <description><![CDATA[Video of the Chinese Army  To buy and use this footage please contact GRN or go to Getty Images]]></description> <guid>http://www.vieblogger.com/Posting/204/China_Army_rushes_part_1/</guid> <comments>http://www.vieblogger.com/Posting/204/China_Army_rushes_part_1/</comments> <enclosure url="http://www.vieblogger.com/data/media/29/56D54B02-1D93-DE11-B1D3-0017F22C183A/s-thb.jpg"  length="3334"  type="image/jpeg" ></enclosure> </item> <item> <title>Sayed Pervez Kambaksh - Interview</title> <link>http://www.vieblogger.com/Posting/201/Sayed_Pervez_Kambaksh_Interview/</link> <pubDate>Wed, 26 Aug 2009 22:06:00 +0100</pubDate> <description><![CDATA[Interview by Jerome Starkey of the journalism imprisoned for blasphemy. This is a sample - NOT FOR BROADCAST]]></description> <guid>http://www.vieblogger.com/Posting/201/Sayed_Pervez_Kambaksh_Interview/</guid> <comments>http://www.vieblogger.com/Posting/201/Sayed_Pervez_Kambaksh_Interview/</comments> <enclosure url="http://www.vieblogger.com/data/media/29/23927A68-5D89-11DE-817F-002332CDB696/s-thb1.jpg"  length="2271"  type="image/jpeg" ></enclosure> </item> <item> <title>Sample Juan film</title> <link>http://www.vieblogger.com/Posting/200/Sample_Juan_film/</link> <pubDate>Wed, 26 Aug 2009 21:36:00 +0100</pubDate> <description><![CDATA[This is sample footage.  - NOT FOR BROADCAST - Please contact GRN for details]]></description> <guid>http://www.vieblogger.com/Posting/200/Sample_Juan_film/</guid> <comments>http://www.vieblogger.com/Posting/200/Sample_Juan_film/</comments> <enclosure url="http://www.vieblogger.com/data/media/29/70BECF7A-1875-11DE-92C5-002332CDB696/s-thb.jpg"  length="3776"  type="image/jpeg" ></enclosure> </item> <item> <title>Glastonbury Festival 2009</title> <link>http://www.vieblogger.com/Posting/198/Glastonbury_Festival_2009/</link> <pubDate>Tue, 21 Jul 2009 14:45:00 +0100</pubDate> <description><![CDATA[Glastonbury Festival 2009. A taste of the weekend.  - (Not for Broadcast - Please contact GRN for details)]]></description> <guid>http://www.vieblogger.com/Posting/198/Glastonbury_Festival_2009/</guid> <comments>http://www.vieblogger.com/Posting/198/Glastonbury_Festival_2009/</comments> <enclosure url="http://www.vieblogger.com/data/media/29/C8918EF4-F975-DE11-A58D-001B639B3B2D/s-thb.jpg"  length="3385"  type="image/jpeg" ></enclosure> </item> <item> <title>Bastille Day London (In French)</title> <link>http://www.vieblogger.com/Posting/197/Bastille_Day_London_In_French/</link> <pubDate>Tue, 21 Jul 2009 10:56:00 +0100</pubDate> <description><![CDATA[French report on Bastille Day in London.  (Not for Broadcast - Please contact GRN for details)]]></description> <guid>http://www.vieblogger.com/Posting/197/Bastille_Day_London_In_French/</guid> <comments>http://www.vieblogger.com/Posting/197/Bastille_Day_London_In_French/</comments> <enclosure url="http://www.vieblogger.com/data/media/29/4A3119AE-D575-DE11-8B0F-001B639B3B2D/s-thb.jpg"  length="3730"  type="image/jpeg" ></enclosure> </item> <item> <title>URUMQIRUSHES SECURITY 2.mov</title> <link>http://www.vieblogger.com/Posting/196/URUMQIRUSHES_SECURITY_2.mov/</link> <pubDate>Mon, 20 Jul 2009 10:48:00 +0100</pubDate> <description><![CDATA[Security personnel around People\'s Square, in the centre of Urumqi.  - (Not for Broadcast - Please contact GRN for details)]]></description> <guid>http://www.vieblogger.com/Posting/196/URUMQIRUSHES_SECURITY_2.mov/</guid> <comments>http://www.vieblogger.com/Posting/196/URUMQIRUSHES_SECURITY_2.mov/</comments> <enclosure url="http://www.vieblogger.com/data/media/29/F8605C07-1175-DE11-BC15-001B639B3B2D/s-thb.jpg"  length="3651"  type="image/jpeg" ></enclosure> </item> <item> <title>URUMQIRUSHES SECURITY.mov</title> <link>http://www.vieblogger.com/Posting/195/URUMQIRUSHES_SECURITY.mov/</link> <pubDate>Mon, 20 Jul 2009 10:36:00 +0100</pubDate> <description><![CDATA[Security personnel in the streets of the main Uighur quarter in the centre of Urumqi.  - (Not for Broadcast - Please contact GRN for details)]]></description> <guid>http://www.vieblogger.com/Posting/195/URUMQIRUSHES_SECURITY.mov/</guid> <comments>http://www.vieblogger.com/Posting/195/URUMQIRUSHES_SECURITY.mov/</comments> <enclosure url="http://www.vieblogger.com/data/media/29/66117856-0F75-DE11-BC15-001B639B3B2D/s-thb.jpg"  length="4208"  type="image/jpeg" ></enclosure> </item> </channel> </rss>';
var vieblogger_widgets_user_id = 29;
var vieblogger_widgets_user_login = "Global Radio News";
var vieblogger_widgets_type = "posting_thumbs"


function VieBloggerAR() {
	this.showFeed = function() {
		
		try {
			if (vieblogger_rss != "") {
				var dom = me.parseDom(vieblogger_rss);
				var items = me.xPath(dom, "//item");
				if (items.length > 0) {
					switch (vieblogger_widgets_type) {
						case "posting_list":
							me.showPostingList(items);
							break;
						case "posting_thumbs":
							me.showPostingThumbs(items);
							break;
					}
				} else {
					me.noData(3);
				}
			} else {
				me.noData(2);
			}
		} catch (e) {
			me.noData(1);
		}
	}
	
	this.showPostingList = function(items) {
		var str_html = "";
		var content = document.getElementById("vieblogger_widget_content_" + vieblogger_widgets_type);
		if (content) {
			str_html += '<ol style="margin:0 0 5px 30px;">';
			var int_max = items.length;
			if (int_max > 10) {
				int_max=10;
			}
			for(var i=0; i<int_max; i++) {
				str_html += '<li style="font-size:16px;font-weight:bold;letter-spacing:0;line-height:12px;color:#C1D72D;margin:0 0 5px 0;">';
				var obj_date = new Date(me.getNodeContent(items[i], "pubDate"));
				str_html += '<div style="color:#8A8D08;font-size:bold;font-size:12px;float:right;padding-top:2px;">' + obj_date.getDate() + "." + (obj_date.getMonth()+1) + "." + obj_date.getFullYear() + "</div>";
				
				str_html += '<a href="' + me.getNodeContent(items[i], "link") + '" style="font-size:11px;color:#000;text-decoration:none;font-weight:normal;" target="_blank">' + me.prepareText(me.getNodeContent(items[i], "title"),45) + '</a>';
				
				str_html += "</li>";
			} 
			str_html += "</ol>";

			
			str_html += '<div style="border-top:1px solid #ccc;padding-top:3px;color:#666;font-size:11px;">';
			str_html += 'Latest postings by user <a href="http://www.vieblogger.com/Blog/' + vieblogger_widgets_user_id + '/' + vieblogger_widgets_user_login + '/" style="font-size:11px;color:#8A8D08;text-decoration:none;font-weight:normal;" target="_blank">' + vieblogger_widgets_user_login + '</a> on <a href="http://www.vieblogger.com/"  style="font-size:11px;color:#8A8D08;text-decoration:none;font-weight:normal;" title="">VieBlogger.com</a>';
			str_html += '</div>';
			content.style.background = "none";
			content.style.padding = "5px";
			content.innerHTML = str_html;
		}
	}
	
	this.showPostingThumbs = function(items) {
	
		var str_html = "";
		var content = document.getElementById("vieblogger_widget_content_" + vieblogger_widgets_type);
		if (content) {
			var int_max = items.length;
			if (int_max > 6) {
				int_max=6;
			}
			for(var i=0; i<int_max; i++) {
				var obj_date = new Date(me.getNodeContent(items[i], "pubDate"));
				str_alt = me.getNodeContent(items[i], "title") + " - " + obj_date.getDate() + "." + (obj_date.getMonth()+1) + "." + obj_date.getFullYear();
				if (i % 2 == 0) {
					str_html += '<a href="' + me.getNodeContent(items[i], "link") + '" target="_blank" style="margin:0 2px 2px 0;float:left;width:120px;height:90px;">';
				} else {
					str_html += '<a href="' + me.getNodeContent(items[i], "link") + '" target="_blank" style="margin:0 0 2px 0;float:left;width:120px;height:90px;">';
				}
				str_html += '<img src="' + me.getNodeAttributeValue(items[i], "enclosure", "url") + '" title="' + str_alt + '" alt="' + str_alt + '" style="border:0;"/>';
				str_html += '</a>';
			} 
			str_html += '<div style="color:#666;font-size:11px;clear:both;">';
			str_html += 'Latest postings by user <a href="http://www.vieblogger.com/Blog/' + vieblogger_widgets_user_id + '/' + vieblogger_widgets_user_login + '/" style="font-size:11px;color:#8A8D08;text-decoration:none;font-weight:normal;" target="_blank">' + vieblogger_widgets_user_login + '</a> on <a href="http://www.vieblogger.com/" style="font-size:11px;color:#8A8D08;text-decoration:none;font-weight:normal;" title="Video Blog">VieBlogger.com</a>';
			str_html += '</div>';
			content.style.background = "none";
			content.style.padding = "3px";
			content.innerHTML = str_html;
		}
	}
	
	this.noData = function(x) {
		var content = document.getElementById("vieblogger_widget_content_" + vieblogger_widgets_type);
		if (content) {
			content.style.background = "none";
			content.style.padding = "10px";
			content.innerHTML = '<span style="color:#666;">no data found</b>';
		}
	}
	
	/* helper functions */
	this.getNodeContent = function(node, str_node_name) {
		var str_out = "";
		try {
			if (node.childNodes.length > 0) {
				for(var j=0; j<node.childNodes.length; j++) {
					if (node.childNodes[j].nodeName == str_node_name) {
						return node.childNodes[j].firstChild.nodeValue; 
					}
				}
			} 
		} catch (e) {}
		return str_out; 
	} 
	
	this.getNodeAttributeValue = function(node, str_node_name, str_attribute) {
		var str_out = "";
		try {
			if (node.childNodes.length > 0) {
				for(var j=0; j<node.childNodes.length; j++) {
					if (node.childNodes[j].nodeName == str_node_name) {
						return node.childNodes[j].getAttribute(str_attribute);
					}
				}
			} 
		} catch (e) {}
		return str_out; 
	} 
	
	this.prepareText = function(str_text, int_length) {
		str_text.replace(/\s*((\S+\s*)*)/, "$1");
		str_text.replace( /((\s*\S+)*)\s*/, "$1");
		
		if (str_text.length > int_length) {
			str_text = str_text.substring(0, int_length-3) + "..."; 
		}
		
		return str_text;
	}

	this.parseDom = function(str_data) {
		try {
  			xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  			xmlDoc.async="false";
  			xmlDoc.loadXML(str_data);
  			return xmlDoc;
  		} catch(e) {
  			parser=new DOMParser();
  			xmlDoc=parser.parseFromString(str_data,"text/xml");
  			return xmlDoc;
  		}
	}
	
	this.xPath = function(oNodes, sXPath) {
	    if(oNodes) {
	    	 if(oNodes) {
    			try {
               		var oXpe = new XPathEvaluator();
               		var oNsResolver = oXpe.createNSResolver(oNodes.ownerDocument == null ? oNodes.documentElement : oNodes.ownerDocument.documentElement);
               		var oResult = oXpe.evaluate(sXPath, oNodes, oNsResolver, 0, null);
               		var aFound = [];
               		var oRes;
               		while (oRes = oResult.iterateNext()) {
	                   	aFound.push(oRes);
               		}
					return aFound;
            	} catch (e) {
	        		oNodes.setProperty ("SelectionLanguage", "XPath")
					var oSelectedNode = oNodes.documentElement.selectNodes(sXPath);
					return oSelectedNode;
	        	}
	    	}
	    }
	}
	
	var me = this;
}

document.write('<div id="vieblogger_widget_container_' + vieblogger_widgets_type + '" style="background-color:#fff;width:250px;margin-bottom:10px;font-family:Arial, Helvetica, sans-serif;font-size:12px;">');
document.write('	<div style="border:1px solid #c1d72d;margin-bottom:1px;"><a href="http://www.vieblogger.com/Blog/' + vieblogger_widgets_user_id + '/"><img src="http://www.vieblogger.com/site/vieblogger_widget_logo.gif" alt="logo" style="border:0;"/></a></div>');
document.write('	<div id="vieblogger_widget_content_' + vieblogger_widgets_type + '" style="border:1px solid #c1d72d;min-height:110px;background:url(http://www.vieblogger.com/site/vieblogger_preloader.gif) center center no-repeat;"></div>');
document.write('</div>');

var vieblogger_ajax_request = new VieBloggerAR(); 
vieblogger_ajax_request.showFeed();
