 SWFObject= function (id, src, width, height, version, autowrite, objectid)
 {
	this.id       = id;
	this.src      = src;
	this.width    = width;
	this.height   = height;
	this.param    = new Array();
	this.version  = (typeof version == 'string')?version:'7,0,19,0';
	if (autowrite)
	{
		if (objectid != undefined)
		{
			document.getElementById(objectid).innerHTML = this.getHTML();
		}
		else
			document.write(this.getHTML());
	}
 }

SWFObject.prototype = {

	getHTML: function ()
	{
		var str = "";

		str += '<div style="position:relative;width:'+ this.width +'px;height:'+ this.height +'px;z-index:0">';
		str += '<object id="'+ this.id +'" name="'+ this.id +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+ this.version +'" width="'+ this.width +'" height="'+ this.height +'">';
		str += '<param name="movie" value="'+ this.src +'" />';		
		str += '<param name="quality" value="high" />';
		str += '<param name="wmode" value="transparent" />';

		for(i=0;i<this.param.length;i++)
			str += '<param name="'+ this.param[i][0] +'" value="'+ this.param[i][1] +'" />';
			
		str += '<embed id="'+ this.id +'" name="'+ this.id +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+ this.src +'" width="'+ this.width +'" height="'+ this.height +'" wmode="transparent" quality="high" ';
		
		for(i=0;i<this.param.length;i++)
			str += this.param[i][0] +'="'+ this.param[i][1] +'" ';
		
		str += '/>';
		str += '</'+'object>';
		str += '</'+'div>';

		return str;
	},
	
	setParam: function(name, value)
	{
		this.param[this.param.length]=new Array(name, value);
	},
	
	write: function ()
	{
		document.write(this.getHTML());	
	}
}

