var timer; 

var current_location = 2;

var next_location = 2; 

var pics_loaded = 0;

var onoff = 0;

var direction = 1;

var timeout_value;

var images = new Array;

var photo_urls = new Array;

var photo_big_urls = new Array;

var photo_captions = new Array;

var transitionNames = new Array;

var transitions = new Array;

var current_transition = 15;

var loop = 1;

photo_urls[1] = "Meerwasser_Aquarium/produkte/anlagenbau/500lSeite.jpg";

photo_big_urls[1] = "Meerwasser_Aquarium/produkte/anlagenbau/500lSeite_gross.jpg";

photo_captions[1] = "500 Liter Aquarium mit Seitentüren links und rechts..";

photo_urls[2] = "Meerwasser_Aquarium/produkte/anlagenbau/silbergelochtLuefter.jpg";

photo_big_urls[2] = "Meerwasser_Aquarium/produkte/anlagenbau/silbergelochtLuefter_gross.jpg";

photo_captions[2] = "Rückwand: PVC 8 mm,gelocht eingebauter Lüfter durchmesser 100 mm, 32db.";

photo_urls[3] = "Meerwasser_Aquarium/produkte/anlagenbau/silberSeite.jpg";

photo_big_urls[3] = "Meerwasser_Aquarium/produkte/anlagenbau/silberSeite_gross.jpg";

photo_captions[3] = "Türe, seitlich";

photo_urls[4] = "Meerwasser_Aquarium/produkte/anlagenbau/silberBlende.jpg";

photo_big_urls[4] = "Meerwasser_Aquarium/produkte/anlagenbau/silberBlende_gross.jpg";

photo_captions[4] = "abnehmbare Blende";

photo_urls[5] = "Meerwasser_Aquarium/produkte/anlagenbau/wasseraufbereitung.jpg";

photo_big_urls[5] = "Meerwasser_Aquarium/produkte/anlagenbau/wasseraufbereitung_gross.jpg";

photo_captions[5] = "Wasseraufbereitung. 1000 Liter/24h. Umkehrosmoseanlage";

photo_urls[6] = "Meerwasser_Aquarium/produkte/anlagenbau/silberEcke.jpg";

photo_big_urls[6] = "Meerwasser_Aquarium/produkte/anlagenbau/silberEcke_gross.jpg";

photo_captions[6] = "Türe, seitlich, Kalkreaktor. Türen innen mit PVC-beschichtet";

photo_urls[7] = "Meerwasser_Aquarium/produkte/anlagenbau/silberVorn.jpg";

photo_big_urls[7] = "Meerwasser_Aquarium/produkte/anlagenbau/silberVorn_gross.jpg";

photo_captions[7] = "Vorderansicht, Black-Box Filteranlage und Hauptverrohrung.";

photo_urls[8] = "Meerwasser_Aquarium/produkte/anlagenbau/silberAblauf.jpg";

photo_big_urls[8] = "Meerwasser_Aquarium/produkte/anlagenbau/silberAblauf_gross.jpg";

photo_captions[8] = "Ablaufkammer, komplett abgedeckt und Gleitschienen für T5 Lampen.";

photo_urls[9] = "Meerwasser_Aquarium/produkte/anlagenbau/silberLicht.jpg";

photo_big_urls[9] = "Meerwasser_Aquarium/produkte/anlagenbau/silberLicht_gross.jpg";

photo_captions[9] = "Detailaufnahme: Gleitschienen aus Kunststoff.";

photo_urls[10] = "Meerwasser_Aquarium/produkte/anlagenbau/silberLicht2.jpg";

photo_big_urls[10] = "Meerwasser_Aquarium/produkte/anlagenbau/silberLicht2_gross.jpg";

photo_captions[10] = "Detailaufnahme: Gleitschienen aus Kunststoff.";

photo_urls[11] = "Meerwasser_Aquarium/produkte/anlagenbau/silberKalki.jpg";

photo_big_urls[11] = "Meerwasser_Aquarium/produkte/anlagenbau/silberKalki_gross.jpg";

photo_captions[11] = "Kalkraktor und Verrohrung.";

