﻿function ObjectLoader(objID, url){
	this.id=objID;
	this.width='';
	this.height='';
	this.style='';
	this.classid='';
	this.style='';
	this.Params = new ObjectParameters(url);
	this.PropertiesToString = ObjectLoader_PropertiesToString;
	this.ToString = ObjectLoader_ToString;
	this.load = ObjectLoader_Load;
}

function ObjectLoader_Load(){
	document.write(this.ToString());
}

function ObjectLoader_ToString(){
	var out = "<object ";
	out += this.PropertiesToString();
	out += ">";
	out += this.Params.ToString();
	out += "</object>";

	return(out);
}

function ObjectLoader_PropertiesToString(){
	var out = ''
	for (var prop in this)   {
		if (typeof(this[prop])!= "function" && typeof(this[prop])!= "object"){
			if (this[prop]){
				var propValue = new String(this[prop])
				if(propValue != ''){
					out += prop + '="' + propValue + '" '
				}
			}
		}
	}

	return(out);
}

function ObjectParameters(url){
	this.url=url
	this.ToString=ObjectParameters_ToString
}

function ObjectParameters_ToString(){
	var out = '';
	for (var prop in this)   {
		if (typeof(this[prop])!= "function" && typeof(this[prop])!= "object"){
			if (this[prop]){
				var propValue = new String(this[prop])
				if(propValue != ''){
					out += '<param name="' + prop+ '" value="' + propValue + '">'
				}
			}
		}
	}
	return(out)
}