Array.prototype.removeDuplicates=function(){
for(var i=1;i<this.length;i++){
if(this[i][0]==this[i-1][0]){
this.splice(i,1);
}
}
};
Array.prototype.empty=function(){
for(var i=0;i<=this.length;i++){
this.shift();
}
};
String.prototype.trim=function(){
return this.replace(/^\s+|\s+$/g,"");
};
function LyteBox(){
this.theme="grey";
this.hideFlash=true;
this.outerBorder=true;
this.resizeSpeed=8;
this.maxOpacity=80;
this.navType=1;
this.autoResize=true;
this.doAnimations=true;
this.borderSize=12;
this.slideInterval=4000;
this.showNavigation=true;
this.showClose=true;
this.showDetails=true;
this.showPlayPause=true;
this.autoEnd=true;
this.pauseOnNextClick=false;
this.pauseOnPrevClick=true;
if(this.resizeSpeed>10){
this.resizeSpeed=10;
}
if(this.resizeSpeed<1){
resizeSpeed=1;
}
this.resizeDuration=(11-this.resizeSpeed)*0.15;
this.resizeWTimerArray=new Array();
this.resizeWTimerCount=0;
this.resizeHTimerArray=new Array();
this.resizeHTimerCount=0;
this.showContentTimerArray=new Array();
this.showContentTimerCount=0;
this.overlayTimerArray=new Array();
this.overlayTimerCount=0;
this.imageTimerArray=new Array();
this.imageTimerCount=0;
this.timerIDArray=new Array();
this.timerIDCount=0;
this.slideshowIDArray=new Array();
this.slideshowIDCount=0;
this.imageArray=new Array();
this.activeImage=null;
this.slideArray=new Array();
this.activeSlide=null;
this.frameArray=new Array();
this.activeFrame=null;
this.checkFrame();
this.isSlideshow=false;
this.isLyteframe=false;
this.ie=false;
this.ie7=(this.ie&&window.XMLHttpRequest);
this.initialize();
}
LyteBox.prototype.initialize=function(){
this.updateLyteboxItems();
var _3=this.doc.getElementsByTagName("body").item(0);
if(this.doc.getElementById("lbOverlay")){
_3.removeChild(this.doc.getElementById("lbOverlay"));
_3.removeChild(this.doc.getElementById("lbMain"));
}
var _4=this.doc.createElement("div");
_4.setAttribute("id","lbOverlay");
_4.setAttribute((this.ie?"className":"class"),this.theme);
if((this.ie&&!this.ie7)||(this.ie7&&this.doc.compatMode=="BackCompat")){
_4.style.position="absolute";
}
_4.style.display="none";
_3.appendChild(_4);
var _5=this.doc.createElement("div");
_5.setAttribute("id","lbMain");
_5.style.display="none";
_3.appendChild(_5);
var _6=this.doc.createElement("div");
_6.setAttribute("id","lbOuterContainer");
_6.setAttribute((this.ie?"className":"class"),this.theme);
_5.appendChild(_6);
var _7=this.doc.createElement("div");
_7.setAttribute("id","lbIframeContainer");
_7.style.display="none";
_6.appendChild(_7);
var _8=this.doc.createElement("iframe");
_8.setAttribute("id","lbIframe");
_8.setAttribute("name","lbIframe");
_8.style.display="none";
_7.appendChild(_8);
var _9=this.doc.createElement("div");
_9.setAttribute("id","lbImageContainer");
_6.appendChild(_9);
var _a=this.doc.createElement("img");
_a.setAttribute("id","lbImage");
_9.appendChild(_a);
var _b=this.doc.createElement("div");
_b.setAttribute("id","lbLoading");
_6.appendChild(_b);
var _c=this.doc.createElement("div");
_c.setAttribute("id","lbDetailsContainer");
_c.setAttribute((this.ie?"className":"class"),this.theme);
_5.appendChild(_c);
var _d=this.doc.createElement("div");
_d.setAttribute("id","lbDetailsData");
_d.setAttribute((this.ie?"className":"class"),this.theme);
_c.appendChild(_d);
var _e=this.doc.createElement("div");
_e.setAttribute("id","lbDetails");
_d.appendChild(_e);
var _f=this.doc.createElement("span");
_f.setAttribute("id","lbCaption");
_e.appendChild(_f);
var _10=this.doc.createElement("div");
_10.setAttribute("id","lbHoverNav");
_9.appendChild(_10);
var _11=this.doc.createElement("div");
_11.setAttribute("id","lbBottomNav");
_d.appendChild(_11);
var _12=this.doc.createElement("a");
_12.setAttribute("id","lbPrev");
_12.setAttribute((this.ie?"className":"class"),this.theme);
_12.setAttribute("href","#");
_10.appendChild(_12);
var _13=this.doc.createElement("a");
_13.setAttribute("id","lbNext");
_13.setAttribute((this.ie?"className":"class"),this.theme);
_13.setAttribute("href","#");
_10.appendChild(_13);
var _14=this.doc.createElement("span");
_14.setAttribute("id","lbNumberDisplay");
_e.appendChild(_14);
var _15=this.doc.createElement("span");
_15.setAttribute("id","lbNavDisplay");
_15.style.display="none";
_e.appendChild(_15);
var _16=this.doc.createElement("a");
_16.setAttribute("id","lbClose");
_16.setAttribute((this.ie?"className":"class"),this.theme);
_16.setAttribute("href","#");
_11.appendChild(_16);
var _17=this.doc.createElement("a");
_17.setAttribute("id","lbPause");
_17.setAttribute((this.ie?"className":"class"),this.theme);
_17.setAttribute("href","#");
_17.style.display="none";
_11.appendChild(_17);
var _18=this.doc.createElement("a");
_18.setAttribute("id","lbPlay");
_18.setAttribute((this.ie?"className":"class"),this.theme);
_18.setAttribute("href","#");
_18.style.display="none";
_11.appendChild(_18);
};
LyteBox.prototype.updateLyteboxItems=function(){
var _19=(this.isFrame)?window.parent.frames[window.name].document.getElementsByTagName("a"):document.getElementsByTagName("a");
for(var i=0;i<_19.length;i++){
var _1b=_19[i];
var _1c=String(_1b.getAttribute("rel"));
if(_1b.getAttribute("href")){
if(_1c.toLowerCase().match("lytebox")){
_1b.onclick=function(){
myLytebox.start(this,false,false);
return false;
};
}else{
if(_1c.toLowerCase().match("lyteshow")){
_1b.onclick=function(){
myLytebox.start(this,true,false);
return false;
};
}else{
if(_1c.toLowerCase().match("lyteframe")){
_1b.onclick=function(){
myLytebox.start(this,false,true);
return false;
};
}
}
}
}
}
};
LyteBox.prototype.start=function(_1d,_1e,_1f){
if(this.ie&&!this.ie7){
this.toggleSelects("hide");
}
if(this.hideFlash){
this.toggleFlash("hide");
}
this.isLyteframe=(_1f?true:false);
var _20=this.getPageSize();
var _21=this.doc.getElementById("lbOverlay");
var _22=this.doc.getElementsByTagName("body").item(0);
_21.style.height=_20[1]+"px";
_21.style.display="";
this.appear("lbOverlay",(this.doAnimations?0:this.maxOpacity));
var _23=(this.isFrame)?window.parent.frames[window.name].document.getElementsByTagName("a"):document.getElementsByTagName("a");
if(this.isLyteframe){
this.frameArray=[];
this.frameNum=0;
if((_1d.getAttribute("rel")=="lyteframe")){
var rev=_1d.getAttribute("rev");
this.frameArray.push(new Array(_1d.getAttribute("href"),_1d.getAttribute("title"),(rev==null||rev==""?"width: 400px; height: 400px; scrolling: auto;":rev)));
}else{
if(_1d.getAttribute("rel").indexOf("lyteframe")!=-1){
for(var i=0;i<_23.length;i++){
var _26=_23[i];
if(_26.getAttribute("href")&&(_26.getAttribute("rel")==_1d.getAttribute("rel"))){
var rev=_26.getAttribute("rev");
this.frameArray.push(new Array(_26.getAttribute("href"),_26.getAttribute("title"),(rev==null||rev==""?"width: 400px; height: 400px; scrolling: auto;":rev)));
}
}
this.frameArray.removeDuplicates();
while(this.frameArray[this.frameNum][0]!=_1d.getAttribute("href")){
this.frameNum++;
}
}
}
}else{
this.imageArray=[];
this.imageNum=0;
this.slideArray=[];
this.slideNum=0;
if((_1d.getAttribute("rel")=="lytebox")){
this.imageArray.push(new Array(_1d.getAttribute("href"),_1d.getAttribute("title")));
}else{
if(_1d.getAttribute("rel").indexOf("lytebox")!=-1){
for(var i=0;i<_23.length;i++){
var _29=_23[i];
if(_29.getAttribute("href")&&(_29.getAttribute("rel")==_1d.getAttribute("rel"))){
this.imageArray.push(new Array(_29.getAttribute("href"),_29.getAttribute("title")));
}
}
this.imageArray.removeDuplicates();
while(this.imageArray[this.imageNum][0]!=_1d.getAttribute("href")){
this.imageNum++;
}
}
if(_1d.getAttribute("rel").indexOf("lyteshow")!=-1){
for(var i=0;i<_23.length;i++){
var _2b=_23[i];
if(_2b.getAttribute("href")&&(_2b.getAttribute("rel")==_1d.getAttribute("rel"))){
this.slideArray.push(new Array(_2b.getAttribute("href"),_2b.getAttribute("title")));
}
}
this.slideArray.removeDuplicates();
while(this.slideArray[this.slideNum][0]!=_1d.getAttribute("href")){
this.slideNum++;
}
}
}
}
var _2c=this.doc.getElementById("lbMain");
_2c.style.top=(this.getPageScroll()+(_20[3]/15))+"px";
_2c.style.display="";
if(!this.outerBorder){
this.doc.getElementById("lbOuterContainer").style.border="none";
this.doc.getElementById("lbDetailsContainer").style.border="none";
}else{
this.doc.getElementById("lbOuterContainer").style.borderBottom="";
this.doc.getElementById("lbOuterContainer").setAttribute((this.ie?"className":"class"),this.theme);
}
this.doc.getElementById("lbOverlay").onclick=function(){
myLytebox.end();
return false;
};
this.doc.getElementById("lbMain").onclick=function(e){
var e=e;
if(!e){
if(window.parent.frames[window.name]&&(parent.document.getElementsByTagName("frameset").length<=0)){
e=window.parent.window.event;
}else{
e=window.event;
}
}
var id=(e.target?e.target.id:e.srcElement.id);
if(id=="lbMain"){
myLytebox.end();
return false;
}
};
this.doc.getElementById("lbClose").onclick=function(){
myLytebox.end();
return false;
};
this.doc.getElementById("lbPause").onclick=function(){
myLytebox.togglePlayPause("lbPause","lbPlay");
return false;
};
this.doc.getElementById("lbPlay").onclick=function(){
myLytebox.togglePlayPause("lbPlay","lbPause");
return false;
};
this.isSlideshow=_1e;
this.isPaused=(this.slideNum!=0?true:false);
if(this.isSlideshow&&this.showPlayPause&&this.isPaused){
this.doc.getElementById("lbPlay").style.display="";
this.doc.getElementById("lbPause").style.display="none";
}
if(this.isLyteframe){
this.changeContent(this.frameNum);
}else{
if(this.isSlideshow){
this.changeContent(this.slideNum);
}else{
this.changeContent(this.imageNum);
}
}
};
LyteBox.prototype.changeContent=function(_30){
if(this.isSlideshow){
for(var i=0;i<this.slideshowIDCount;i++){
window.clearTimeout(this.slideshowIDArray[i]);
}
}
this.activeImage=this.activeSlide=this.activeFrame=_30;
if(!this.outerBorder){
this.doc.getElementById("lbOuterContainer").style.border="none";
this.doc.getElementById("lbDetailsContainer").style.border="none";
}else{
this.doc.getElementById("lbOuterContainer").style.borderBottom="";
this.doc.getElementById("lbOuterContainer").setAttribute((this.ie?"className":"class"),this.theme);
}
this.doc.getElementById("lbLoading").style.display="";
this.doc.getElementById("lbImage").style.display="none";
this.doc.getElementById("lbIframe").style.display="none";
this.doc.getElementById("lbPrev").style.display="none";
this.doc.getElementById("lbNext").style.display="none";
this.doc.getElementById("lbIframeContainer").style.display="none";
this.doc.getElementById("lbDetailsContainer").style.display="none";
this.doc.getElementById("lbNumberDisplay").style.display="none";
if(this.navType==2||this.isLyteframe){
object=this.doc.getElementById("lbNavDisplay");
object.innerHTML="&nbsp;&nbsp;&nbsp;<span id=\"lbPrev2_Off\" style=\"display: none;\" class=\""+this.theme+"\">&laquo; prev</span><a href=\"#\" id=\"lbPrev2\" class=\""+this.theme+"\" style=\"display: none;\">&laquo; prev</a> <b id=\"lbSpacer\" class=\""+this.theme+"\">||</b> <span id=\"lbNext2_Off\" style=\"display: none;\" class=\""+this.theme+"\">next &raquo;</span><a href=\"#\" id=\"lbNext2\" class=\""+this.theme+"\" style=\"display: none;\">next &raquo;</a>";
object.style.display="none";
}
if(this.isLyteframe){
var _32=myLytebox.doc.getElementById("lbIframe");
var _33=this.frameArray[this.activeFrame][2];
var _34=_33.split(";");
for(var i=0;i<_34.length;i++){
if(_34[i].indexOf("width:")>=0){
var w=_34[i].replace("width:","");
_32.width=w.trim();
}else{
if(_34[i].indexOf("height:")>=0){
var h=_34[i].replace("height:","");
_32.height=h.trim();
}else{
if(_34[i].indexOf("scrolling:")>=0){
var s=_34[i].replace("scrolling:","");
_32.scrolling=s.trim();
}else{
if(_34[i].indexOf("border:")>=0){
}
}
}
}
}
this.resizeContainer(parseInt(_32.width),parseInt(_32.height));
}else{
imgPreloader=new Image();
imgPreloader.onload=function(){
var _39=imgPreloader.width;
var _3a=imgPreloader.height;
if(myLytebox.autoResize){
var _3b=myLytebox.getPageSize();
var x=_3b[2]-150;
var y=_3b[3]-150;
if(_39>x){
_3a=Math.round(_3a*(x/_39));
_39=x;
if(_3a>y){
_39=Math.round(_39*(y/_3a));
_3a=y;
}
}else{
if(_3a>y){
_39=Math.round(_39*(y/_3a));
_3a=y;
if(_39>x){
_3a=Math.round(_3a*(x/_39));
_39=x;
}
}
}
}
var _3e=myLytebox.doc.getElementById("lbImage");
_3e.src=(myLytebox.isSlideshow?myLytebox.slideArray[myLytebox.activeSlide][0]:myLytebox.imageArray[myLytebox.activeImage][0]);
_3e.width=_39;
_3e.height=_3a;
myLytebox.resizeContainer(_39,_3a);
imgPreloader.onload=function(){
};
};
imgPreloader.src=(this.isSlideshow?this.slideArray[this.activeSlide][0]:this.imageArray[this.activeImage][0]);
}
};
LyteBox.prototype.resizeContainer=function(_3f,_40){
this.wCur=this.doc.getElementById("lbOuterContainer").offsetWidth;
this.hCur=this.doc.getElementById("lbOuterContainer").offsetHeight;
this.xScale=((_3f+(this.borderSize*2))/this.wCur)*100;
this.yScale=((_40+(this.borderSize*2))/this.hCur)*100;
var _41=(this.wCur-this.borderSize*2)-_3f;
var _42=(this.hCur-this.borderSize*2)-_40;
if(!(_42==0)){
this.hDone=false;
this.resizeH("lbOuterContainer",this.hCur,_40+this.borderSize*2,this.getPixelRate(this.hCur,_40));
}else{
this.hDone=true;
}
if(!(_41==0)){
this.wDone=false;
this.resizeW("lbOuterContainer",this.wCur,_3f+this.borderSize*2,this.getPixelRate(this.wCur,_3f));
}else{
this.wDone=true;
}
if((_42==0)&&(_41==0)){
if(this.ie){
this.pause(250);
}else{
this.pause(100);
}
}
this.doc.getElementById("lbPrev").style.height=_40+"px";
this.doc.getElementById("lbNext").style.height=_40+"px";
this.doc.getElementById("lbDetailsContainer").style.width=(_3f+(this.borderSize*2)+(this.ie&&this.doc.compatMode=="BackCompat"&&this.outerBorder?2:0))+"px";
this.showContent();
};
LyteBox.prototype.showContent=function(){
if(this.wDone&&this.hDone){
for(var i=0;i<this.showContentTimerCount;i++){
window.clearTimeout(this.showContentTimerArray[i]);
}
if(this.outerBorder){
this.doc.getElementById("lbOuterContainer").style.borderBottom="none";
}
this.doc.getElementById("lbLoading").style.display="none";
if(this.isLyteframe){
this.doc.getElementById("lbIframe").style.display="";
this.appear("lbIframe",(this.doAnimations?0:100));
}else{
this.doc.getElementById("lbImage").style.display="";
this.appear("lbImage",(this.doAnimations?0:100));
this.preloadNeighborImages();
}
if(this.isSlideshow){
if(this.activeSlide==(this.slideArray.length-1)){
if(this.autoEnd){
this.slideshowIDArray[this.slideshowIDCount++]=setTimeout("myLytebox.end('slideshow')",this.slideInterval);
}
}else{
if(!this.isPaused){
this.slideshowIDArray[this.slideshowIDCount++]=setTimeout("myLytebox.changeContent("+(this.activeSlide+1)+")",this.slideInterval);
}
}
this.doc.getElementById("lbHoverNav").style.display=(this.showNavigation&&this.navType==1?"":"none");
this.doc.getElementById("lbClose").style.display=(this.showClose?"":"none");
this.doc.getElementById("lbDetails").style.display=(this.showDetails?"":"none");
this.doc.getElementById("lbPause").style.display=(this.showPlayPause&&!this.isPaused?"":"none");
this.doc.getElementById("lbPlay").style.display=(this.showPlayPause&&!this.isPaused?"none":"");
this.doc.getElementById("lbNavDisplay").style.display=(this.showNavigation&&this.navType==2?"":"none");
}else{
this.doc.getElementById("lbHoverNav").style.display=(this.navType==1&&!this.isLyteframe?"":"none");
if((this.navType==2&&!this.isLyteframe&&this.imageArray.length>1)||(this.frameArray.length>1&&this.isLyteframe)){
this.doc.getElementById("lbNavDisplay").style.display="";
}else{
this.doc.getElementById("lbNavDisplay").style.display="none";
}
this.doc.getElementById("lbClose").style.display="";
this.doc.getElementById("lbDetails").style.display="";
this.doc.getElementById("lbPause").style.display="none";
this.doc.getElementById("lbPlay").style.display="none";
}
this.doc.getElementById("lbImageContainer").style.display=(this.isLyteframe?"none":"");
this.doc.getElementById("lbIframeContainer").style.display=(this.isLyteframe?"":"none");
try{
this.doc.getElementById("lbIframe").src=this.frameArray[this.activeFrame][0];
}
catch(e){
}
}else{
this.showContentTimerArray[this.showContentTimerCount++]=setTimeout("myLytebox.showContent()",200);
}
};
LyteBox.prototype.updateDetails=function(){
var _44=this.doc.getElementById("lbCaption");
var _45=(this.isSlideshow?this.slideArray[this.activeSlide][1]:(this.isLyteframe?this.frameArray[this.activeFrame][1]:this.imageArray[this.activeImage][1]));
_44.style.display="";
_44.innerHTML=(_45==null?"":_45);
this.updateNav();
this.doc.getElementById("lbDetailsContainer").style.display="";
_44=this.doc.getElementById("lbNumberDisplay");
if(this.isSlideshow&&this.slideArray.length>1){
_44.style.display="";
_44.innerHTML="Image "+eval(this.activeSlide+1)+" of "+this.slideArray.length;
this.doc.getElementById("lbNavDisplay").style.display=(this.navType==2&&this.showNavigation?"":"none");
}else{
if(this.imageArray.length>1&&!this.isLyteframe){
_44.style.display="";
_44.innerHTML="Image "+eval(this.activeImage+1)+" of "+this.imageArray.length;
this.doc.getElementById("lbNavDisplay").style.display=(this.navType==2?"":"none");
}else{
if(this.frameArray.length>1&&this.isLyteframe){
_44.style.display="";
_44.innerHTML="Page "+eval(this.activeFrame+1)+" of "+this.frameArray.length;
this.doc.getElementById("lbNavDisplay").style.display="";
}else{
this.doc.getElementById("lbNavDisplay").style.display="none";
}
}
}
this.appear("lbDetailsContainer",(this.doAnimations?0:100));
};
LyteBox.prototype.updateNav=function(){
if(this.isSlideshow){
if(this.activeSlide!=0){
var _46=(this.navType==2?this.doc.getElementById("lbPrev2"):this.doc.getElementById("lbPrev"));
_46.style.display="";
_46.onclick=function(){
if(myLytebox.pauseOnPrevClick){
myLytebox.togglePlayPause("lbPause","lbPlay");
}
myLytebox.changeContent(myLytebox.activeSlide-1);
return false;
};
}else{
if(this.navType==2){
this.doc.getElementById("lbPrev2_Off").style.display="";
}
}
if(this.activeSlide!=(this.slideArray.length-1)){
var _47=(this.navType==2?this.doc.getElementById("lbNext2"):this.doc.getElementById("lbNext"));
_47.style.display="";
_47.onclick=function(){
if(myLytebox.pauseOnNextClick){
myLytebox.togglePlayPause("lbPause","lbPlay");
}
myLytebox.changeContent(myLytebox.activeSlide+1);
return false;
};
}else{
if(this.navType==2){
this.doc.getElementById("lbNext2_Off").style.display="";
}
}
}else{
if(this.isLyteframe){
if(this.activeFrame!=0){
var _48=this.doc.getElementById("lbPrev2");
_48.style.display="";
_48.onclick=function(){
myLytebox.changeContent(myLytebox.activeFrame-1);
return false;
};
}else{
this.doc.getElementById("lbPrev2_Off").style.display="";
}
if(this.activeFrame!=(this.frameArray.length-1)){
var _49=this.doc.getElementById("lbNext2");
_49.style.display="";
_49.onclick=function(){
myLytebox.changeContent(myLytebox.activeFrame+1);
return false;
};
}else{
this.doc.getElementById("lbNext2_Off").style.display="";
}
}else{
if(this.activeImage!=0){
var _4a=(this.navType==2?this.doc.getElementById("lbPrev2"):this.doc.getElementById("lbPrev"));
_4a.style.display="";
_4a.onclick=function(){
myLytebox.changeContent(myLytebox.activeImage-1);
return false;
};
}else{
if(this.navType==2){
this.doc.getElementById("lbPrev2_Off").style.display="";
}
}
if(this.activeImage!=(this.imageArray.length-1)){
var _4b=(this.navType==2?this.doc.getElementById("lbNext2"):this.doc.getElementById("lbNext"));
_4b.style.display="";
_4b.onclick=function(){
myLytebox.changeContent(myLytebox.activeImage+1);
return false;
};
}else{
if(this.navType==2){
this.doc.getElementById("lbNext2_Off").style.display="";
}
}
}
}
this.enableKeyboardNav();
};
LyteBox.prototype.enableKeyboardNav=function(){
document.onkeydown=this.keyboardAction;
};
LyteBox.prototype.disableKeyboardNav=function(){
document.onkeydown="";
};
LyteBox.prototype.keyboardAction=function(e){
var _4d=key=escape=null;
_4d=(e==null)?event.keyCode:e.which;
key=String.fromCharCode(_4d).toLowerCase();
escape=(e==null)?27:e.DOM_VK_ESCAPE;
if((key=="x")||(key=="c")||(_4d==escape)){
myLytebox.end();
}else{
if((key=="p")||(_4d==37)){
if(myLytebox.isSlideshow){
if(myLytebox.activeSlide!=0){
myLytebox.disableKeyboardNav();
myLytebox.changeContent(myLytebox.activeSlide-1);
}
}else{
if(myLytebox.isLyteframe){
if(myLytebox.activeFrame!=0){
myLytebox.disableKeyboardNav();
myLytebox.changeContent(myLytebox.activeFrame-1);
}
}else{
if(myLytebox.activeImage!=0){
myLytebox.disableKeyboardNav();
myLytebox.changeContent(myLytebox.activeImage-1);
}
}
}
}else{
if((key=="n")||(_4d==39)){
if(myLytebox.isSlideshow){
if(myLytebox.activeSlide!=(myLytebox.slideArray.length-1)){
myLytebox.disableKeyboardNav();
myLytebox.changeContent(myLytebox.activeSlide+1);
}
}else{
if(myLytebox.isLyteframe){
if(myLytebox.activeFrame!=(myLytebox.frameArray.length-1)){
myLytebox.disableKeyboardNav();
myLytebox.changeContent(myLytebox.activeFrame+1);
}
}else{
if(myLytebox.activeImage!=(myLytebox.imageArray.length-1)){
myLytebox.disableKeyboardNav();
myLytebox.changeContent(myLytebox.activeImage+1);
}
}
}
}
}
}
};
LyteBox.prototype.preloadNeighborImages=function(){
if(this.isSlideshow){
if((this.slideArray.length-1)>this.activeSlide){
preloadNextImage=new Image();
preloadNextImage.src=this.slideArray[this.activeSlide+1][0];
}
if(this.activeSlide>0){
preloadPrevImage=new Image();
preloadPrevImage.src=this.slideArray[this.activeSlide-1][0];
}
}else{
if((this.imageArray.length-1)>this.activeImage){
preloadNextImage=new Image();
preloadNextImage.src=this.imageArray[this.activeImage+1][0];
}
if(this.activeImage>0){
preloadPrevImage=new Image();
preloadPrevImage.src=this.imageArray[this.activeImage-1][0];
}
}
};
LyteBox.prototype.togglePlayPause=function(_4e,_4f){
if(this.isSlideshow&&_4e=="lbPause"){
for(var i=0;i<this.slideshowIDCount;i++){
window.clearTimeout(this.slideshowIDArray[i]);
}
}
this.doc.getElementById(_4e).style.display="none";
this.doc.getElementById(_4f).style.display="";
if(_4e=="lbPlay"){
this.isPaused=false;
if(this.activeSlide==(this.slideArray.length-1)){
this.end();
}else{
this.changeContent(this.activeSlide+1);
}
}else{
this.isPaused=true;
}
};
LyteBox.prototype.end=function(_51){
var _52=(_51=="slideshow"?false:true);
if(this.isSlideshow&&this.isPaused&&!_52){
return;
}
this.disableKeyboardNav();
this.doc.getElementById("lbMain").style.display="none";
this.fade("lbOverlay",(this.doAnimations?this.maxOpacity:0));
this.toggleSelects("visible");
if(this.hideFlash){
this.toggleFlash("visible");
}
if(this.isSlideshow){
for(var i=0;i<this.slideshowIDCount;i++){
window.clearTimeout(this.slideshowIDArray[i]);
}
}
if(this.isLyteframe){
this.initialize();
}
};
LyteBox.prototype.checkFrame=function(){
if(window.parent.frames[window.name]&&(parent.document.getElementsByTagName("frameset").length<=0)){
this.isFrame=true;
this.lytebox="window.parent."+window.name+".myLytebox";
this.doc=parent.document;
}else{
this.isFrame=false;
this.lytebox="myLytebox";
this.doc=document;
}
};
LyteBox.prototype.getPixelRate=function(cur,img){
var _56=(img>cur)?img-cur:cur-img;
if(_56>=0&&_56<=100){
return 10;
}
if(_56>100&&_56<=200){
return 15;
}
if(_56>200&&_56<=300){
return 20;
}
if(_56>300&&_56<=400){
return 25;
}
if(_56>400&&_56<=500){
return 30;
}
if(_56>500&&_56<=600){
return 35;
}
if(_56>600&&_56<=700){
return 40;
}
if(_56>700){
return 45;
}
};
LyteBox.prototype.appear=function(id,_58){
var _59=this.doc.getElementById(id).style;
_59.opacity=(_58/100);
_59.MozOpacity=(_58/100);
_59.KhtmlOpacity=(_58/100);
_59.filter="alpha(opacity="+(_58+10)+")";
if(_58==100&&(id=="lbImage"||id=="lbIframe")){
try{
_59.removeAttribute("filter");
}
catch(e){
}
this.updateDetails();
}else{
if(_58>=this.maxOpacity&&id=="lbOverlay"){
for(var i=0;i<this.overlayTimerCount;i++){
window.clearTimeout(this.overlayTimerArray[i]);
}
return;
}else{
if(_58>=100&&id=="lbDetailsContainer"){
try{
_59.removeAttribute("filter");
}
catch(e){
}
for(var i=0;i<this.imageTimerCount;i++){
window.clearTimeout(this.imageTimerArray[i]);
}
this.doc.getElementById("lbOverlay").style.height=this.getPageSize()[1]+"px";
}else{
if(id=="lbOverlay"){
this.overlayTimerArray[this.overlayTimerCount++]=setTimeout("myLytebox.appear('"+id+"', "+(_58+20)+")",1);
}else{
this.imageTimerArray[this.imageTimerCount++]=setTimeout("myLytebox.appear('"+id+"', "+(_58+10)+")",1);
}
}
}
}
};
LyteBox.prototype.fade=function(id,_5d){
var _5e=this.doc.getElementById(id).style;
_5e.opacity=(_5d/100);
_5e.MozOpacity=(_5d/100);
_5e.KhtmlOpacity=(_5d/100);
_5e.filter="alpha(opacity="+_5d+")";
if(_5d<=0){
try{
_5e.display="none";
}
catch(err){
}
}else{
if(id=="lbOverlay"){
this.overlayTimerArray[this.overlayTimerCount++]=setTimeout("myLytebox.fade('"+id+"', "+(_5d-20)+")",1);
}else{
this.timerIDArray[this.timerIDCount++]=setTimeout("myLytebox.fade('"+id+"', "+(_5d-10)+")",1);
}
}
};
LyteBox.prototype.resizeW=function(id,_60,_61,_62,_63){
if(!this.hDone){
this.resizeWTimerArray[this.resizeWTimerCount++]=setTimeout("myLytebox.resizeW('"+id+"', "+_60+", "+_61+", "+_62+")",100);
return;
}
var _64=this.doc.getElementById(id);
var _65=_63?_63:(this.resizeDuration/2);
var _66=(this.doAnimations?_60:_61);
_64.style.width=(_66)+"px";
if(_66<_61){
_66+=(_66+_62>=_61)?(_61-_66):_62;
}else{
if(_66>_61){
_66-=(_66-_62<=_61)?(_66-_61):_62;
}
}
this.resizeWTimerArray[this.resizeWTimerCount++]=setTimeout("myLytebox.resizeW('"+id+"', "+_66+", "+_61+", "+_62+", "+(_65+0.02)+")",_65+0.02);
if(parseInt(_64.style.width)==_61){
this.wDone=true;
for(var i=0;i<this.resizeWTimerCount;i++){
window.clearTimeout(this.resizeWTimerArray[i]);
}
}
};
LyteBox.prototype.resizeH=function(id,_69,_6a,_6b,_6c){
var _6d=_6c?_6c:(this.resizeDuration/2);
var _6e=this.doc.getElementById(id);
var _6f=(this.doAnimations?_69:_6a);
_6e.style.height=(_6f)+"px";
if(_6f<_6a){
_6f+=(_6f+_6b>=_6a)?(_6a-_6f):_6b;
}else{
if(_6f>_6a){
_6f-=(_6f-_6b<=_6a)?(_6f-_6a):_6b;
}
}
this.resizeHTimerArray[this.resizeHTimerCount++]=setTimeout("myLytebox.resizeH('"+id+"', "+_6f+", "+_6a+", "+_6b+", "+(_6d+0.02)+")",_6d+0.02);
if(parseInt(_6e.style.height)==_6a){
this.hDone=true;
for(var i=0;i<this.resizeHTimerCount;i++){
window.clearTimeout(this.resizeHTimerArray[i]);
}
}
};
LyteBox.prototype.getPageScroll=function(){
if(self.pageYOffset){
return this.isFrame?parent.pageYOffset:self.pageYOffset;
}else{
if(this.doc.documentElement&&this.doc.documentElement.scrollTop){
return this.doc.documentElement.scrollTop;
}else{
if(document.body){
return this.doc.body.scrollTop;
}
}
}
};
LyteBox.prototype.getPageSize=function(){
var _71,yScroll,windowWidth,windowHeight;
if(window.innerHeight&&window.scrollMaxY){
_71=this.doc.scrollWidth;
yScroll=(this.isFrame?parent.innerHeight:self.innerHeight)+(this.isFrame?parent.scrollMaxY:self.scrollMaxY);
}else{
if(this.doc.body.scrollHeight>this.doc.body.offsetHeight){
_71=this.doc.body.scrollWidth;
yScroll=this.doc.body.scrollHeight;
}else{
_71=this.doc.getElementsByTagName("html").item(0).offsetWidth;
yScroll=this.doc.getElementsByTagName("html").item(0).offsetHeight;
_71=(_71<this.doc.body.offsetWidth)?this.doc.body.offsetWidth:_71;
yScroll=(yScroll<this.doc.body.offsetHeight)?this.doc.body.offsetHeight:yScroll;
}
}
if(self.innerHeight){
windowWidth=(this.isFrame)?parent.innerWidth:self.innerWidth;
windowHeight=(this.isFrame)?parent.innerHeight:self.innerHeight;
}else{
if(document.documentElement&&document.documentElement.clientHeight){
windowWidth=this.doc.documentElement.clientWidth;
windowHeight=this.doc.documentElement.clientHeight;
}else{
if(document.body){
windowWidth=this.doc.getElementsByTagName("html").item(0).clientWidth;
windowHeight=this.doc.getElementsByTagName("html").item(0).clientHeight;
windowWidth=(windowWidth==0)?this.doc.body.clientWidth:windowWidth;
windowHeight=(windowHeight==0)?this.doc.body.clientHeight:windowHeight;
}
}
}
var _72=(yScroll<windowHeight)?windowHeight:yScroll;
var _73=(_71<windowWidth)?windowWidth:_71;
return new Array(_73,_72,windowWidth,windowHeight);
};
LyteBox.prototype.toggleFlash=function(_74){
var _75=this.doc.getElementsByTagName("object");
for(var i=0;i<_75.length;i++){
_75[i].style.visibility=(_74=="hide")?"hidden":"visible";
}
var _77=this.doc.getElementsByTagName("embed");
for(var i=0;i<_77.length;i++){
_77[i].style.visibility=(_74=="hide")?"hidden":"visible";
}
if(this.isFrame){
for(var i=0;i<parent.frames.length;i++){
try{
_75=parent.frames[i].window.document.getElementsByTagName("object");
for(var j=0;j<_75.length;j++){
_75[j].style.visibility=(_74=="hide")?"hidden":"visible";
}
}
catch(e){
}
try{
_77=parent.frames[i].window.document.getElementsByTagName("embed");
for(var j=0;j<_77.length;j++){
_77[j].style.visibility=(_74=="hide")?"hidden":"visible";
}
}
catch(e){
}
}
}
};
LyteBox.prototype.toggleSelects=function(_7c){
var _7d=this.doc.getElementsByTagName("select");
for(var i=0;i<_7d.length;i++){
_7d[i].style.visibility=(_7c=="hide")?"hidden":"visible";
}
if(this.isFrame){
for(var i=0;i<parent.frames.length;i++){
try{
_7d=parent.frames[i].window.document.getElementsByTagName("select");
for(var j=0;j<_7d.length;j++){
_7d[j].style.visibility=(_7c=="hide")?"hidden":"visible";
}
}
catch(e){
}
}
}
};
LyteBox.prototype.pause=function(_81){
var now=new Date();
var _83=now.getTime()+_81;
while(true){
now=new Date();
if(now.getTime()>_83){
return;
}
}
};
if(window.addEventListener){
window.addEventListener("load",initLytebox,false);
}else{
if(window.attachEvent){
window.attachEvent("onload",initLytebox);
}else{
window.onload=function(){
initLytebox();
};
}
}
function initLytebox(){
myLytebox=new LyteBox();
}


