function preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.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 swapImgRestore() { //v3.0
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function findObj(n, d) { //v4.01
  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;
}

function swapImage() { //v3.0
  var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


   var Warten = 3000; 
   var Timer;
   // Wie viele Bilder enthält die gesamte
   // Slideshow
   var Anzahl = 0;
   // Welches Bild wird momentan angezeigt
   var AktuellesBild = 0;
   // Array um die Bilder vorladen zu können
   var Vorladen = new Array();


function slideshow() {

   // Hier wird für jedes Bild das in
   // der Slideshow auftauchen soll
   // ein Eintrag im Array vorgenommen

   // Alle Bilder die in der Slideshow sind
   // in das Array laden
   Anzahl = slideshow.arguments.length;
   for (i = 0; i < Anzahl; i++){
    Vorladen[i] = new Image();
    Vorladen[i].src = slideshow.arguments[i];
   }

   Timer = setInterval('BildWechseln()', Warten);
}

function BildWechseln(){

    // Sobald das Aktuelle Bild einen höheren
    // Wert hat als uns überhaupt Bilder zur
    // Verfügung stehen wieder mit dem
    // ersten Bild anfangen
   if (AktuellesBild > (Anzahl-1)) AktuellesBild=0;

    // Den Inhalt des auf der Webseite
    // angezeigten Bildes austauschen
    document.images.Bild.src = Vorladen[AktuellesBild].src;

    // Das Aktuelle Bild um eins erhöhen
    // damit wir nicht nur ein Bild sehen
    AktuellesBild++;
   }
   

function closeonclick(name,w,h,title) {
var att = "width=" + (w+20) + ",height=" + (h+60) + ",titlebar=no";
var x;
x = window.open(name,null,att);
x.document.open();
x.document.write("<IMG Src=" + name + " width=" + w + ">");
x.document.write("<HEAD><title>" + title + "</title>");
x.document.write("</HEAD>");
x.document.write("<BODY bgcolor='#FFCC66'>");
x.document.write("</BODY>");
x.document.close;
x.focus(); 
}

function printChildWindow(img,w,h,title,txt_print,txt_close) {
var att = "width=" + (w+20) + ",height=" + (h+60) + ",titlebar=no";
var newWindow = window.open(img, "newWindow", att);
newWindow.document.write('<HTML><HEAD><TITLE>');
newWindow.document.write(title);
newWindow.document.write('</TITLE>');
newWindow.document.write('<link href="../script/prices.css" rel="stylesheet" type="text/css" /></HEAD>');
newWindow.document.write('<BODY bgcolor="#FFCC66">');
newWindow.document.write('<IMG src="');
newWindow.document.write(img);
newWindow.document.write('" width="');
newWindow.document.write(w);
newWindow.document.write('" height="');
newWindow.document.write(h);
newWindow.document.write('"></IMG>');
newWindow.document.write('<P align="center">');
newWindow.document.write('<A href="javascript:window.print()">');
newWindow.document.write(txt_print);
newWindow.document.write('</A>&nbsp;&nbsp;<A href="javascript:window.close()">');
newWindow.document.write(txt_close);
newWindow.document.write('</A></P></BODY></HTML>');
newWindow.document.close(); 
newWindow.focus(); 
}

function openwin(name) {
var att = "height=500, width=500, top=10, left=10, screenX=10, screenY=10, resizable=yes";
var x;
x = window.open(name,null,att);
x.focus(); 
}



