var BLIP_SITE_URL = "http://blip.tv"; 
var OUTPUT_METHOD = "document_write";

var posts = [{ "Post" : {
	"title":"JDC - Round 1",
	"adminTitle":"JDC - Round 1",
	"description":"Moments from first round of the John Deere Classic Thursday July 9, 2009 at TPC Deere Run in Silvis, IL.",
	"tags":["golf","pga","john deere classic"],
	"datestamp":"07-09-09 11:39pm",
	"datestampUnixtime":"1247197145",
	"datestampDate":"2009-07-09",
	"datestampText":"Jul  9, 2009",
		
	"postsId":2361555,
	"postsGuid":"3777B4EC-6D03-11DE-AF95-8E1518B034BA",
	"itemType":"file",
	"itemId":2341471,
	"url":"http://blip.tv/file/2341471",
	"mediaUrl":"http://blip.tv/file/get/Qconlinevideo-RoundOneOfTheJohnDeereClassic279.mov?source=2",
	"thumbnailUrl":"http://a.images.blip.tv/Qconlinevideo-RoundOneOfTheJohnDeereClassic279-292.jpg",
	"thumbnail120Url":"http://a.images.blip.tv/Qconlinevideo-RoundOneOfTheJohnDeereClassic279-292-751.jpg",
	"login":"qconlinevideo",
	"userId":389748,
	"showName":"qconlinevideo",
	"blogUrl":null,
	"media":{
		"url":"http://blip.tv/file/get/Qconlinevideo-RoundOneOfTheJohnDeereClassic279.mov?source=2",
		"mimeType":"video/quicktime",
		"duration":115,
		"width":640,
		"height":360
	},
	"contentRating":"TV-UN",
	"advertising":"",

	/* Version 1 implementation, please supply version=2 in the future */
	"Title":"JDC - Round 1",
	"posts_id":"2361555",
	"item_type":"file",
	"item_id":"2341471",
	"posts_url":"http://blip.tv/file/2341471",
	
	"media_src":"blip.tv/file/get/Qconlinevideo-RoundOneOfTheJohnDeereClassic279.mov?source=2",
	
	
	"Thumbnail":{
		"Url":"http://a.images.blip.tv/Qconlinevideo-RoundOneOfTheJohnDeereClassic279-292.jpg"
	},
	
	"User":"qconlinevideo"
}},{ "Post" : {
	"title":"JDC-Wandering",
	"adminTitle":"JDC-Wandering",
	"description":"Despite Mother Nature\'s defeat of the John Deere Classic Pro-Am Wednesday, July 8, sports writer Matt Veto and multimedia producer Stephanie Makosky managed to find hijinks and hilarity on a rainy day at TPC at Deere Run.",
	"tags":["john deere classic","pga","golf","dispatch","argus","moline","matt veto","stephanie makosky"],
	"datestamp":"07-08-09 09:55pm",
	"datestampUnixtime":"1247104522",
	"datestampDate":"2009-07-08",
	"datestampText":"Jul  8, 2009",
		
	"postsId":2356940,
	"postsGuid":"90106C76-6C2B-11DE-A8FF-CD747FF3B220",
	"itemType":"file",
	"itemId":2336853,
	"url":"http://blip.tv/file/2336853",
	"mediaUrl":"http://blip.tv/file/get/Qconlinevideo-JDCWandering731.mov?source=2",
	"thumbnailUrl":"http://a.images.blip.tv/Qconlinevideo-JDCWandering457.jpg",
	"thumbnail120Url":"http://a.images.blip.tv/Qconlinevideo-JDCWandering457-536.jpg",
	"login":"qconlinevideo",
	"userId":389748,
	"showName":"qconlinevideo",
	"blogUrl":null,
	"media":{
		"url":"http://blip.tv/file/get/Qconlinevideo-JDCWandering731.mov?source=2",
		"mimeType":"video/quicktime",
		"duration":202,
		"width":640,
		"height":360
	},
	"contentRating":"TV-UN",
	"advertising":"",

	/* Version 1 implementation, please supply version=2 in the future */
	"Title":"JDC-Wandering",
	"posts_id":"2356940",
	"item_type":"file",
	"item_id":"2336853",
	"posts_url":"http://blip.tv/file/2336853",
	
	"media_src":"blip.tv/file/get/Qconlinevideo-JDCWandering731.mov?source=2",
	
	
	"Thumbnail":{
		"Url":"http://a.images.blip.tv/Qconlinevideo-JDCWandering457.jpg"
	},
	
	"User":"qconlinevideo"
}},{ "Post" : {
	"title":"Who Is Tiger Woods? ",
	"adminTitle":"Who Is Tiger Woods? ",
	"description":"On Tuesday July 7, 2009 the children of the United Neighbors Summer Park Program performed their best Tiger Woods impersonations after the Alcoa Youth Clinic on the practice tee at TPC Deere Run. The annual youth clinic marks the start of a busy week of activities at the John Deere Classic. Wednesday will feature the annual Pro-Am.",
	"tags":["john deere classic","golf","moline","dispatch","argus"],
	"datestamp":"07-07-09 09:06pm",
	"datestampUnixtime":"1247015168",
	"datestampDate":"2009-07-07",
	"datestampText":"Jul  7, 2009",
		
	"postsId":2352467,
	"postsGuid":"84E1698E-6B5B-11DE-BE21-FB7C432AF2B4",
	"itemType":"file",
	"itemId":2332452,
	"url":"http://blip.tv/file/2332452",
	"mediaUrl":"http://blip.tv/file/get/Qconlinevideo-WhoIsTigerWoods398.mov?source=2",
	"thumbnailUrl":"http://a.images.blip.tv/Qconlinevideo-WhoIsTigerWoods398-660.jpg",
	"thumbnail120Url":"http://a.images.blip.tv/Qconlinevideo-WhoIsTigerWoods398-660-583.jpg",
	"login":"qconlinevideo",
	"userId":389748,
	"showName":"qconlinevideo",
	"blogUrl":null,
	"media":{
		"url":"http://blip.tv/file/get/Qconlinevideo-WhoIsTigerWoods398.mov?source=2",
		"mimeType":"video/quicktime",
		"duration":61,
		"width":640,
		"height":360
	},
	"contentRating":"TV-UN",
	"advertising":"",

	/* Version 1 implementation, please supply version=2 in the future */
	"Title":"Who Is Tiger Woods? ",
	"posts_id":"2352467",
	"item_type":"file",
	"item_id":"2332452",
	"posts_url":"http://blip.tv/file/2332452",
	
	"media_src":"blip.tv/file/get/Qconlinevideo-WhoIsTigerWoods398.mov?source=2",
	
	
	"Thumbnail":{
		"Url":"http://a.images.blip.tv/Qconlinevideo-WhoIsTigerWoods398-660.jpg"
	},
	
	"User":"qconlinevideo"
}}
];



	
		var html; 
