/**
 * SWF - universal flash inserting object
 * @package object.SWF.js
 * @copyrights full/all
 */
SWF = function(url, id, width, height, color){
	this.vars = new Array();
	this.url = url;
	this.id = id;
	this.width = width;
	this.height = height;
	this.color = color;
}

SWF.prototype = {
	param: function(name, value) {
		this.vars.push(name+'='+value);
	},
	html: function() {
		var code = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length)	{
			code += '<embed type="application/x-shockwave-flash" src="'+ this.url + '" width="' + this.width + '" height="' + this.height + '"';
			code += ' id="'+ this.id +'" name="'+ this.id + '"';
			code += ' quality="high" bgcolor="#FFFFFF" ';
			if (this.vars.length > 0)
				code += 'flashvars="' + this.vars.join('&') + '"';
			code += ' />';
		}
		else {
			code += '<object name="'+ this.id +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.width +'" height="' + this.height +'">';
			code += '<param name="movie" value="'+ this.url +'" />';
			if (this.vars.length > 0)
				code += '<param name="flashvars" value="' + this.vars.join('&') + '" />';
			code += '</object>';
		}
		return code;
	},
	show: function(id) {
		var id = document.getElementById(id);
		id.innerHTML = this.html();
	}
}