/*
=======================================================================================================================
	Grundgerüst für Diashow in neuem Fenster
=======================================================================================================================
*/


function DiaShow() {
	/* alert( 'automatische Dia-Show' ); */

	ZeitproBild = 3000;
    Counter = 1;

    /*
    alert( ImgSrc[0] );
    alert( ImgWidth[0] );
    alert( ImgHeight[0] );
    */

    globBildAnzahl = ImgZahl;
    globImgSrc = ImgSrc;
    globImgWidth = ImgWidth;
    globImgHeight = ImgHeight;
    globImgTxt = ImgTxt;

    /* alert( globImgTxt[0] ); */


    DiaShowFenster = window.open("about:blank", "DiaShowFenster");
    DiaShowFenster.focus();

    DiaShowFenster.document.write('<HTML>');
    DiaShowFenster.document.write('<HEAD>');
    DiaShowFenster.document.write('<TITLE>DiaShow-Fenster</TITLE>');
    DiaShowFenster.document.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
    DiaShowFenster.document.write('</HEAD>');
    DiaShowFenster.document.write('<body bgcolor="#C0C0C0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="font: 70% Arial, Helvetica, sans-serif; color: #45474a; margin: 0px; padding: 0px;">');
    DiaShowFenster.document.write('<DIV ALIGN=CENTER>');
    DiaShowFenster.document.write('<br><br>');
    DiaShowFenster.document.write('<img id="LoopImage" src="' + globImgSrc[0] + '" border="1">');
    DiaShowFenster.document.write('<br><br>');
    DiaShowFenster.document.write('<input id="LoopImgText" type="text" value="' + globImgTxt[0] + '" size="120" style="background-color:transparent; border-style:none; text-align:center;">');
    DiaShowFenster.document.write('<br><br>');
    DiaShowFenster.document.write('</DIV>');
    DiaShowFenster.document.write('</BODY></HTML>');

    window.setTimeout( "Pruefung()", ZeitproBild );

}




/*
=======================================================================================================================
	IMAGES - STEUERUNG
=======================================================================================================================
*/


function Pruefung( Durchgang ) {
    DiaShowFenster.focus();
    if ( Counter < globBildAnzahl ) {
        window.setTimeout( "Bildtausch()", ZeitproBild );
    } else {
		window.setTimeout( "Ende()", 10000 );
    }
}



function Bildtausch() {
    DiaShowFenster.focus();
    DiaShowFenster.document.getElementById('LoopImage').src = globImgSrc[Counter];
    DiaShowFenster.document.getElementById('LoopImage').height = 525;
    /* DiaShowFenster.document.getElementById('LoopImage').width = globImgWidth[Counter];
    DiaShowFenster.document.getElementById('LoopImage').height = globImgHeight[Counter]; */
    DiaShowFenster.document.getElementById('LoopImgText').value = globImgTxt[Counter];
	newCounter = Counter + 1;
    Counter = Counter + 1;
    /* alert( 'newCounter: ' + Counter ); */
    Pruefung( newCounter );
}


function Ende() {
    DiaShowFenster.focus();
	DiaShowFenster.close();
}