var curImg=0;var timerId=-1;var intervalf=1500;var intervalm=3000;var intervals=5000;var interval=intervalm;var imgIsLoaded=false;var arrPreload=new Array();var imageSrcArray=new Array();var imageNameArray=new Array();var imageDescArray=new Array();var imageWidthArray=new Array();var imageHeightArray=new Array();var imageLinkArray=new Array();var curImageStyle="cursor:hand;border:2px solid #FFF;";var _PRELOADRANGE=5;var playerState=0;var numImgs=0;var widthe=1;var _SMALLWIDTH=128;var _SMALLHEIGHT=96;var _LARGEWIDTH=540;var _LARGEHEIGHT=405;var pWidth=0;var pHeight=0;var isNeedPicPagination=true;var noPicHtml="<center>无可查看相片！</center>";var playObj;var forwardObj;var rewindObj;var speedObj;var stopObj;var repeatObj;var addFunc=0;var stopNum=0;var rootPath="";var htmlCont="";var isRepeatPlay=false;var isPicOpenInNewWindow=true;var buttonPicPrefix="/images";var spaceMark="/";var forwardImages=["bt_u_fwd.gif","bt_u_fwd2.gif"];var rewardImages=["bt_u_rwd.gif","bt_u_rwd2.gif"];var playImages=["bt_u_play.gif","bt_u_play2.gif"];var stopImages=["bt_u_stop.gif","bt_u_stop2.gif"];var repeatImages=["bt_u_repeat.gif","bt_u_repeat2.gif"];var playCallbackFunction;function preloadRange(a,b){arrPreload[0]=new Image();for(var i=a;i<a+b;i++){arrPreload[0].src=imageSrcArray[i]}return true}function imageP(a,b){var c;var d;if(pWidth!=0&&pHeight!=0){c=pWidth;d=pHeight}else{if(b==0){c=_SMALLWIDTH;d=_SMALLHEIGHT}else{c=_LARGEWIDTH;d=_LARGEHEIGHT}}oWidth=imageWidthArray[a];oHeight=imageHeightArray[a];if(oWidth==0&&oHeight==0){var e=new Image();e.src=imageSrcArray[a];oWidth=e.width;oHeight=e.height;if(oWidth==0&&oHeight==0){e=new Image();e.src=imageSrcArray[a];oWidth=e.width;oHeight=e.height}if(oWidth==0&&oHeight==0){e=new Image();e.src=imageSrcArray[a];oWidth=e.width;oHeight=e.height}if(oWidth<c&&oHeight<d){this.height=oHeight;this.width=oWidth}else{var f=(c/oWidth)>(d/oHeight)?(d/oHeight):(c/oWidth);this.height=Math.round(oHeight*f);this.width=Math.round(oWidth*f)}}else if(oWidth<c&&oHeight<d){this.height=oHeight;this.width=oWidth}else{if(oHeight>d||oWidth>c){this.height=d;var f=(c/oWidth)>(d/oHeight)?(d/oHeight):(c/oWidth);this.height=Math.round(oHeight*f);this.width=Math.round(oWidth*f)}else{this.height=oHeight;this.width=oWidth}}if(this.width==0&&this.height==0){this.width=_LARGEWIDTH;this.height=_LARGEHEIGHT}}function imgLoadNotify(){imgIsLoaded=true;if(timerId==-1&&playerState==1){timerId=setTimeout('forward();timerId = -1',interval)}}function changeSlide(a){if(document.getElementById("imgp")==null){return}htmlCont="";if(numImgs==0){curImg=-1;htmlCont=noPicHtml;setButtonStatus("all_hidden")}else{if(addFunc==1){addFunction()}htmlCont="<table width='100%' height='100%' cellpadding='0' cellspacing='0' >";if(!a)a='imgLoadNotify()';var b=new imageP(curImg,widthe);if(document.getElementById("imgp")!=null&&numImgs>1){document.getElementById("imgp").style.filter="blendTrans(duration=1)";document.getElementById("imgp").filters.blendTrans.Apply()}imgIsLoaded=false;if(widthe==1&&isNeedPicPagination==true){htmlCont+="<tr><td align='center'>第"+(curImg+1)+"张，共"+numImgs+"张</td></tr>"}var c="";if(curImg<imageLinkArray.length){c=imageLinkArray[curImg]}else{var d=imageSrcArray[curImg];d=d.replace("res.winupon","@temp");d=d.replace("s.",".");d=d.replace("@temp","res.winupon");c=d}htmlCont+="<tr><td width='100%' align='center'>";htmlCont+="<img SYNCMASTER style='"+curImageStyle+"' onclick=\"windowOpen('"+c+"');\" src=\""+imageSrcArray[curImg]+"\"";if(widthe==1){htmlCont+=" alt=\""+imageNameArray[curImg]+"\""}if(b.width>0&&b.height>0){htmlCont+="width="+b.width+" height="+b.height}htmlCont+=" border=0 onload=\""+a+"\" onerror=\""+a+"\" onabort=\""+a+"\">";htmlCont+="</td></tr>";if(widthe==1){htmlCont+="<tr><td align='center'><span>"+imageNameArray[curImg]+"</span></td></tr>"}htmlCont+="</table>"}if(document.getElementById("imgp")!=null){document.getElementById("imgp").innerHTML=htmlCont}if(numImgs==1||numImgs==0){setButtonStatus("all_hidden")}else{document.getElementById("imgp").filters.blendTrans.Play();setButtonStatus()}if(typeof(playCallbackFunction)=="function"){playCallbackFunction.call(this,curImg)}}function rewind(){if(curImg>0){curImg--;changeSlide()}setButtonStatus()}function setButtonStatus(a){if(!a){if(forwardObj!=null){if(curImg>=numImgs-1){forwardObj.src=rootPath+buttonPicPrefix+spaceMark+forwardImages[1]}else{forwardObj.src=rootPath+buttonPicPrefix+spaceMark+forwardImages[0]}}if(rewindObj!=null){if(curImg<=0){rewindObj.src=rootPath+buttonPicPrefix+spaceMark+rewardImages[1]}else{rewindObj.src=rootPath+buttonPicPrefix+spaceMark+rewardImages[0]}}}else if(a=="all_hidden"){if(forwardObj!=null)forwardObj.style.visibility="hidden";if(rewindObj!=null)rewindObj.style.visibility="hidden";if(playObj!=null)playObj.style.visibility="hidden";if(stopObj!=null)stopObj.style.visibility="hidden";if(speedObj!=null)speedObj.style.visibility="hidden";if(repeatObj!=null)repeatObj.style.visibility="hidden"}}function forward(){if(curImg>=numImgs-1){if(isRepeatPlay){curImg=0;changeSlide();play()}else{stop()}}else{curImg++;changeSlide()}if(typeof(imgAutoPage)=='function'){imgAutoPage(curImg)}setButtonStatus()}function rewindPic(){rewind();pause()}function forwardPic(){forward();pause()}function stopPic(){stop()}function showPic(a){curImg=a-1;forward()}function stop(){playerState=0;window.clearInterval(timerId);if(timerId!=-1){clearTimeout(timerId);timerId=-1}curImg=0;changeSlide();imgIsLoaded=true;if(playObj){playObj.src=rootPath+buttonPicPrefix+spaceMark+playImages[0];playObj.title="播放";playObj.onclick=function(){play()}}if(stopObj){stopObj.src=rootPath+buttonPicPrefix+spaceMark+stopImages[1]}}function play(){playerState=1;if(timerId==-1){timerId=setTimeout('forward();timerId=-1',interval)}if(playObj){playObj.src=rootPath+buttonPicPrefix+spaceMark+playImages[1];playObj.title="暂停";playObj.onclick=function(){pause()}}if(stopObj){stopObj.src=rootPath+buttonPicPrefix+spaceMark+stopImages[0]}}function pause(){playerState=0;window.clearInterval(timerId);if(timerId!=-1){clearTimeout(timerId);timerId=-1}imgIsLoaded=true;if(playObj){playObj.src=rootPath+buttonPicPrefix+spaceMark+playImages[0];playObj.title="播放";playObj.onclick=function(){play()}}}function playPic(){play()}function init(){playObj=document.getElementById("play");forwardObj=document.getElementById("forward");rewindObj=document.getElementById("rewind");stopObj=document.getElementById("stop");speedObj=document.getElementById("speed");repeatObj=document.getElementById("repeat");numImgs=imageSrcArray.length;changeSlide();playerState=1;setRepeatPlay(false)}function setRepeatPlay(a){if(a!=null){isRepeatPlay=a}else{isRepeatPlay=!isRepeatPlay}if(isRepeatPlay){if(repeatObj){repeatObj.src=rootPath+buttonPicPrefix+spaceMark+repeatImages[1]}}else{if(repeatObj){repeatObj.src=rootPath+buttonPicPrefix+spaceMark+repeatImages[0]}}}function setButtonPicPrefix(a){buttonPicPrefix=a}function windowOpen(a){if(isPicOpenInNewWindow){window.open(a)}else{location.href=a}}function setPicOpenInNewWindow(a){isPicOpenInNewWindow=a}