var resizeSpeed=7;var borderSize=10;var slideShowWidth=500;var slideShowHeight=375;var navigationBarWidth=-1;var slideshow=0;var foreverLoop=0;var loopInterval=4000;var loopMusic=true;var homeURL="http://www.hvfire.org/";var fileLoadingImage=homeURL+"images/loading.gif";var fileBottomNavCloseImage=homeURL+"images/close.png";var SlideShowStartImage=homeURL+"images/play.png";var SlideShowStopImage=homeURL+"images/stop.png";var MusicOnImage=homeURL+"images/music_on.png";var MusicOffImage=homeURL+"images/music_off.png";var replayImage=homeURL+"images/replay.png";var blankSrc=homeURL+"images/blank.gif";var SoundBridgeSWF=homeURL+"js/SoundBridge.swf";var imageDataContainerOpacity=1;var resize=1;var imageArray=new Array;var activeImage;if(resizeSpeed>10){resizeSpeed=10;}
if(resizeSpeed<1){resizeSpeed=1;}
resizeDuration=(11-resizeSpeed)*0.15;var so=null;var objSlideShowImage;var objLightboxImage;var objImageDataContainer;var objSpeakerImage;var objBottomNavCloseImage;var keyPressed=false;var slideshowMusic=null;var firstTime=1;var closeWindow=false;var saveSlideshow;var saveForeverLoop;var saveLoopInterval;var saveSlideShowWidth;var saveSlideShowHeight;var saveLoopMusic;var saveNavigationBarWidth;var timeStart=0;var isPNGSupported=!(/MSIE ((5\.5)|(6\.0))/.test(navigator.userAgent)&&(navigator.platform=="Win32"));var realSrc;function propertyChanged(){if(isPNGSupported)return;var pName=event.propertyName;if(pName!="src")return;if(!new RegExp(blankSrc).test(event.srcElement.src)){fixPNGImage(event.srcElement);}}
function fixPNGImage(element){if(isPNGSupported)return;var src=element.src;if(src==realSrc&&/\.png$/i.test(src)){element.src=blankSrc;return;}
if(!new RegExp(blankSrc).test(src)){realSrc=src;}
if(/\.png$/i.test(realSrc)){element.src=blankSrc;element.runtimeStyle.filter="progid:DXImageTransform.Microsoft."+"AlphaImageLoader(src='"+src+"',sizingMethod='scale')";}
else{element.runtimeStyle.filter="";}}
function openSlideShow(slideshowName){var wW=800;var wH=620;var X=(screen.width-wW)/2;var Y=(screen.height-wH)/3;var pageURL=homeURL+slideshowName+'.html';var slideshowWindow=window.open(pageURL,'_blank','width='+wW+',height='+wH+',top='+Y+',left='+X+',screenX='+X+',screenY='+Y+',toolbar=0,scrollbars=0,resizable=0,location=0,status=0');if(slideshowWindow==null||typeof(slideshowWindow)=="undefined"){alert("Can't open a slideshow window.\nPlease, try again when the page gets reloaded.");location.reload();}}
function startSlideshow(){closeWindow=true;init();var anchors=document.getElementsByTagName('a');if(anchors.length!=0){var anchor=anchors[0];myLightbox.start(anchor);}}
Object.extend(Element,{getWidth:function(element){element=$(element);return element.offsetWidth;},setWidth:function(element,w){element=$(element);element.style.width=w+"px";},setHeight:function(element,h){element=$(element);element.style.height=h+"px";},setTop:function(element,t){element=$(element);element.style.top=t+"px";},setSrc:function(element,src){element=$(element);element.src=src;},setHref:function(element,href){element=$(element);element.href=href;},setInnerHTML:function(element,content){element=$(element);element.innerHTML=content;}});Array.prototype.removeDuplicates=function(){for(i=1;i<this.length;i++){if(this[i][0]==this[i-1][0]){this.splice(i,1);}}}
Array.prototype.empty=function(){for(i=0;i<=this.length;i++){this.shift();}}
Sound.trace=function(value,isJavascript){}
function Player(){this.paused=true;this.stoped=true;this.options=new Object();this.options.swfLocation=SoundBridgeSWF;this.sound=new Sound(this.options);this.position=0;this.frequency=1000;this.isLoaded=false;this.duration=0;this.bytesTotal=0;this.callback=this.registerCallback();}
Player.prototype.onTimerEvent=function(){var isDurationOk=false
if(!this.paused){var position=this.sound.getPosition();if(!position)position=0;if(position!=this.position&&position!=0){this.onPlaying();}else{this.onBuffering();}
this.position=position;var duration=0;duration=this.sound.getDuration();if(!duration)duration=0;if(duration==this.duration&&duration!=0){isDurationOk=true;}
this.duration=duration;var progress=position/duration;if(isDurationOk){this.setProgressBar(progress);}
var isBytesTotalOk=false;var bytesTotal=this.sound.getBytesTotal();if(bytesTotal==this.bytesTotal){isBytesTotalOk=true;}
this.bytesTotal=bytesTotal;if(isBytesTotalOk){var loaded=this.sound.getBytesLoaded()/bytesTotal;this.setLoadedBar(loaded);}
if(progress==1&&duration!=0&&position!=0){this.onSoundComplete();}}}
Player.prototype.registerCallback=function(){return setInterval(this.onTimerEvent.bind(this),this.frequency);}
Player.prototype.clearCallback=function(){clearInterval(this.callback);this.callback=null;}
Player.prototype.setProgressBar=function(progress){if(!progress)progress=0;}
Player.prototype.setLoadedBar=function(loaded){if(!loaded)loaded=0;}
Player.prototype.onPlaying=function(){}
Player.prototype.onPause=function(){}
Player.prototype.onBuffering=function(){}
Player.prototype.onSoundComplete=function(){if(!this.paused){if(loopMusic){this.onForward();}}}
Player.prototype.onForward=function(){this.position=0;this.duration=0;this.sound.start(this.duration/1000,1);this.sound.stop();this.loadTrack(this.track);this.stoped=true;this.setProgressBar(0);this.setLoadedBar(0);if(!this.paused){this.paused=true;this.play();}}
Player.prototype.fadeOut=function(){for(var i=this.sound.getVolume()-1;i>=0;i--){this.sound.setVolume(i);}}
Player.prototype.fadeIn=function(){for(var i=1;i<=100;i++){this.sound.setVolume(i);}}
Player.prototype.toggleVolume=function(){if(this.paused)return;var volume=this.sound.getVolume();if(volume==0){this.fadeIn();objSpeakerImage.setAttribute('src',MusicOnImage);}
if(volume==100){this.fadeOut();objSpeakerImage.setAttribute('src',MusicOffImage);}}
Player.prototype.play=function(){if(this.paused){this.paused=false;if(this.stoped){this.sound.loadSound(this.track,true);}
this.sound.start(this.position/1000,1);this.stoped=false;}else{this.position=this.sound.getPosition();this.sound.stop();this.paused=true;this.onPause();}}
Player.prototype.stop=function(){if(!this.paused){for(var i=this.sound.getVolume()-1;i>=0;i--){this.sound.setVolume(i);pause(1);}}
this.paused=true;this.stoped=true;this.position=0;this.duration=0;this.sound.start(this.duration/1000,1);this.sound.stop();}
Player.prototype.loadTrack=function(track){this.track=track;}
var player;var Lightbox=Class.create();Lightbox.prototype={initialize:function(){this.dimmingOut=false;if(!document.getElementsByTagName){return;}
var anchors=document.getElementsByTagName('a');for(var i=0;i<anchors.length;i++){var anchor=anchors[i];var relAttribute=String(anchor.getAttribute('rel'));if(anchor.getAttribute('href')&&(relAttribute.toLowerCase().match('lightbox'))){anchor.onclick=function(){myLightbox.start(this);return false;}}}
var objBody=document.getElementsByTagName("body").item(0);var objOverlay=document.createElement("div");objOverlay.setAttribute('id','overlay');objOverlay.style.display='none';objOverlay.onclick=function(){if(!closeWindow){myLightbox.end();}
return false;}
objBody.appendChild(objOverlay);var objLightbox=document.createElement("div");objLightbox.setAttribute('id','lightbox');objLightbox.style.display='none';objBody.appendChild(objLightbox);var objOuterImageContainer=document.createElement("div");objOuterImageContainer.setAttribute('id','outerImageContainer');objLightbox.appendChild(objOuterImageContainer);var objImageContainer=document.createElement("div");objImageContainer.setAttribute('id','imageContainer');objOuterImageContainer.appendChild(objImageContainer);objLightboxImage=document.createElement("img");objLightboxImage.setAttribute('id','lightboxImage');objLightboxImage.setAttribute('width','');objLightboxImage.setAttribute('height','');objImageContainer.appendChild(objLightboxImage);var objHoverNav=document.createElement("div");objHoverNav.setAttribute('id','hoverNav');objImageContainer.appendChild(objHoverNav);var objPrevLink=document.createElement("a");objPrevLink.setAttribute('id','prevLink');objPrevLink.setAttribute('href','#');objPrevLink.setAttribute('onFocus','if (this.blur) this.blur()');objHoverNav.appendChild(objPrevLink);var objNextLink=document.createElement("a");objNextLink.setAttribute('id','nextLink');objNextLink.setAttribute('href','#');objNextLink.setAttribute('onFocus','if (this.blur) this.blur()');objHoverNav.appendChild(objNextLink);var objLoading=document.createElement("div");objLoading.setAttribute('id','loading');objImageContainer.appendChild(objLoading);var objLoadingLink=document.createElement("a");objLoadingLink.setAttribute('id','loadingLink');objLoadingLink.setAttribute('href','#');objLoadingLink.setAttribute('onFocus','if (this.blur) this.blur()');objLoadingLink.onclick=function(){myLightbox.end();if(closeWindow)window.close();return false;}
objLoading.appendChild(objLoadingLink);var objLoadingImage=document.createElement("img");objLoadingImage.setAttribute('src',fileLoadingImage);objLoadingLink.appendChild(objLoadingImage);var objReplay=document.createElement("div");objReplay.setAttribute('id','replay');objImageContainer.appendChild(objReplay);var objReplayLink=document.createElement("a");objReplayLink.setAttribute('id','replayLink');objReplayLink.setAttribute('href','#');objReplayLink.setAttribute('onFocus','if (this.blur) this.blur()');objReplayLink.onclick=function(){myLightbox.toggleSlideShow();return false;}
objReplay.appendChild(objReplayLink);var objReplayImage=document.createElement("img");objReplayImage.onpropertychange=function(){propertyChanged();return false;};objReplayImage.setAttribute('src',replayImage);objReplayLink.appendChild(objReplayImage);objReplayImage.setAttribute('src',replayImage);Element.hide('replay');var objSpacer=document.createElement("div");objSpacer.setAttribute('id','spacer');objSpacer.className='spacer';objLightbox.appendChild(objSpacer);objImageDataContainer=document.createElement("div");objImageDataContainer.setAttribute('id','imageDataContainer');objImageDataContainer.className='clearfix';objImageDataContainer.onmouseover=function(ev){if(ev==undefined){ev=event;}
if(checkMouseEnter(this,ev)){myLightbox.lightUpNavigationBar();}
return false;}
objImageDataContainer.onmouseout=function(ev){if(ev==undefined){ev=event;}
if(checkMouseLeave(this,ev)){myLightbox.dimDownNavigationBar();}
return false;}
objLightbox.appendChild(objImageDataContainer);var objImageData=document.createElement("div");objImageData.setAttribute('id','imageData');objImageDataContainer.appendChild(objImageData);var objImageDetails=document.createElement("div");objImageDetails.setAttribute('id','imageDetails');objImageData.appendChild(objImageDetails);var objCaption=document.createElement("span");objCaption.setAttribute('id','caption');objImageDetails.appendChild(objCaption);var objNumberDisplay=document.createElement("span");objNumberDisplay.setAttribute('id','numberDisplay');objImageDetails.appendChild(objNumberDisplay);var objBottomNav=document.createElement("div");objBottomNav.setAttribute('id','bottomNav');objImageData.appendChild(objBottomNav);var objBottomNavCloseLink=document.createElement("a");objBottomNavCloseLink.setAttribute('id','bottomNavClose');objBottomNavCloseLink.setAttribute('href','#');objBottomNavCloseLink.setAttribute('onFocus','if (this.blur) this.blur()');objBottomNavCloseLink.onclick=function(){myLightbox.end();if(closeWindow)window.close();return false;}
objBottomNav.appendChild(objBottomNavCloseLink);objBottomNavCloseImage=document.createElement("img");objBottomNavCloseImage.setAttribute('id','closeButton');objBottomNavCloseImage.setAttribute('alt',"Close");objBottomNavCloseImage.onpropertychange=function(){propertyChanged();return false;};objBottomNavCloseImage.setAttribute('src',fileBottomNavCloseImage);objBottomNavCloseLink.appendChild(objBottomNavCloseImage);var objSlideShowLink=document.createElement("a");objSlideShowLink.setAttribute('id','slideshowLink');objSlideShowLink.setAttribute('href','#');objSlideShowLink.setAttribute('onFocus','if (this.blur) this.blur()');objSlideShowLink.onclick=function(){myLightbox.toggleSlideShow();return false;}
objBottomNav.appendChild(objSlideShowLink);objSlideShowImage=document.createElement("img");objSlideShowImage.setAttribute('id','playButton');objSlideShowImage.setAttribute('alt',"Start/Stop");objSlideShowImage.setAttribute('src',SlideShowStartImage);objSlideShowImage.onpropertychange=function(){propertyChanged();return false;};objSlideShowLink.appendChild(objSlideShowImage);var objSpeakerLink=document.createElement("a");objSpeakerLink.setAttribute('id','speakerLink');objSpeakerLink.setAttribute('href','#');objSpeakerLink.setAttribute('onFocus','if (this.blur) this.blur()');objSpeakerLink.onclick=function(){player.toggleVolume();return false;}
objBottomNav.appendChild(objSpeakerLink);objSpeakerImage=document.createElement("img");objSpeakerImage.setAttribute('id','speaker');objSpeakerImage.setAttribute('alt',"Music On/Off");objSpeakerImage.setAttribute('src',MusicOffImage);objSpeakerImage.onpropertychange=function(){propertyChanged();return false;};objSpeakerLink.appendChild(objSpeakerImage);var objFlashPlayer=document.createElement("div");objFlashPlayer.setAttribute('id','__sound_flash__');objOverlay.appendChild(objFlashPlayer);},lightUpNavigationBar:function(){if(!this.dimmingOut){new Effect.Parallel([new Effect.Appear('imageDataContainer',{duration:0.25,from:imageDataContainerOpacity,to:1.0})],{duration:0.25});}else{this.dimmingOut=false;}},dimDownNavigationBar:function(){this.dimmingOut=true;setTimeout(function(){if(this.dimmingOut){new Effect.Parallel([new Effect.Appear('imageDataContainer',{duration:0.25,from:1.0,to:imageDataContainerOpacity,afterFinish:function(){myLightbox.dimmingOut=false;}})],{duration:0.25});}}.bind(this),2000);},start:function(imageLink){player=new Player();slideshowMusic=null;firstTime=1;saveSlideshow=slideshow;saveForeverLoop=foreverLoop;saveLoopInterval=loopInterval;saveSlideShowWidth=slideShowWidth;saveSlideShowHeight=slideShowHeight;saveLoopMusic=loopMusic;saveNavigationBarWidth=navigationBarWidth;hideSelectBoxes();var arrayPageSize=getPageSize();Element.setHeight('overlay',arrayPageSize[1]);new Effect.Appear('overlay',{duration:0.2,from:0.0,to:0.8});imageArray=[];imageNum=0;if(!document.getElementsByTagName){return;}
var anchors=document.getElementsByTagName('a');if((imageLink.getAttribute('rel')=='lightbox')){var t=imageLink.getAttribute('title');if(t.indexOf("javascript:")>=0){t=eval(t);}
imageArray.push(new Array(imageLink.getAttribute('href'),t));}else{for(var i=0;i<anchors.length;i++){var anchor=anchors[i];if(anchor.getAttribute('href')&&(anchor.getAttribute('rel')==imageLink.getAttribute('rel'))){var t=anchor.getAttribute('title');if(t.indexOf("javascript:")>=0){t=eval(t);}
imageArray.push(new Array(anchor.getAttribute('href'),t));if(imageArray.length==1){slideshowMusic=anchor.getAttribute('music');if(slideshowMusic==null){}else{player.loadTrack(slideshowMusic);}
var startSlideshow=anchor.getAttribute('startslideshow');if(startSlideshow!=null){if(startSlideshow=="false")slideshow=0;}
var forever=anchor.getAttribute('forever');if(forever!=null){if(forever=="true")foreverLoop=1;else foreverLoop=0;}
var foreverMusic=anchor.getAttribute('loopMusic');if(foreverMusic!=null){if(foreverMusic=="true")loopMusic=true;else loopMusic=false;}
if(foreverLoop==1){loopMusic=true;}
var slideDuration=anchor.getAttribute('slideDuration');if(slideDuration!=null){loopInterval=slideDuration*1000;}
var width=anchor.getAttribute('slideshowwidth');if(width!=null){slideShowWidth=width*1;}
var height=anchor.getAttribute('slideshowheight');if(height!=null){slideShowHeight=height*1;}
var barWidth=anchor.getAttribute('navbarWidth');if(barWidth!=null){navigationBarWidth=barWidth*1;}}}}
imageArray.removeDuplicates();while(imageArray[imageNum][0]!=imageLink.getAttribute('href')){imageNum++;}}
this.changeImageByTimer(imageNum);},showLightBox:function(){var arrayPageSize=getPageSize();var arrayPageScroll=getPageScroll();var lightboxTop=arrayPageScroll[1]+(arrayPageSize[3]/15);Element.setTop('lightbox',lightboxTop+10);Element.show('lightbox');},changeImageByTimer:function(imageNum){activeImage=imageNum;this.imageTimer=setTimeout(function(){this.showLightBox();this.changeImage(activeImage);}.bind(this),10);},changeImage:function(imageNum){activeImage=imageNum;Element.show('loading');Element.hide('replay');Element.hide('lightboxImage');Element.hide('hoverNav');Element.hide('prevLink');Element.hide('nextLink');if(firstTime==1){Element.hide('imageDataContainer');Element.hide('bottomNav');Element.hide('numberDisplay');Element.hide('speakerLink');Element.hide('slideshowLink');}
imgPreloader=new Image();imgPreloader.onload=function(){Element.setSrc('lightboxImage',imageArray[activeImage][0]);objLightboxImage.setAttribute('width',imgPreloader.width);objLightboxImage.setAttribute('height',imgPreloader.height);if((imageArray.length>1)&&(slideShowWidth!=-1||slideShowHeight!=-1)){if(slideShowWidth==-1&&slideShowHeight!=-1){myLightbox.resizeImageContainer(imgPreloader.width,slideShowHeight);}else{if(slideShowHeight==-1&&slideShowWidth!=-1){myLightbox.resizeImageContainer(slideShowWidth,imgPreloader.height);}else{if((slideShowWidth>=imgPreloader.width)&&(slideShowHeight>=imgPreloader.height))
{myLightbox.resizeImageContainer(slideShowWidth,slideShowHeight);}else{myLightbox.resizeImageAndContainer(imgPreloader.width,imgPreloader.height);}}}}else{myLightbox.resizeImageAndContainer(imgPreloader.width,imgPreloader.height);}}
imgPreloader.src=imageArray[activeImage][0];},resizeImageAndContainer:function(imgWidth,imgHeight){if(resize==1){useableWidth=0.9;useableHeight=0.8;var arrayPageSize=getPageSize();windowWidth=arrayPageSize[2];windowHeight=arrayPageSize[3];var w=windowWidth*useableWidth;var h=windowHeight*useableHeight;var d=Element.getHeight('spacer');if(d){h=h-(d+d);}
scaleX=1;scaleY=1;if(imgWidth>w)scaleX=(w)/imgWidth;if(imgHeight>h)scaleY=(h)/imgHeight;scale=Math.min(scaleX,scaleY);imgWidth*=scale;imgHeight*=scale;objLightboxImage.setAttribute('width',imgWidth);objLightboxImage.setAttribute('height',imgHeight);}
this.resizeImageContainer(imgWidth,imgHeight);},resizeImageContainer:function(imgWidth,imgHeight){imgWidth=imgWidth+1;this.wCur=Element.getWidth('outerImageContainer');this.hCur=Element.getHeight('outerImageContainer');this.xScale=((imgWidth+(borderSize*2))/this.wCur)*100;this.yScale=((imgHeight+(borderSize*2))/this.hCur)*100;wDiff=(this.wCur-borderSize*2)-imgWidth;hDiff=(this.hCur-borderSize*2)-imgHeight;this.slideDownImageDataContainer=true;if(!(hDiff==0)){new Effect.Scale('outerImageContainer',this.yScale,{scaleX:false,duration:resizeDuration,queue:'front'});}
if(!(wDiff==0)){if(navigationBarWidth==-1){Element.hide('imageDataContainer');}
new Effect.Scale('outerImageContainer',this.xScale,{scaleY:false,delay:resizeDuration,duration:resizeDuration});}else{this.slideDownImageDataContainer=false;}
if((hDiff==0)&&(wDiff==0)){if(navigator.appVersion.indexOf("MSIE")!=-1){pause(250);}else{pause(100);}}
Element.setHeight('prevLink',imgHeight);Element.setHeight('nextLink',imgHeight);if(navigationBarWidth==-1){Element.setWidth('imageDataContainer',imgWidth+(borderSize*2));}else{Element.setWidth('imageDataContainer',navigationBarWidth+(borderSize*2));this.slideDownImageDataContainer=false;}
this.showImage();},showImage:function(){Element.hide('loading');new Effect.Appear('lightboxImage',{duration:0.5,queue:'end',afterFinish:function(){myLightbox.updateDetails();}});this.preloadNeighborImages();},updateDetails:function(){Element.show('bottomNav');if(firstTime==1){objSpeakerImage.setAttribute('src',MusicOffImage);objSlideShowImage.setAttribute('src',SlideShowStartImage);objBottomNavCloseImage.setAttribute('src',fileBottomNavCloseImage);}
Element.show('caption');if(imageArray[activeImage][1]!=''&&imageArray[activeImage][1]!=null){Element.setInnerHTML('caption',imageArray[activeImage][1]);}else{Element.setInnerHTML('caption',"&nbsp;");}
if(imageArray.length>1){Element.show('numberDisplay');Element.setInnerHTML('numberDisplay',""+eval(activeImage+1)+" of "+imageArray.length);}
if(firstTime==1||this.slideDownImageDataContainer){new Effect.Parallel([new Effect.SlideDown('imageDataContainer',{sync:true,duration:resizeDuration+0.25,from:0.0,to:1}),new Effect.Appear('imageDataContainer',{sync:true,duration:1.0,from:0.0,to:imageDataContainerOpacity})],{duration:0.65,afterFinish:function(){myLightbox.updateNav();}});}else{myLightbox.updateNav();}
if(imageArray.length>1){Element.show('slideshowLink');}else{Element.hide('slideshowLink');}
if(slideshow==1&&imageArray.length>1){this.startSlideShow();}},updateNav:function(){Element.show('hoverNav');if(activeImage!=0){Element.show('prevLink');document.getElementById('prevLink').onclick=function(){if(slideshow==1)keyPressed=true;myLightbox.changeImage(activeImage-1);return false;}}
if(activeImage!=(imageArray.length-1)){Element.show('nextLink');document.getElementById('nextLink').onclick=function(){if(slideshow==1)keyPressed=true;myLightbox.changeImage(activeImage+1);return false;}}
this.enableKeyboardNav();if(firstTime==1){firstTime=0;this.showSpeaker();if(slideshow==1)this.playMusic();}},enableKeyboardNav:function(){document.onkeydown=this.keyboardAction;},disableKeyboardNav:function(){document.onkeydown='';},keyboardAction:function(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;}
key=String.fromCharCode(keycode).toLowerCase();if((key=='x')||(key=='o')||(key=='c')){myLightbox.end();}else if((keycode==188)||(key=='p')){if(activeImage!=0){if(slideshow==1)keyPressed=true;myLightbox.disableKeyboardNav();myLightbox.changeImage(activeImage-1);}}else if((keycode==190)||(key=='n')){if(activeImage!=(imageArray.length-1)){if(slideshow==1)keyPressed=true;myLightbox.disableKeyboardNav();myLightbox.changeImage(activeImage+1);}}},preloadNeighborImages:function(){if((imageArray.length-1)>activeImage){preloadNextImage=new Image();preloadNextImage.src=imageArray[activeImage+1][0];}
if(activeImage>0){preloadPrevImage=new Image();preloadPrevImage.src=imageArray[activeImage-1][0];}},showSpeaker:function(){if(slideshowMusic!=null){Element.show('speakerLink');}else{Element.hide('speakerLink');}},playMusic:function(){if(slideshowMusic!=null){objSpeakerImage.setAttribute('src',MusicOnImage);player.play();}},stopMusic:function(){if(slideshowMusic!=null){objSpeakerImage.setAttribute('src',MusicOffImage);if(player.paused){player.stop();}else{player.play();}}},toggleSlideShow:function(){if(slideshow==1)this.stopSlideShow();else{this.playMusic();if(activeImage==(imageArray.length-1)){slideshow=1;this.changeImage(0);}else{this.startSlideShow();}}},startSlideShow:function(){slideshow=1;objSlideShowImage.setAttribute('src',SlideShowStopImage);this.slideShowTimer=setTimeout(function(){if(keyPressed){keyPressed=false;return;}
if(activeImage<(imageArray.length-1)){this.changeImage(activeImage+1);}
else{if(foreverLoop){this.changeImage(0);}
else{slideshow=0;if(this.slideShowTimer){clearTimeout(this.slideShowTimer);this.slideShowTimer=null;}
player.clearCallback();this.disableKeyboardNav();Element.hide('hoverNav');Element.hide('prevLink');Element.hide('nextLink');Element.setInnerHTML('numberDisplay','');this.fadeoutTimer=setInterval(function(){player.sound.setVolume(player.sound.getVolume()-1);}.bind(this),30);new Effect.Appear('lightboxImage',{duration:3,from:1,to:0,afterFinish:function(){new Effect.Appear('replay',{duration:0.2,from:0,to:1});objSlideShowImage.setAttribute('src',SlideShowStartImage);clearInterval(myLightbox.fadeoutTimer);player.paused=true;myLightbox.stopMusic();}});}}}.bind(this),loopInterval);},stopSlideShow:function(){slideshow=0;objSlideShowImage.setAttribute('src',SlideShowStartImage);this.stopMusic();if(this.slideShowTimer){clearTimeout(this.slideShowTimer);this.slideShowTimer=null;}},end:function(){player.paused=true;this.stopSlideShow();player.clearCallback();clearInterval(myLightbox.fadeoutTimer);this.disableKeyboardNav();Element.hide('bottomNav');Element.hide('lightbox');new Effect.Fade('overlay',{duration:0.2});showSelectBoxes();slideshow=saveSlideshow;foreverLoop=saveForeverLoop;loopInterval=saveLoopInterval;slideShowWidth=saveSlideShowWidth;slideShowHeight=saveSlideShowHeight;navigationBarWidth=saveNavigationBarWidth;loopMusic=saveLoopMusic;}}
function containsDOM(container,containee){var isParent=false;do{if((isParent=container==containee))
break;containee=containee.parentNode;}
while(containee!=null);return isParent;}
function checkMouseEnter(element,evt){if(element.contains&&evt.fromElement){return!element.contains(evt.fromElement);}
else if(evt.relatedTarget){return!containsDOM(element,evt.relatedTarget);}}
function checkMouseLeave(element,evt){if(element.contains&&evt.toElement){return!element.contains(evt.toElement);}
else if(evt.relatedTarget){return!containsDOM(element,evt.relatedTarget);}}
function getPageScroll(){var yScroll;if(self.pageYOffset){yScroll=self.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollTop){yScroll=document.documentElement.scrollTop;}else if(document.body){yScroll=document.body.scrollTop;}
arrayPageScroll=new Array('',yScroll)
return arrayPageScroll;}
function getPageSize(){var xScroll,yScroll;if(window.innerHeight&&window.scrollMaxY){xScroll=document.body.scrollWidth;yScroll=window.innerHeight+window.scrollMaxY;}else if(document.body.scrollHeight>document.body.offsetHeight){xScroll=document.body.scrollWidth;yScroll=document.body.scrollHeight;}else{xScroll=document.body.offsetWidth;yScroll=document.body.offsetHeight;}
var windowWidth,windowHeight;if(self.innerHeight){windowWidth=self.innerWidth;windowHeight=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight;}else if(document.body){windowWidth=document.body.clientWidth;windowHeight=document.body.clientHeight;}
if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
if(xScroll<windowWidth){pageWidth=windowWidth;}else{pageWidth=xScroll;}
arrayPageSize=new Array(pageWidth,pageHeight,windowWidth,windowHeight)
return arrayPageSize;}
function getKey(e){if(e==null){keycode=event.keyCode;}else{keycode=e.which;}
key=String.fromCharCode(keycode).toLowerCase();if(key=='x'){}}
function listenKey(){document.onkeypress=getKey;}
function showSelectBoxes(){selects=document.getElementsByTagName("select");for(i=0;i!=selects.length;i++){selects[i].style.visibility="visible";}}
function hideSelectBoxes(){selects=document.getElementsByTagName("select");for(i=0;i!=selects.length;i++){selects[i].style.visibility="hidden";}}
function pause(numberMillis){var now=new Date();var exitTime=now.getTime()+numberMillis;while(true){now=new Date();if(now.getTime()>exitTime)
return;}}
function initLightbox(){myLightbox=new Lightbox();}
function init(){if(arguments.callee.done)return;arguments.callee.done=true;if(_timer){clearInterval(_timer);_timer=null;}
initLightbox();};if(document.addEventListener){document.addEventListener("DOMContentLoaded",init,false);}
if(/WebKit/i.test(navigator.userAgent)){var _timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){init();}},10);}
window.onload=init;