function objectEmbed(classid, codebase, pluginspage, src, type, height, width, parameterPairs_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.parameterPairs_array = parameterPairs_array;
}

objectEmbed.prototype.addParameter = function(parameterName, parameterValue) {
	var bParameterAdded = false;
	for(iLoop=0; iLoop<this.parameterPairs_array.length; iLoop+=2) {
		if ((this.parameterPairs_array[iLoop]==parameterName)&&(!bParameterAdded)) {
			bParameterAdded = true;
			this.parameterPairs_array[iLoop+1]=parameterValue;
		}
	}
	if(!bParameterAdded){
		this.parameterPairs_array.push(parameterName);
		this.parameterPairs_array.push(parameterValue);
	}
}

objectEmbed.prototype.returnTag = function(tagEnding) {
	var objectParams_string = "";
	var embedParams_string = "";
	if(this.parameterPairs_array != null) {
		if((this.parameterPairs_array.length%2) != 0) {
			alert("The objectEmbed class received an odd number of optional parameters.");
		} else {
			for(iLoop=0; iLoop < this.parameterPairs_array.length; iLoop+=2) {
				objectParams_string += '<param name="'+this.parameterPairs_array[iLoop] +
					'" value="'+this.parameterPairs_array[iLoop+1]+'"'+tagEnding+'>';
				embedParams_string += this.parameterPairs_array[iLoop]+'="'+this.parameterPairs_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.returnHTML = function() {return this.returnTag("");};
objectEmbed.prototype.returnXHTML = function() {return this.returnTag(" /");};

objectEmbed.prototype.render = function(tagEnding) {
	document.write(this.returnTag(tagEnding));
};
objectEmbed.prototype.renderHTML = function() {this.render("");};
objectEmbed.prototype.renderXHTML = function() {this.render(" /");};

objectEmbed.prototype.innerHTMLforElement = function(element) {
	element.innerHTML = this.returnXHTML();
}
//
QuickTimeObject.prototype = new objectEmbed();

function QuickTimeObject(src, autostart, controller, height, width, optionalParameterPairs_array){
	//class specific properties
	this.autostart = autostart;
	this.controller = controller;
	//inherited properties
	this.classid = "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B";
	this.codebase = "http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0";
	this.pluginspage = "http://www.apple.com/quicktime/download/";
	this.type = "video/quicktime";
	this.height = height+(controller?16:0);
	this.width = width;
	this.parameterPairs_array = Array("src", src, "autostart", this.autostart, "controller", this.controller);
	//
	if(typeof(optionalParameterPairs_array)=="object") {
		if((optionalParameterPairs_array.length%2) != 0) {
			alert("The QuickTimeObject class received an odd number of optional parameters.");
		} else {
			for (iLoop = 0; iLoop< optionalParameterPairs_array.length; iLoop+=2) {
				this.addParameter(optionalParameterPairs_array[iLoop], optionalParameterPairs_array[iLoop+1]);
			}
		}
	}
}