var popupOStep=15;var popupOMax=75;var popupODelay=25;var popUpBeginW=0;var popUpBeginH=0;var popUpDeltaW=0;var popUpDeltaH=0;var popUpStep=0;var popUpStage=0;var popUpRatio=0;var windowWidth=0;var windowHeight=0;var fixedTop=0;var imageScale=0;var imageMaxRatio=0.7;var imageScaleFlag=false;var finalPopUpHeight=0;var finalPopUpWidth=0;if(typeof popUpImageFolder=="undefined")var popUpImageFolder="../photos/";var popUpImageFile="";if(typeof popupDisplayOtherGals=="undefined")var popupDisplayOtherGals=true;if(typeof popupDisplayHeading=="undefined")var popupDisplayHeading=true;var popUpButtonsCloseFlag=true;var popUpButtonsLeftFlag=true;var popUpButtonsRightFlag=true;var popUpButtonsCommentFlag=true;var popUpButtonsLeftNow=true;var popUpButtonsRightNow=true;var popUpCurrentlyDisplayed=false;var popUpCurrentComment="";var popupCurrentImageIndex=0;var popUpGalleryIndex=-1;var popUpGalleryLength=0;if(typeof popUpCaptionAtBottom=="undefined")var popUpCaptionAtBottom=true;var popUpButtonsActive=false;var imageLoadedProceed=false;whichie=document.URL.split("?");if(whichie.length>1){arr=whichie[1].split("&");if(arr[0].length>0){if(isNaN(arr[0])){arr[0]=unescape(arr[0]);for(i=0;i<galleries.length;i++){if(arr[0]==galleries[i].toLowerCase()){popUpGalleryIndex=i;i=galleries.length;}}}
else if(arr[0]<popupGalText.length)popUpGalleryIndex=arr[0];}}
function getWindowSize(){if(typeof(window.innerWidth)=='number'){windowWidth=window.innerWidth;windowHeight=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}}
function getWindowSizeScale(){getWindowSize();}
function popUpInit(){getWindowSize();fixedTop=-(Math.floor(windowHeight/2))+30;popUp=document.getElementById("popUpPlate");popupRevealBkgd=document.getElementById("popUpBkgd");popUpI=document.getElementById("popUpImage");popUpI.onload=function(){imageLoadedProceed=true;}
lRollerImg=document.createElement('img');lRollerImg.setAttribute('src',"../../popupimage/images/loading-roller.gif");lRollerDiv=document.createElement('div');lRollerDiv.setAttribute('id','popUpLoadingRoller');lRollerDiv.appendChild(lRollerImg);popUp.appendChild(lRollerDiv);popUpLoading=document.getElementById("popUpLoadingRoller");popUpComment=document.getElementById("popUpCommentBox");popUpCoverObj=document.getElementById("popUpCover");popUpCoverLImg=document.getElementById("popUpCoverLeftImage");popUpCoverRImg=document.getElementById("popUpCoverRightImage");popUpBClose=document.getElementById("popUpButtonClose");if(popUpButtonsLeftFlag)popUpBLeft=document.getElementById("popUpButtonLeft");if(popUpButtonsRightFlag)popUpBRight=document.getElementById("popUpButtonRight");if(popUpButtonsCommentFlag)popUpBComment=document.getElementById("popUpButtonComment");for(i=0;i<popupImageArray.length;i++){if(popupImageArray[i][5]==popUpGalleryIndex&&document.images){rslt=new Image();rslt.src=popUpImageFolder+popupImageArray[i][0];}}}
function popUpCreateGallery(ii){if(ii!=-1){if(isNaN(ii)){for(i=0;i<popupGalNames.length;i++)if(ii==popupGalNames[i]){popUpGalleryIndex=i;i=popupGalNames.length;}}else if(popUpGalleryIndex==-1)popUpGalleryIndex=ii;if(popupDisplayHeading)document.write("<div id='popupGalleryHeading'><h1>"+popupGalMainName+popupGalNames[popUpGalleryIndex]+"</h1></div>");if(popupGalText[popUpGalleryIndex].length>0)document.write("<div id='popupGalleryCopy'>"+popupGalText[popUpGalleryIndex]+"</div>");document.write("<div id='popupGalleryThumbs'>");for(i=0;i<popupImageArray.length;i++)if(popupImageArray[i][5]==popUpGalleryIndex){document.write("<div id=\"popUpThumb"+popupImageArray[i][6]+"\"><img class=\"popupThumb\" onclick=\"popUpShow("+i+"); return false;\" src=\""+popUpImageFolder+popupImageArray[i][4]+"\" alt=\"Thumb #"+i+"\" /></div>");popUpGalleryLength++;}
if(popupGalNames.length>1&&popupDisplayOtherGals)document.write(popupGalList);document.write("</div>");}else popUpCreateOverview();}
function popUpCreateOverview(){if(popupDisplayHeading)document.write("<div id='popupGalleryHeading'><h1>Galleries</h1></div>");for(i=0;i<popupGalNames.length;i++){for(j=0;j<popupImageArray.length;j++){if(popupImageArray[j][5]==i){firstImage=j;j=popupImageArray.length;}}
document.write("<a href=\""+popupGalLinks[i]+"\"><img class=\"popupOverviewThumb\" src=\""+popUpImageFolder+popupImageArray[firstImage][4]+"\" alt=\"Thumb #"+i+"\" /></a><h3><a href=\""+popupGalLinks[i]+"\">"+popupGalNames[i]+"</a></h3>"+popupGalOverview[i]+"<br clear=\"all\" />");}}
function popUpFriend(popUpImageFileN,popUpWidth,popUpHeight,ccomment){getWindowSize();popUpCurrentComment=ccomment;popUpButtonsActive=false;finalPopUpWidth=popUpWidth;finalPopUpHeight=popUpHeight;imageScale=Math.max(popUpWidth/windowWidth,(100+popUpHeight)/windowHeight);imageScaleFlag=(imageScale>imageMaxRatio);if(imageScaleFlag){finalPopUpWidth=Math.floor(popUpWidth*imageMaxRatio/imageScale);finalPopUpHeight=Math.floor(popUpHeight*imageMaxRatio/imageScale);}
popUpLoading.style.left=Math.floor(finalPopUpWidth/2-50)+"px";popUpDeltaW=finalPopUpWidth+20-popUpBeginW;popUpDeltaH=finalPopUpHeight+20-popUpBeginH;popUpImageFile=popUpImageFileN;popUpButtonsCommentFlag=(popUpCurrentComment.length>0);popupRevealBkgd.style.display="block";popUpI.style.opacity=0;popUpI.style.filter='alpha(opacity=0)';if(!popUpCurrentlyDisplayed){imageLoadedProceed=false;popUpI.src=popUpImageFolder+popUpImageFile;popUpI.setAttribute('height',finalPopUpHeight);popUpI.setAttribute('width',finalPopUpWidth);popUpSequence(1,0);}else popUpSequence(5,0);}
function popUpSequence(popUpStage,popUpStep){switch(popUpStage){case 1:popUpCurrentlyDisplayed=true;popupRevealBkgd.style.opacity=popUpStep/100;popupRevealBkgd.style.filter='alpha(opacity='+popUpStep+')';if(popUpStep<popupOMax)setTimeout("popUpSequence(1, "+Math.min((popUpStep+popupOStep),popupOMax)+")",popupODelay);else{setTimeout("popUpSequence(2, 0)",popupODelay);}
break;case 2:popUpRatio=popUpStep/100;popUp.style.top=fixedTop+"px";popUp.style.left="-"+Math.floor((popUpBeginW+popUpDeltaW*popUpRatio)/2)+"px";popUp.style.height=Math.floor(popUpBeginH+popUpDeltaH*popUpRatio)+"px";popUp.style.width=Math.floor(popUpBeginW+popUpDeltaW*popUpRatio)+"px";if(popUpStep==0){popUp.style.display="block";popUp.style.opacity=1;popUp.style.filter='alpha(opacity=100)';}
if(popUpStep<100)setTimeout("popUpSequence(2, "+Math.min((popUpStep+popupOStep),100)+")",popupODelay);else{popUpI.style.display="block";if(popUpCaptionAtBottom){popUpComment.style.top=(popUpBeginH+popUpDeltaH+fixedTop)+"px";popUpComment.style.left="-"+Math.floor((popUpBeginW+popUpDeltaW)/2)+"px";popUpComment.style.width=Math.floor(popUpBeginW+popUpDeltaW)+"px";}else{popUpComment.style.top=fixedTop+"px";popUpComment.style.left="-"+Math.floor((popUpBeginW+popUpDeltaW)/2-15)+"px";popUpComment.style.height=Math.floor(popUpBeginH+popUpDeltaH-40)+"px";popUpComment.style.width=Math.floor(popUpBeginW+popUpDeltaW-40)+"px";}
popUpCoverObj.style.top=fixedTop+"px";popUpCoverObj.style.left="-"+Math.floor((popUpBeginW+popUpDeltaW)/2)+"px";popUpCoverObj.style.height=Math.floor(popUpBeginH+popUpDeltaH)+"px";popUpCoverObj.style.width=Math.floor(popUpBeginW+popUpDeltaW)+"px";popUpCoverLImg.style.height=Math.floor(popUpBeginH+popUpDeltaH)+"px";popUpCoverLImg.style.width=Math.floor((popUpBeginW+popUpDeltaW)/2+1)+"px";popUpCoverRImg.style.height=Math.floor(popUpBeginH+popUpDeltaH)+"px";popUpCoverRImg.style.width=Math.floor((popUpBeginW+popUpDeltaW)/2)+"px";popUpCoverObj.style.display="block";setTimeout("popUpSequence(9, 0)",popupODelay);}
break;case 3:popUpI.style.opacity=popUpStep/100;popUpI.style.filter='alpha(opacity='+popUpStep+')';if(popUpStep<100)setTimeout("popUpSequence(3, "+Math.min((popUpStep+popupOStep),100)+")",popupODelay);else{popUpBeginH=popUpBeginH+popUpDeltaH;popUpBeginW=popUpBeginW+popUpDeltaW;popUpButtonsLeftNow=(popUpButtonsLeftFlag&&popupImageArray[popupCurrentImageIndex][7]!=-1);popUpButtonsRightNow=(popUpButtonsRightFlag&&popupImageArray[popupCurrentImageIndex][8]!=-1);setTimeout("popUpSequence(4, 0)",popupODelay);}
break;case 4:if(popUpButtonsCloseFlag){popUpBClose.style.opacity=popUpStep/100;popUpBClose.style.filter='alpha(opacity='+popUpStep+')';if(popUpStep==0)popUpBClose.style.display="block";}
if(popUpButtonsLeftNow){popUpBLeft.style.opacity=popUpStep/100;popUpBLeft.style.filter='alpha(opacity='+popUpStep+')';}
if(popUpButtonsRightNow){popUpBRight.style.opacity=popUpStep/100;popUpBRight.style.filter='alpha(opacity='+popUpStep+')';}
if(!popUpCaptionAtBottom&&popUpButtonsCommentFlag){popUpBComment.style.opacity=popUpStep/100;popUpBComment.style.filter='alpha(opacity='+popUpStep+')';if(popUpStep==0)popUpBComment.style.display="block";}
if(popUpStep<100)setTimeout("popUpSequence(4, "+Math.min((popUpStep+popupOStep),100)+")",popupODelay);else{popUpButtonsActive=true;if(popUpCaptionAtBottom)popUpSequence(8,0);}
break;case 5:if(popUpStep==0){if(popUpButtonsCloseFlag)popUpBClose.style.display="none";if(popUpButtonsLeftFlag)popUpBLeft.style.display="none";if(popUpButtonsRightFlag)popUpBRight.style.display="none";popUpBComment.style.display="none";popUpComment.style.display="none";}
popUpI.style.opacity=(100-popUpStep)/100;popUpI.style.filter='alpha(opacity='+(100-popUpStep)+')';if(popUpStep<100)setTimeout("popUpSequence(5, "+Math.min((popUpStep+popupOStep),100)+")",popupODelay);else{popUpI.style.display="none";imageLoadedProceed=false;popUpI.src=popUpImageFolder+popUpImageFile;popUpI.setAttribute('height',finalPopUpHeight);popUpI.setAttribute('width',finalPopUpWidth);popUpCoverObj.style.display="none";setTimeout("popUpSequence(2, 0)",popupODelay);}
break;case 6:popUpComment.style.opacity=popUpStep/100;popUpComment.style.filter='alpha(opacity='+popUpStep+')';if(popUpStep==0){popUpComment.innerHTML=popUpCurrentComment+"<p><a href=\"#\" onclick=\"popUpHideComment(); return false;\">Close</a></p>";popUpComment.style.display="block";}
if(popUpStep<93)setTimeout("popUpSequence(6, "+Math.min((popUpStep+popupOStep),93)+")",popupODelay);break;case 7:popUpComment.style.opacity=(100-popUpStep)/100;popUpComment.style.filter='alpha(opacity='+(100-popUpStep)+')';if(popUpStep<100)setTimeout("popUpSequence(7, "+Math.min((popUpStep+popupOStep),100)+")",popupODelay);else popUpComment.style.display="none";break;case 8:if(popUpCurrentComment.length>0){popUpComment.innerHTML=popUpCurrentComment;popUpComment.style.display="block";popUpComment.style.opacity=1;popUpComment.style.filter='alpha(opacity=100)';}
break;case 9:if(imageLoadedProceed){popUpLoading.style.display="none";setTimeout("popUpSequence(3, 0)",popupODelay);}else{if(popUpStep==2)popUpLoading.style.display="block";setTimeout("popUpSequence(9, "+(popUpStep+1)+")",popupODelay);}
break;}}
function dropUp(popUpStage,popUpStep){switch(popUpStage){case 1:if(popUpStep==0){popUpButtonsActive=false;if(popUpButtonsCloseFlag)popUpBClose.style.display="none";if(popUpButtonsLeftFlag)popUpBLeft.style.display="none";if(popUpButtonsRightFlag)popUpBRight.style.display="none";popUpComment.style.display="none";popUpBComment.style.display="none";popUpBeginW=0;popUpBeginH=0;popUpCurrentlyDisplayed=false;}
popUp.style.opacity=(100-popUpStep)/100;popUp.style.filter='alpha(opacity='+(100-popUpStep)+')';if(popUpStep<100)setTimeout("dropUp(1, "+Math.min((popUpStep+popupOStep),100)+")",popupODelay);else{popUpCoverObj.style.display="none";setTimeout("dropUp(2, 0)",popupODelay);}
break;case 2:popupRevealBkgd.style.opacity=(popupOMax-popUpStep)/100;popupRevealBkgd.style.filter='alpha(opacity='+(popupOMax-popUpStep)+')';if(popUpStep<popupOMax)setTimeout("dropUp(2, "+Math.min((popUpStep+popupOStep),popupOMax)+")",popupODelay);else{popupRevealBkgd.style.display="none";popUp.style.display="none";}
break;}}
function popUpShow(i){popupCurrentImageIndex=i;popUpFriend(popupImageArray[i][0],popupImageArray[i][1],popupImageArray[i][2],popupImageArray[i][3]);}
function popUpIncrement(i){if(popupImageArray[popupCurrentImageIndex][7+i]!=-1)
popUpShow(popupImageArray[popupCurrentImageIndex][7+i]);}
function popUpShowComment(){popUpSequence(6,0);}
function popUpHideComment(){popUpSequence(7,0);}
function popupSlideshow(){alert("Zoober");}