var container;
if(OUTPUT_METHOD == "dom") {
	container = document.createElement('div');
	container.className = 'bliptv_sidebar';
	container.style.width = '110px';
	container.style.border = '1px solid black';
	container.style.padding = '5px';
	
	var c = document.createElement('center');
	container.appendChild(c);

	var title = document.createElement('span');
	title.style.fontFamily = 'arial';
	title.style.fontSize = '7.5pt';
	title.style.fontWeight = 'bold';
	title.innerHTML = 'VIDEO';
	c.appendChild(title);
	c.appendChild(document.createElement('br'));
	c.appendChild(document.createElement('br'));
} else {
	html = '<div class="bliptv_sidebar" style="width: 110px; border: 1px solid black; padding: 5px;"><center>';
	html += '<span style="font-family: arial; font-size: 7.5pt; font-weight: bold;">VIDEO</span><br /><br />'; 
}

for(var i = 0; i < posts.length; i++) {
	if(posts[i]['Post']['Thumbnail']) {
		if(OUTPUT_METHOD == "dom") {
			var anchor = document.createElement('a');
			anchor.href = BLIP_SITE_URL + '/' + posts[i]['Post']['item_type'] + '/'+ posts[i]['Post']['item_id'];

			var img = document.createElement('img');
			img.src = posts[i]['Post']['Thumbnail']['Url'];
			img.width = '90';
			img.height = '75';
			img.border = '0';
			img.title = posts[i]['Post']['Title'];

			anchor.appendChild(img);
			c.appendChild(anchor);
			c.appendChild(document.createElement('br'));
			c.appendChild(document.createElement('br'));
		} else {
			html += '<a href="' + BLIP_SITE_URL + '/' + posts[i]['Post']['item_type'] + '/'+ posts[i]['Post']['item_id'] + '"><img src="' + posts[i]['Post']['Thumbnail']['Url'] + '" width="90" height="75" style="border: 0px;" title="' + posts[i]['Post']['Title'] + '"/></a><br /><br />';
		}
	}
}

if(OUTPUT_METHOD == "dom") {
	c.appendChild(document.createElement('br'));
	var anchor = document.createElement('a');
	anchor.href = BLIP_SITE_URL;
	
	var img = document.createElement('img');
	img.src = BLIP_SITE_URL  + '/skin/blipcast/blip.tv.share.button.gif';
	img.border = 0;

	anchor.appendChild(img);
	c.appendChild(anchor);

	document.getElementById('blip_sidebar_container').appendChild(container);
	
} else {
	html += '<br /><a href="' + BLIP_SITE_URL + '"><img src="' + BLIP_SITE_URL  + '/skin/blipcast/blip.tv.share.button.gif" border="0" /></a>'; 
	html += '</center></div>';
	document.write(html);
}

	

