/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
frmFlash.js
		模块名称：幻灯片使用模块
		使用说明：在调用部位生成一个专用FLASH
		ＪＳ方法：配置frmFlashValue使用
		CSS 方法：无
		模块开发：wfr
		框架说明：无
		最后更新：12/23/2007

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
if(typeof(ff_width)=='undefined')ff_width = 240;
if(typeof(ff_height)=='undefined')ff_height = 200;
if(typeof(ff_texth)=='undefined')ff_texth = 20;
if(typeof(ff_path)=='undefined')ff_path = "../ad/";

if(ff_mode==1 || ff_mode==2){
	 var focus_width=ff_width
	 var focus_height=ff_height-ff_texth
	 var text_height=ff_texth
	 var swf_height = focus_height+text_height
	 
	 var pics =ff_imag.join("|");
	 var links=ff_link.join("|");
	 var texts=ff_text.join("|");
	 
	 document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
	 document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="'+ff_path+'flash/'+ff_mode+'.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
	 document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
	 document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
	 document.write('</object>');
}else if(ff_mode==3){
	var swf_width=ff_width;
	var swf_height=ff_height;
	var config='5|0xffffff|0x0099ff|50|0xffffff|0x0099ff|0x000000'
	// config 设置分别为: 自动播放时间(秒)|文字颜色|文字背景色|文字背景透明度|按键数字色|当前按键色|普通按键色
	var files =ff_imag.join("|");
	var links=ff_link.join("|");
	var texts=ff_text.join("|");
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">');
	document.write('<param name="movie" value="'+ff_path+'flash/'+ff_mode+'.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name=wmode value="opaque" />');
	document.write('<param name="FlashVars" value="config='+config+'&bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'" />');
	document.write('<embed src="'+ff_path+'flash/'+ff_mode+'.swf" wmode="opaque" FlashVars="config='+config+'&bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'& menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}else if(ff_mode==4){
	document.write("<DIV id=flash4content>调用flash动画焦点图</DIV>");
	var swf_width=255;
	var swf_height=250;
	var pics =ff_imag.join("|");
	var mylinks=ff_link.join("|");
	var texts=ff_text.join("|");
		/**
	 * SWFObject v1.4.2: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
	 *
	 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
	 * http://www.opensource.org/licenses/mit-license.php
	 *
	 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
	 *   legal reasons.
	 */
	if(typeof deconcept=="undefined"){var deconcept=new Object();}
	if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
	if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
	deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
	if(!document.getElementById){return;}
	this.DETECT_KEY=_b?_b:"detectflash";
	this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params=new Object();
	this.variables=new Object();
	this.attributes=new Array();
	if(_1){this.setAttribute("swf",_1);}
	if(id){this.setAttribute("id",id);}
	if(w){this.setAttribute("width",w);}
	if(h){this.setAttribute("height",h);}
	if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
	this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
	if(c){this.addParam("bgcolor",c);}
	var q=_8?_8:"high";
	this.addParam("quality",q);
	this.setAttribute("useExpressInstall",_7);
	this.setAttribute("doExpressInstall",false);
	var _d=(_9)?_9:window.location;
	this.setAttribute("xiRedirectUrl",_d);
	this.setAttribute("redirectUrl","");
	if(_a){this.setAttribute("redirectUrl",_a);}};
	deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
	this.attributes[_e]=_f;
	},getAttribute:function(_10){
	return this.attributes[_10];
	},addParam:function(_11,_12){
	this.params[_11]=_12;
	},getParams:function(){
	return this.params;
	},addVariable:function(_13,_14){
	this.variables[_13]=_14;
	},getVariable:function(_15){
	return this.variables[_15];
	},getVariables:function(){
	return this.variables;
	},getVariablePairs:function(){
	var _16=new Array();
	var key;
	var _18=this.getVariables();
	for(key in _18){_16.push(key+"="+_18[key]);}
	return _16;
	},getSWFHTML:function(){
	var _19="";
	if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
	if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
	_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
	_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
	var _1a=this.getParams();
	for(var key in _1a){_19+=key+"=\""+_1a[key]+"\" ";}
	var _1c=this.getVariablePairs().join("&");
	if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}
	_19+="/>";
	}else{if(this.getAttribute("doExpressInstall")){
	this.addVariable("MMplayerType","ActiveX");}
	_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
	_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
	var _1d=this.getParams();
	for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
	var _1f=this.getVariablePairs().join("&");
	if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}
	_19+="</object>";}
	return _19;
	},write:function(_20){
	if(this.getAttribute("useExpressInstall")){
	var _21=new deconcept.PlayerVersion([6,0,65]);
	if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
	this.setAttribute("doExpressInstall",true);
	this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
	document.title=document.title.slice(0,47)+" - Flash Player Installation";
	this.addVariable("MMdoctitle",document.title);}}
	if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
	var n=(typeof _20=="string")?document.getElementById(_20):_20;
	n.innerHTML=this.getSWFHTML();
	return true;
	}else{
	if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
	return false;}};
	deconcept.SWFObjectUtil.getPlayerVersion=function(){
	var _23=new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins&&navigator.mimeTypes.length){
	var x=navigator.plugins["Shockwave Flash"];
	if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
	}else{
	try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
	catch(e){try{
	var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
	_23=new deconcept.PlayerVersion([6,0,21]);
	axo.AllowScriptAccess="always";}
	catch(e){
	if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
	catch(e){}}
	if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
	return _23;};
	deconcept.PlayerVersion=function(_27){
	this.major=_27[0]!=null?parseInt(_27[0]):0;
	this.minor=_27[1]!=null?parseInt(_27[1]):0;
	this.rev=_27[2]!=null?parseInt(_27[2]):0;
	};
	deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
	if(this.major<fv.major){return false;}
	if(this.major>fv.major){return true;}
	if(this.minor<fv.minor){return false;}
	if(this.minor>fv.minor){return true;}
	if(this.rev<fv.rev){return false;}
	return true;
	};
	deconcept.util={getRequestParameter:function(_29){
	var q=document.location.search||document.location.hash;
	if(q){
	var _2b=q.substring(1).split("&");
	for(var i=0;i<_2b.length;i++){
	if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){
	return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
	return "";}};
	deconcept.SWFObjectUtil.cleanupSWFs=function(){
	var _2d=document.getElementsByTagName("OBJECT");
	for(var i=0;i<_2d.length;i++){
	_2d[i].style.display="none";
	for(var x in _2d[i]){if(typeof _2d[i][x]=="function"){_2d[i][x]=null;}}}};
	if(typeof window.onunload=="function"){
	var oldunload=window.onunload;
	window.onunload=function(){
	deconcept.SWFObjectUtil.cleanupSWFs();
	oldunload();};
	}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}
	if(Array.prototype.push==null){
	Array.prototype.push=function(_30){
	this[this.length]=_30;
	return this.length;};}
	
	var getQueryParamValue=deconcept.util.getRequestParameter;
	var FlashObject=deconcept.SWFObject; // for legacy support
	var SWFObject=deconcept.SWFObject;
	

	var autoflash = new SWFObject(ff_path+"flash/"+ff_mode+".swf", "myflash", swf_width, swf_height, "5","#ffffff");
	 autoflash.addParam("quality", "high");
	 autoflash.addParam("wmode", "opaque");
	 autoflash.addParam("salign", "t");
	 autoflash.addVariable("p",pics); 
	 autoflash.addVariable("l",mylinks);
	 autoflash.addVariable("icon",texts);
	 autoflash.write("flash4content");
	// ]]>
}else if(ff_mode==5){
	//描述
	/**
 * FlashObject v1.3c: Flash detection and embed - http://blog.deconcept.com/flashobject/
 *
 * FlashObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
	if(typeof com=="undefined"){var com=new Object();}
	if(typeof com.deconcept=="undefined"){com.deconcept=new Object();}
	if(typeof com.deconcept.util=="undefined"){com.deconcept.util=new Object();}
	if(typeof com.deconcept.FlashObjectUtil=="undefined"){com.deconcept.FlashObjectUtil=new Object();}
	com.deconcept.FlashObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
	if(!document.createElement||!document.getElementById){return;}
	this.DETECT_KEY=_b?_b:"detectflash";
	this.skipDetect=com.deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params=new Object();
	this.variables=new Object();
	this.attributes=new Array();
	this.useExpressInstall=_7;
	if(_1){this.setAttribute("swf",_1);}
	if(id){this.setAttribute("id",id);}
	if(w){this.setAttribute("width",w);}
	if(h){this.setAttribute("height",h);}
	if(_5){this.setAttribute("version",new com.deconcept.PlayerVersion(_5.toString().split(".")));}
	this.installedVer=com.deconcept.FlashObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);
	if(c){this.addParam("bgcolor",c);}
	var q=_8?_8:"high";
	this.addParam("quality",q);
	var _d=(_9)?_9:window.location;
	this.setAttribute("xiRedirectUrl",_d);
	this.setAttribute("redirectUrl","");
	if(_a){this.setAttribute("redirectUrl",_a);}
	};
	com.deconcept.FlashObject.prototype={setAttribute:function(_e,_f){
	this.attributes[_e]=_f;
	},getAttribute:function(_10){
	return this.attributes[_10];
	},addParam:function(_11,_12){
	this.params[_11]=_12;
	},getParams:function(){
	return this.params;
	},addVariable:function(_13,_14){
	this.variables[_13]=_14;
	},getVariable:function(_15){
	return this.variables[_15];
	},getVariables:function(){
	return this.variables;
	},createParamTag:function(n,v){
	var p=document.createElement("param");
	p.setAttribute("name",n);
	p.setAttribute("value",v);
	return p;
	},getVariablePairs:function(){
	var _19=new Array();
	var key;
	var _1b=this.getVariables();
	for(key in _1b){_19.push(key+"="+_1b[key]);}
	return _19;
	},getFlashHTML:function(){
	var _1c="";
	if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
	if(this.getAttribute("doExpressInstall")){
	this.addVariable("MMplayerType","PlugIn");
	}
	_1c="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
	_1c+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
	var _1d=this.getParams();
	for(var key in _1d){_1c+=[key]+"=\""+_1d[key]+"\" ";}
	var _1f=this.getVariablePairs().join("&");
	if(_1f.length>0){_1c+="flashvars=\""+_1f+"\"";}
	_1c+="/>";
	}else{
	if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
	_1c="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
	_1c+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
	var _20=this.getParams();
	for(var key in _20){_1c+="<param name=\""+key+"\" value=\""+_20[key]+"\" />";}
	var _22=this.getVariablePairs().join("&");
	if(_22.length>0){_1c+="<param name=\"flashvars\" value=\""+_22+"\" />";
	}_1c+="</object>";}
	return _1c;
	},write:function(_23){
	if(this.useExpressInstall){
	var _24=new com.deconcept.PlayerVersion([6,0,65]);
	if(this.installedVer.versionIsValid(_24)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
	this.setAttribute("doExpressInstall",true);
	this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
	document.title=document.title.slice(0,47)+" - Flash Player Installation";
	this.addVariable("MMdoctitle",document.title);}
	}else{this.setAttribute("doExpressInstall",false);}
	if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
	var n=(typeof _23=="string")?document.getElementById(_23):_23;
	n.innerHTML=this.getFlashHTML();
	}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}}};
	com.deconcept.FlashObjectUtil.getPlayerVersion=function(_26,_27){
	var _28=new com.deconcept.PlayerVersion(0,0,0);
	if(navigator.plugins&&navigator.mimeTypes.length){
	var x=navigator.plugins["Shockwave Flash"];
	if(x&&x.description){_28=new com.deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
	}else{
	try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
	for(var i=3;axo!=null;i++){
	axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
	_28=new com.deconcept.PlayerVersion([i,0,0]);}}
	catch(e){}
	if(_26&&_28.major>_26.major){return _28;}
	if(!_26||((_26.minor!=0||_26.rev!=0)&&_28.major==_26.major)||_28.major!=6||_27){
	try{
	_28=new com.deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
	}catch(e){}}}
	return _28;
	};
	com.deconcept.PlayerVersion=function(_2c){
	this.major=parseInt(_2c[0])||0;
	this.minor=parseInt(_2c[1])||0;
	this.rev=parseInt(_2c[2])||0;
	};
	com.deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
	if(this.major<fv.major){return false;}
	if(this.major>fv.major){return true;}
	if(this.minor<fv.minor){return false;}
	if(this.minor>fv.minor){return true;}
	if(this.rev<fv.rev){return false;}
	return true;
	};
	com.deconcept.util={getRequestParameter:function(_2e){
	var q=document.location.search||document.location.href.hash;
	if(q){var _30=q.indexOf(_2e+"=");
	var _31=(q.indexOf("&",_30)>-1)?q.indexOf("&",_30):q.length;
	if(q.length>1&&_30>-1){
	return q.substring(q.indexOf("=",_30)+1,_31);}}return "";
	},removeChildren:function(n){
	while(n.hasChildNodes()){
	n.removeChild(n.firstChild);}}};
	if(Array.prototype.push==null){
	Array.prototype.push=function(_33){
	this[this.length]=_33;
	return this.length;};}
	var getQueryParamValue=com.deconcept.util.getRequestParameter;
	var FlashObject=com.deconcept.FlashObject;

	document.writeln("<div id=flashcontent><a ");
	document.writeln("href=\"http:\/\/www.adobe.com\/shockwave\/download\/download.cgi?P1_Prod_Version=ShockwaveFlash&amp;promoid=BIOW\"><img ");
	document.writeln("src=\"\" border=0 \/><\/a>");
	document.writeln("    <object ");
	document.writeln("codebase=http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=8,0,0,0 ");
	document.writeln("height=0 width=0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000>");
	document.writeln("      <param name=\"quality\" value=\"high\" \/>");
	document.writeln("      <param name=\"movie\" value=\""+ff_path+"flash\/"+ff_mode+".swf\" \/>");
	document.writeln("      <embed src=\""+ff_path+"flash\/"+ff_mode+".swf\" quality=\"high\" ");
	document.writeln("pluginspage=\"http:\/\/www.macromedia.com\/go\/getflashplayer\" ");
	document.writeln("type=\"application\/x-shockwave-flash\" width=\"0\" height=\"0\"><\/embed>");
	document.writeln("    <\/object>");
	document.writeln("<\/div>");
	var pics =ff_imag.join("|");
	var links=ff_link.join("|");
	var texts=ff_text.join("|");
	var fo = new FlashObject(""+ff_path+"flash/"+ff_mode+".swf", "focus", 290, 230, "7", "#336699");
    fo.addParam("quality", "high");//高质量播放
    fo.addParam("menu","false");//不显示右键菜单
    fo.addParam("wmode", "transparent");//透明方式
    fo.addVariable("pics", pics);//图片地址
    fo.addVariable("links",links);//图片链接
    fo.addVariable("texts", texts);//图片文字
    fo.write("flashcontent");//输出内容
}
