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

var posts = [{ "Post" : {
	"title":"Touching the Surface of Teaching with Microsoft Surface",
	"adminTitle":"Touching the Surface of Teaching with Microsoft Surface",
	"description":"Two teachers from opposite sides of the world play with Microsoft Surface at NECC 2009 and Vicki Davis, Cool Cat Teacher, video blogs her thoughts about it.",
	"tags":["education","microsoft surface"],
	"datestamp":"08-03-09 04:12pm",
	"datestampUnixtime":"1249330341",
	"datestampDate":"2009-08-03",
	"datestampText":"Aug  3, 2009",
		
	"postsId":2454373,
	"postsGuid":"F3D93C0E-8069-11DE-84BA-ED807E12E7C5",
	"itemType":"file",
	"itemId":2434340,
	"url":"http://blip.tv/file/2434340",
	"mediaUrl":"http://blip.tv/file/get/Coolcatteacher-TouchingTheSurfaceOfTeachingWithMicrosoftSurface371.wmv?source=2",
	"thumbnailUrl":"http://a.images.blip.tv/Coolcatteacher-TouchingTheSurfaceOfTeachingWithMicrosoftSurface371-903.jpg",
	"thumbnail120Url":"http://a.images.blip.tv/Coolcatteacher-TouchingTheSurfaceOfTeachingWithMicrosoftSurface371-903-918.jpg",
	"login":"coolcatteacher",
	"userId":343828,
	"showName":"coolcatteacher",
	"blogUrl":"http://coolcatteacher.blogspot.com",
	"media":{
		"url":"http://blip.tv/file/get/Coolcatteacher-TouchingTheSurfaceOfTeachingWithMicrosoftSurface371.wmv?source=2",
		"mimeType":"video/ms-wmv",
		"duration":852,
		"width":640,
		"height":480
	},
	"contentRating":"TV-G",
	"advertising":"",

	/* Version 1 implementation, please supply version=2 in the future */
	"Title":"Touching the Surface of Teaching with Microsoft Surface",
	"posts_id":"2454373",
	"item_type":"file",
	"item_id":"2434340",
	"posts_url":"http://blip.tv/file/2434340",
	
	"media_src":"blip.tv/file/get/Coolcatteacher-TouchingTheSurfaceOfTeachingWithMicrosoftSurface371.wmv?source=2",
	
	
	"Thumbnail":{
		"Url":"http://a.images.blip.tv/Coolcatteacher-TouchingTheSurfaceOfTeachingWithMicrosoftSurface371-903.jpg"
	},
	
	"User":"coolcatteacher"
}},{ "Post" : {
	"title":"A Tour into Digiteen Island",
	"adminTitle":"A Tour into Digiteen Island",
	"description":"Using some video from Leon Cynch of the BBC on our <a href=\"http://digiteendreamteam.blogspot.com\">Digiteen Island</a>, this is a compliation of some of the sights and sounds of Digiteen Island built on <a href=\"http://www.reactiongrid.com\">Reaction Grid</a>, using OpenSim, the open Source version of <a href=\"http://www.secondlife.com\">Second Life</a>.",
	"tags":["education","secondlife","opensim"],
	"datestamp":"03-31-09 03:58pm",
	"datestampUnixtime":"1238529483",
	"datestampDate":"2009-03-31",
	"datestampText":"Mar 31, 2009",
		
	"postsId":1950782,
	"postsGuid":"3EACCAE6-1E2E-11DE-A1A5-DE1808435EE7",
	"itemType":"file",
	"itemId":1941137,
	"url":"http://blip.tv/file/1941137",
	"mediaUrl":"http://blip.tv/file/get/Coolcatteacher-ATourIntoDigiteenIsland692.wmv?source=2",
	"thumbnailUrl":"http://a.images.blip.tv/Coolcatteacher-ATourIntoDigiteenIsland692-533.jpg",
	"thumbnail120Url":"http://a.images.blip.tv/Coolcatteacher-ATourIntoDigiteenIsland692-533-579.jpg",
	"login":"coolcatteacher",
	"userId":343828,
	"showName":"coolcatteacher",
	"blogUrl":"http://coolcatteacher.blogspot.com",
	"media":{
		"url":"http://blip.tv/file/get/Coolcatteacher-ATourIntoDigiteenIsland692.wmv?source=2",
		"mimeType":"video/ms-wmv",
		"duration":86,
		"width":640,
		"height":480
	},
	"contentRating":"TV-G",
	"advertising":"",

	/* Version 1 implementation, please supply version=2 in the future */
	"Title":"A Tour into Digiteen Island",
	"posts_id":"1950782",
	"item_type":"file",
	"item_id":"1941137",
	"posts_url":"http://blip.tv/file/1941137",
	
	"media_src":"blip.tv/file/get/Coolcatteacher-ATourIntoDigiteenIsland692.wmv?source=2",
	
	
	"Thumbnail":{
		"Url":"http://a.images.blip.tv/Coolcatteacher-ATourIntoDigiteenIsland692-533.jpg"
	},
	
	"User":"coolcatteacher"
}},{ "Post" : {
	"title":"Curriculum Idea: Flint River Immersion Project",
	"adminTitle":"Curriculum Idea: Flint River Immersion Project",
	"description":"This week\'s video cast is about the Flint River Immersion project which is an immersive project that we are kicking off at our school.  Immersive projects are coming into practice in many schools that implement Project Based Learning. The students will actually be out of the classroom for a week in grades 9-12.  They will be studying the Flint River.  More detail can be seen at the <a href=\"http://flintriver.ning.com\" target=\"_blank\">Flint River Ning</a>.",
	"tags":["education","learning","curriculum","innovation"],
	"datestamp":"03-27-09 12:05pm",
	"datestampUnixtime":"1238169957",
	"datestampDate":"2009-03-27",
	"datestampText":"Mar 27, 2009",
		
	"postsId":1935656,
	"postsGuid":"2836CFA2-1AE9-11DE-9735-978A9EF58EFC",
	"itemType":"file",
	"itemId":1926034,
	"url":"http://blip.tv/file/1926034",
	"mediaUrl":"http://blip.tv/file/get/Coolcatteacher-CurriculumIdeaFlintRiverImmersionProject810.wmv?source=2",
	"thumbnailUrl":"http://a.images.blip.tv/Coolcatteacher-CurriculumIdeaFlintRiverImmersionProject810-394.jpg",
	"thumbnail120Url":"http://a.images.blip.tv/Coolcatteacher-CurriculumIdeaFlintRiverImmersionProject810-394-904.jpg",
	"login":"coolcatteacher",
	"userId":343828,
	"showName":"coolcatteacher",
	"blogUrl":"http://coolcatteacher.blogspot.com",
	"media":{
		"url":"http://blip.tv/file/get/Coolcatteacher-CurriculumIdeaFlintRiverImmersionProject810.wmv?source=2",
		"mimeType":"video/ms-wmv",
		"duration":431,
		"width":320,
		"height":240
	},
	"contentRating":"TV-G",
	"advertising":"",

	/* Version 1 implementation, please supply version=2 in the future */
	"Title":"Curriculum Idea: Flint River Immersion Project",
	"posts_id":"1935656",
	"item_type":"file",
	"item_id":"1926034",
	"posts_url":"http://blip.tv/file/1926034",
	
	"media_src":"blip.tv/file/get/Coolcatteacher-CurriculumIdeaFlintRiverImmersionProject810.wmv?source=2",
	
	
	"Thumbnail":{
		"Url":"http://a.images.blip.tv/Coolcatteacher-CurriculumIdeaFlintRiverImmersionProject810-394.jpg"
	},
	
	"User":"coolcatteacher"
}},{ "Post" : {
	"title":"Tip #1 Rock the Box (Your Inbox that Is)",
	"adminTitle":"Tip #1 Rock the Box (Your Inbox that Is)",
	"description":"The Cool Cat Teacher shares her video tips for cool little tricks that you may not know are there.  This week, it is the GTD (Getting things done) Firefox plug in for Gmail.  It is downloadable at <a href=\"http://www.gtdgmail.com/\">http://www.gtdgmail.com/</a>.",
	"tags":[],
	"datestamp":"03-19-09 10:21am",
	"datestampUnixtime":"1237472469",
	"datestampDate":"2009-03-19",
	"datestampText":"Mar 19, 2009",
		
	"postsId":1905216,
	"postsGuid":"313B6774-1491-11DE-9041-F4B0B7C01022",
	"itemType":"file",
	"itemId":1895627,
	"url":"http://blip.tv/file/1895627",
	"mediaUrl":"http://blip.tv/file/get/Coolcatteacher-Tip1RockTheBoxYourInboxThatIs976.wmv?source=2",
	"thumbnailUrl":"http://a.images.blip.tv/Coolcatteacher-Tip1RockTheBoxYourInboxThatIs161.jpg",
	"thumbnail120Url":"http://a.images.blip.tv/Coolcatteacher-Tip1RockTheBoxYourInboxThatIs161-673.jpg",
	"login":"coolcatteacher",
	"userId":343828,
	"showName":"coolcatteacher",
	"blogUrl":"http://coolcatteacher.blogspot.com",
	"media":{
		"url":"http://blip.tv/file/get/Coolcatteacher-Tip1RockTheBoxYourInboxThatIs976.wmv?source=2",
		"mimeType":"video/ms-wmv",
		"duration":238,
		"width":640,
		"height":480
	},
	"contentRating":"TV-UN",
	"advertising":"",

	/* Version 1 implementation, please supply version=2 in the future */
	"Title":"Tip #1 Rock the Box (Your Inbox that Is)",
	"posts_id":"1905216",
	"item_type":"file",
	"item_id":"1895627",
	"posts_url":"http://blip.tv/file/1895627",
	
	"media_src":"blip.tv/file/get/Coolcatteacher-Tip1RockTheBoxYourInboxThatIs976.wmv?source=2",
	
	
	"Thumbnail":{
		"Url":"http://a.images.blip.tv/Coolcatteacher-Tip1RockTheBoxYourInboxThatIs161.jpg"
	},
	
	"User":"coolcatteacher"
}}
];



	
		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 = 'My Videos: ';
	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;">My Videos: </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);
}

	

