var FlashObject = function(swfFile, swfID, width, height, color) {
	this.setSwfFile(swfFile);
	this.setSwfID(swfID);
	this.setWidth(width);
	this.setHeight(height);
	this.setColor(color);
}

FlashObject.prototype.setSwfFile = function(value) {
	if (value && typeof(value) == "string" && value.substr(value.length - 3, 3) == "swf") {
		this.swfFile = value;
	}
}

FlashObject.prototype.setSwfID = function(value) {
	if (value && typeof(value) == "string") {
		this.swfID = value;
	}
}

FlashObject.prototype.setWidth = function(value) {
	if (value && typeof(value) == "string") {
		this.setWidth = value;
	}
}

FlashObject.prototype.setHeight = function(value) {
	if (value && typeof(value) == "string") {
		this.setHeight = value;
	}
}

FlashObject.prototype.setColor = function(value) {
	if (value && typeof(value) == "string") {
		this.setColor = value;
	}
}

FlashObject.prototype.checkParams = function() {
	if (this.swfFile && this.swfID && this.setWidth && this.setHeight && this.setColor) {
		return true;	
	} else {
		return false;	
	}
}

FlashObject.prototype.createEmbedString = function() {
	var mySwf = '';
	mySwf += '<object type="application/x-shockwave-flash" ';
	mySwf += 'data="' + this.swfFile + '" ';
	mySwf += 'width="' + this.setWidth + '" ';
	mySwf += 'height="' + this.setHeight + '" ';
	mySwf += 'id="' + this.swfID + '">';
	mySwf += '<param name="movie" value="' + this.swfFile + '" />';
	mySwf += '<param name="allowScriptAccess" value="sameDomain" />';
	mySwf += '<param name="menu" value="true" />';
	mySwf += '<param name="quality" value="high" />';
	mySwf += '<param name="salign" value="lt" />';
	mySwf += '<param name="bgcolor" value="' + this.setColor + '" />';
	mySwf += '</object>';
	return mySwf;
}

FlashObject.prototype.attachSwfToDiv = function(divID) {
	if (this.checkParams() && typeof(divID) == "string") {
		var getID = document.getElementById(divID);
		getID.innerHTML = this.createEmbedString();
	}
}

FlashObject.prototype.writeSwfToHtml = function() {
	if (this.checkParams()) {
		document.writeln(this.createEmbedString());
	}
}

FlashObject.prototype.setFocusToSwf = function() {
	var getID = document.getElementById(this.swfID);
	if (getID) {
		getID.focus();
	}
}

