﻿<!--

//图片按比例缩放
var flag=false;
function DrawImage(ImgD,maxWidth,maxHeight){
	var image=new Image();
	var iwidth = maxWidth; //定义允许图片宽度
	var iheight = maxHeight; //定义允许图片高度
	image.src=ImgD.src;
	if(image.width>0 && image.height>0){
		flag=true;
		if(image.width/image.height>= iwidth/iheight){
			if(image.width>iwidth){ 
				ImgD.width=iwidth;
				ImgD.height=(image.height*iwidth)/image.width;
			}else{
				ImgD.width=image.width; 
				ImgD.height=image.height;
			}
		//ImgD.alt=image.width+"×"+image.height;
		}else{
			if(image.height>iheight){ 
				ImgD.height=iheight;
				ImgD.width=(image.width*iheight)/image.height; 
			}else{
				ImgD.width=image.width; 
				ImgD.height=image.height;
			}
		//ImgD.alt=image.width+"×"+image.height;
		}
	}
}

function change_img()
{
if(key==0){key=1;}
else if(document.all)
{
   document.getElementById("pic").filters[0].Apply();
   document.getElementById("pic").filters[0].Play(duration=2);
   document.getElementById("pic").filters[0].Transition=23;
}

eval('document.getElementById("pic").src=img'+nn+'.src');
eval('document.getElementById("s_url").href=url'+nn+'.src');
eval('typemsg=txt'+nn+'.txt');
eval('typelen=txt'+nn+'.txt.length');
type();
for (var i=1;i<=counts;i++)
{
   document.getElementById("xxjdjj"+i).className='axx';
}
document.getElementById("xxjdjj"+nn).className='bxx';
nn++;
if(nn>counts){nn=1;}
tt=setTimeout('change_img()',picspeed);
}
function changeimg(n)
{
nn=n;
window.clearInterval(tt);
change_img();
}
function type()
{
document.getElementById("typetxt").innerText=typemsg.substring(0,typeseq)
if(typeseq==typelen){typeseq=0}
else
{
   typeseq++
   setTimeout("type()",typespeed)
}
}
document.write('<div class="pic_border_a4"><p class="p_in"><a id="s_url" target="_blank"><img id="pic" class="img_in_a" style="FILTER: progid:DXImageTransform.Microsoft.RevealTrans (duration=2,transition=23)" onload="DrawImage(this,'+widths+','+heights+');" alt="点击查看大图" /></a></p></div>');
document.write('<div style="filter:alpha(style=1,opacity=10,finishOpacity=90);background: #888888;width:100%;text-align:right;top:-16px;position:relative;margin:1px;height:14px;border:0px;padding-top:1px;z-index:4000;">');
for(var i=1;i<counts+1;i++){document.write('<a href="javascript:changeimg('+i+');" id="xxjdjj'+i+'" class="axx" target="_self">'+i+'</a>');}
document.write('</div>');
document.write('<div style="display:none;" id="typetxt" style="color:red;"></div>'); 
change_img();



//-->
