var slideshow_stop = new Image();
var slideshow_play = new Image();
var slideshow_stop_b = new Image();
var slideshow_play_b = new Image();
slideshow_stop.src = "../kleinteile/slideshow_stop.gif";
slideshow_play.src = "../kleinteile/slideshow_play.gif";
slideshow_stop_b.src = "../kleinteile/slideshow_stop_b.gif";
slideshow_play_b.src = "../kleinteile/slideshow_play_b.gif";

function set_slideshow_button(){
	if (cread("slideshow_stat") == "on"){
		window.document.slideshow.src="../kleinteile/slideshow_play.gif";
	}
	else {
		window.document.slideshow.src="../kleinteile/slideshow_stop.gif";
	}
}

function slideshow1(){
	if (cread("slideshow_stat") == "on"){
		document.images.slideshow.src=slideshow_play_b.src;
	}
	else {
		document.images.slideshow.src=slideshow_stop_b.src;
	}
}

function slideshow2(){
	if (cread("slideshow_stat") == "on"){
		document.images.slideshow.src=slideshow_play.src;
	}
	else {
		document.images.slideshow.src=slideshow_stop.src;
	}
}

function play_stop(){
	var jetzt = new Date();
	<!-- maximale Dauer einer unbaeufsichtigten Slideshow ist 25 min (1000*60*25) -->
 	var Auszeit = new Date(jetzt.getTime() + 1000*60*25);
	if (cread("slideshow_stat") != "on"){
		document.cookie = "slideshow_stat=on; expires="+Auszeit.toGMTString()+";";
	}
	else{
		document.cookie = "slideshow_stat=off; expires="+Auszeit.toGMTString()+";";
	}
	location.reload()
}


function cread(name){
   var i=0
   var suche = name+"="
   while (i<document.cookie.length){
      if (document.cookie.substring(i, i+suche.length)==suche){
         var ende = document.cookie.indexOf(";", i+suche.length)
         ende = (ende>-1) ? ende : document.cookie.length
         var cook = document.cookie.substring(i+suche.length, ende)
         return unescape(cook)
      }
      i++
   }
   return null
}


function img_a()
{
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function imgsPreload()
{
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=imgsPreload.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function findImg(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=findImg(n,d.layers[i].document); return x;
}

function img_b()
{
  var i,j=0,x,a=img_b.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findImg(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}




function lupe_laden(nr)
{
img1 = new Image()
img1.src = "bilder/bild" + nr + "_d.jpg"
img2 = new Image()
img2.src = "bilder/bild" + nr + ".jpg"
}

function lupe_an()
{
  document.showimg.src = img1.src
}

function lupe_aus()
{
  document.showimg.src = img2.src
}

function lupe2_laden(nr)
{
img3 = new Image()
img3.src = "bilder/bild" + nr + "_d2.jpg"
img4 = new Image()
img4.src = "bilder/bild" + nr + ".jpg"
}

function lupe_an()
{
  document.showimg.src = img1.src
}

function lupe_aus()
{
  document.showimg.src = img2.src
}

function lupe2_an()
{
  document.showimg.src = img3.src
}

function lupe2_aus()
{
  document.showimg.src = img4.src
}
