//显示flash，避免IE的激活障碍
function flash(movie,width,height,paramname,paramvalue){
	var swfHtml="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\""+width+"\" height=\""+height+"\">";
	swfHtml+="<param name=\"movie\" value=\""+movie+"\">";
	swfHtml+="<param name=\"quality\" value=\"high\">";
	if(paramname!="" && paramvalue!=""){
		var nameArr=new Array();
		var valueArr=new Array();
		nameArr=paramname.split(",");
		valueArr=paramvalue.split(",");
		if(nameArr.length==valueArr.length){
			for(iCount=0;iCount<nameArr.length;iCount++){
				swfHtml+="<param name=\""+nameArr[iCount]+"\" value=\""+valueArr[iCount]+"\">";
			}
		}
	}
	swfHtml+="<embed src=\""+movie+"\" width=\""+width+"\" height=\""+height+"\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" wmode=\"opaque\"></embed>";
	swfHtml+="</object>";
	document.write(swfHtml);
}

function ratImg(Img,blw,blh){
	var i=Img.width;
	var j=Img.height; 

	if (i>blw){
		var zjbl1=blw/i;
		var zjbl2=blh/j;
		if (zjbl1<zjbl2){
			zjbl=zjbl1;
		}else{
			zjbl=zjbl2;
		}
		i=i*zjbl;
		j=j*zjbl;
	}else{
		if (j>blh){
			zjbl=blh/j;
			j=blh;
			i=i*zjbl;
		}
	}

	Img.width=i;
	Img.height=j;
}

function bbImg(o){
	var zoom=parseInt(o.style.zoom, 10)||100;
	zoom+=event.wheelDelta/12;
	if (zoom>0) o.style.zoom=zoom+'%';
	return false;
}

var size=12;	//字体大小
//设置字体
function fontZoom(){
	size=12;
	document.getElementById('show-content').style.fontSize=size+'px';
}
//字体放大
function fontMax(){
	size=size+2;
	document.getElementById('show-content').style.fontSize=size+'px';
}
//字体缩小
function fontMin(){
	size=size-2;
	if(size<2) size=2;
	document.getElementById('show-content').style.fontSize=size+'px';
}


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
		}
	}
}

function photoContent() {
	var iCount=parseInt(document.forms[0].elements['iCount'].value);
	if(iCount=="" || iCount<=1){
		document.getElementById('ContentHtml').innerHTML='<div class="pic_content_tr"><div class="pic_content_td1"><input name="Picture1" type="text" size="32"> <Input type="button" class="mbutton" style="width:98px;" value="浏览已上传图片" onClick="winOpen(\'Picture1\')"><iframe src="pic_Upload.php?InputName=Picture1" scrolling="no" frameborder="0" width="320" height="32"></iframe></div></div>';
		document.forms[0].elements['iCount'].value=2;
	} else {
		document.getElementById('ContentHtml').innerHTML=document.getElementById('ContentHtml').innerHTML+'<div class="pic_content_tr"><div class="pic_content_td1"><input name="Picture'+iCount+'" type="text" size="32"> <Input type="button" class="mbutton" style="width:98px;" value="浏览已上传图片" onClick="winOpen(\'Picture'+iCount+'\')"><iframe src="pic_Upload.php?InputName=Picture'+iCount+'" scrolling="no" frameborder="0" width="320" height="32"></iframe></div></div>';
		document.forms[0].elements['iCount'].value=iCount+1;
	}
}

function winOpen(inputStr){
	window.open('Files.php?InputName='+inputStr+'','','status=no,scrollbars=yes,top=20,left=110,width=460,height=300')
}
