var resizeSpeed=7;
var borderSize=10;
var slideShowWidth=300;
var slideShowHeight=200;
var navigationBarWidth=-1;
var slideshow=1;
var foreverLoop=0;
var loopInterval=4000;
var loopMusic=true;
var homeURL="http://www.megaideas.net/bytere/";
var fileLoadingImage=homeURL+"images/loading.gif";
var fileBottomNavCloseImage=homeURL+"images/closelabel.gif";
var SlideShowStartImage=homeURL+"images/play.gif";
var SlideShowStopImage=homeURL+"images/stop.gif";
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 imageDataContainerOpacity=1;
var resize=1;
var SoundBridgeSWF="http://www.feriasbrasil.com.br/js/prototype/lightboxEx/SoundBridge.swf";
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 _1=event.propertyName;
if(_1!="src"){
return;
}
if(!new RegExp(blankSrc).test(event.srcElement.src)){
fixPNGImage(event.srcElement);
}
}
function fixPNGImage(_2){
if(isPNGSupported){
return;
}
var _3=_2.src;
if(_3==realSrc&&/\.png$/i.test(_3)){
_2.src=blankSrc;
return;
}
if(!new RegExp(blankSrc).test(_3)){
realSrc=_3;
}
if(/\.png$/i.test(realSrc)){
_2.src=blankSrc;
_2.runtimeStyle.filter="progid:DXImageTransform.Microsoft."+"AlphaImageLoader(src='"+_3+"',sizingMethod='scale')";
}else{
_2.runtimeStyle.filter="";
}
}
function openSlideShow(_4){
var wW=800;
var wH=620;
var X=(screen.width-wW)/2;
var Y=(screen.height-wH)/3;
var _9=homeURL+_4+".html";
var _a=window.open(_9,"_blank","width="+wW+",height="+wH+",top="+Y+",left="+X+",screenX="+X+",screenY="+Y+",toolbar=0,scrollbars=0,resizable=0,location=0,status=0");
if(_a==null||typeof (_a)=="undefined"){
alert("Can't open a slideshow window.\nPlease, try again when the page gets reloaded.");
location.reload();
}
}
function startSlideshow(){
closeWindow=true;
init();
var _b=document.getElementsByTagName("a");
if(_b.length!=0){
var _c=_b[0];
myLightbox.start(_c);
}
}
Object.extend(Element,{getWidth:function(_d){
_d=$(_d);
return _d.offsetWidth;
},setWidth:function(_e,w){
_e=$(_e);
_e.style.width=w+"px";
},setHeight:function(_10,h){
_10=$(_10);
_10.style.height=h+"px";
},setTop:function(_12,t){
_12=$(_12);
_12.style.top=t+"px";
},setSrc:function(_14,src){
_14=$(_14);
_14.src=src;
},setHref:function(_16,_17){
_16=$(_16);
_16.href=_17;
},setInnerHTML:function(_18,_19){
_18=$(_18);
_18.innerHTML=_19;
}});
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(_1a,_1b){
};
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 _1c=false;
if(!this.paused){
var _1d=this.sound.getPosition();
if(!_1d){
_1d=0;
}
if(_1d!=this.position&&_1d!=0){
this.onPlaying();
}else{
this.onBuffering();
}
this.position=_1d;
var _1e=0;
_1e=this.sound.getDuration();
if(!_1e){
_1e=0;
}
if(_1e==this.duration&&_1e!=0){
_1c=true;
}
this.duration=_1e;
var _1f=_1d/_1e;
if(_1c){
this.setProgressBar(_1f);
}
var _20=false;
var _21=this.sound.getBytesTotal();
if(_21==this.bytesTotal){
_20=true;
}
this.bytesTotal=_21;
if(_20){
var _22=this.sound.getBytesLoaded()/_21;
this.setLoadedBar(_22);
}
if(_1f==1&&_1e!=0&&_1d!=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(_23){
if(!_23){
_23=0;
}
};
Player.prototype.setLoadedBar=function(_24){
if(!_24){
_24=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 _27=this.sound.getVolume();
if(_27==0){
this.fadeIn();
objSpeakerImage.setAttribute("src",MusicOnImage);
}
if(_27==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(_29){
this.track=_29;
};
var player;
var Lightbox=Class.create();
Lightbox.prototype={initialize:function(){
this.dimmingOut=false;
if(!document.getElementsByTagName){
return;
}
var _2a=document.getElementsByTagName("a");
for(var i=0;i<_2a.length;i++){
var _2c=_2a[i];
var _2d=String(_2c.getAttribute("rel"));
if(_2c.getAttribute("href")&&(_2d.toLowerCase().match("lightbox"))){
_2c.onclick=function(){
myLightbox.start(this);
return false;
};
}
}
var _2e=document.getElementsByTagName("body").item(0);
var _2f=document.createElement("div");
_2f.setAttribute("id","overlay");
_2f.style.display="none";
_2f.onclick=function(){
if(!closeWindow){
myLightbox.end();
}
return false;
};
_2e.appendChild(_2f);
var _30=document.createElement("div");
_30.setAttribute("id","lightbox");
_30.style.display="none";
_2e.appendChild(_30);
var _31=document.createElement("div");
_31.setAttribute("id","outerImageContainer");
_30.appendChild(_31);
var _32=document.createElement("div");
_32.setAttribute("id","imageContainer");
_31.appendChild(_32);
objLightboxImage=document.createElement("img");
objLightboxImage.setAttribute("id","lightboxImage");
objLightboxImage.setAttribute("width","");
objLightboxImage.setAttribute("height","");
_32.appendChild(objLightboxImage);
var _33=document.createElement("div");
_33.setAttribute("id","hoverNav");
_32.appendChild(_33);
var _34=document.createElement("a");
_34.setAttribute("id","prevLink");
_34.setAttribute("href","#");
_34.setAttribute("onFocus","if (this.blur) this.blur()");
_33.appendChild(_34);
var _35=document.createElement("a");
_35.setAttribute("id","nextLink");
_35.setAttribute("href","#");
_35.setAttribute("onFocus","if (this.blur) this.blur()");
_33.appendChild(_35);
var _36=document.createElement("div");
_36.setAttribute("id","loading");
_32.appendChild(_36);
var _37=document.createElement("a");
_37.setAttribute("id","loadingLink");
_37.setAttribute("href","#");
_37.setAttribute("onFocus","if (this.blur) this.blur()");
_37.onclick=function(){
myLightbox.end();
if(closeWindow){
window.close();
}
return false;
};
_36.appendChild(_37);
var _38=document.createElement("img");
_38.setAttribute("src",fileLoadingImage);
_37.appendChild(_38);
var _39=document.createElement("div");
_39.setAttribute("id","replay");
_32.appendChild(_39);
var _3a=document.createElement("a");
_3a.setAttribute("id","replayLink");
_3a.setAttribute("href","#");
_3a.setAttribute("onFocus","if (this.blur) this.blur()");
_3a.onclick=function(){
myLightbox.toggleSlideShow();
return false;
};
_39.appendChild(_3a);
var _3b=document.createElement("img");
_3b.onpropertychange=function(){
propertyChanged();
return false;
};
_3b.setAttribute("src",replayImage);
_3a.appendChild(_3b);
_3b.setAttribute("src",replayImage);
Element.hide("replay");
var _3c=document.createElement("div");
_3c.setAttribute("id","spacer");
_3c.className="spacer";
_30.appendChild(_3c);
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;
};
_30.appendChild(objImageDataContainer);
var _3f=document.createElement("div");
_3f.setAttribute("id","imageData");
objImageDataContainer.appendChild(_3f);
var _40=document.createElement("div");
_40.setAttribute("id","imageDetails");
_3f.appendChild(_40);
var _41=document.createElement("span");
_41.setAttribute("id","caption");
_40.appendChild(_41);
var _42=document.createElement("span");
_42.setAttribute("id","numberDisplay");
_40.appendChild(_42);
var _43=document.createElement("div");
_43.setAttribute("id","bottomNav");
_3f.appendChild(_43);
var _44=document.createElement("a");
_44.setAttribute("id","bottomNavClose");
_44.setAttribute("href","#");
_44.setAttribute("onFocus","if (this.blur) this.blur()");
_44.onclick=function(){
myLightbox.end();
if(closeWindow){
window.close();
}
return false;
};
_43.appendChild(_44);
objBottomNavCloseImage=document.createElement("img");
objBottomNavCloseImage.setAttribute("id","closeButton");
objBottomNavCloseImage.setAttribute("alt","Close");
objBottomNavCloseImage.onpropertychange=function(){
propertyChanged();
return false;
};
objBottomNavCloseImage.setAttribute("src",fileBottomNavCloseImage);
_44.appendChild(objBottomNavCloseImage);
var _45=document.createElement("a");
_45.setAttribute("id","slideshowLink");
_45.setAttribute("href","#");
_45.setAttribute("onFocus","if (this.blur) this.blur()");
_45.onclick=function(){
myLightbox.toggleSlideShow();
return false;
};
_43.appendChild(_45);
objSlideShowImage=document.createElement("img");
objSlideShowImage.setAttribute("id","playButton");
objSlideShowImage.setAttribute("alt","Start/Stop");
objSlideShowImage.setAttribute("src",SlideShowStartImage);
objSlideShowImage.onpropertychange=function(){
propertyChanged();
return false;
};
_45.appendChild(objSlideShowImage);
var _46=document.createElement("a");
_46.setAttribute("id","speakerLink");
_46.setAttribute("href","#");
_46.setAttribute("onFocus","if (this.blur) this.blur()");
_46.onclick=function(){
player.toggleVolume();
return false;
};
_43.appendChild(_46);
objSpeakerImage=document.createElement("img");
objSpeakerImage.setAttribute("id","speaker");
objSpeakerImage.setAttribute("alt","Music On/Off");
objSpeakerImage.setAttribute("src",MusicOffImage);
objSpeakerImage.onpropertychange=function(){
propertyChanged();
return false;
};
_46.appendChild(objSpeakerImage);
var _47=document.createElement("div");
_47.setAttribute("id","__sound_flash__");
_2f.appendChild(_47);
},lightUpNavigationBar:function(){
if(!this.dimmingOut){
new Effect.Parallel([new Effect.Appear("imageDataContainer",{duration:0.25,from:imageDataContainerOpacity,to:1})],{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,to:imageDataContainerOpacity,afterFinish:function(){
myLightbox.dimmingOut=false;
}})],{duration:0.25});
}
}.bind(this),2000);
},start:function(_48){
player=new Player();
slideshowMusic=null;
firstTime=1;
saveSlideshow=slideshow;
saveForeverLoop=foreverLoop;
saveLoopInterval=loopInterval;
saveSlideShowWidth=slideShowWidth;
saveSlideShowHeight=slideShowHeight;
saveLoopMusic=loopMusic;
saveNavigationBarWidth=navigationBarWidth;
hideSelectBoxes();
var _49=getPageSize();
Element.setHeight("overlay",_49[1]);
new Effect.Appear("overlay",{duration:0.2,from:0,to:0.8});
imageArray=[];
imageNum=0;
if(!document.getElementsByTagName){
return;
}
var _4a=document.getElementsByTagName("a");
if((_48.getAttribute("rel")=="lightbox")){
imageArray.push(new Array(_48.getAttribute("href"),_48.getAttribute("title")));
}else{
for(var i=0;i<_4a.length;i++){
var _4c=_4a[i];
if(_4c.getAttribute("href")&&(_4c.getAttribute("rel")==_48.getAttribute("rel"))){
imageArray.push(new Array(_4c.getAttribute("href"),_4c.getAttribute("title")));
if(imageArray.length==1){
slideshowMusic=_4c.getAttribute("music");
if(slideshowMusic==null){
}else{
player.loadTrack(slideshowMusic);
}
var _4d=_4c.getAttribute("startslideshow");
if(_4d!=null){
if(_4d=="false"){
slideshow=0;
}
}
var _4e=_4c.getAttribute("forever");
if(_4e!=null){
if(_4e=="true"){
foreverLoop=1;
}else{
foreverLoop=0;
}
}
var _4f=_4c.getAttribute("loopMusic");
if(_4f!=null){
if(_4f=="true"){
loopMusic=true;
}else{
loopMusic=false;
}
}
if(foreverLoop==1){
loopMusic=true;
}
var _50=_4c.getAttribute("slideDuration");
if(_50!=null){
loopInterval=_50*1000;
}
var _51=_4c.getAttribute("slideshowwidth");
if(_51!=null){
slideShowWidth=_51*1;
}
var _52=_4c.getAttribute("slideshowheight");
if(_52!=null){
slideShowHeight=_52*1;
}
var _53=_4c.getAttribute("navbarWidth");
if(_53!=null){
navigationBarWidth=_53*1;
}
}
}
}
imageArray.removeDuplicates();
while(imageArray[imageNum][0]!=_48.getAttribute("href")){
imageNum++;
}
}
this.changeImageByTimer(imageNum);
},showLightBox:function(){
var _54=getPageSize();
var _55=getPageScroll();
var _56=_55[1]+(_54[3]/50);
Element.setTop("lightbox",_56+10);
Element.show("lightbox");
},changeImageByTimer:function(_57){
activeImage=_57;
this.imageTimer=setTimeout(function(){
this.showLightBox();
this.changeImage(activeImage);
}.bind(this),10);
},changeImage:function(_58){
activeImage=_58;
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(_59,_5a){
if(resize==1){
useableWidth=0.9;
useableHeight=0.8;
var _5b=getPageSize();
windowWidth=_5b[2];
windowHeight=_5b[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(_59>w){
scaleX=(w)/_59;
}
if(_5a>h){
scaleY=(h)/_5a;
}
scale=Math.min(scaleX,scaleY);
_59*=scale;
_5a*=scale;
objLightboxImage.setAttribute("width",_59);
objLightboxImage.setAttribute("height",_5a);
}
this.resizeImageContainer(_59,_5a);
},resizeImageContainer:function(_5f,_60){
_5f=_5f+1;
this.wCur=Element.getWidth("outerImageContainer");
this.hCur=Element.getHeight("outerImageContainer");
this.xScale=((_5f+(borderSize*2))/this.wCur)*100;
this.yScale=((_60+(borderSize*2))/this.hCur)*100;
wDiff=(this.wCur-borderSize*2)-_5f;
hDiff=(this.hCur-borderSize*2)-_60;
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",_60);
Element.setHeight("nextLink",_60);
if(navigationBarWidth==-1){
Element.setWidth("imageDataContainer",_5f+(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,to:1}),new Effect.Appear("imageDataContainer",{sync:true,duration:1,from: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(_62,_63){
var _64=false;
do{
if((_64=_62==_63)){
break;
}
_63=_63.parentNode;
}while(_63!=null);
return _64;
}
function checkMouseEnter(_65,evt){
if(_65.contains&&evt.fromElement){
return !_65.contains(evt.fromElement);
}else{
if(evt.relatedTarget){
return !containsDOM(_65,evt.relatedTarget);
}
}
}
function checkMouseLeave(_67,evt){
if(_67.contains&&evt.toElement){
return !_67.contains(evt.toElement);
}else{
if(evt.relatedTarget){
return !containsDOM(_67,evt.relatedTarget);
}
}
}
function getPageScroll(){
var _69;
if(self.pageYOffset){
_69=self.pageYOffset;
}else{
if(document.documentElement&&document.documentElement.scrollTop){
_69=document.documentElement.scrollTop;
}else{
if(document.body){
_69=document.body.scrollTop;
}
}
}
arrayPageScroll=new Array("",_69);
return arrayPageScroll;
}
function getPageSize(){
var _6a,yScroll;
if(window.innerHeight&&window.scrollMaxY){
_6a=document.body.scrollWidth;
yScroll=window.innerHeight+window.scrollMaxY;
}else{
if(document.body.scrollHeight>document.body.offsetHeight){
_6a=document.body.scrollWidth;
yScroll=document.body.scrollHeight;
}else{
_6a=document.body.offsetWidth;
yScroll=document.body.offsetHeight;
}
}
var _6b,windowHeight;
if(self.innerHeight){
_6b=self.innerWidth;
windowHeight=self.innerHeight;
}else{
if(document.documentElement&&document.documentElement.clientHeight){
_6b=document.documentElement.clientWidth;
windowHeight=document.documentElement.clientHeight;
}else{
if(document.body){
_6b=document.body.clientWidth;
windowHeight=document.body.clientHeight;
}
}
}
if(yScroll<windowHeight){
pageHeight=windowHeight;
}else{
pageHeight=yScroll;
}
if(_6a<_6b){
pageWidth=_6b;
}else{
pageWidth=_6a;
}
arrayPageSize=new Array(pageWidth,pageHeight,_6b,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(_6d){
var now=new Date();
var _6f=now.getTime()+_6d;
while(true){
now=new Date();
if(now.getTime()>_6f){
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;