photo_urls[12] = "Meerwasser_Aquarium/produkte/anlagenbau/silbervorsprung.jpg";

photo_big_urls[12] = "Meerwasser_Aquarium/produkte/anlagenbau/silbervorsprung_gross.jpg";

photo_captions[12] = "Detailaufnahme: Untergestell mit Rücksprüngen.";

photo_urls[13] = "Meerwasser_Aquarium/produkte/anlagenbau/wanne1.jpg";

photo_big_urls[13] = "Meerwasser_Aquarium/produkte/anlagenbau/wanne1_gross.jpg";

photo_captions[13] = "Security- Auffangwanne aus 10 mm PVC Platten, verschweißt.";

photo_urls[14] = "Meerwasser_Aquarium/produkte/anlagenbau/wanne2.jpg";

photo_big_urls[14] = "Meerwasser_Aquarium/produkte/anlagenbau/wanne2_gross.jpg";

photo_captions[14] = "Security- Auffangwanne aus 10 mm PVC Platten, verschweißt.";

photo_urls[15] = "Meerwasser_Aquarium/produkte/anlagenbau/wanne3.jpg";

photo_big_urls[15] = "Meerwasser_Aquarium/produkte/anlagenbau/wanne3_gross.jpg";

photo_captions[15] = "Security- Auffangwanne unter einem 10.000 Liter Aquarium, mit 2 cm Gefälle.";

photo_urls[16] = "Meerwasser_Aquarium/produkte/anlagenbau/verkleidungCreme.jpg";

photo_big_urls[16] = "Meerwasser_Aquarium/produkte/anlagenbau/verkleidungCreme_gross.jpg";

photo_captions[16] = "Montage einer Verkleidung Aquarium mit Creme-Sonderfarbton.";

photo_urls[17] = "Meerwasser_Aquarium/produkte/anlagenbau/verkleidungRund.jpg";

photo_big_urls[17] = "Meerwasser_Aquarium/produkte/anlagenbau/verkleidungRund_gross.jpg";

photo_captions[17] = "Herstellung einer Verkleidung für ein Aquarium mit runder Frontscheibe.";

photo_urls[18] = "Meerwasser_Aquarium/produkte/anlagenbau/300l.jpg";

photo_big_urls[18] = "Meerwasser_Aquarium/produkte/anlagenbau/300l_gross.jpg";

photo_captions[18] = "300 Liter Aquarium mit Verkleidung und Oberrahmen aus MDF 19mm Lackierung: weiß Ral 9010 matt.";

photo_urls[19] = "Meerwasser_Aquarium/produkte/anlagenbau/auffangwanne1000l.jpg";

photo_big_urls[19] = "Meerwasser_Aquarium/produkte/anlagenbau/auffangwanne1000l_gross.jpg";

photo_captions[19] = "Auffangwanne aus PVC unter einem 1000 Liter Aquarium..";

photo_urls[20] = "Meerwasser_Aquarium/produkte/anlagenbau/verrohrung10.jpg";

photo_big_urls[20] = "Meerwasser_Aquarium/produkte/anlagenbau/verrohrung10_gross.jpg";

photo_captions[20] = "Innen-Verrohrung 10m³ Aquarium, vor dem PU-Schäumen.";

photo_urls[21] = "Meerwasser_Aquarium/produkte/anlagenbau/durchbruch.jpg";

photo_big_urls[21] = "Meerwasser_Aquarium/produkte/anlagenbau/durchbruch_gross.jpg";

photo_captions[21] = "Durchbrüche durch den Boden, von 40 - 125 mm mit Kernbohrmaschine.";

photo_urls[22] = "Meerwasser_Aquarium/produkte/anlagenbau/verrohrung.jpg";

photo_big_urls[22] = "Meerwasser_Aquarium/produkte/anlagenbau/verrohrung_gross.jpg";

photo_captions[22] = "Verrohrung und Leitungsführung.";

photo_urls[23] = "Meerwasser_Aquarium/produkte/anlagenbau/500lFront.jpg";

photo_big_urls[23] = "Meerwasser_Aquarium/produkte/anlagenbau/500lFront_gross.jpg";

