/*
 * xSWF v2.1 build 1905: http://www.hofmanns.net - All rights reserved.
 *
 * xSWF Copyright (C) 2003-2007 by Karl Hofmann, Am Wimhof 73, D-94034 Passau, Germany (DE)
 *
 * This program is copyright software; you should have received a copy
 * of the General License along with this program; if not, write to
 * Karl Hofmann, Am Wimhof 73, D-94034 Passau, Germany (DE)
 *
 * You are welcome to use or redistribute it under certain conditions;
 * for the use of the software within a website the author note must be
 * invariably taken over, please contact, for use going beyond that,
 * Karl Hofmann for further details.
 *
 */

if (typeof com == "undefined") var com = new Object();

com.xSWF = function(swf, flashvars, id){
	this.attributes = new Array();
	this.params = new Object();
	this.variables = new Object();

	if (swf) this.setAttribute('swf', 'http://www.scacupuncture.com/siteflash/flash/' + swf);
	if (flashvars) this.setAttribute('flashvars', flashvars);
	if (id) this.setAttribute('id', id);

	this.setAttribute('width', '766');
	this.setAttribute('height', '720');
	this.setAttribute('version', '6,0,0');
}

com.xSWF.prototype.setAttribute = function(name, value) {this.attributes[name] = value;}
com.xSWF.prototype.getAttribute = function(name) {return this.attributes[name];}
com.xSWF.prototype.getAttributes = function() {return this.attributes;}
com.xSWF.prototype.addParam = function(name, value) {this.params[name] = value;}
com.xSWF.prototype.getParam = function(name) {return this.params[name];}
com.xSWF.prototype.getParams = function() {return this.params;}
com.xSWF.prototype.addVariable = function(name, value) {this.variables[name] = value;}
com.xSWF.prototype.getVariable = function(name) {return this.variables[name];}
com.xSWF.prototype.getVariables = function() {return this.variables;}

com.xSWF.prototype.getHTML = function() {
	var flashHTML = "";
	flashHTML += '<object type="application/x-shockwave-flash" "data="' + this.getAttribute('swf') + '" width="' + this.getAttribute('width') + '" height="' + this.getAttribute('height') + '" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="' + this.getAttribute('version') + '" id="' + this.getAttribute('id') + '">';
	flashHTML += '<param name="allowScriptAccess" value="sameDomain">/';
	flashHTML += '<param name="movie" value="' + this.getAttribute('swf') + '">/';
	flashHTML += '<param name="flashvars" value="' + this.getAttribute('flashvars') + '">/';
	flashHTML += '<param name="loop" value="false">/';
	flashHTML += '<param name="menu" value="false">/';
	flashHTML += '<param name="quality" value="high">/';
	flashHTML += '<param name="PLAY" value="true">/';
	flashHTML += '</object>';
	return flashHTML;
}

com.xSWF.prototype.write = function(elementId) {
	document.getElementById(elementId).innerHTML = this.getHTML();
}

if (Array.prototype.push == null) { Array.prototype.push = function(item) {this[this.length] = item; return this.length;}}