﻿function swf(Swf,Name,Width,Height,X,Y) {
	//var Target =Swf+(Swf.indexOf("?")==-1?"?":"&")+Math.random();
	var Target =Swf;
	var Position = X+Y?"style='position:absolute;left:"+X+";top:"+Y+"';":"";
	var Id="id='"+Name+"'";
	var Size="width='"+Width+"' height='"+Height+"'";
	
	var Classid="classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'";
	var Codebase="codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0'";
	var Pluginspage="pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'";
	
	document.write ("<object "+Position+" "+Id+" "+Classid+" "+Codebase+" "+Size+">");
	document.write ("<param name='movie' value='"+Target+"'>");
	//document.write ("<param name='wmode' value='transparent'>");
	//document.write ("<embed src='"+Target+"' wmode='transparent' quality='high' "+Pluginspage+" "+Size+"></embed></object>");
	document.write ("<embed src='"+Target+"' quality='high' "+Pluginspage+" "+Size+"></embed></object>");
	
}
function wondows_Size(Width,Height){
	var varWidht=250;
	var varHeigth=100;
	var Width=parseInt(Width);
	var Height=parseInt(Height);
	var Windo_Width=screen.width;
	var Windo_Height=screen.height;
	window.resizeTo(varWidht,varHeigth);
	
	var W=document.body.clientWidth;
	var H=document.body.clientHeight;
	
	var Ws=varWidht-W;
	var Hs=varHeigth-H;
	
	var Wx=Math.round((Windo_Width-(W+Ws))/2);
	var Hy=Math.round((Windo_Height-(H+Hs))/2);
	window.moveTo(Wx,Hy);
	//========================================================================================
	if (navigator.appName.indexOf("Microsoft") < 0) {
		window.myFlash.flash_as();
		window.moveTo((Windo_Width-(Width+3))/2,(Windo_Height-(Height+Hs))/2);
		window.resizeTo(Width+10,Height+55);
		
		//return false;
	}else{
	//========================================================================================
		var getSize=Number;
		//设置宽度
		function IntervalWidth(){
			W+=Math.round((Width-W)/5);
			Wx=Math.round((Windo_Width-(W+Ws))/2);
			try{
				window.moveTo(Wx,Hy);
				window.resizeTo(W+Ws,H+Hs);
			}catch(e){
			}
			getSize=window.setTimeout(IntervalWidth,20);
			if(Math.abs(Width-W)<3){
				W=Width;
				window.resizeTo(W+Ws,H+Hs);
				clearTimeout(getSize);	
				IntervalHeight();
			}
		}
		IntervalWidth();
		//设置高度
		function IntervalHeight(){
			H+=Math.round((Height-H)/5);
			Hy=Math.round((Windo_Height-(H+Hs))/2);
			try{
				window.moveTo(Wx,Hy);
				window.resizeTo(W+Ws,H+Hs);
			}catch(e){
			}
			getSize=window.setTimeout(IntervalHeight,20);
			if(Math.abs(Height-H)<3){
				H=Height;
				window.moveTo(Wx,Hy);
				window.resizeTo(W+Ws,H+Hs);
				clearTimeout(getSize);	
				ieModer("myFlash").flash_as();
				//alert(W+"x"+H);
			}
		}
	}
}
//==================================== IE ====================================
//window.document.myFlash.SetVariable("dianpu", "<?=$coname?>");
//ieModer("myFlash").flash_as();
function ieModer(N){
	if (navigator.appName.indexOf("Microsoft") < 0) {
		return 	window[N];
	}else{
	   	return 	document[N];
	}
}
//============================================================================










