/* 

*/

function FlashObject(swf,id, w, h) {
	if (!document.createElement || !document.getElementById) return;

  this.params = new Object();
  this.variables = new Object();
  this.attributes = new Array();
 

  if(swf) this.setAttribute('swf', swf);
  if(id) this.setAttribute('id', id);
  if(w) this.setAttribute('width', w);
  if(h) this.setAttribute('height', h);

}


FlashObject.prototype = {
setAttribute: function(name, value){
    this.attributes[name] = value;
  },
  getAttribute: function(name){
    return this.attributes[name];
  },
   addParam: function(name, value){
    this.params[name] = value;
  },
  getParams: function(){
    return this.params;
  },
  
  
getFlashHTML: function() {
    var flashNode = ""; 
    
    flashNode = '<object id="'+ this.getAttribute('id') + '" data="' +  this.getAttribute('swf')  + '" type="application/x-shockwave-flash" align="left" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'"Style="position:relative;top:3px">';
    flashNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
    
    var params = this.getParams();
    for(var key in params) {
		flashNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
    }		
    
    return flashNode;
  },
  
  
  write: function(elementId){
  
		var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
		n.innerHTML = this.getFlashHTML();
   }
}