// Web software by DavidRegier.com
function SlideShow(popUp){initImagesArr();if(popUp){if(!AOL){window.moveTo(0,0);window.resizeTo(screen.availWidth,screen.availHeight);}}
this.userIsAdministrator=GetCookie("userWithWritePrivileges");this.popUp=popUp;this.slideNum=(Settings.SS.randomStart&&!this.userIsAdministrator)?Math.floor(Math.random()*Images.length):0;this.nFirstSlide=this.slideNum;this.speedActual=Settings.SS.speed*1000;this.automated=(this.speedActual<86400000);this.SPEED_FAST=500;this.preLoadTimer=0;this.NextImage=null;this.slideDelay=0;this.running=true;this.forward=true;this.buttons=false;this.dissolve=true;this.maxDissolveMZ=1000*1000;this.maxImgWid=0;this.maxImgHgt=0;this.changeSpeed=changeSpeed;this.init=init;this.start=start;this.showSlide=showSlide;this.skipErrantSlide=skipErrantSlide;this.preLoadNext=preLoadNext;this.imgClickHandler=imgClickHandler;this.back=back;this.next=next;this.showMsg=showMsg;this.getCoordinates=getCoordinates;this.repositionElements=repositionElements;this.pauseSS=pauseSS;this.getControls=getControls;this.getGUI=getGUI;window.onresize=this.repositionElements;this.rightClick=rightClick;this.setControlVisibility=setControlVisibility;this.msg=new Array();this.msg.ssRunning="Slide Show Running...";this.msg.downloadingImg="Preparing next slide...";this.msg.pleaseWait="Downloading image, please wait...";this.msg.ssPaused="Slide Show Paused, re-click \"Pause\" to continue...";this.msg.ssPausedSF="Slide Show Paused, click \"Run\" to continue...";this.msg.next=(this.automated)?"Jump forward":"Next";this.msg.back=(this.automated)?"Go back":"Back";this.msg.ssExit=(this.automated)?"Close this slide-show window":"Close this pop-up window";function setControlVisibility(on){var SSButtons=document.getElementById("SSButtons");if(SSButtons)SSButtons.style.visibility=(on)?"visible":"hidden";var SSExitPopUp=document.getElementById("SSExitPopUp");if(SSExitPopUp)SSExitPopUp.style.visibility=(on)?"visible":"hidden";}
function start(){if(Settings.SS.console){var Console=document.getElementById("ssConsole");var maxConsoleHgt=0;for(var i=0;i<Images.length;i++){Console.innerHTML=(Images[i][3])?Images[i][3]:"X";var consoleHgt=Console.offsetHeight;if(consoleHgt>maxConsoleHgt)maxConsoleHgt=consoleHgt;}
Console.style.height=maxConsoleHgt+"px";}
this.repositionElements();this.showMsg();if(Settings.SS.console)Console.style.visibility="visible";this.preLoadNext();}
function getCoordinates(TheImage){var x=0;var y=0;TheElement=TheImage;var parPosAbs=false;while(TheElement){if(SF){if(!parPosAbs)parPosAbs=(TheElement.style.position=="absolute");if(parPosAbs&&TheElement==document.body)break;}
y+=TheElement.offsetTop;x+=TheElement.offsetLeft;TheElement=TheElement.offsetParent;}
return[x,y];}
function repositionElements(){if(SS.popUp){var IeBody=(IE&&document.compatMode=="CSS1Compat")?document.documentElement:document.body;var bodyHgt=(IE)?IeBody.clientHeight:window.innerHeight;var bodyWid=(IE)?IeBody.clientWidth:window.innerWidth;var SsGui=document.getElementById("SsGui");var ssGuiHgt=SsGui.offsetHeight;var ssGuiWid=SsGui.offsetWidth;SsGui.style.position="absolute";SsGui.style.top=parseInt((bodyHgt-ssGuiHgt)/2)+"px";SsGui.style.left=parseInt((bodyWid-ssGuiWid)/2)+"px";}
if(SS.ImgOverlay){var OverlayPos=SS.getCoordinates(document.images.slideShow.parentNode);SS.ImgOverlay.style.left=OverlayPos[0]+"px";SS.ImgOverlay.style.top=OverlayPos[1]+"px";}}
function showSlide(){if(this.NextImage){this.showMsg();var TheImage=document.images.slideShow;var widNew=Images[this.slideNum][1];var hgtNew=Images[this.slideNum][2];var imgArea=widNew*hgtNew;checkDim(this.NextImage.src,widNew,hgtNew);if(this.forward&&this.dissolve&&(winIE||(MZ&&imgArea<=this.maxDissolveMZ)||(SF&&Settings.dissolveSF))&&Settings.transNum>=1&&this.speedActual>this.SPEED_FAST){var nNewImg=(Images.length==this.slideNum)?0:this.slideNum;var nOldImg=(nNewImg==0)?Images.length-1:nNewImg-1;TheImage.width=Images[nOldImg][1];TheImage.height=Images[nOldImg][2];TheImage.src=Settings.folder+Images[nOldImg][0];if(Settings.borderWid&&Images[nOldImg][4])TheImage.style.borderColor="rgb( "+getRGB(Images[nOldImg][4])+" )";var imgStyle=(Settings.borderWid&&Images[nNewImg][4])?" style='border:"+Settings.borderWid+"px solid rgb("+getRGB(Images[nNewImg][4])+");'":"";var newImg="<img name='slideShowNew' src='"+Settings.folder+Images[nNewImg][0]+"' width='"+Images[nNewImg][1]+"' height='"+Images[nNewImg][2]+"' title='"+TheImage.title+"'"+imgStyle+" onmousedown='SS.imgClickHandler( event );' onContextMenu='return SS.rightClick( this, event );' class='ssImage'>";if(!SS.ImgOverlay){SS.ImgOverlay=document.createElement("DIV");SS.ImgOverlay.style.textAlign="center";SS.ImgOverlay.style.top=(screen.height*-1)+"px";SS.ImgOverlay.style.left=(screen.width*-1)+"px";SS.ImgOverlay.style.zIndex=1000;SS.ImgOverlay.style.position="absolute";SS.ImgOverlay.style.backgroundColor="rgb( "+Settings.SS.bkgColor+" )";document.body.appendChild(SS.ImgOverlay);}
SS.ImgOverlay.style.width=this.maxImgWid+"px";SS.ImgOverlay.style.height=this.maxImgHgt+"px";if(winIE)SS.ImgOverlay.style.visibility="hidden";if(MZ)SS.ImgOverlay.style.opacity=0;else SS.ImgOverlay.style.opacity=0;var OverlayPos=SS.getCoordinates(TheImage.parentNode);SS.ImgOverlay.style.left=OverlayPos[0]+"px";SS.ImgOverlay.style.top=OverlayPos[1]+"px";SS.ImgOverlay.innerHTML=newImg;if(winIE)startFade(SS.ImgOverlay,Settings.transNum,Settings.transDur,0,0,0);else fadeIn(SS.ImgOverlay);}
else{if(this.ImgOverlay){document.body.removeChild(this.ImgOverlay);this.ImgOverlay=null;}
TheImage.style.visibility="hidden";TheImage.width=widNew;TheImage.height=hgtNew;if(Settings.borderWid&&Images[this.slideNum][4])TheImage.style.borderColor="rgb( "+getRGB(Images[this.slideNum][4])+" )";TheImage.src=this.NextImage.src;TheImage.style.visibility="visible";}
this.dissolve=true;this.forward=true;}}
function showMsg(){if(Settings.SS.console){var imgTitle=Images[this.slideNum][3];var colon=(imgTitle)?": ":"";var slideNumDisplay=this.slideNum-this.nFirstSlide+1;if(slideNumDisplay<1)slideNumDisplay=Images.length+slideNumDisplay;var slideCount=slideNumDisplay+" of "+Images.length
if(imgTitle=="*")imgTitle=Settings.pageTitle;else if(imgTitle.indexOf("*+")==0)imgTitle=Settings.pageTitle+imgTitle.split("+")[1];else if(imgTitle.indexOf("+*")>=0)imgTitle=imgTitle.split("+")[0]+Settings.pageTitle;else if(imgTitle=="_")imgTitle=Images[this.slideNum][0];document.getElementById("ssConsole").innerHTML=slideCount+colon+imgTitle;}}
function skipErrantSlide(){if(local||SS.speedActual==SS.SPEED_FAST){if(!SS.errReported){alert("Slide #"+(SS.slideNum+1)+"; "+SS.NextImage.src+" failed to load");SS.errReported=true;}}
SS.NextImage=null;}
function preLoadNext(){var recursionTimer=100;this.slideDelay+=recursionTimer;if(!this.NextImage){if(this.SPEED_FAST!=this.speedActual&&this.forward)this.speedActual=Images[this.slideNum][5]*1000;this.slideNum++;if(this.slideNum==Images.length)this.slideNum=0;this.NextImage=new Image();this.NextImage.onerror=this.skipErrantSlide;this.NextImage.src=Settings.folder+Images[this.slideNum][0];}
if(this.NextImage&&this.NextImage.complete&&this.slideDelay>this.speedActual){this.slideDelay=0;this.showSlide();this.NextImage=null;clearTimeout(this.preLoadTimer);this.preLoadNext();if(Settings.SS.controls&&document.getElementById("BackBut"))document.getElementById("BackBut").disabled=false;if(Settings.SS.scrollSlide)window.scroll(Settings.SS.scrollSlide[0],Settings.SS.scrollSlide[1]);}
else
this.preLoadTimer=setTimeout("SS.preLoadNext()",recursionTimer);}
function imgClickHandler(e){if(!e)e=window.event;if(e.ctrlKey||e.metaKey){if(this.speedActual==this.SPEED_FAST)this.speedActual=Settings.SS.speed*1000;else
this.speedActual=this.SPEED_FAST;}
if(e.shiftKey){if(this.running)this.pauseSS(true);else
this.pauseSS(false);}}
function back(){if(Settings.SS.console)document.getElementById("ssConsole").innerHTML=this.msg.pleaseWait;clearTimeout(this.preLoadTimer);this.forward=false;this.slideNum-=3;if(this.slideNum==-2)this.slideNum=Images.length-2;if(this.slideNum==-3)this.slideNum=Images.length-3;this.NextImage=null;this.speedActual=Settings.SS.speed;this.pauseSS(false);if(Settings.SS.scrollToTopOnJump!=-1)window.scroll(0,Settings.SS.scrollToTopOnJump);}
function next(){if(Settings.SS.console)document.getElementById("ssConsole").innerHTML=this.msg.pleaseWait;clearTimeout(this.preLoadTimer);this.forward=true;this.speedActual=Settings.SS.speed;this.pauseSS(false);if(Settings.SS.scrollToTopOnJump!=-1)window.scroll(0,Settings.SS.scrollToTopOnJump);}
function pauseSS(pause){var Button=(this.buttons)?document.getElementById("PauseBut"):null;var HighSpeed=document.getElementById("HighSpeed");if(HighSpeed&&this.speedActual!=this.SPEED_FAST){if(SF)HighSpeed.value="Hi-Speed";else
HighSpeed.className="ssButton";HighSpeed.title="Run at Hi-Speed";}
if(pause){if(SF){if(Button)Button.value="Run";}
else{if(Button)Button.className="ssButtonOn";}
clearTimeout(this.preLoadTimer);this.running=false;if(Button)Button.title="Resume";}
else{this.slideDelay=Settings.SS.speed*1000+1;this.preLoadNext();if(Button){if(SF)Button.value="Pause";Button.className="ssButton";Button.title="Pause";}
this.running=true;}
if(window.DW)DW.removeWin();}
function changeSpeed(Button){if(this.speedActual==this.SPEED_FAST){SS.speedActual=Settings.SS.speed*1000;if(SF)Button.value="Hi-Speed";else
Button.className="ssButton";Button.title="Run at Hi-Speed";}
else{this.speedActual=this.SPEED_FAST;if(SF)Button.value="Lo-Speed";else
Button.className="ssButtonOn";Button.title="Revert to normal speed";}
this.forward=true;this.pauseSS(false);}
function getControls(){this.buttons=true;htm="<input type='button' id='BackBut' class='ssButton' value='&lt;&lt;' onClick='SS.back();' title='"+this.msg.back+"'>&nbsp;";if(this.automated)htm+="&nbsp;<input name='PauseBut' class='ssButton' id='PauseBut' type='button' value='Pause' onClick='SS.speedActual = Settings.SS.speed; SS.pauseSS( ( ( SS.running ) ? true : false ) );' title='Pause'"+((SF)?" style='width:60px;'":"")+">&nbsp;";if(this.userIsAdministrator)htm+="&nbsp;<input id='HighSpeed' class='ssButton' type='button' value='Hi-Speed' onClick='SS.changeSpeed( this );' title='Run at Hi-Speed'"+((SF)?" style='width:80px;'":"")+">&nbsp;";htm+="&nbsp;<input type='button' id='NextBut' class='ssButton' value='&gt;&gt;' onClick='SS.next();' title='"+this.msg.next+"'>";return htm;}
function init(){var maxWid=-1,maxHgt=-1,bordWid=Settings.borderWid*2;for(var i=0;i<Images.length;i++){if(Images[i][1]>maxWid)maxWid=Images[i][1];if(Images[i][2]>maxHgt)maxHgt=Images[i][2];Images[i][3]=Images[i][3].replace(/\^/g, "\"" ).replace(/\[/g, "<div class='ssCaptionOtherLines'>" ).replace(/]/g, "</div>" );
if(!Images[i][4])Images[i][4]=Settings.borderCol;if(!Images[i][5])Images[i][5]=Settings.SS.speed;checkImgName(Images[i][0]);}
this.maxImgWid=maxWid+bordWid;this.maxImgHgt=maxHgt+bordWid;}
function rightClick(Photo,evt){if(this.userIsAdministrator){SS.speedActual=Settings.SS.speed;this.pauseSS(true);var nImages=Images.length;var indexNum=(this.slideNum>0)?this.slideNum-1:nImages-1;var Img=Images[indexNum];var wid=Img[1],hgt=Img[2],tnWid=-1,tnHgt=-1,longestEdge=150;var shape=(wid>hgt)?"horizontal":((wid<hgt)?"vertical":"square");if(shape=="horizontal"){tnWid=longestEdge;tnHgt=parseInt(hgt*longestEdge/wid);}
else{tnWid=parseInt(wid*longestEdge/hgt);tnHgt=longestEdge;}
var fileSize=Photo.fileSize;if(fileSize)fileSize=Math.round(fileSize/1000)+" KB";var htm="<table align='left' border='0' cellspacing='0' cellpadding='0'><tr><td align=center valign=top><img src='"+Photo.src+"' width='"+tnWid+"' height='"+tnHgt+"'></td><td align=center valign=top style='padding:4px;'><table align='center' border='0' cellspacing='0' cellpadding='0' class='dwText'><tr><td align=right>Name:&nbsp;</td><td align=left>"+Img[0]+"</td></tr><tr><td align=right>Number:&nbsp;</td><td align=left>"+((this.slideNum>0)?this.slideNum:nImages)+" of "+Images.length+"</td></tr><tr><td align=right>Dimensions:&nbsp;</td><td align=left>"+wid+" &times; "+hgt+" px; "+shape+"</td></tr>"+((fileSize)?"<tr><td align=right valign=top>File Size:&nbsp;</td><td align=left>"+fileSize+"</td></tr>":"")+((typeof Img[3]=="string")?"<tr><td align=right valign=top> Caption:&nbsp;</td><td align=left>"+Img[3]+"</td></tr>":"")+"<tr><td align=left colspan=2>Slide-Show paused, <a href='javascript:SS.dissolve=false; SS.pauseSS( false );' class='dwLink'>click here</a> to resume</td></tr></table></td></table>";DW.createWindow(["Image Properties",htm],[0,500,0],Photo,evt);return false;}
else
return(Settings.disableRightClick)?false:true;}
function getGUI(guiAlign,consoleLoc,buttonsLoc){this.init();var imgStyle=(Settings.borderWid&&Images[this.slideNum][4])?" style='border-color:rgb("+getRGB(Images[this.slideNum][4])+");'":"";var img1Title=(Images[0][3])?Images[0][3].replace(/\^/g, "\"" ):"";var console="",buttons="";if(Settings.SS.console)console="<tr><td align='center'><div class='ssCaption' id='ssConsole' style='visibility:hidden; width:"+this.maxImgWid+"px;'>X</div></td></tr>";if(Settings.SS.controls)buttons="<tr id='SSButtons'><td align='center'><div class='ssControls' style='white-space:nowrap;'>"+SS.getControls()+"</div></td></tr>";var htm="<table align='"+guiAlign+"' border='0' cellspacing='0' cellpadding='0' id='SsGui' class='ssGUI'>";if(Settings.pageTitle)htm+="<tr><td align='center'><div class='ssTnTitle'>"+Settings.pageTitle+"</div></td></tr>";if(buttonsLoc=="above")htm+=buttons;if(consoleLoc=="above")htm+=console;htm+="<tr><td valign='top' align='center'><table align='center' border='0' cellspacing='0' cellpadding='0'><tr><td valign='top'><table align='center' border='0' cellspacing='0' cellpadding='0'><tr><td align='center' valign='top' style='width:"+this.maxImgWid+"px;"+((Settings.SS.imageConsoleHeightIsFixed)?" height:"+this.maxImgHgt+"px;":"")+"'><img name='slideShow' src='"+Settings.folder+Images[this.slideNum][0]+"' onError='SS.skipErrantSlide(); SS.preLoadNext(); this.slideDelay = this.speedActual + 1;' width='"+Images[this.slideNum][1]+"' height='"+Images[this.slideNum][2]+"' title='Slide-Show' onmousedown='SS.imgClickHandler( event );'"+imgStyle+" galleryimg='no' onAbort='this.src=this.src;' class='ssImage' onContextMenu='return SS.rightClick( this, event );'></td></tr>";if(consoleLoc=="below")htm+=console;if(buttonsLoc=="below")htm+=buttons;htm+="</table></td></tr></table></td></tr></table>";if(this.popUp)htm+="<div style='position:absolute; top:0%; right:1%; margin:10px 15px 0px 0px;' id='SSExitPopUp'><a href='javascript:void(0);' onClick='window.close(); return false;' onMouseover='this.title=SS.msg.ssExit;' class='ssExitPopUp'>Exit</a></div>";return htm;}}
function ThumbNails(){this.disableRightClick=0;this.dissolveSF=1;this.transNum=2;this.transDur=0.8;this.maxDissolveMZ=800*800;initImagesArr();this.nImages=Images.length;this.maxIndex=this.nImages-1;for(var i=0;i<this.nImages;i++){var imgTitle=(Images[i][3])?Images[i][3]:"";Images[i][3]=imgTitle.replace(/'/g, "^^" );
if(!Images[i][4])Images[i][4]=Settings.borderCol;checkImgName(Images[i][0]);}
this.init=init;this.checkTnDim=checkTnDim;this.setSectVis=setSectVis;this.getNewIndex=getNewIndex;this.preloadNext=preloadNext;this.getNumLinesInTitle=getNumLinesInTitle;this.swapLgImg=swapLgImg;this.show=show;this.hideLgImg=hideLgImg;this.setImgTitle=setImgTitle;this.imgBorder=imgBorder;this.disableBackButton=disableBackButton;this.showNumImages=showNumImages;this.writeConsole=writeConsole;this.updateProgressBar=updateProgressBar;this.reportImgName=reportImgName;this.writeHtmlTN=writeHtmlTN;this.Link=null;this.scrollFromTop=0;this.scrollFromLeft=0;this.lgPhotoShowing=false;this.NextLgImage=null;this.nextImgTimer=0;this.curIndex=-1;this.tnRemainingTN=0;function init(){this.showNumImages();this.checkTnDim();}
this.checkTN=1;this.checkTnTimer=0;this.TnReal=null;this.TnSizeErr="";function checkTnDim(){if(GetCookie("userHasWritePrivleges")){if(this.TnReal==null){var TN=document.getElementById("TN_"+this.checkTN);if(TN){TnReal=new Image();TnReal.src=TN.src;}
else{TnReal=null;clearTimeout(this.checkTnTimer);if(this.TnSizeErr)DW.createWindow(["Thumbnail Dimension Error","<div style='margin:0px 0px 4px 0px;'>Thumbnails must be "+Settings.TN.width+" x "+Settings.TN.height+" pixels:</div>"+this.TnSizeErr],[0,400,0],null,null,6,[4,0,0]);}}
if(TnReal&&TnReal.complete){var realWid=TnReal.width,realHgt=TnReal.height;if(realWid>1&&realHgt>1&&(realWid!=Settings.TN.width||realHgt!=Settings.TN.height)){var FileComponents=TnReal.src.split("/");var fileName=FileComponents[FileComponents.length-1];this.TnSizeErr+="<div style='margin:0px 0px 0px 8px;'>#"+this.checkTN+" "+fileName+" is "+realWid+" x "+realHgt+"</div>";}
this.checkTN++;this.checkTnTimer=setTimeout("TN.checkTnDim();",100);}}}
function setSectVis(sectName,className){var i=0;while(document.getElementById(sectName+i)){var PageSection=document.getElementById(sectName+i);PageSection.className=className;i++;}}
function getNewIndex(movingForward){if(movingForward)return(this.curIndex<this.maxIndex)?this.curIndex+1:0;else
return(this.curIndex>0)?this.curIndex-1:this.maxIndex;}
function preloadNext(){var newIndex=this.getNewIndex(1);var PreLoadImage=new Image(Images[newIndex][1],Images[newIndex][2]);PreLoadImage.src=Settings.folder+Images[newIndex][0];}
function getNumLinesInTitle(imgTitle){var imgtitle=imgTitle.toLowerCase();var nLinesInTitle=imgtitle.split("<br>").length;var lineBrks="";for(var i=0;i<nLinesInTitle;i++)lineBrks+="<br>";return lineBrks;}
function swapLgImg(movingForward){var Img=document.getElementById("imgLargeID");if(Img){Img.onload=null;var newIndex=this.getNewIndex(movingForward);if(!this.NextLgImage){this.NextLgImage=new Image(Images[newIndex][1],Images[newIndex][2]);this.NextLgImage.src=Settings.folder+Images[newIndex][0];}
if(this.NextLgImage.complete){document.getElementById("imgLargeID").style.visibility="hidden";var imgTitle=Images[newIndex][3];TN.setImgTitle(imgTitle,newIndex);Img.width=Images[newIndex][1];Img.height=Images[newIndex][2];Img.style.border=Settings.borderWid+"px solid rgb( "+getRGB(Images[newIndex][4])+" )";Img.src=this.NextLgImage.src;setTimeout("document.getElementById( 'imgLargeID' ).style.visibility = 'visible'",1);checkDim(this.NextLgImage.src,Images[newIndex][1],Images[newIndex][2]);this.NextLgImage=null;clearInterval(this.nextImgTimer);this.nextImgTimer=0;this.curIndex=(movingForward)?this.curIndex+1:this.curIndex-1;if(this.curIndex>this.maxIndex)this.curIndex=0;else if(this.curIndex<0)this.curIndex=this.maxIndex;this.preloadNext();}
else{if(this.nextImgTimer==0){eval("this.nextImgTimer = setInterval( 'TN.swapLgImg( "+movingForward+" )', 250 );");var lineBrks=getNumLinesInTitle(Images[newIndex][3]);TN.setImgTitle("Downloading image, please wait..."+lineBrks,null);}}}
else{this.NextLgImage=null;clearInterval(this.nextImgTimer);this.nextImgTimer=0;}}
function show(ImgInfoArr){this.lgPhotoShowing=true;var ieCSS=(IE&&document.compatMode)?document.compatMode=="CSS1Compat":false;if(IE)var IeBody=ieCSS?document.documentElement:document.body;this.scrollFromTop=(IE)?IeBody.scrollTop:window.pageYOffset;this.scrollFromLeft=(IE)?IeBody.scrollLeft:window.pageXOffset;this.Link=ImgInfoArr[7];var sectName=ImgInfoArr[8];this.setSectVis(sectName,"off");ImgInfoArr[5]=getRGB(ImgInfoArr[5]);var tableHgt=1;tableHgt=(IE)?document.body.clientHeight-60:window.innerHeight-60;var BodyStyle=document.body.style;BodyStyle.backgroundImage="url( none )";BodyStyle.backgroundColor=Settings.TN.bkgColOn;BodyStyle.marginTop="0px";BodyStyle.marginRight="0px";BodyStyle.marginBottom="0px";BodyStyle.marginLeft="0px";var html="<DIV ID='bigID"+sectName+"'>"+"<TABLE BORDER='0' CELLSPACING='0' CELLPADDING='0' WIDTH='100%' HEIGHT='"+tableHgt+"'><TR><TD ALIGN='center' VALIGN='middle'>";html+="<TABLE BORDER='0' CELLSPACING='0' CELLPADDING='0'><TR><TD><A HREF='javascript:void(0);' ID='topFocalPt'></A><br></TD></TR><TR>";var bkgStyle=" STYLE='background-color:"+Settings.TN.bkgColOn+";'";var thisIndex=this.curIndex;var backMsg="Back to thumbnails";var imgTitle=ImgInfoArr[4];var lineBrks=getNumLinesInTitle(imgTitle);html+="<TD id='imgTD' ALIGN='center'"+bkgStyle+"><A HREF='javascript:TN.hideLgImg( \""+sectName+"\" );' onMouseOver='self.status=this.title; return true;' onMouseOut='self.status=\"\"; return true;' TITLE='"+backMsg+"'"+bkgStyle+">";var dissolveMZ=(ImgInfoArr[2]*ImgInfoArr[3]<=this.maxDissolveMZ);html+="<IMG ID='imgLargeID' NAME='"+sectName+"ID' SRC='"+ImgInfoArr[0]+ImgInfoArr[1]+"' BORDER='0' WIDTH='"+ImgInfoArr[2]+"' HEIGHT='"+ImgInfoArr[3]+"' HSPACE=0 VSPACE=0 STYLE='border:"+ImgInfoArr[6]+"px solid rgb( "+ImgInfoArr[5]+" );"+getOpacity(TN.dissolveSF,dissolveMZ)+"' onAbort='this.src=this.src;' onLoad='startFade( this, TN.transNum, TN.transDur, 0, TN.dissolveSF, "+dissolveMZ+" ); TN.setImgTitle( \""+imgTitle+"\", "+thisIndex+" ); TN.preloadNext(); checkDim( this.src, "+ImgInfoArr[2]+", "+ImgInfoArr[3]+" );' onContextMenu='"+((TN.disableRightClick)?"return false;":"return true;")+"'></A></TD></TR><TR><TD ALIGN='center' width='100%'><DIV ID='imgTitleID' CLASS='tnLgImgTitle'>Loading image, please wait..."+lineBrks+"</DIV><DIV STYLE='line-height:4px;'> &nbsp;</DIV></TD></TR><TR><TD ALIGN='center'><A HREF='javascript:TN.swapLgImg( 0 );' onMouseOver='self.status=this.title; style.textDecoration=\"underline\"; return true;' onMouseOut='self.status=\"\"; style.textDecoration=\"none\"; return true;' style='text-decoration:none;' TITLE='Previous image'>&lt;&lt;</A>&nbsp;&nbsp;<A HREF='javascript:TN.hideLgImg( \""+sectName+"\" );' onMouseOver='self.status=this.title; style.textDecoration=\"underline\"; return true;' onMouseOut='self.status=\"\"; style.textDecoration=\"none\"; return true;' style='text-decoration:none;' TITLE='"+backMsg+"'>Back to Thumbnails</A>&nbsp;&nbsp;<A HREF='javascript:TN.swapLgImg( 1 );' onMouseOver='self.status=this.title; style.textDecoration=\"underline\"; return true;' onMouseOut='self.status=\"\"; style.textDecoration=\"none\"; return true;' style='text-decoration:none;' TITLE='Next image'>&gt;&gt;</A></TD></TR><TR><TD><A HREF='javascript:void(0);' ID='botFocalPt'></A><br></TD></TR></TABLE><br>";html+="</TD></TR></TABLE><br>";html+="</DIV>";var ImgConsole=document.getElementById(sectName);ImgConsole.innerHTML=html;ImgConsole.className="on";var FocuserTop=document.getElementById("topFocalPt");FocuserTop.focus();var FocuserBot=document.getElementById("botFocalPt");FocuserBot.focus();return false;}
function hideLgImg(sectName){this.lgPhotoShowing=false;var ImgConsole=document.getElementById("bigID"+sectName);ImgConsole.innerHTML="";ImgConsole.className="off";var BodyStyle=document.body.style;BodyStyle.backgroundImage=Settings.TN.PageStyle.bkgImg;BodyStyle.backgroundColor=Settings.TN.PageStyle.bkgCol;BodyStyle.marginTop=Settings.TN.PageStyle.marTop;BodyStyle.marginRight=Settings.TN.PageStyle.marRgt;BodyStyle.marginBottom=Settings.TN.PageStyle.marBot;BodyStyle.marginLeft=Settings.TN.PageStyle.marLft;TN.setSectVis(sectName,"on");if(typeof this.Link=="object"){this.Link.focus();this.Link.blur();}
window.scroll(this.scrollFromLeft,this.scrollFromTop);}
function setImgTitle(imgTitle,newIndex){if(imgTitle=="*")imgTitle=Settings.pageTitle;else if(imgTitle.indexOf("*+")==0)imgTitle=Settings.pageTitle+imgTitle.split("+")[1];else if(imgTitle.indexOf("+*")>=0)imgTitle=imgTitle.split("+")[0]+Settings.pageTitle;else if(imgTitle=="_")imgTitle=Images[newIndex][0].split(".")[0];if(newIndex!=null){var colon=(imgTitle!="&nbsp; <br>"&&imgTitle!="")?": ":"";imgTitle=(newIndex+1)+" of "+(this.maxIndex+1)+colon+imgTitle;}
if(!imgTitle)imgTitle="&nbsp; <br>";var ImgTitle=document.getElementById("imgTitleID");imgTitle=imgTitle.replace(/\^\^/g, "'" );
imgTitle=imgTitle.replace(/\^/g, "\"" );ImgTitle.innerHTML=imgTitle;}
function imgBorder(Img,color){if(Img.complete)Img.style.borderColor=color;}
function disableBackButton(){if(this.lgPhotoShowing)document.location.href=document.location.href;}
function showNumImages(){if(this.nImages>-1){if(Settings.TN.ProgressBar.hideOnSuccess)document.getElementById("consoleTN").style.visibility="hidden";setTimeout('self.status=TN.nImages+" Thumbnails loaded..."',500);}}
function writeConsole(){document.write("<div id='consoleTN' style='line-height:14px;' align='center'><div>&nbsp; </div><br></div>");}
function updateProgressBar(){var Console=document.getElementById("consoleTN");try{if(this.tnRemainingTN>=0){var dBarWid=(this.nImages-this.tnRemainingTN)*(Settings.TN.ProgressBar.width/this.nImages);var percentLoaded=parseInt(((this.nImages-this.tnRemainingTN)/this.nImages)*100)+"%";var pBar="<div style='width:"+Settings.TN.ProgressBar.width+"px; background-color:"+Settings.TN.ProgressBar.bgColor+"; text-align:left; z-index:0;'><div style='width:"+dBarWid+"px; background-color:"+Settings.TN.ProgressBar.progressColor+";'>&nbsp;</div></div><div style='position:relative; top:-14px; left:0px; width:"+Settings.TN.ProgressBar.width+"px; text-align:center; z-index:1; font-family:arial,helvetica; font-size:8pt; color:"+Settings.TN.ProgressBar.fontColor+"; font-weight:bold'>Loading Thumbnails "+percentLoaded+"</div>";Console.innerHTML=pBar;if(this.tnRemainingTN>0)setTimeout("TN.updateProgressBar()",250);else if(Settings.TN.ProgressBar.hideOnSuccess)Console.style.visibility="hidden";}}
catch(Err){setTimeout("TN.updateProgressBar()",250);}}
function reportImgName(Link,imageNum,evt){if(GetCookie("userHasWritePrivleges")){var Img=Images[imageNum-1];var ImgTN=Link.firstChild;var wid=Img[1],hgt=Img[2];var shape=(wid>hgt)?"horizontal":((wid<hgt)?"vertical":"square");var htm="<table align='left' border='0' cellspacing='0' cellpadding='0'><tr><td align=center valign=top><img src='"+ImgTN.src+"' width='"+ImgTN.width+"' height='"+ImgTN.height+"'></td><td align=center valign=top style='padding:4px;'><table align='center' border='0' cellspacing='0' cellpadding='0'><tr><td align=right> Name:&nbsp;</td><td>"+Img[0]+"</td></tr><tr><td align=right> Number:&nbsp;</td><td>"+imageNum+" of "+TN.nImages+"</td></tr><tr><td align=right> Size:&nbsp;</td><td>"+wid+" &times; "+hgt+" px; "+shape+"</td></tr><tr><td align=right valign=top> Caption:&nbsp;</td><td>"+Img[3]+"</td></tr></table></td></table>";if(window.DW)DW.createWindow(["Image Information",htm],[0,400,0],Link,evt);return false;}}
function writeHtmlTN(){self.status="Reading information in data-base...";if(dataFile){this.tnRemainingTN=this.nImages;self.status="Rendering data as HTML, please wait...";var htm="<div id='thumbnails0'>";var tnNum=0;thePageTitle=Settings.pageTitle;thePageTitle=thePageTitle.replace(/\^\^/g, "&#39;" );
thePageTitle=thePageTitle.replace(/\^/g, "&#34;" );
if(thePageTitle)htm+="<div class='ssTnTitle' align='center'>"+thePageTitle+"</div><div style='line-height:10px;'>&nbsp; </div>";htm+="<table align='center' border=0 cellpadding=0 cellspacing=0>";var nRows=Math.floor(this.nImages/Settings.TN.nImagesRow)+1;for(var row=0;row<nRows;row++){htm+="<tr align='center' valign='middle'><td align=center nowrap>";for(var i=0;i<Settings.TN.nImagesRow;i++){var thisTnImgData='';var writeTN=(tnNum<this.nImages)?true:false;if(writeTN){var lgImageName=Images[tnNum][0],tnImageName="";lastDotPos=lgImageName.lastIndexOf(".");var fileExt="TN"+lgImageName.substring(lastDotPos,lgImageName.length);tnImageName=lgImageName.split(".")[0]+fileExt;var lgWid=Images[tnNum][1];var lgHgt=Images[tnNum][2];var imgTitle=Images[tnNum][3];imgTitle=imgTitle.replace(/\"/g, "^" );
if(imgTitle=="*")imgTitle=Settings.pageTitle;else if(imgTitle.indexOf("*+")==0)imgTitle=Settings.pageTitle+imgTitle.split("+")[1];else if(imgTitle.indexOf("+*")>=0)imgTitle=imgTitle.split("+")[0]+Settings.pageTitle;else if(imgTitle=="_")imgTitle=lgImageName.split(".")[0];var toolTip=imgTitle.replace(/<.*?>/g, "" ); // Remove HTML tags
toolTip=toolTip.replace(/\^\^/g, "&#39;" );
toolTip=toolTip.replace(/\^/g, "&#34;" );
var lgBorderCol=Images[tnNum][4];var lgBorderWid=Settings.borderWid;var tn=Settings.folder+tnImageName;tnNum++;}
var imageNum=row*Settings.TN.nImagesRow+i+1;if(writeTN){var lgImgName=tnImageName.replace(/TN\./, "." );
var toolTipColon=(toolTip)?": ":"";toolTip=imageNum+" of "+this.nImages+toolTipColon+toolTip;htm+="<a href='"+Settings.folder+lgImgName+"' onMouseOver='self.status=\""+toolTip+"\"; return true;' onMouseOut='self.status=\"\"; return true;' title=\""+toolTip+"\" onClick='if( window.TN ) { TN.curIndex = "+(imageNum-1)+"; return TN.show( [ \""+Settings.folder+"\", \""+lgImgName+"\", "+lgWid+", "+lgHgt+", \""+imgTitle+"\", \""+lgBorderCol+"\", "+lgBorderWid+", this, \"thumbnails\" ] ); }' onContextMenu='return TN.reportImgName( this, "+imageNum+", event );'><img src='"+tn+"' border='0' hspace='2' vspace='2' width='"+Settings.TN.width+"' HEIGHT='"+Settings.TN.height+", ' title=\""+toolTip+"\" style='border:1px solid "+Settings.TN.bordColOff+";' onMouseover='if( window.TN ) TN.imgBorder(this,Settings.TN.bordColOn);' onMouseout='if( window.TN ) TN.imgBorder(this,Settings.TN.bordColOff);' onAbort='this.src=this.src;' onLoad='TN.tnRemainingTN--;' onContextMenu='"+((TN.disableRightClick)?"return false;":"return true;")+"' id='TN_"+imageNum+"'></a>";}}
htm+="</td></tr>";}
htm+="</table></div><span id='thumbnails' class='off'></span>";document.write(htm);self.status="";}}}
