/*显示Flash动画(无边框)*/
/*ShowFlashAll(路径,宽,高,变量,背景色,窗口模式,是否显示菜单,影片ID,质量,是否全屏)*/
function ShowFlashAll(Swf,W,H,FlashVars,BgColor,Wmode,Menu,ID,Quality,AllowFullScreen) {
	var W=(W==null || W=="") ? null:W;
	var H=(H==null || H=="") ? null:H;
	var FlashVars=(FlashVars==null || FlashVars=="") ? null:FlashVars;
	var BgColor=(BgColor==null || BgColor=="") ? null:BgColor;
	var Wmode=(Wmode==null || Wmode=="") ? "opaque":Wmode;
	var Menu=(Menu==null || Menu=="") ? false:Menu;
	var ID=(ID==null || ID=="") ? null:ID;
	var Quality=(Quality==null || Quality=="") ? "high":Quality;
	var AllowFullScreen=(AllowFullScreen==null || AllowFullScreen=="") ? true:AllowFullScreen;
	
	var FLashObj=null;
	FLashObj="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,2,8'";
	FLashObj+=W!=null ? " width='" + W + "'":"";
	FLashObj+=H!=null ? " height='" + H + "'":"";
	FLashObj+=ID!=null ? " ID='"+ ID + "'":"";
	FLashObj+=">"

	FLashObj+=Swf!=null ? "<param name='movie' value='"+ Swf + "' />":"";
	FLashObj+=BgColor!=null ? "<param name='bgcolor' value='"+ BgColor + "' />":"";
	FLashObj+=Wmode!=null ? "<param name='wmode' value='"+ Wmode + "' />":''; //opaque,transparent,window
	FLashObj+=Menu!=null ? "<param name='menu' value='"+ Menu + "' />":"";
	FLashObj+=FlashVars!=null ? "<param name='FlashVars' value='"+ FlashVars + "' />":"";
	FLashObj+=Quality!=null ? "<param name='quality' value='"+ Quality + "' />":"";
	FLashObj+=AllowFullScreen!=null ? "<param name='allowFullScreen' value='"+ AllowFullScreen + "' />":"";

	FLashObj+="<embed";
	FLashObj+=Swf!=null ? " src='"+ Swf + "'":"";
	FLashObj+=W!=null ? " width='"+ W + "'":"";
	FLashObj+=H!=null ? " height='"+ H + "'":"";
	FLashObj+=ID!=null ? " id='"+ ID + "'":"";
	FLashObj+=BgColor!=null ? " bgcolor='"+ BgColor + "'":"";
	FLashObj+=Wmode!=null ? " wmode='"+ Wmode + "'":"";
	FLashObj+=Menu!=null ? " menu='"+ Menu + "'":"";
	FLashObj+=FlashVars!=null ? " FlashVars='"+ FlashVars + "'":"";
	FLashObj+=Quality!=null ? " quality='"+ Quality + "'":"";
	FLashObj+=AllowFullScreen!=null ? " allowFullScreen='"+ AllowFullScreen + "'":"";
	FLashObj+="></embed>";
	FLashObj+="</object>";
	document.write(FLashObj);
}


/*显示Flash动画(无边框)*/
function ShowFlash(Url,W,H) {
	/*wmode="opaque";*/
document.write('<embed src="' + Url + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + W + '" height="' + H + '" menu="false" wmode="opaque"></embed>')
}

var flag=false; 
function DrawImage(ImgD,MaxWidth,MaxHeight){ 
	var image=new Image(); 
	//var MaxWidth = 120
	//var MaxHeight = 120
	image.src=ImgD.src; 
	if(image.width>0 && image.height>0){ 
		flag=true; 
		if(image.width/image.height>= MaxWidth/MaxHeight){ 
			if(image.width>MaxWidth){
				ImgD.width=MaxWidth; 
				ImgD.height=(image.height*MaxWidth)/image.width; 
			}else{ 
				ImgD.width=image.width;
				ImgD.height=image.height; 
			} 
			//ImgD.alt=image.width+"x"+image.height; 
		} 
		else{ 
			if(image.height>MaxHeight){
			ImgD.height=MaxHeight; 
			ImgD.width=(image.width*MaxHeight)/image.height; 
			}else{ 
			ImgD.width=image.width;
			ImgD.height=image.height; 
			} 
			//ImgD.alt=image.width+"x"+image.height; 
		} 
	}
}


