var selectList=""; for(var i=0;i<arrUrl.length;i++){ $("photo_select").options[$("photo_select").length]=n ew Option((i+1) +"/" +arrUrl.length+ "張",i); } ViewPhoto('<!--list.var1-->',2); ShowUrlList(Bof);
function changePic(id){ var j = parseInt(id.options[id.selectedIndex].value); ViewPhoto(arrUrl[j],j+2); }
function ViewPhoto(PhotoUrl,num){ var strHtml; var FileExt=PhotoUrl.substr(PhotoUrl.lastIndexOf('.')+1).to LowerCase(); if(FileExt=='gif'||FileExt=='jpg'||FileExt=='png'||FileExt=='bm p'||FileExt=='jpeg'){ strHtml="<a href='javascript:nextpic("+num+");'><img s rc='"+PhotoUr l+"' onload='if(this.width>500) t his.width=500'></a>"; document.getElementById('show_pic').href=PhotoUrl; document.getElementById('prev_pic').href="javascript:ne xtpic("+(num-2)+");"; document.getElementById('next_pic').href="javascript:n extpic("+num+");"; }else if(FileExt=='swf'){ strHtml="<object classid='clsid:D27CDB6E-AE6D-11cf-9 6B8-44455354 0000' width='550' height='400' codebase='http://download.m acromedia.com} pub/shockwave/cabs/flash/sw flash.cab#version=5,0,0,0'><param n ame='movie' value='"+PhotoUrl+"'><param name='quality' v alue='high'><embe d src='"+PhotoUrl+"' plugins page='http://www.macromedia.com/shockwave/download/ index.cgi?P1_Prod_ Version=ShockwaveFlash' t ype='application/x-shockwave-flash' width='550' height='400 '></embed></object>"; document.getElementById('show_pic').href=PhotoUrl; document.getElementById('prev_pic').href="javascript:next pic("+(num-2)+");"; document.getElementById('next_pic').href="javascript:nextp ic("+num+");"; }else{ strHtml=PhotoUrl; } var inum = num-1; iplay=num; if(inum<=6){ ShowUrlList(1); }else if(inum<=12){ ShowUrlList(2); }else if(inum<=18){ ShowUrlList(3); }else if(inum<=24){ ShowUrlList(4); } document.getElementById('imgBox').innerHTML=strHtml; }
function SlidePlay(){ var sTimer,url; if(IsPlaying==false){ IsPlaying=true; document.getElementById('SlideButton').src=idomain +'Skin/Tags/im g2/photo_play1.gif'; sTimer=setTimeout("ViewNext("+(iplay+1)+")",2000); }else{ clearTimeout(sTimer); IsPlaying=false; document.getElementById('SlideButton').src=idomain+'S kin/Tags/img2 /photo_play.gif'; } } function ViewNext(i){ if(IsPlaying==false){return false;} if(PhotoIndex<arrUrl.length){ ViewPhoto(arrUrl[PhotoIndex],i); PhotoIndex+=1; iplay+=1 } if(PhotoIndex>=arrUrl.length){ PhotoIndex=0; iplay=2; } var iTimeout=parseInt(document.getElementById('interv al').value * 1000); if (isNaN(iTimeout)){ iTimeout = 3000; } if(iTimeout<1000){iTimeout=5000;} sTimer=setTimeout("ViewNext("+iplay+")",iTimeout); $("photo_select").selectedIndex = i-2; }
function nextpic(ix){ var num = ix-1; for(var i=0;i<arrUrl.length;i++){ if(num==i) ViewPhoto(arrUrl[i],(i+2)); } //13 14 if(num<arrUrl.length&&num>0)$("photo_select").selected Index = num; }
function ShowUrlList(page){ if(arrUrl.length<=1) return ''; var dTotalPage=arrUrl.length/6; var TotalPage; var MaxPerPage=6; var changePage=false; if(arrUrl.length%MaxPerPage==0){TotalPage=Math.floor( dTotalPage);} else{TotalPage=Math.floor(dTotalPage)+1;} if(page<1) page=1; if(page>TotalPage) page=TotalPage; var strPage=""; for(var i=(page-1)*MaxPerPage;i<arrUrl.length&&i<page*MaxP erPage;i++){ //if(!changePage){ // strPage+="<li class='thispic'><a href='javascript:;' onclick=V iewPhot o('"+arrUrl[i]+"','"+(i+2)+"')><img src='"+arrUrl[i]+"' border='0' width ='70' heig ht='70' /></a></li>"; // ViewPhoto(arrUrl[i],i+2); // changePage=true; /