var PP,NUMTHUMB,firstnum,currnum,preload,urlArray=new Array();
function init(){
PP=parent.parent;NUMTHUMB=document.images.length-1;var URL=PP.frames[0].getCurrentURL();parent.sPWL(URL);
var pause_time=PP.frames[0].getCookie("pausetime")-0;
if(isNaN(pause_time))pause_time=9;
document.forms[0].ssp.value=pause_time;
if(PP.frames[0].getCookie("nopop")=="true")document.forms[0].nopop.checked=true;
perhapsUpdateThumbs(URL);
if(PP.frames[0].getCookie("embedit")=="true")PP.frames[0].setCookie("embedit","false");//document.forms[0].embedit.checked=true;
}
function sPWL(URL){if(URL!=""){if(parent.frames[0].getCookie("embedit")=="true")parent.frames[0].embedIt(N,URL);else N.location.href=URL;}if(URL.indexOf("ben=")<0)thumber.perhapsUpdateThumbs(URL);}
function al(){alert('You do not need to press the enter key.')}
function tFrame(){
var s=parent.frames[0].getCookie("thumbsize")-0;
if(isNaN(s)||s<5)s=145;
document.write("<frameset cols='"+s+",*' border=1 frameborder=1 framespacing=0><frame src=t.html name=thumber marginwidth=0 marginheight=0><frame name=N marginwidth=0 marginheight=0></frameset>");
}
function r(){onresize="if(navigator.userAgent.indexOf('MSIE')>-1)resizeThumbs(document.body.clientWidth);else resizeThumbs(self.innerWidth);"}
function resizeThumbs(w){PP.frames[0].setCookie("thumbsize",w);}
function popup(p){if(p){PP.frames[0].setCookie("nopop","true");alert("LAST ONE! Checking this box to turns off NAKEDBROWSER! alerts.\n\nJUST REMEMBER: CLICK THE |< BUTTON TWICE to go from 001.jpg to 1.jpg");}else PP.frames[0].setCookie("nopop","false");}
function embed(p){if(p){PP.frames[0].setCookie("embedit","true");alert("NOT RECOMMENDED! TURN OFF WHEN DONE!\nMay cause some web browsers to act oddly, but checking this box:\n-disables annoying popup windows & browser redirects\n-allows NAKEDBROWSER! to work with movies");parent.N.location.href="about:blank";}else PP.frames[0].setCookie("embedit","false");}
function updateThumbs(URL){
var i;for(i=0;i<NUMTHUMB;i++){document.images[i].src="";document.links[i].href="#";urlArray[i]="";}
var a,b,num,r=URL.match(/^(.*\D)(\d+)(.*)/);
if(URL==""||r==null||r.length<3)return;
a=r[1];num=r[2];b=r[3];var numLenWithZero=(""+num).length,numLenNoZero=((num-0)+"").length;firstnum=num-0;currnum=firstnum;
for(var i=0;i<NUMTHUMB+1;i++){
var mynum=i+(num-0),num$=""+mynum;
while(numLenWithZero>num$.length)num$="0"+num$;
var newURL=a+num$+b;
urlArray[i]=newURL;
if(i<NUMTHUMB){document.images[i].src=newURL;document.links[i].href="javascript:void(thumbClick('"+newURL+"'))";}
else{document.images[i].src=newURL;}
}document.images[0].border=3;
}
function perhapsUpdateThumbs(URL){
var i,b_update=true;
for(i=0;i<NUMTHUMB;i++){
if(urlArray[i]==URL){currnum=firstnum+i-0;b_update=false;document.images[i].border=3;}
else document.images[i].border=0;
}
if(b_update)updateThumbs(URL);
}
function thumbClick(URL){PP.frames[0].changeAd();parent.sPWL(URL);PP.frames[0].setLocationField(URL);}
function ss(){
var ss_button=document.forms[0].ssb;
if(ss_button.value=="slideshow"){ss_button.value="pause";setTimeout("advanceSlideshow()",500);}
else ss_button.value="slideshow";
}
function advanceSlideshow(){
if(document.forms[0].ssb.value=="pause"){
PP.frames[0].g(1,false);
var pause_time=document.forms[0].ssp.value-0;
if(isNaN(pause_time)||pause_time<2)pause_time=2;
PP.frames[0].setCookie("pausetime",""+pause_time);
setTimeout("advanceSlideshow()",pause_time*1000);
}
}
function g(n){PP.frames[0].g(n*NUMTHUMB-currnum+firstnum,false)}