// JavaScript Document
//IE中插入FLASH"单击并激活此控件"的解决办法

// ################## Script For Flash & ActiveX #########################

// +++++++++++++ MakeFlashString(source,id,width,height,wmode) ++++++++

// 参数说明+++++++++++++++++++++++++
// source: source url --> FLASH地址
// id: flash id 
// width: source width
// height: source height
// wmode: wmode --> "none, transparent, opaque"
// otherparam :其它参数  "<param name='myParam' value='myValue' />
// 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// +++++++++++++ MakeObjectString(classid, codebase, name, id, width,height, param) ++++++++

// 参数说明+++++++++++++++++++++++++
// classid: classid -->一般是默认的 "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
// codebase: codebase-->一般是默认的 "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
// name : name
// id : flash id
// width: source width
// height: source height
// wmode: wmode --> "none, transparent, opaque"
// param : param --> "<param name='myParam' value='myValue' />
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// 样例：在原来要插入FLASH的地方替换为如下代码。
/* <script>DocumentWrite(MakeFlashString('image/ml_flash.swf','emb1','330','520','transparent'));</script>*/
/*在<HEAD>部分首先加入<script src="embed.js" language="javascript"></script>*/

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// SetInnerHTML(document.all.mm, MakeFlashString('image/ml_flash.swf','emb1','330','520','transparent'));


function MakeFlashString(source,id,width,height,wmode, otherParam)
{  
  return "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0\" width="+width+" height="+height+" id="+id+"><param name=wmode value="+wmode+" /><param name=movie value="+source+" /><param name=quality value=high />"+otherParam+"<embed src="+source+" quality=high wmode="+wmode+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+width+" height="+height+"></embed></object>";
}

function MakeObjectString(classid, codebase, name, id, width,height, param)
{
  return "<object classid="+classid+" codebase="+codebase+" name="+name+" width="+width+" height="+height+" id="+id+">"+param+"</object>";
}

function MakemovieString(id, classid, codebase, type, width,height,filename, param)
{
  return "<object id="+id+" classid="+classid+" codebase="+codebase+" standby='loading microsoft windows media player components...' type="+type+" width="+width+" height="+height+" >"+param+"<param name=filename value="+filename+"></object>";
}

// innerHTML Type
function SetInnerHTML(target, code)
{ 
  target.innerHTML = code; 
}

// Direct Write Type
function DocumentWrite(src)
{  
  document.write(src);
}







