function popup(url, width, height) {
	var props = "location=no,scrollbars=no,menubar=no,directories=no,status=no,toolbar=no,resizable=yes,width="+width+",height="+height;
	window.open(url, "_blank", props);
}

function ShowImgDiv(img, id) {
	if (document.getElementById(id)) return;
	var container = document.createElement('div');
	container.setAttribute('id', id);
	container.className = 'container';
	container.innerHTML =
		"<div class='cell'>" +
			"<table align='center' class='popupimg'>" +
				"<tr><td>" +
					"<img src='" + img.getAttribute('src') + "' alt='" + img.getAttribute('alt') + "' onclick='document.body.removeChild( document.getElementById(\"" + id + "\") )' /><br />" +
					"Click image to close" +
				"</td></tr>" +
			"</table>" +
		"</div>";
	document.body.appendChild(container);
}

// Video For Everybody by Kroc Camen. see <camendesign.com/code/video_for_everybody> for documented code
function ShowVideoDiv(id, relpath, fullpath, width, height, playerpath) {
	if (document.getElementById(id)) return;
	var container = document.createElement('div');
	container.setAttribute('id', id);
	container.className = 'container';
	container.innerHTML =
		"<div class='cell'>" +
			"<table align='center' class='popupimg'>" +
				"<tr><td>" +
					"<video width='" + width + "' height='" + height + "' poster='" + relpath + ".jpg' controls='controls' autoplay='autoplay'>" +
					"	<source src='" + relpath + ".mp4' type='video/mp4' />" +
					"	<source src='" + relpath + ".ogv' type='video/ogg' />" +
					"	<object width='" + width + "' height='" + height + "' type='application/x-shockwave-flash'" +
					"		data='" + playerpath + "/player.swf'" +
					"	>	<param name='movie' value='" + playerpath + "/player.swf' />" +
					"		<param name='allowfullscreen' value='true' />" +
					"		<param name='allowscriptaccess' value='always' />" +
					"		<param name='flashvars' value='file=" + fullpath + ".mp4&image=" + relpath + ".jpg&autostart=true&skin=" + playerpath + "/bekle.swf&backcolor=#CCCC99&frontcolor=#FFFFFF&controlbar=over' />" +
					"		<!--[if gt IE 6]>" +
					"		<object width='" + width + "' height='" + height + "' classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'>" +
					"			<param name='src' value='" + relpath + ".mp4' /><!" +
					"		[endif]--><!--[if gt IE 6]><!-->" +
					"		<object width='" + width + "' height='" + height + "' type='video/quicktime' data='" + relpath + ".mp4'" +
					"		>	<param name='src' value='" + relpath + ".mp4' />" +
					"		<!--<![endif]-->" +
					"			<strong>No video playback capabilities detected.</strong>" +
					"			Why not try to download the file instead?<br />" +
					"			<a href='" + relpath + ".mp4'>MPEG4 / H.264 &quot;.mp4&quot; (Windows / Mac)</a> |" +
					"			<a href='" + relpath + ".ogv'>Ogg Theora &amp; Vorbis &quot;.ogv&quot; (Linux)</a>" +
					"		<!--[if gt IE 6]><!--></object><!--<![endif]-->" +
					"		<!--[if gt IE 6]></object><![endif]-->" +
					"	</object>" +
					"</video><br />" +
					"<div onclick='document.body.removeChild( document.getElementById(\"" + id + "\") )'>Click here to close</div>" +
				"</td></tr>" +
			"</table>" +
		"</div>";

	document.body.appendChild(container);
}

/*
					"<video width='" + width + "' height='" + height + "' poster='" + relpath + ".jpg' controls='controls' autoplay='autoplay'>" +
					"	<source src='" + relpath + ".ogv' type='video/ogg' />" +
					"	<source src='" + relpath + ".mp4' type='video/mp4' />" +
					"	<!--[if gt IE 6]>" +
					"	<object width='" + width + "' height='" + height + "' classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B'><!" +
					"	[endif]--><!--[if !IE]><!-->" +
					"	<object width='" + width + "' height='" + height + "' type='video/quicktime' data='" + relpath + ".mp4'>" +
					"	<!--<![endif]-->" +
					"	<param name='src' value='" + relpath + ".mp4' />" +
					"	<param name='autoplay' value='true' />" +
					"	<param name='showlogo' value='false' />" +
					"	<object width='" + width + "' height='" + height + "' type='application/x-shockwave-flash'" +
					"		data='" + playerpath + "/player.swf?autostart=true&image=" + relpath + ".jpg&file=" + relpath + ".mp4'>" +
					"		<param name='movie' value='" + playerpath + "/player.swf?autostart=true&image=" + relpath + ".jpg&file=" + relpath + ".mp4' />" +
					"		<img src='" + relpath + ".jpg' width='" + width + "' height='" + height + "' />" +
					"			<strong>No video playback capabilities detected.</strong>" +
					"			Why not try to download the file instead?<br />" +
					"			<a href='" + relpath + ".mp4'>MPEG4 / H.264 &quot;.mp4&quot; (Windows / Mac)</a> |" +
					"			<a href='" + relpath + ".ogv'>Ogg Theora &amp; Vorbis &quot;.ogv&quot; (Linux)</a>" +
					"	</object><!--[if gt IE 6]><!-->" +
					"	</object><!--<![endif]-->" +
					"</video><br />" +
*/
