/**
 * copyright digital work co.,ltd.
 * 2006.5
 */
function Flash(swf, id, width, height){
  this.swf    = swf;
  this.id     = id;
  this.width  = width;
  this.height = height;
  this.param  = new Array();

  //init params
  this.setParam("allowScriptAccess", "sameDomain");
  this.setParam("loop"   , "false");
  this.setParam("menu"   , "false");
  this.setParam("quality", "high");
  this.setParam("wmode", "transparent");
  this.setParam("bgcolor", "");
	//this.setParam("wmode","window");

  return this;
}

function __Flash_method_setParam(key, val){
  this.param[key] = val;
}

function __Flash_method_write(){
  var html   = new String();
  var params = new String();
  var attrs  = new String();

  this.setParam('movie', this.swf);
  for(var i in this.param){
   if(this.param[i]){
     params += '<param name="' + i + '" value="' + this.param[i] + '"/>\n';
     attrs  += ' '+ i + '="' + this.param[i] + '"';
   }
  }

	
  var html = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"'
                 + ' width="'  + this.width  + '"'
                 + ' height="' + this.height + '"'
                 + ' id="'     + this.id     + '">\n';
  html += params;
  html += '<embed src="' + this.swf    + '" ' + attrs 
                + ' width="'   + this.width  +'"'
                + ' height="'  + this.height + '"'
                + ' name="'    + this.id     +'"'
                + ' type="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></embed></object>';
//	alert(html);
  document.write(html);
}

Flash.prototype.setParam = __Flash_method_setParam;
Flash.prototype.write    = __Flash_method_write;

