//VidPanel.js
// a convenience class - to encapsulate the cruft of inserting a SWF into a webpage
// Author: Martin Cowie

function VidPanel( url, width, height, id )
{
	this.url = url;
	this.height = height;
	this.width = width;

	// Magic up an ID if none is given, but make sure it > 0, or IE gets very confused and assumes '0'. Silly IE.
	this.id = ( typeof( id ) == "undefined" ) ? Math.random() * Math.pow(10, 6) : id;
	this.renderHTML();
}

VidPanel.prototype.getId = function()
{
	return this.id;
}

VidPanel.prototype.renderHTML = function()
{
	document.write( '<object id="' + this.id + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ this.width +'" height="'+this.height+'">' );
	document.write( '<param name="movie" value="'+ this.url +'">' );
	document.write( '<param name="quality" value="high">' );
	document.write( '<param name="PLAY" value="false">' );
	document.write( '<param name="LOOP" value="false">' );
	document.write( '<embed src="'+ this.url +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ this.width +'" height="'+ this.height +'" name="'+ this.id +'" loop="false" quality="high" play="false"></embed>' );
	document.write( '</object>' );
}