﻿function ActiveXObjectTag(ClassId, Id, Width, Height, aParamNameValue)
{
	this.ClassId = ClassId;
	this.Id = Id;
	this.Width = Width;
	this.Height = Height;

	this.ParamNameValue = aParamNameValue;
	this.Write = function()
	{
		var s = this.GetActiveXObjectTag();
		document.write(s);
	};
	this.GetActiveXObjectTag = function()
	{
		var Tag = "<object classid=\"clsid:" + this.ClassId + "\" id=\"" + this.Id + "\" width=\"" + this.Width + "\" height=\"" + this.Height + "\">";
		for (var i = 0; i < this.ParamNameValue.length; i += 2)
		{
			var Name = this.ParamNameValue[i];
			var Value = this.ParamNameValue[i + 1];
			
			Tag += "<param name=\"" + Name + "\" value=\"" + Value + "\" />";
		}
		Tag += "</object>";

		return Tag;
	};
	
	return this;
}

