function Flash(movie, id, width, height, ver, bg, lp, fv)
	{
		this.movie = movie;
		this.id = id;
		this.width = width;
		this.height = height;
		this.ver = ver ? ver : "8,0,0,0";

		this.align ="middle";

		this.attributes = new Array();
		this.params = new Object();

		if(bg)
			this.setParam("bgcolor", bg);
		if(lp)
			this.setParam("loop", lp);
		if(fv)
			this.setParam("FlashVars", fv);

		this.setParam("quality", "high");
		this.setParam("menu", "false");		
		this.setParam("wmode", "opaque");
	}

	Flash.prototype.addAttribute = function(n, v)
	{
		if(v)
			this.attributes[this.attributes.length] = n + '="' + v + '"';
		else
			this.attributes[this.attributes.length] = n;
	}

	Flash.prototype.setParam = function(n, v)
	{
		this.params[n] = v;
	}

	Flash.prototype.render = function()
	{
		if(this.ver.length < 2)
			this.ver += ",0,0,0";

		var s = '<object id="' + this.id + '" width="' + this.width + '" height="' + this.height + '" align="' + this.align + '" ';
		s += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + this.ver + '" ';
		for(var i=0; i<this.attributes.length; i++)
			s += this.attributes[i] + " ";
		s += '>';

		s += '<param name="movie" value="' + this.movie + '" />';
		for(var k in this.params)
			s += '<param name="' + k + '" value="' + this.params[k] + '" />';

		s += '<embed src="' + this.movie + '" ';
		s += 'width="' + this.width + '" height="' + this.height + '" name="' + this.id + '" align="' + this.align + '" ';
		for(var k in this.params)
			s += k + '="' + this.params[k] + '" ';

		s += 'swLiveConnect="true" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" />';

		s += '</object>';
		document.write(s);
	}