photo_captions[23] = "500 Liter Aquarium mit Oberrahmen und MDF-Verkleidung.";


transitions[0] = "progid:DXImageTransform.Microsoft.Fade(duration=1)";

transitions[1] = "progid:DXImageTransform.Microsoft.Blinds(Duration=1,bands=20)";

transitions[2] = "progid:DXImageTransform.Microsoft.Checkerboard(Duration=1,squaresX=20,squaresY=20)";

transitions[3] = "progid:DXImageTransform.Microsoft.Strips(Duration=1,motion=rightdown)";

transitions[4] = "progid:DXImageTransform.Microsoft.Barn(Duration=1,orientation=vertical)";

transitions[5] = "progid:DXImageTransform.Microsoft.GradientWipe(duration=1)";

transitions[6] = "progid:DXImageTransform.Microsoft.Iris(Duration=1,motion=out)";

transitions[7] = "progid:DXImageTransform.Microsoft.Wheel(Duration=1,spokes=12)";

transitions[8] = "progid:DXImageTransform.Microsoft.Pixelate(maxSquare=10,duration=1)";

transitions[9] = "progid:DXImageTransform.Microsoft.RadialWipe(Duration=1,wipeStyle=clock)";

transitions[10] = "progid:DXImageTransform.Microsoft.RandomBars(Duration=1,orientation=vertical)";

transitions[11] = "progid:DXImageTransform.Microsoft.Slide(Duration=1,slideStyle=push)";

transitions[12] = "progid:DXImageTransform.Microsoft.RandomDissolve(Duration=1,orientation=vertical)";

transitions[13] = "progid:DXImageTransform.Microsoft.Spiral(Duration=1,gridSizeX=40,gridSizeY=40)";

transitions[14] = "progid:DXImageTransform.Microsoft.Stretch(Duration=1,stretchStyle=push)";

transitions[15] = "special case";

var transition_count = 15;

var photo_count = 23; 



// Browser capabilities detection ---

// - assume only IE4+ and NAV6+ can do image resizing, others redirect to low 

if (is_ie4up || is_nav6up) {

    //-- it's all good ---

} else {

    //-- any other browser we go low-tech ---

    document.location = slideShowLow;

}



// - IE5.5 and up can do the blending transition.

var browserCanBlend = (is_ie5_5up);

function openBigPic(location){

	var imageName = photo_big_urls[location]

	var imageWidth = 500;

	var imageHeight = 500;

	var posLeft = 10;

	var posTop = 10;

	var alt = 'Royal-Exclusiv';

	var imageType="jepg";

	var count;

	newWindow = window.open("about:blank","title","width="+imageWidth+",height="+imageHeight+",scrollbars=no,resizable=yes");

	newWindow.document.open();

	newWindow.document.write('<html><head><title>' +alt+ '</title>\n ');

	newWindow.document.write('<script language="JavaScript">\n ');

	newWindow.document.write('var isLoad = false; \n ');

   	newWindow.document.write(' function set_size(){\n ');

   	newWindow.document.write(' if(isLoad) return;\n ');

   	newWindow.document.write(' isLoad = true;\n ');

   	newWindow.document.write(' var hoehe=document.images[0].height;\n ');

   	newWindow.document.write(' var breite=document.images[0].width;\n ');

   	newWindow.document.write(' var h=screen.availHeight;\n ');

   	newWindow.document.write(' var b=screen.availWidth;\n ');

   	newWindow.document.write(' if (h<=hoehe) hoehe=h;\n ');

   	newWindow.document.write(' if (b<=breite) breite=b;\n ');

   	newWindow.document.write(' window.resizeTo(breite,hoehe);\n ');

   	newWindow.document.write(' window.moveTo((b-breite)*0.5,(h-hoehe)*0.5);\n ');

   	newWindow.document.write(' waitText.style.display="none";\n ');

   	newWindow.document.write(' }\n ');

   	newWindow.document.write(' </SCRIPT>\n ');

	newWindow.document.write('</head><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">\n '); 

	newWindow.document.write('<div id="waitText">Bild wird geladen...<br></div>\n');

	newWindow.document.write('<div align="center"><img src="'+ imageName +'" border="0" onLoad="set_size()"></div>\n');

	newWindow.document.write('</body>\n</html>\n');

	newWindow.document.close();

	newWindow.focus();

}



