function playBlingVideo(id, height, width, title, time, location, url) {
	switch (location) {
		case "popup":
			var newurl = url + "/wp-content/plugins/tubepress/tubepress_popup.php?name=" + escape(title) + "&id=" + id + "&w=" + width + "&h=" + height;
			window.open(newurl, "newwin", "width=" + width + ",height=" + height + ",toolbar=false,locationbar=false,directories=false,status=false,menubar=false,scrollbars=false,resizable=true,copyhistory=false");
			break;
		case "youtube":
			document.location.href = "http://youtube.com/watch?v=" + id;
			break;
		case "new_window":
			var url = document.location.href;
			var endLocation = url.indexOf("tubepress_id=", 0);
			if (endLocation != -1) {
				url = url.substr(0, endLocation -1);
			}
			endLocation = url.indexOf("#", 0);
			if (endLocation != -1) {
				url = url.substr(0, endLocation);
			}
			var firstChar = '?';
			if (url.indexOf(".php?") != -1)
				firstChar = '&';
			url += firstChar + "tubepress_id=" + id;
			document.location.replace(url);
			break;
		default:
			document.getElementById('blingblog_mainvideo').innerHTML = ' \
					<object width="159" height="159"><param name="movie" value="http://www.youtube.com/v/' + id + '" ></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/' + id + '" type="application/x-shockwave-flash" wmode="transparent" width="150" height="150"></embed></object>';
			document.location.hash = 'blingblog_mainvideo';
			break;
	}
}
function backToGallery() {
	var url = document.location.href;
	var endLocation = url.indexOf("tubepress_id=", 0);
	if (endLocation != -1) {
		url = url.substr(0, endLocation -1);
	}
	document.location.replace(url);
}