// Geschwindigkeit des Sliders
var slidespeed = 1;
// Speed
var copyspeed = slidespeed;
// Interval
var lefttime = null;
// Sliders
leftrightslide = leftrightslide.join("");

var iedom = document.all || document.getElementById;
if (iedom)
   document.write('<span id="temp" style="visibility:hidden;position:absolute;left:-100px;top:-3000px">' + leftrightslide + '</span>');

var actualheight = '';
var cross_slide, cross_slide2, ns_slide;

function stopSlider()
{
   if(lefttime)
      window.clearInterval(lefttime);

   if (iedom)
   {
      var la = document.getElementById('sLayer');
      la.removeAttribute( 'style' );
      la.setAttribute( 'style', 'position:relative;width:148px;height:680px;overflow:auto;' );
   }
}

function loadSlider()
{
   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=leftrightslide;
      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("slidedown()",60);
}

window.onload=loadSlider;

function slidedown()
{
   if ( iedom )
   {
      if (parseInt(cross_slide.style.top)<(actualheight-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-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;
   }

}

if (iedom||document.layers)
{
   with (document)
   {
      document.write('<div style="border:none;margin:0;overflow:hidden;">');
      if (iedom)
      {
         document.write('<div id="sLayer">');
         document.write('<div style="position:absolute;width:148px;height:680px;background:transparent;" onmouseover="copyspeed=0" onmouseout="copyspeed=slidespeed">');
         document.write('<div id="test2" style="position:absolute;left:0px;top:0px;"></div>');
         document.write('<div id="test3" style="position:absolute;top:-1000;left:0px;"></div>');
         document.write('</div></div>');
      }
      else if (document.layers)
      {
         document.write('<ilayer width="148" height="590" name="ns_slidemenu" bgColor="#B4B1F6">');
         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('</div>');
   }
}

