//============Laden der Navi-Grafiken==============
Normal1 = new Image();
Normal1.src = "pics/navi_11.png";
Highlight1 = new Image();
Highlight1.src = "pics/navi_11s.png";

Normal2 = new Image();
Normal2.src = "pics/navi_12.png";
Highlight2 = new Image();
Highlight2.src = "pics/navi_12s.png";

Normal3 = new Image();
Normal3.src = "pics/navi_13.png";
Highlight3 = new Image();
Highlight3.src = "pics/navi_13s.png";

Normal4 = new Image();
Normal4.src = "pics/navi_14.png";
Highlight4 = new Image();
Highlight4.src = "pics/navi_14s.png";

Normal5 = new Image();
Normal5.src = "pics/navi_15.png";
Highlight5 = new Image();
Highlight5.src = "pics/navi_15s.png";

Normal6 = new Image();
Normal6.src = "pics/navi_16.png";
Highlight6 = new Image();
Highlight6.src = "pics/navi_16s.png";

Normal7 = new Image();
Normal7.src = "pics/navi_17.png";
Highlight7 = new Image();
Highlight7.src = "pics/navi_17s.png";

Normal8 = new Image();
Normal8.src = "pics/navi_18.png";
Highlight8 = new Image();
Highlight8.src = "pics/navi_18s.png";

Normal9 = new Image();
Normal9.src = "pics/navi_19.png";
Highlight9 = new Image();
Highlight9.src = "pics/navi_19s.png";

Normal10 = new Image();
Normal10.src = "pics/navi_20.png";
Highlight10 = new Image();
Highlight10.src = "pics/navi_20s.png";

/* ========================================================= */
Normal11 = new Image();                         /* Linke Patschi-Hand */
Normal11.src = "pics/h_orange_l.png";
Highlight11 = new Image();
Highlight11.src = "pics/h_orange_lh.png";

Normal12 = new Image();                         /* Rechts Patschi-Hand */
Normal12.src = "pics/h_orange_r.png";
Highlight12 = new Image();
Highlight12.src = "pics/h_orange_rh.png";


//===========Navi-Grafiken beim Hovern austauschen========================
function p_swap (picno, pic) {
  window.document.images[picno].src = pic.src;
}
//========================Password-Seite laden============================
function loadpage()
{
    document.location.href="ergo-in-team/" + document.passwort.pswd.value + ".html"
}
function goForit()
{
	var pass  = document.testform.inputbox.value;
	var seite = pass + '.html';
	fetch(seite);
	window.top.close();
}
function fetch(seite)
{
	if (opener.closed)
	{
		var root = window.open('','root','toolbar=yes,location=yes,status=yes,menubar=yes');
		root.location.href = seite;
	}
	else
		opener.location.href = seite;
}
/* Dieser Programmteil steuert zwei Hand-Grafiken  */

var endeLinks = 90;        /* bezogen auf die "top"-Position (left ist fix)*/
var endeRechts = 60;        /* bezogen auf die "top"-Position (left ist fix)
Die Endpositionen müssen um die halbe Schrittweite versetzt sein, sonst gibt es Stolperer*/
var pausenzyklus = 10;             /* Pausenzeit beim Timeout */
var Schrittweite = 2*(endeLinks - endeRechts);
var Schrittzahl = 15;
var startLinks = endeLinks + Schrittweite * Schrittzahl;
var startRechts = endeRechts + Schrittweite * Schrittzahl + Schrittweite;
//Animation für linke Hand Linke Hand fängt an!==================================
function lieslinks() {
    if (document.all) {                             /* Check für IE */
        return document.all.linkeHand.style.posTop;       /* IE übergibt sofort Integer - Ist das wahr?*/
    } else if (document.getElementById) {           /* Check für Mozilla */
        return parseInt(                             /* Wert wird als String übergeben und muss zum Integer gewandelt werden. */
        document.getElementById("linkeHand").style.top);     /* Wenn die Koordinaten nicht eingelesen werden, sind Browser und Javascript nicht syncronisiert! */
    }
}
function setzelinks(n) {
    if (document.all) {
      document.all.linkeHand.style.posTop = n;
    } else if (document.getElementById) {
      document.getElementById("linkeHand").style.top = n + "px";
    }
}
function initLinks() {
    if (document.getElementById) {
    //Wenn moderner Browser
    setzelinks(startLinks);
    }
    //Animation starten
    animateLinks();
}
function animateLinks() {
    if (lieslinks() < endeLinks) {                  /* Endposition linke Hand prüfen*/
        setzelinks(endeLinks);
        p_swap(3, Normal12);                        /* ganz zum Schluss recht Hand auf normal setzen! */
    }
    if (lieslinks() > startLinks - Schrittweite) {
        setzelinks(lieslinks() - 1);
        setTimeout("animateLinks()", pausenzyklus);
    }
    else {
        p_swap(2, Highlight11)        /* linke Hand austauschen */
        p_swap(3, Normal12)        /* rechte Hand austauschen */
        startRechts = startRechts - Schrittweite;
        initRechts();
    }
}
//===============Animation für rechte Hand========================
function liesrechts() {
    if (document.all) {                             /* Check für IE */
        return document.all.rechteHand.style.posTop;       /* IE übergibt sofort Integer - Ist das wahr?*/
    }   else if (document.getElementById) {           /* Check für Mozilla */
        return parseInt(                             /* Wert wird als String übergeben und muss zum Integer gewandelt werden. */
        document.getElementById("rechteHand").style.top);     /* Wenn die Koordinaten nicht eingelesen werden, sind Browser und Javascript nicht synchronisiert! */
    }
}
function setzerechts(n) {
    if (document.all) {
        document.all.rechteHand.style.posTop = n;
    }   else if (document.getElementById) {
        document.getElementById("rechteHand").style.top = n + "px";
    }
}
function initRechts() {
    if (document.getElementById) {
        //Wenn moderner Browser
        setzerechts(startRechts);
    }
        //Animation starten
        animateRechts();
}
function animateRechts() {
    if (liesrechts() < endeRechts) {                        /* Endposition rechte Hand */
        setzerechts(endeRechts);
   }
    if (liesrechts() > startRechts - Schrittweite) {
        setzerechts(liesrechts() - 1);
        setTimeout("animateRechts()", pausenzyklus);
   }
   else {
        p_swap(2, Normal11)        /* linke Hand austauschen */
        p_swap(3, Highlight12)        /* rechte Hand austauschen */
        startLinks = startLinks - Schrittweite;
        initLinks();
   }
}
/* ===========Ende Patschihändchen========================= */
