function objectEmbed(classid, codebase, pluginspage, src, type, height, width, params_array) {
	//base class properties
	this.classid = classid;
	this.codebase = codebase;
	this.pluginspage = pluginspage;
	this.src = src;
	this.type = type;
	this.height = height;
	this.width = width;
	this.params_array = params_array;
}

objectEmbed.prototype.render = function(tagEnding) {
	document.write(this.returnTag(tagEnding));
};
objectEmbed.prototype.renderHTML = function() {this.render("");};
objectEmbed.prototype.renderXHTML = function() {this.render(" /");};

objectEmbed.prototype.returnHTML = function() {return this.returnTag("");};
objectEmbed.prototype.returnXHTML = function() {return this.returnTag(" /");};

objectEmbed.prototype.returnTag = function(tagEnding) {
	var objectParams_string = "";
	var embedParams_string = "";
	if(this.params_array != null) {
		if((this.params_array.length%2) != 0) {
			alert("The objectEmbed class received an odd number of optional parameters.");
		} else {
			for(iLoop=0; iLoop < this.params_array.length; iLoop+=2) {
				objectParams_string += '<param name="'+this.params_array[iLoop] +
					'" value="'+this.params_array[iLoop+1]+'"'+tagEnding+'>';
				embedParams_string += this.params_array[iLoop]+'="'+this.params_array[iLoop+1]+'" ';
			}
		}
	}
	return '<object classid="'+this.classid +
		'" codebase="'+this.codebase+
		'" height="'+this.height+
		'" width="'+this.width+'">'+
		objectParams_string+
		'<embed '+embedParams_string+
		'height="'+this.height+
		'" pluginspage="'+this.pluginspage+
		'" src="'+this.src+
		'" type="'+this.type+
		'" width="'+this.width+
		'"></embed>'+
		'</object>';	
}

objectEmbed.prototype.innerHTMLforElement = function(element) {
	element.innerHTML = this.returnXHTML();
}

//
FlashObject.prototype = new objectEmbed();

function FlashObject(src, version, height, width, bgcolor, optionalParams_array){
	//class specific properties
	this.version = version;
	this.bgcolor = bgcolor;
	//inherited properties
	this.classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
	this.codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+this.version+",0,0,0";
	this.pluginspage = "http://www.macromedia.com/go/getflashplayer";
	this.src = src;
	this.type = "application/x-shockwave-flash";
	this.height = height;
	this.width = width;
	this.params_array = Array("bgcolor", this.bgcolor, "menu", "false", "movie", this.src, "swliveconnect", "false", "quality", "high");
	if(typeof(optionalParams_array)=="object") {
		if((optionalParams_array.length%2) != 0) {
			alert("The FlashObject class received an odd number of optional parameters.");
		} else {
			for (iLoop = 0; iLoop< optionalParams_array.length; iLoop+=2) {
				this.params_array.push(optionalParams_array[iLoop]);
				this.params_array.push(optionalParams_array[iLoop+1]);
			}
		}
	}
}
