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 GRN Live Video userGRNLive</title> <atom:link href="http://video.grnlive.net/RSS/Blog/4/GRNLive/" rel="self" type="application/rss+xml" /> <link>http://video.grnlive.net/RSS/Blog/4/GRNLive/</link> <description><![CDATA[RSS feed of the postings on GRN Live Video of the user GRNLive]]></description> <lastBuildDate>Sat, 04 Sep 2010 07:33:34 +0100</lastBuildDate> <item> <title>GRN 2 Way Interview</title> <link>http://video.grnlive.net/Posting/33/GRN_2_Way_Interview/</link> <pubDate>Thu, 21 Jan 2010 14:30:00 +0000</pubDate> <description><![CDATA[GRN 2 Way Interview]]></description> <guid>http://video.grnlive.net/Posting/33/GRN_2_Way_Interview/</guid> <comments>http://video.grnlive.net/Posting/33/GRN_2_Way_Interview/</comments> <enclosure url="http://video.grnlive.net/data/media/4/4F355AE8-0697-11DF-A967-001B63991F8F/s-thb.jpg"  length="2302"  type="image/jpeg" ></enclosure> </item> <item> <title>Prince William Arrives in Australia</title> <link>http://video.grnlive.net/Posting/29/Prince_William_Arrives_in_Australia/</link> <pubDate>Wed, 20 Jan 2010 10:59:00 +0000</pubDate> <description><![CDATA[Prince William, the second in line to the British throne, arrived in Sydney today (January 19, 2010) for a three day tour, which will also take in Melbourne. He will spend two days in Sydney, which will include meetings with the local indigenous community and a barbecue with Australians on the banks of Sydney harbour. He will then travel to Victoria where he will visit the site of last year?s disastrous bushfires which claimed 173 lives. It is the only the Prince?s second time in Australia. He last visited the country as a nine month old baby in l983 when he accompanied his mother, the late Princess Diana, and his father Prince Charles. Although the latest visit is not described as an ?official? trip, royal watchers believe Buckingham Palace is testing the water with a view to a longer stay for Prince William at some time in the future. Australians are divided over whether to declare the country a republic or maintain constitutional ties with Britain. The reception the Prince receives over the next three days will help to gauge the level of  support for the monarchy down under.]]></description> <guid>http://video.grnlive.net/Posting/29/Prince_William_Arrives_in_Australia/</guid> <comments>http://video.grnlive.net/Posting/29/Prince_William_Arrives_in_Australia/</comments> <enclosure url="http://video.grnlive.net/data/media/4/4F8A1ED3-1C7B-4BC2-B6FB-799DF8F7A302/s-thb.jpg"  length="3791"  type="image/jpeg" ></enclosure> </item> <item> <title>Hugh Grant at premier of Did You Hear what happened to the Morgans</title> <link>http://video.grnlive.net/Posting/27/Hugh_Grant_at_premier_of_Did_You_Hear_what_happened_to_the_Morgans/</link> <pubDate>Tue, 22 Dec 2009 14:12:00 +0000</pubDate> <description><![CDATA[To buy this video, please go to GettyImages.com]]></description> <guid>http://video.grnlive.net/Posting/27/Hugh_Grant_at_premier_of_Did_You_Hear_what_happened_to_the_Morgans/</guid> <comments>http://video.grnlive.net/Posting/27/Hugh_Grant_at_premier_of_Did_You_Hear_what_happened_to_the_Morgans/</comments> <enclosure url="http://video.grnlive.net/data/media/4/B138FDDE-EEF6-11DE-9DE2-002332CDB696/s-thb.jpg"  length="3768"  type="image/jpeg" ></enclosure> </item> <item> <title>Another dodgy NewsXchange video</title> <link>http://video.grnlive.net/Posting/26/Another_dodgy_NewsXchange_video/</link> <pubDate>Thu, 15 Oct 2009 11:08:00 +0100</pubDate> <description><![CDATA[More messing about]]></description> <guid>http://video.grnlive.net/Posting/26/Another_dodgy_NewsXchange_video/</guid> <comments>http://video.grnlive.net/Posting/26/Another_dodgy_NewsXchange_video/</comments> <enclosure url="http://video.grnlive.net/data/media/4/FB7D68D2-B970-11DE-BE63-002332CDB696/s-thb.jpg"  length="3533"  type="image/jpeg" ></enclosure> </item> <item> <title>NewsXchange video</title> <link>http://video.grnlive.net/Posting/25/NewsXchange_video/</link> <pubDate>Thu, 15 Oct 2009 10:28:00 +0100</pubDate> <description><![CDATA[Demo of end to end process - recording, editing and uploading via SNAPS]]></description> <guid>http://video.grnlive.net/Posting/25/NewsXchange_video/</guid> <comments>http://video.grnlive.net/Posting/25/NewsXchange_video/</comments> <enclosure url="http://video.grnlive.net/data/media/4/936CC480-B96C-11DE-87F3-002332CDB696/s-thb.jpg"  length="2571"  type="image/jpeg" ></enclosure> </item> <item> <title>The Good Side of Voodoo</title> <link>http://video.grnlive.net/Posting/24/The_Good_Side_of_Voodoo/</link> <pubDate>Wed, 14 Oct 2009 11:57:00 +0100</pubDate> <description><![CDATA[To many people, voodoo is seen as a mysterious religion, indeed violent and even dangerous. In Benin, where voodoo appeared for the first time four centuries ago, this religion gives us its more positive and benign side; its most misunderstood side.]]></description> <guid>http://video.grnlive.net/Posting/24/The_Good_Side_of_Voodoo/</guid> <comments>http://video.grnlive.net/Posting/24/The_Good_Side_of_Voodoo/</comments> <enclosure url="http://video.grnlive.net/data/media/4/A23E2B1A-3DB7-DE11-8F05-0017F22C183A/s-thb.jpg"  length="3154"  type="image/jpeg" ></enclosure> </item> <item> <title>Jerry Rawlings; A Controversial Leader</title> <link>http://video.grnlive.net/Posting/23/Jerry_Rawlings_A_Controversial_Leader/</link> <pubDate>Wed, 14 Oct 2009 11:31:00 +0100</pubDate> <description><![CDATA[A military man, a leader, head of state, a visionary or a tortuer, savior or tyrant...Jerry Rawlings, the man who took power twice in Ghana for his country but took a controversial route.]]></description> <guid>http://video.grnlive.net/Posting/23/Jerry_Rawlings_A_Controversial_Leader/</guid> <comments>http://video.grnlive.net/Posting/23/Jerry_Rawlings_A_Controversial_Leader/</comments> <enclosure url="http://video.grnlive.net/data/media/4/8A7322F6-38B7-DE11-8F05-0017F22C183A/s-thb.jpg"  length="5679"  type="image/jpeg" ></enclosure> </item> <item> <title>ghanascoffin_merchants.mov</title> <link>http://video.grnlive.net/Posting/22/ghanascoffin_merchants.mov/</link> <pubDate>Wed, 14 Oct 2009 11:02:00 +0100</pubDate> <description><![CDATA[In Ghana, death is celebrated through the art and imagination of coffin merchants, craftsmen who have placed their imagination in the service of the dead.]]></description> <guid>http://video.grnlive.net/Posting/22/ghanascoffin_merchants.mov/</guid> <comments>http://video.grnlive.net/Posting/22/ghanascoffin_merchants.mov/</comments> <enclosure url="http://video.grnlive.net/data/media/4/154DED26-37B7-DE11-8F05-0017F22C183A/s-thb.jpg"  length="3272"  type="image/jpeg" ></enclosure> </item> <item> <title>Land Mines in Angola</title> <link>http://video.grnlive.net/Posting/21/Land_Mines_in_Angola/</link> <pubDate>Mon, 12 Oct 2009 16:33:00 +0100</pubDate> <description><![CDATA[A long civil war lasting 27 years, a ravaged country and enough mines to main the whole of its population...Welcome to Angola, welcome to hell.]]></description> <guid>http://video.grnlive.net/Posting/21/Land_Mines_in_Angola/</guid> <comments>http://video.grnlive.net/Posting/21/Land_Mines_in_Angola/</comments> <enclosure url="http://video.grnlive.net/data/media/4/BFDF4549-34B7-DE11-97E7-0017F22C183A/s-thb.jpg"  length="3911"  type="image/jpeg" ></enclosure> </item> <item> <title>New story test - Barnes Sunday</title> <link>http://video.grnlive.net/Posting/20/New_story_test_Barnes_Sunday/</link> <pubDate>Sun, 11 Oct 2009 10:39:00 +0100</pubDate> <description><![CDATA[No  major transcript...]]></description> <guid>http://video.grnlive.net/Posting/20/New_story_test_Barnes_Sunday/</guid> <comments>http://video.grnlive.net/Posting/20/New_story_test_Barnes_Sunday/</comments> <enclosure url="http://video.grnlive.net/data/media/4/8AA152AE-B2BD-11DE-B133-002332CDB696/s-thb.jpg"  length="2492"  type="image/jpeg" ></enclosure> </item> </channel> </rss>';
var vieblogger_widgets_user_id = 4;
var vieblogger_widgets_user_login = "GRNLive";
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:#98A8D0;margin:0 0 5px 0;">';
				var obj_date = new Date(me.getNodeContent(items[i], "pubDate"));
				str_html += '<div style="color:#2C437A;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://video.grnlive.net/Blog/' + vieblogger_widgets_user_id + '/' + vieblogger_widgets_user_login + '/" style="font-size:11px;color:#2C437A;text-decoration:none;font-weight:normal;" target="_blank">' + vieblogger_widgets_user_login + '</a> on <a href="http://video.grnlive.net/"  style="font-size:11px;color:#2C437A;text-decoration:none;font-weight:normal;" title="">Video GRN Live</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://video.grnlive.net/Blog/' + vieblogger_widgets_user_id + '/' + vieblogger_widgets_user_login + '/" style="font-size:11px;color:#2C437A;text-decoration:none;font-weight:normal;" target="_blank">' + vieblogger_widgets_user_login + '</a> on <a href="http://video.grnlive.net/" style="font-size:11px;color:#2C437A;text-decoration:none;font-weight:normal;" title="Video Blog">Video GRN Live</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 #98A8D0;margin-bottom:1px;"><a href="http://video.grnlive.net/Blog/' + vieblogger_widgets_user_id + '/"><img src="http://video.grnlive.net/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 #98A8D0;min-height:110px;background:url(http://video.grnlive.net/site/vieblogger_preloader.gif) center center no-repeat;"></div>');
document.write('</div>');

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