// <![CDATA[
/* Script zur Flashsteuerung durch die Hauptnavigation
die Initialisierung erfolgt in styleswitcher.js

Die Funktion "findeFlash" stammt von Gernot Back http://aktuell.de.selfhtml.org/artikel/programmiertechnik/liveconnect/index.htm.

Die Funktion "tump" wurde von Johannes Natterer kopiert.

Subhash 2006 (www.subhash.at) */

function initNavig(navigId) {
	aufruf = initLinks(navigId);
	window.setTimeout("aufruf", 1000);
}

function initLinks(navigId) {

	var saxanimation = findeFlash('saxanimation');
	if(saxanimation) {
		if ((window.location.href.indexOf("index.html") != -1) || (window.location.href.indexOf(".html") == -1)) { /* fuer die Startseite */
			saxanimation.SetVariable("dieSeite", "start");
		}
		else { 																				 /* fuer die Folgeseiten */
			saxanimation.SetVariable("dieSeite", "folge");
		}
	
		var menuepunkt = document.getElementById(navigId);
		if (menuepunkt) {
			if ((window.location.href.indexOf("index.html") == -1) && (window.location.href.indexOf(".html") != -1)) { /* fuer die Folgeseiten */
				menuepunkt.onmouseover = function() {
					if (!saxanimation.IsPlaying() && (saxanimation.CurrentFrame() < 47)) {
						saxanimation.Play();
					}
				}
				menuepunkt.onmouseout = function() {
					if (!saxanimation.IsPlaying() && (saxanimation.CurrentFrame() == 47)) {
						saxanimation.Play();
					}
					else if (saxanimation.IsPlaying() && (saxanimation.CurrentFrame() < 47)) {
					// fadet gerade zur Zeichnung - fertig machen lassen
						window.setTimeout("saxanimation.Play();", 700);
					}
				}
			}
			else { 																				/* fuer die Startseite */
				menuepunkt.onmouseover = function() {
					if (!saxanimation.IsPlaying() && (saxanimation.CurrentFrame() < 15)) {
						saxanimation.Play();
					}
					else if (saxanimation.IsPlaying() && (saxanimation.CurrentFrame() > 16)) {
					// fadet gerade zum mouseout-Zustand (Foto) - fertig machen lassen
						window.setTimeout("saxanimation.Play();", 700);
					}
				}
				menuepunkt.onmouseout = function() {
					saxanimation.GotoFrame(19);
					saxanimation.Play();
				}
			}
		}
	}
	else {
	}
}

function findeFlash (flash) {
	if (document.all) {
		if (document.all[flash]) {
			return document.all[flash];
		}
		if (window.opera) {
			var movie = eval(window.document + flash);
			if (movie.SetVariable) {
				return movie;
			}
		}
		return;
	}
	if(document.layers) {
		if(document.embeds) {
			var movie = document.embeds[flash];
			if (movie.SetVariable) {
				return movie;
			}
		}
		return;
	}
	if (!document.getElementById) {
		return;
	}
	var movie = document.getElementById(flash);
	if (movie.SetVariable) {
		return movie;
	}
	var movies = movie.getElementsByTagName('embed');
	if (!movies || !movies.length) {
		return;
	}
	movie = movies[0];
	if (movie.SetVariable) {
		return movie;
	}
	return;
}

function tump(img, w, h) {
	window.open(img, 'zoom', 'toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height = ' + h);
}
// ]]>
