// -----------------------------------------------
// ## ObjFlash
// ## v1.1
// ## Stradfred, http://www.stradfred-area.com/
// ## 06.12.07
// ## JavaScript Powered
// -----------------------------------------------
function objFlash(width, height, path, obj)
{
	this.quality = (typeof obj.quality == 'string') ? obj.quality : 'best';
	this.flashvars = (typeof obj.flashvars == 'string') ? obj.flashvars : '';
	this.wmode = (typeof obj.wmode == 'string') ? obj.wmode : 'transparent';
	this.bgcolor = (typeof obj.bgcolor == 'string') ? obj.bgcolor : 'transparent';
	this.menu = (typeof obj.menu == 'string') ? obj.menu : 'false';
	this.scale = (typeof obj.scale == 'string') ? obj.scale : 'exactfit';

	this.code = '<object type="application/x-shockwave-flash" data="' + path + '.swf" width="' + width + '" height="' + height + '">\n'
	+ '  <param name="movie" value="' + path + '.swf" />\n'
	+ '  <param name="quality" value="' + this.quality + '" />\n'
	+ '  <param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer" />\n'
	+ '  <param name="flashvars" value="' + this.flashvars + '" />\n'
	+ '  <param name="scale" value="' + this.scale + '" />\n'
	+ '  <param name="menu" value="' + this.menu + '" />\n'
	+ '  <param name="wmode" value="' + this.wmode + '" />\n'
	+ '  <param name="bgcolor" value="' + this.bgcolor + '" />\n'
	+ '</object>\n';

	this.goArea = function(id)
	{
		try
		{
			document.getElementById(id).innerHTML = this.code;
		}
		catch(e){}
	};

	this.writeIt = function()
	{
		document.write(this.code);
	};

	this.tellParam = function(variable)
	{
		if(typeof this[variable] != 'undefined')
		{
			return this[variable];
		}

		return false;
	};

	return this;
}
