/* Javascript-Funktionen die mit Flash zusammen hängen - die verwendet werden, falls Flash nicht funktioniert */

function Einblenden( DiaPic1, DiaPic2, intIndex ) {
	if ( !document.all ) {
		var Deckkraft = parseFloat(DiaPic2.style.opacity);
		var Maximal = 1.0;
		var SchrittWeite = Maximal / intSchritte;
		DiaPic2.style.opacity = Deckkraft + SchrittWeite;
	} else {
		var Deckkraft = DiaPic2.filters[0].opacity;
		var Maximal = 100;
		var SchrittWeite = Maximal / intSchritte;
		DiaPic2.filters[0].opacity += SchrittWeite;
	}
	if ( Deckkraft >= Maximal - SchrittWeite || strPlay == "stop" ) {
		clearInterval(Einblendung);
		Einblendung = null;
		if ( DiaPic1 != null ) {
			DiaPic1.src = DiaPic2.src;
			DiaPic1.style.display = "block";
		}
		if ( !isNaN(intIndex) ) {
			if ( intIndex < Pics.length - 1 ) {
				intIndex++;
			} else {
				intIndex = 0;
			}
			if ( strPlay == "endlos" ) {
				if ( DiaPic1 != null ) {
					DiaPic1Id = DiaPic1.getAttribute("id");
				} else {
					DiaPic1Id = null;
				}
				setTimeout( function callFunc() { Diashow( DiaPic1Id, DiaPic2.getAttribute("id"), intIndex); }, intAnzeigeDauer );
			}
		}
	}
}

function fnFlashGeladen() {
	FlashGeladen = false;
	if ( swfobject.getFlashPlayerVersion().major >= 8 ) {
		//var SinnPPFlash = swfobject.getObjectById("SinnPP");
		var SinnPPFlash = document.getElementById("SinnPP");
		if ( SinnPPFlash != null ) {
			try {
				var FlashPercentLoaded = SinnPPFlash.PercentLoaded();
				if ( !isNaN(FlashPercentLoaded) ) {
					if ( FlashPercentLoaded == 100 ) {
						throw true;
					}
				}
				throw false;
			} catch (FehlerVar) {
				if ( FehlerVar === true ) {
					FlashGeladen = true;
				}
			}
		}
	} else {
		FlashGeladen = true;
	}
}

function Bildbrowser_BildWechsel( BrowserPic ) {
	if ( Einblendung != null ) {
		clearInterval(Einblendung);
		Einblendung = null;
	}
	var Bilder = document.getElementById( "flashcontent1" ).getElementsByTagName("div");
	
	for ( y=0; y < Bilder.length; y++ ) {
		if ( Bilder[y].className == "BildbrowserPics" ) {
			Bilder[y].style.display = "none";
			Bilder[y].firstChild.style.display = "none";
		}
	}
	if ( !document.all ) {
		BrowserPic.style.opacity = "0.0";
	} else {
		BrowserPic.filters[0].opacity = 0;
	}
	BrowserPic.style.display = "block";
	BrowserPic.parentNode.style.display = "block";
	strPlay = "einmal";
	Einblendung = setInterval( function callFunc() { Einblenden(null, BrowserPic, "asd"); }, intIntervall );
}

/*
var ZoomInOut = null;
var intIntervallZoom = 15;
var intZoomSchritte = 50;

function Bildbrowser_Zoom() {
	var Breite1 = 300;
	var Breite2 = 375;
	var intZoomSchrittWeite = Math.floor((Breite2 - Breite1) / intZoomSchritte);
	if ( ZoomInOut != null ) {
		clearInterval(ZoomInOut);
		ZoomInOut = null;
	}
	var Bilder = document.getElementById( "flashcontent1" ).getElementsByTagName("div");
	for ( y=0; y < Bilder.length; y++ ) {
		if ( Bilder[y].className == "BildbrowserPics" && Bilder[y].style.display == "block" ) {
			var AktuellesBild = Bilder[y];
		}
	}
	var NeuesBild = document.getElementById(AktuellesBild.firstChild.getAttribute("id") + "_XL");
	
	NeuesBild.style.width = Breite1 + "px";
	ZoomInOut = setInterval( function callFunc() { Bildbrowser_ZoomIn(NeuesBild, Breite2, intZoomSchrittWeite); }, intIntervallZoom );
	
}

function Bildbrowser_ZoomIn( Bild, Breite2, intSchrittWeite ) {
	
	var BildBreite = parseInt(Bild.style.width);
	if ( BildBreite + intSchrittWeite <= Breite2 ) {
		Bild.style.width = BildBreite + intSchrittWeite + "px";
	} else {
		clearInterval(ZoomInOut);
		ZoomInOut = null;
		Bild.style.width = Breite2 + "px";
	}
}
*/


