function findObj(n, d) {
var p, i, x;  
if(!d) d=document; 
if( (p=n.indexOf("?")) > 0 && parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; 
n=n.substring(0,p);}
if(!(x=d[n]) && d.all) x=d.all[n]; 
for (i=0; !x && i<d.forms.length; i++) x=d.forms[i][n]; 
for (i=0; !x && d.layers && i<d.layers.length; i++) x=findObj(n,d.layers[i].document); 
if(!x && d.getElementById) x=d.getElementById(n);
return x;
}

var slideshowrefadr=''
if (!ext){var ext=8;}	/* length .jpg or s.jpg */

function ClearFilter(){this.style.filter="";}

function replaceString(oldS,newS,fullS) {// Replaces oldS with newS in the string fullS   
for (var i=0; i<fullS.length; i++) {
      if (fullS.substring(i,i+oldS.length) == oldS) {
         fullS = fullS.substring(0,i)+newS+fullS.substring(i+oldS.length,fullS.length)
      }
   }   
return fullS}

function stopT2(){//Stop timer T2
var obj=findObj(arguments[0]);
if (obj && obj.T2 != null){clearTimeout(obj.T2);}
}

 
function f2(){
var a=arguments, name=a[0], obj=findObj(name), tid1=a[1], tid2=a[2], v6, v7, v8, Dennef2, v10, v11, d=document;
if (obj && obj.FilFilt){
stopT2(name);
Dennef2="f2('"+name+"',"+tid1+","+tid2+")";
if (tid1==1){
if (! obj.nxtpic.complete){ obj.T2=setTimeout(Dennef2,50);return;} 
v6=obj.nupoint+1;
if (v6>obj.FilFilt.length-1){if (obj.A4==0){return;} else {v6=0;} }
else if (v6+1<obj.FilFilt.length){obj.nxtpic.src=obj.virpath+obj.FilFilt[v6+1][0];}
}
else {
if (!obj.prepic.complete){obj.T2=setTimeout(Dennef2,50); return;}
v6=obj.nupoint-1;
if (v6<0){if (obj.A4==0){return;} else {v6=obj.FilFilt.length-1;} }
else if (v6-1>0){obj.prepic.src=obj.virpath+obj.FilFilt[v6-1][0];}
}
obj.nupoint=v6;
v10=obj.FilFilt[v6][0]; //filnavn
v11=obj.FilFilt[v6][1]; //filter.style
v7=(obj.filters && !d.ejmac && v11<25);
if (v7){
if (obj.filters[0]&&obj.filters[0].status==2){obj.filters[0].Stop();}
if (v11==0){v8="blendTrans(Duration="+obj.Tid1s+")";}
else {v8="revealTrans(Duration="+obj.Tid1s+",Transition="+(v11-1)+")";} obj.style.filter=v8;
obj.onfilterchange=ClearFilter;
obj.filters[0].Apply();
}
obj.src=obj.virpath+v10; 
slideshowrefadr=obj.linkfile+replaceString('&','%26',v10);
slideshowrefno=obj.linkfile+replaceString('&','%26',v10.substring(0,v10.length-ext));
if (v7){obj.filters[0].Play();}
if (tid2==1){obj.T2=setTimeout(Dennef2,obj.Tottid);}
}
}

 
function slideshow(){
var a=arguments, d=document, name=a[0], obj=findObj(name); 
if (obj){
d.ejmac=(navigator.userAgent.toLowerCase().indexOf("mac")!=-1);
obj.Tid1s=a[1]/1000; 
obj.Tottid=a[2]+a[1];
obj.virpath=a[5];	//virpath
obj.linkfile=a[6]	//link
slideshowrefadr=a[6]+replaceString('&','%26',a[7]); 
slideshowrefno=slideshowrefadr.substring(0,slideshowrefadr.length-ext);
obj.A4=a[4]; 		//Loop
obj.FilFilt=new Array(); 
for (var i=7; i<a.length; i+=2){//opret array med filnavne, filterstyle
obj.FilFilt[obj.FilFilt.length]=new Array(a[i],a[i+1]);}
obj.nupoint=0; 								
obj.nxtpic=new Image(); obj.nxtpic.src=a[5]+a[9]; 
obj.prepic=new Image(); obj.prepic.src=a[5]+a[a.length-2]; 
if (a[3]==1){obj.T2=setTimeout("f2('"+name+"',1,"+a[3]+")",obj.Tottid);}
}
}

function slideshowref(){parent.location = slideshowrefadr;}

function slideshowrefmain(){parent.main.location = slideshowrefadr }

function slideshowwin(){ window.open(slideshowrefadr,'dias', 'toolbar=no, location=no, scrollbars=no, resizable=yes, status=no, menubar=no')}

function slideshowno(){parent.location = slideshowrefno;}

function slideshownomain(){parent.main.location = slideshowrefno }

function slideshownowin(){ window.open(slideshowrefno,'dias', 'toolbar=no, location=no, scrollbars=no, resizable=yes, status=no, menubar=no')}
