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(){
	if (cread("slideshow_stat") != "on"){document.cookie = "slideshow_stat=on";}
	else{document.cookie = "slideshow_stat=off";}
	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
}


function ddrivetip(thetext, thecolor, thewidth){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20
var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000
if (rightedge<tipobj.offsetWidth)
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
tipobj.style.left=curX+offsetxpoint+"px"
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

