/* Deklarationen */
var sliderwidth  = 228;       // Breite des Sliders
var sliderheight = 150;       // H&ouml;he des Sliders
var slidespeed   = 1;         // Geschwindigkeit des Sliders
var slidebgcolor = "#eeeeee"; // Hintergrundfarbe

var copyspeed = slidespeed;
var iedom = document.all || document.getElementById;
var cross_slide, ns_slide;


/* Bilder */
var i = 0;
var leftrightslide = new Array();
leftrightslide[i++] = '<div><a href="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_1_small.jpg" rel="lightbox-slide" target="_blank"><img src="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_1_small.jpg" alt="" border="0" width="226"></a></div>';
leftrightslide[i++] = '<div><a href="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_6_small.jpg" rel="lightbox-slide" target="_blank"><img src="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_6_small.jpg" alt="" border="0" width="226"></a></div>';
leftrightslide[i++] = '<div><a href="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_9_small.jpg" rel="lightbox-slide" target="_blank"><img src="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_9_small.jpg" alt="" border="0" width="226"></a></div>';
leftrightslide[i++] = '<div><a href="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_11_small.jpg" rel="lightbox-slide" target="_blank"><img src="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_11_small.jpg" alt="" border="0" width="226"></a></div>';
leftrightslide[i++] = '<div><a href="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_13_small.jpg" rel="lightbox-slide" target="_blank"><img src="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_13_small.jpg" alt="" border="0" width="226"></a></div>';
leftrightslide[i++] = '<div><a href="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_19_small.jpg" rel="lightbox-slide" target="_blank"><img src="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_19_small.jpg" alt="" border="0" width="226"></a></div>';
leftrightslide[i++] = '<div><a href="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_22_small.jpg" rel="lightbox-slide" target="_blank"><img src="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_22_small.jpg" alt="" border="0" width="226"></a></div>';
leftrightslide[i++] = '<div><a href="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_25_small.jpg" rel="lightbox-slide" target="_blank"><img src="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_25_small.jpg" alt="" border="0" width="226"></a></div>';
leftrightslide[i++] = '<div><a href="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_26_small.jpg" rel="lightbox-slide" target="_blank"><img src="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_26_small.jpg" alt="" border="0" width="226"></a></div>';
leftrightslide[i++] = '<div><a href="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_28_small.jpg" rel="lightbox-slide" target="_blank"><img src="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_28_small.jpg" alt="" border="0" width="226"></a></div>';
leftrightslide[i++] = '<div><a href="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_30_small.jpg" rel="lightbox-slide" target="_blank"><img src="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_30_small.jpg" alt="" border="0" width="226"></a></div>';
leftrightslide[i++] = '<div><a href="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_31_small.jpg" rel="lightbox-slide" target="_blank"><img src="/fotos/sommerfest10/2010_06_11_SommerfestKiGa_31_small.jpg" alt="" border="0" width="226"></a></div>';

leftrightslide[i++] = '<div><a href="/fotos/sommerfest10/2010_06_11_P1040828_small.jpg" rel="lightbox-slide" target="_blank"><img src="/fotos/sommerfest10/2010_06_11_P1040828_small.jpg" alt="" border="0" width="226"></a></div>';
leftrightslide[i++] = '<div><a href="/fotos/sommerfest10/2010_06_11_P1040829_small.jpg" rel="lightbox-slide" target="_blank"><img src="/fotos/sommerfest10/2010_06_11_P1040829_small.jpg" alt="" border="0" width="226"></a></div>';
leftrightslide[i++] = '<div><a href="/fotos/sommerfest10/2010_06_11_P1040836_small.jpg" rel="lightbox-slide" target="_blank"><img src="/fotos/sommerfest10/2010_06_11_P1040836_small.jpg" alt="" border="0" width="226"></a></div>';
leftrightslide[i++] = '<div><a href="/fotos/sommerfest10/2010_06_11_P1040843_small.jpg" rel="lightbox-slide" target="_blank"><img src="/fotos/sommerfest10/2010_06_11_P1040843_small.jpg" alt="" border="0" width="226"></a></div>';
leftrightslide[i++] = '<div><a href="/fotos/sommerfest10/2010_06_11_P1040849_small.jpg" rel="lightbox-slide" target="_blank"><img src="/fotos/sommerfest10/2010_06_11_P1040849_small.jpg" alt="" border="0" width="226"></a></div>';
leftrightslide = leftrightslide.join("");

