// JavaScript Document

function VideoDisplay( name, title, id ) 
{

	this.name = name;
	this.title = title;
	this.id = id;
	
	
	document.write('<div id="' + this.id + '" style="display:block; position:relative;" class="video">' + '\n'
			+ '<!-- "Video For Everybody" by Kroc Camen. see <camendesign.com/code/video_for_everybody> for documented code -->' + '\n' 
			
			+ '<video id="video0" width="240" controls="controls" height="128" poster="' + this.name.Img + '">' + '\n'
				+ '<source src="' + this.name.QT + '" type="video/mp4" />' + '\n'
				+ '<source src="' + this.name.OGG + '" type="video/ogg" />' + '\n'
				+ '<!-- IE only QuickTime embed: IE6 is ignored as it does not support `<object>` in `<object>` so we skip QuickTime' + '\n'
					 + 'and go straight to Flash further down. the line break after the `classid` is required due to a bug in IE -->' + '\n'
				+ '<!--[if gt IE 6]>' + '\n'
					+ '<object width="240" height="143" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"><!' + '\n'
				+ '[endif]-->' + '\n'
				+ '<!-- non-IE QuickTime embed (hidden from IE): the self-closing comment tag allows non-IE browsers to' + '\n'
					 + 'see the HTML whilst being compatible with serving as XML -->' + '\n'
				+ '<!--[if !IE]><!-->' + '\n'
					+ '<object width="240" height="143" type="video/quicktime" data="' + this.name.QT + '">' + '\n'
				+ '<!--<![endif]-->' + '\n'
				+ '<param name="src" value="' + this.name.QT + '" />' + '\n'
				+ '<param name="showlogo" value="false" />' + '\n'
				+ '<param name="autoplay" value="false" />' + '\n'
				+ '<param name="controller" value="true" />' + '\n'
				+ '<param name="controls" value="true" />' + '\n'
			
				+ '<!-- fallback to Flash -->' + '\n'
				+ '<object width="240" height="152" type="application/x-shockwave-flash"' + '\n' 
					+ 'data="player.swf?image=' + this.name.Img + '&amp;file=' + this.name.QT + '">' + '\n'
					+ '<!-- Firefox uses the `data` attribute above, IE/Safari uses the param below -->' + '\n'
					+ '<param name="flashvars" value="autostart=true" />' + '\n'
					+ '<param name="movie" value="player.swf?image=' + this.name.Img + '&amp;file=' + this.name.QT + '" />' + '\n'
					+ '<param name="wmode" value="transparent" />' + '\n'
					+ '<!-- fallback image. download links are below the video. warning: putting anything more than the fallback image in the fallback may trigger an iPhone OS3+ bug where the video will not play -->' + '\n'
					+ '<img src="' + this.name.Img + '" width="240" height="128" alt="' + this.title + '" title="No video playback capabilities, please download the video below"' + '\n'
					+ '/>' + '\n'
				+ '</object><!--[if gt IE 6]><!-->' + '\n'
				+ '</object><!--<![endif]-->' + '\n'
			+ '</video>' + '\n'
		+ '</div>');
	
}