// PNG图片透明用法1 --图片加载
//<img src="/Company/Images/ZI_C.png" width="145" height="40" border="0" onload="fixPNG(this)"/>
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
function fixPNG(myImage) {
	if ((version >= 5.5) && (version < 7) && (document.body.filters)){
		var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
		var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
		var imgTitle = (myImage.title) ? 
					 "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
		var imgStyle = "display:inline-block;" + myImage.style.cssText
		var strNewHTML = "<span " + imgID + imgClass + imgTitle
					  + " style=\"" + "width:" + myImage.width 
					  + "px; height:" + myImage.height 
					  + "px;" + imgStyle + ";"
					  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
					  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
		myImage.outerHTML = strNewHTML	  
	}
}


// PNG图片透明循环用法 --javascript控制自动循环
//<img src="/Company/Images/ZI_C.png" width="145" height="40" border="0" class="png"/>
//<script type="text/javascript">pngHandler.init();<//script>

function PNGHandler(){var self=this;this.na=navigator.appName.toLowerCase();this.nv=navigator.appVersion.toLowerCase();this.isIE=this.na.indexOf('internet explorer')+1?1:0;this.isWin=this.nv.indexOf('windows')+1?1:0;this.ver=this.isIE?parseFloat(this.nv.split('msie ')[1]):parseFloat(this.nv);this.isMac=this.nv.indexOf('mac')+1?1:0;this.isOpera=(navigator.userAgent.toLowerCase().indexOf('opera ')+1||navigator.userAgent.toLowerCase().indexOf('opera/')+1);if(this.isOpera)this.isIE=false;this.transform=null;this.getElementsByClassName=function(className,oParent){doc=(oParent||document);matches=[];nodes=doc.all||doc.getElementsByTagName('*');for(i=0;i<nodes.length;i++){if(nodes[i].className==className||nodes[i].className.indexOf(className)+1||nodes[i].className.indexOf(className+' ')+1||nodes[i].className.indexOf(' '+className)+1){matches[matches.length]=nodes[i]}};return matches};this.filterMethod=function(oOld){var o=document.createElement('div');var filterID='DXImageTransform.Microsoft.AlphaImageLoader';if(oOld.nodeName=='DIV'){var b=oOld.currentStyle.backgroundImage.toString();oOld.style.backgroundImage='none';var i1=b.indexOf('url("')+5;var newSrc=b.substr(i1,b.length-i1-2).replace('.gif','.png');o=oOld;o.style.writingMode='lr-tb';o.style.filter="progid:"+filterID+"(src='"+newSrc+"',sizingMethod='crop')"}else if(oOld.nodeName=='IMG'){var newSrc=oOld.getAttribute('src').replace('.gif','.png');oOld.src='http://www.71baby.com/images/none.gif';oOld.style.filter="progid:"+filterID+"(src='"+newSrc+"',sizingMethod='crop')";oOld.style.writingMode='lr-tb'}};this.pngMethod=function(o){bgImage=this.getBackgroundImage(o);if(bgImage){o.style.backgroundImage='url('+bgImage.replace('.gif','.png')+')'}else if(o.nodeName=='IMG'){o.src=o.src.replace('.gif','.png')}else if(!this.isMac){}};this.getBackgroundImage=function(o){var b,i1;var bgUrl=null;if(o.nodeName=='DIV'&&!(this.isIE&&this.isMac)){if(document.defaultView){if(document.defaultView.getComputedStyle){b=document.defaultView.getComputedStyle(o,'').getPropertyValue('background-image');i1=b.indexOf('url(')+4;bgUrl=b.substr(i1,b.length-i1-1)}else{}}else{}};return bgUrl};this.supportTest=function(){if(this.isIE&&this.isWin&&this.ver>=5.5){self.transform=self.filterMethod}else if(!this.isIE&&this.ver<5){self.transform=null}else if(!this.isIE&&this.ver>=5||(this.isIE&&this.isMac&&this.ver>=5)){self.transform=self.pngMethod}else{self.transform=null;return false};return true};this.init=function(){if(this.supportTest()){this.elements=this.getElementsByClassName('png');for(var i=0;i<this.elements.length;i++){this.transform(this.elements[i])}}}};var pngHandler=new PNGHandler();
																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																								  
																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																								/*// PNG图片透明循环用法3  --页面加载完毕自动循环
function correctPNG(){
	for(var i=0; i<document.images.length; i++){
		var img = document.images[i]
		var imgName = img.src.toUpperCase()
		if (imgName.substring(imgName.length-3, imgName.length) == "PNG"){
			var imgID = (img.id) ? "id='" + img.id + "' " : ""
			var imgClass = (img.className) ? "class='" + img.className + "' " : ""
			var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
			var imgStyle = "display:inline-block;" + img.style.cssText 
			if (img.align == "left") imgStyle = "float:left;" + imgStyle
			if (img.align == "right") imgStyle = "float:right;" + imgStyle
			if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle  
			var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
			img.outerHTML = strNewHTML
			i = i-1
		}
	}
}
window.attachEvent("onload", correctPNG);
*/