/* Coding */
if (iedom)
        document.write('<span id="temp" style="visibility:hidden;position:absolute;left:-100px;top:-3000px">' + leftrightslide + '</span>');

if (iedom||document.layers){
        with (document){
                document.write('<table border="0" bgcolor="#000000" cellspacing="0" cellpadding="0"><td>');
                if (iedom){
                        document.write('<div style="position:relative;width:' + sliderwidth + 'px;height:' + sliderheight + 'px;overflow:hidden">');
                        document.write('<div style="position:absolute;width:' + sliderwidth + 'px;height:' + sliderheight + 'px;background-color:' + slidebgcolor + '" onmouseover="copyspeed=0" onmouseout="copyspeed=slidespeed">');
                        document.write('<div id="test2" style="position:absolute;left:0;top:0"></div>');
                        document.write('<div id="test3" style="position:absolute;top:-1000;left:0"></div>');
                        document.write('</div></div>');
                }
                else if (document.layers){
                        document.write('<ilayer width='+sliderwidth+' height='+sliderheight+' name="ns_slidemenu" bgColor='+slidebgcolor+'>');
                        document.write('<layer name="ns_slidemenu2" left=0 top=0 onmouseover="copyspeed=0" onmouseout="copyspeed=slidespeed"></layer>');
                        document.write('<layer name="ns_slidemenu3" left=0 top=0 onmouseover="copyspeed=0" onmouseout="copyspeed=slidespeed"></layer>');
                        document.write('</ilayer>');
                }
                document.write('</td></table>');
        }
}

function fillup(){
        if (iedom){
                cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2;
                cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3;
                cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide;
                actualheight=document.all? cross_slide.offsetHeight : document.getElementById("temp").offsetHeight;
                cross_slide2.style.top=actualheight+20+"px";
        }
        else if (document.layers){
                ns_slide=document.ns_slidemenu.document.ns_slidemenu2;
                ns_slide2=document.ns_slidemenu.document.ns_slidemenu3;
                ns_slide.document.write(leftrightslide);
                ns_slide.document.close();
                actualheight=ns_slide.document.height;
                ns_slide2.top=actualheight+20;
                ns_slide2.document.write(leftrightslide);
                ns_slide2.document.close();
        }
        lefttime=setInterval("slidetop()",25);
}

function slidetop(){
        if (iedom){
                if (parseInt(cross_slide.style.top)>(actualheight*(-1)+8))
                        cross_slide.style.top=parseInt(cross_slide.style.top)-copyspeed+"px";
                else
                        cross_slide.style.top=parseInt(cross_slide2.style.top)+actualheight+"px";

                if (parseInt(cross_slide2.style.top)>(actualheight*(-1)+8))
                        cross_slide2.style.top=parseInt(cross_slide2.style.top)-copyspeed+"px";
                else
                        cross_slide2.style.top=parseInt(cross_slide.style.top)+actualheight+"px";
        }
        else if (document.layers){
                if (ns_slide.top>(actualheight*(-1)+8))
                        ns_slide.top-=copyspeed;
                else
                        ns_slide.top=ns_slide2.top+actualheight;

                if (ns_slide2.top>(actualheight*(-1)+8))
                        ns_slide2.top=copyspeed;
                else
                        ns_slide2.top=ns_slide.top+actualheight;
        }
}

window.onload=fillup;