/**********************************************************
		flash.js ( version 1.0 Abril 2006  )
		
		Powered by Quadratica S.R.L.
**********************************************************/


//Begin of object Param
function Param( name, value ){
	this.name = name;
	this.value = value;
	this.getName = getName;
	this.getValue = getValue;
}

function getValue(){
	return this.value;
}

function getName(){
	return this.name;
}
//End of object Param


//Begin of object Flash

/* 
The Flash object receives the source, the width and the height of the flash to render.
The classid, codebase, quality, pluginspage and type attributes are setted width defaults values, but can be changed by theirs setters.
The parameters of the flash must be added using the addParam Method.
The Flash object constructor, set as default the 'movie' and 'quality' parameters. To delete them, you must execute the delParams method.
*/
function Flash( src, width, height ){
	this.classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
	this.codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0";
	this.width = width;
	this.height = height;
	this.src = src;
	this.quality = "high";
	this.pluginspage = "http://www.macromedia.com/go/getflashplayer";
	this.type = "application/x-shockwave-flash";
	this.params = new Array();
	this.addParam = addParam;
	this.delParams = delParams;
	this.render = render;
	this.setClassId = setClassId;
	this.setCodeBase = setCodeBase;
	this.setQuality = setQuality;
	this.setPluginsPage = setPluginsPage;
	this.setType = setType;
	this.addParam( 'movie', src );
	this.addParam( 'quality', 'high' );
}

function addParam( name, value ){
	var prm = new Param( name, value );
	this.params.push( prm );
}

function delParams(){
	this.params = null;
	this.params = new Array();
}

function render(){
	//document.write( 'valores: ' + this.src + this.width + this.height );
	var out = '';
	out += '<object classid="'+this.classid+'" codebase="'+this.codebase+'" width="'+this.width+'" height="'+this.height+'">';
	var embedParams = '';
	for( i=0;i<this.params.length;i++ ){
		var paramName = this.params[ i ].name;
		var paramValue = this.params[i].value;
		out += '<param name="'+ paramName +'" value="'+ paramValue +'">';
		if( paramName != 'movie' ){
			embedParams += ' '+paramName+'="'+paramValue+'" ';
		}
	}
	out += '<embed src="'+this.src+'" pluginspage="'+this.pluginspage+'" '+ embedParams +' type="'+this.type+'" width="'+this.width+'" height="'+this.height+'"/>';
	out += '</object>';
	document.write( out );
}

function setClassId( value ){
	this.classid = value;
}

function setCodeBase( value ){
	this.codebase = value;
}

function setQuality( value ){
	this.quality = value;
}

function setPluginsPage( value ){
	this.pluginspage = value;
}

function setType( value ){
	this.type = value;
}
//End of object Flash