

//缩放图片
function ResizePhoto(){
	for (i=0;i<document.images.length;i++){
		if (document.all){
			if (document.images[i].width>500){
				var ih = document.images[i].height;
				var iw = document.images[i].width;
				document.images[i].style.width = "500px";
				document.images[i].style.height = (ih * 500 / iw) + 'px';
				document.images[i].outerHTML='<a href="'+document.images[i].src+'" target="_blank" title="在新窗口打开图片">'+document.images[i].outerHTML+'</a>'
  				document.images[i].hspace = "0";
			 }
		}else{
			if (document.images[i].width>500) {
				document.images[i].title="在新窗口打开图片"
				document.images[i].style.cursor="hand"
				document.images[i].onclick=function(e){window.open(this.src)}
				document.images[i].hspace = "0";
			}
		}
	}
	Element.hide("pageLoading");
}

var imageObject;
function ResizeImage(obj, MaxW, MaxH) {
	if (obj != null) imageObject = obj;
	var state=imageObject.readyState;
	if(state!='complete') {
	        setTimeout("ResizeImage(null,"+MaxW+","+MaxH+")",50);
		return;
	}
	var oldImage = new Image();
	oldImage.src = imageObject.src;
	var dW=oldImage.width; var dH=oldImage.height;
	//alert ('宽：'+dW+'，高：'+dH)
	if(dW>MaxW || dH>MaxH) {
		a=dW/MaxW; b=dH/MaxH;
		if(b>a) a=b;
		dW=dW/a; dH=dH/a;
	}
	if(dW > 0 && dH > 0) {
		imageObject.width=dW;
		imageObject.height=dH;
	}
}

function WriteFlash(Path,Width,Height,Transparent){
	var Temp,T=""
	Temp='<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="FlashH" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="'+Width+'" height="'+Height+'">'
	Temp+='<param name="movie" value="'+Path+'"/>'
	Temp+='<param name="quality" value="High"/>'
	Temp+='<param name="scale" value="ExactFit"/>'
	if (Transparent) {Temp+=' <param name="wmode" value="transparent"/>';T='wmode="transparent"'}
	Temp+='<embed src="'+Path+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="FlashH" width="'+Width+'" height="'+Height+'" quality="High"'+T+' scale="ExactFit"/>'
	Temp+='</object>'
	document.write(Temp);
	//document.getElementById("pic_box").innerHTML=Temp
}