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

var posts = [{ "Post" : {
	"title":"Texas Renewable Energy Roundup and Green LIving Fair Exhibitor promo",
	"adminTitle":"Texas Renewable Energy Roundup and Green LIving Fair Exhibitor promo",
	"description":"",
	"tags":["texas","renewable","energy","roundup","green","living","fair","exhibitor"],
	"datestamp":"09-11-09 12:20pm",
	"datestampUnixtime":"1252686047",
	"datestampDate":"2009-09-11",
	"datestampText":"Sep 11, 2009",
    
		
	"postsId":2610892,
	"postsGuid":"1047ABD4-9EEF-11DE-BDC1-BC4B6CCD660E",
	"itemType":"file",
	"itemId":2590940,
	"url":"http://blip.tv/file/2590940",
	"mediaUrl":"http://blip.tv/file/get/Toddoneill-TexasRenewableEnergyRoundupAndGreenLIvingFairExhibitorP716.mov?source=2",
	"thumbnailUrl":"http://a.images.blip.tv/Toddoneill-TexasRenewableEnergyRoundupAndGreenLIvingFairExhibitorP420.png",
	"thumbnail120Url":"http://a.images.blip.tv/Toddoneill-TexasRenewableEnergyRoundupAndGreenLIvingFairExhibitorP420-858.jpg",
    "thumbnailFilename": "Toddoneill-TexasRenewableEnergyRoundupAndGreenLIvingFairExhibitorP420.png",
	"login":"toddoneill",
	"userId":74958,
	"showName":"DoingMedia",
	"blogUrl":"http://www.doingmedia.net",
	"conversions": [
		
		  ],
	"media":{
		"url":"http://blip.tv/file/get/Toddoneill-TexasRenewableEnergyRoundupAndGreenLIvingFairExhibitorP716.mov?source=2",
		"mimeType":"video/quicktime",
		"duration":172,
		"width":640,
		"height":360
	},
	"contentRating":"TV-UN",
	"advertising":"",

	/* Version 1 implementation, please supply version=2 in the future */
	"Title":"Texas Renewable Energy Roundup and Green LIving Fair Exhibitor promo",
	"posts_id":"2610892",
	"item_type":"file",
	"item_id":"2590940",
	"posts_url":"http://blip.tv/file/2590940",
	
	"media_src":"blip.tv/file/get/Toddoneill-TexasRenewableEnergyRoundupAndGreenLIvingFairExhibitorP716.mov?source=2",
	
	
	"Thumbnail":{
		"Url":"http://a.images.blip.tv/Toddoneill-TexasRenewableEnergyRoundupAndGreenLIvingFairExhibitorP420.png"
	},
	
	"User":"toddoneill"
}},{ "Post" : {
	"title":"Alamo Heights High School Marching Band 2008 Season Highlights",
	"adminTitle":"Alamo Heights High School Marching Band 2008 Season Highlights",
	"description":"",
	"tags":["alamo heights","texas","marching","band","high school","san antonio"],
	"datestamp":"09-03-09 05:19pm",
	"datestampUnixtime":"1252012780",
	"datestampDate":"2009-09-03",
	"datestampText":"Sep  3, 2009",
    
		
	"postsId":2572060,
	"postsGuid":"7DB2F26C-98CF-11DE-9BFF-B8D982E05866",
	"itemType":"file",
	"itemId":2552097,
	"url":"http://blip.tv/file/2552097",
	"mediaUrl":"http://blip.tv/file/get/Toddoneill-AlamoHeightsHighSchoolMarchingBand2008SeasonHighlights883.flv?source=2",
	"thumbnailUrl":"http://a.images.blip.tv/Toddoneill-AlamoHeightsHighSchoolMarchingBand2008SeasonHighlights883-450.jpg",
	"thumbnail120Url":"http://a.images.blip.tv/Toddoneill-AlamoHeightsHighSchoolMarchingBand2008SeasonHighlights883-450-69.jpg",
    "thumbnailFilename": "Toddoneill-AlamoHeightsHighSchoolMarchingBand2008SeasonHighlights883-450.jpg",
	"login":"toddoneill",
	"userId":74958,
	"showName":"DoingMedia",
	"blogUrl":"http://www.doingmedia.net",
	"conversions": [
		
		  ],
	"media":{
		"url":"http://blip.tv/file/get/Toddoneill-AlamoHeightsHighSchoolMarchingBand2008SeasonHighlights883.flv?source=2",
		"mimeType":"video/flv",
		"duration":465,
		"width":640,
		"height":360
	},
	"contentRating":"TV-UN",
	"advertising":"",

	/* Version 1 implementation, please supply version=2 in the future */
	"Title":"Alamo Heights High School Marching Band 2008 Season Highlights",
	"posts_id":"2572060",
	"item_type":"file",
	"item_id":"2552097",
	"posts_url":"http://blip.tv/file/2552097",
	
	"media_src":"blip.tv/file/get/Toddoneill-AlamoHeightsHighSchoolMarchingBand2008SeasonHighlights883.flv?source=2",
	
	
	"Thumbnail":{
		"Url":"http://a.images.blip.tv/Toddoneill-AlamoHeightsHighSchoolMarchingBand2008SeasonHighlights883-450.jpg"
	},
	
	"User":"toddoneill"
}},{ "Post" : {
	"title":"San Antonio Area Foundation - Schroeder UTHSC Interview",
	"adminTitle":"San Antonio Area Foundation - Schroeder UTHSC Interview",
	"description":"",
	"tags":[],
	"datestamp":"07-26-09 08:04pm",
	"datestampUnixtime":"1248653078",
	"datestampDate":"2009-07-26",
	"datestampText":"Jul 26, 2009",
    
		
	"postsId":2424349,
	"postsGuid":"131F99F2-7A41-11DE-92D3-9AC8A2554092",
	"itemType":"file",
	"itemId":2404309,
	"url":"http://blip.tv/file/2404309",
	"mediaUrl":"http://blip.tv/file/get/Toddoneill-SchroederInterviewFINAL529.mov?source=2",
	"thumbnailUrl":"http://a.images.blip.tv/Toddoneill-SchroederInterviewFINAL529-42.jpg",
	"thumbnail120Url":"http://a.images.blip.tv/Toddoneill-SchroederInterviewFINAL529-42-872.jpg",
    "thumbnailFilename": "Toddoneill-SchroederInterviewFINAL529-42.jpg",
	"login":"toddoneill",
	"userId":74958,
	"showName":"DoingMedia",
	"blogUrl":"http://www.doingmedia.net",
	"conversions": [
		
		  ],
	"media":{
		"url":"http://blip.tv/file/get/Toddoneill-SchroederInterviewFINAL529.mov?source=2",
		"mimeType":"video/quicktime",
		"duration":222,
		"width":640,
		"height":360
	},
	"contentRating":"TV-UN",
	"advertising":"",

	/* Version 1 implementation, please supply version=2 in the future */
	"Title":"San Antonio Area Foundation - Schroeder UTHSC Interview",
	"posts_id":"2424349",
	"item_type":"file",
	"item_id":"2404309",
	"posts_url":"http://blip.tv/file/2404309",
	
	"media_src":"blip.tv/file/get/Toddoneill-SchroederInterviewFINAL529.mov?source=2",
	
	
	"Thumbnail":{
		"Url":"http://a.images.blip.tv/Toddoneill-SchroederInterviewFINAL529-42.jpg"
	},
	
	"User":"toddoneill"
}}
];



	
		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 = ' DoingMedia on blip.tv';
	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;"> DoingMedia on blip.tv</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);
}

	