function stopOrStart() {

    if (onoff) {

	stop();

    } else {

	play();

    }

}



function toggleLoop() {

    if (loop) {

	loop = 0;

    } else {

	loop = 1;

    }

}



function changeElementText(id, newText) {

    element = document.getElementById(id);

    //status = element;

    element.innerHTML = newText;

}



function stop() {

    changeElementText("stopOrStartText", "Starten");



    onoff = 0;

    status = "Die Bildershow ist gestoppt, clicken Sie auf [Starten] um Fortzufahren .";

    clearTimeout(timer);



}



function play() {

    changeElementText("stopOrStartText", "Stoppen");



    onoff = 1;

    status = "Bildershow ist gestartet...";

    go_to_next_photo();

}



function changeDirection() {

    if (direction == 1) {

	direction = -1;

	changeElementText("changeDirText", "Richtung ändern vorwärts");

    } else {

	direction = 1;

	changeElementText("changeDirText", "Richtung ändern rückwärts");

    }

    preload_next_photo();



}



function change_transition() {

    current_transition = document.TopForm.transitionType.selectedIndex;

}



function preload_complete() {

}



function reset_timer() {

    clearTimeout(timer);

    if (onoff) {

	timeout_value = document.TopForm.time.value * 1000;

	timer = setTimeout('go_to_next_photo()', timeout_value);

    }

}



function wait_for_current_photo() {



    /* Show the current photo */

    if (!show_current_photo()) {



	/*

	 * The current photo isn't loaded yet.  Set a short timer just to wait

	 * until the current photo is loaded.

	 */

	status = "Bild wird geladen...(" + current_location + " von " + photo_count + ").  Bitte warten..." ;

	clearTimeout(timer);

	timer = setTimeout('wait_for_current_photo()', 500);

	return 0;

    } else {

	status = "Bildershow ist gestartet...";

	preload_next_photo();

	reset_timer();

    }

}



function go_to_next_photo() {

    /* Go to the next location */

    current_location = next_location;



    /* Show the current photo */

    if (!show_current_photo()) {

	wait_for_current_photo();

	return 0;

    }



    preload_next_photo();

    reset_timer();

}



function preload_next_photo() {

    

    /* Calculate the new next location */

    next_location = (parseInt(current_location) + parseInt(direction));

    if (next_location > photo_count) {

	next_location = 1;

	if (!loop) {

	    stop();

	}

    }

    if (next_location == 0) {

        next_location = photo_count;

	if (!loop) {

	    stop();

	}

    }

    

    /* Preload the next photo */

    preload_photo(next_location);

}



function show_current_photo() {



    /*

     * If the current photo is not completely loaded don't display it.

     */

    if (!images[current_location] || !images[current_location].complete) {

	preload_photo(current_location);

	return 0;

    }

    

    /* transistion effects */

    if (browserCanBlend){

	var do_transition;

	if (current_transition == (transition_count)) {

	    do_transition = Math.floor(Math.random() * transition_count);

	} else {

	    do_transition = current_transition;

	}

	document.images.slide.style.filter=transitions[do_transition];

	document.images.slide.filters[0].Apply();

    }

    document.slide.src = images[current_location].src;

    setCaption(photo_captions[current_location]);

	photo_big_url = photo_big_urls[current_location];

    if (browserCanBlend) {

	document.images.slide.filters[0].Play();

    }



    return 1;

}



function preload_photo(index) {



    /* Load the next picture */

    if (pics_loaded < photo_count) {



	/* not all the pics are loaded.  Is the next one loaded? */

	if (!images[index]) {

	    images[index] = new Image;

	    images[index].onLoad = preload_complete();

	    images[index].src = photo_urls[index];

	    pics_loaded++;

	}

    } 

}



function setCaption(text) {

    changeElementText("caption", " " + text);

}
