﻿/*----------------------------------------------------------------------------*/
function tAWechsel() {
  if (tAAnz > 1) {
    tA = tA + 1;
    if (tA == tAAnz) tA = 0;
    document.getElementById('tAWechselTitle').firstChild.nodeValue = tATitle[tA];
    document.getElementById("tAWechselFoto").src                   = tAFoto[tA].src;
    document.getElementById("tAWechselHrefFoto").setAttribute('href',   tALinkErmit[tA], 1);
    document.getElementById("tAWechselHrefFoto").setAttribute('target', tATarget[tA], 1);
    document.getElementById("tAWechselHrefTitle").setAttribute('href',   tALinkErmit[tA], 1);
    document.getElementById("tAWechselHrefTitle").setAttribute('target', tATarget[tA], 1);
    tAfade();
  }
}

function tAfade(step) {
  step = step || 0;

  document.getElementById("tAWechselFoto").style.opacity = step/100;
  document.getElementById("tAWechselFoto").style.filter  = "alpha(opacity=" + step + ")"; 

  step = step + 2;

  if (step <= 100) {
    window.setTimeout(function () { tAfade(step); }, 1);
  } 
  else {
    window.setTimeout("tAWechsel()", 10000);
  }
}




/*----------------------------------------------------------------------------*/
function tBWechsel() {
  if (tBAnz > 1) {
    tB = tB + 1;
    if (tB == tBAnz) tB = 0;
    document.getElementById('tBWechselTitle').firstChild.nodeValue = tBTitle[tB];
    document.getElementById("tBWechselFoto").src               = tBFoto[tB].src;
    document.getElementById("tBWechselHrefFoto").setAttribute('href',   tBLinkErmit[tB], 1);
    document.getElementById("tBWechselHrefFoto").setAttribute('target', tBTarget[tB], 1);
    document.getElementById("tBWechselHrefTitle").setAttribute('href',   tBLinkErmit[tB], 1);
    document.getElementById("tBWechselHrefTitle").setAttribute('target', tBTarget[tB], 1);
    tBfade();
  }
}

function tBfade(step) {
  step = step || 0;

  document.getElementById("tBWechselFoto").style.opacity = step/100;
  document.getElementById("tBWechselFoto").style.filter  = "alpha(opacity=" + step + ")"; 

  step = step + 2;

  if (step <= 100) {
    window.setTimeout(function () { tBfade(step); }, 1);
  } 
  else {
    window.setTimeout("tBWechsel()", 10000);
  }
}




/*----------------------------------------------------------------------------*/
function tCWechsel() {
  if (tCAnz > 1) {
    tC = tC + 1;
    if (tC == tCAnz) tC = 0;
    document.getElementById('tCWechselTitle').firstChild.nodeValue = tCTitle[tC];
    document.getElementById("tCWechselFoto").src               = tCFoto[tC].src;
    document.getElementById("tCWechselHrefFoto").setAttribute('href',   tCLinkErmit[tC], 1);
    document.getElementById("tCWechselHrefFoto").setAttribute('target', tCTarget[tC], 1);
    document.getElementById("tCWechselHrefTitle").setAttribute('href',   tCLinkErmit[tC], 1);
    document.getElementById("tCWechselHrefTitle").setAttribute('target', tCTarget[tC], 1);
    tCfade();
  }
}

function tCfade(step) {
  step = step || 0;

  document.getElementById("tCWechselFoto").style.opacity = step/100;
  document.getElementById("tCWechselFoto").style.filter  = "alpha(opacity=" + step + ")"; 

  step = step + 2;

  if (step <= 100) {
    window.setTimeout(function () { tCfade(step); }, 1);
  } 
  else {
    window.setTimeout("tCWechsel()", 10000);
  }
}




/*----------------------------------------------------------------------------*/
function tDWechsel() {
  if (tDAnz > 1) {
    tD = tD + 1;
    if (tD == tDAnz) tD = 0;
    document.getElementById('tDWechselTitle').firstChild.nodeValue = tDTitle[tD];
    document.getElementById("tDWechselFoto").src               = tDFoto[tD].src;
    document.getElementById("tDWechselHrefFoto").setAttribute('href',   tDLinkErmit[tD], 1);
    document.getElementById("tDWechselHrefFoto").setAttribute('target', tDTarget[tD], 1);
    document.getElementById("tDWechselHrefTitle").setAttribute('href',   tDLinkErmit[tD], 1);
    document.getElementById("tDWechselHrefTitle").setAttribute('target', tDTarget[tD], 1);
    tDfade();
  }
}

function tDfade(step) {
  step = step || 0;

  document.getElementById("tDWechselFoto").style.opacity = step/100;
  document.getElementById("tDWechselFoto").style.filter  = "alpha(opacity=" + step + ")"; 

  step = step + 2;

  if (step <= 100) {
    window.setTimeout(function () { tDfade(step); }, 1);
  } 
  else {
    window.setTimeout("tDWechsel()", 10000);
  }
}




/*----------------------------------------------------------------------------*/
function b1Wechsel() {
  if (b1Anz > 1) {
    b1 = b1 + 1;
    if (b1 == b1Anz) b1 = 0;
    document.getElementById("b1DsWechselTitleHref").firstChild.nodeValue   = b1Title[b1];
    document.getElementById("b1DsWechselTitleHref").setAttribute('href',     b1LinkErmit[b1], 1);
    document.getElementById("b1DsWechselTitleHref").setAttribute('target',   b1Target[b1], 1);

    document.getElementById("b1DsWechselFoto").src                         = b1Foto[b1].src;
    document.getElementById("b1DsWechselFotoHref").setAttribute('href',      b1LinkErmit[b1], 1);
    document.getElementById("b1DsWechselFotoHref").setAttribute('target',    b1Target[b1], 1);

    document.getElementById("b1DsWechselDatumAuthor").firstChild.nodeValue = b1DatumAuthor[b1];
    document.getElementById("b1DsWechselText").firstChild.nodeValue        = b1Text[b1];

    document.getElementById("b1DsWechselMoreHref").setAttribute('href',      b1LinkErmit[b1], 1);
    document.getElementById("b1DsWechselMoreHref").setAttribute('target',    b1Target[b1], 1);
    b1fade();
  }
}

function b1fade(step) {
  step = step || 0;

  document.getElementById("b1DsWechselFoto").style.opacity = step/100;
  document.getElementById("b1DsWechselFoto").style.filter  = "alpha(opacity=" + step + ")"; 

  step = step + 2;

  if (step <= 100) {
    window.setTimeout(function () { b1fade(step); }, 1);
  } 
  else {
    window.setTimeout("b1Wechsel()", 30000);
  }
}




/*----------------------------------------------------------------------------*/
function c1Wechsel() {
  if (c1Anz > 1) {
    c1 = c1 + 1;
    if (c1 == c1Anz) c1 = 0;
    document.getElementById("c1DsWechselTitleHref").firstChild.nodeValue   = c1Title[c1];
    document.getElementById("c1DsWechselTitleHref").setAttribute('href',     c1LinkErmit[c1], 1);
    document.getElementById("c1DsWechselTitleHref").setAttribute('target',   c1Target[c1], 1);

    document.getElementById("c1DsWechselFoto").src                         = c1Foto[c1].src;
    document.getElementById("c1DsWechselFotoHref").setAttribute('href',      c1LinkErmit[c1], 1);
    document.getElementById("c1DsWechselFotoHref").setAttribute('target',    c1Target[c1], 1);

    document.getElementById("c1DsWechselDatumAuthor").firstChild.nodeValue = c1DatumAuthor[c1];
    document.getElementById("c1DsWechselText").firstChild.nodeValue        = c1Text[c1];

    document.getElementById("c1DsWechselMoreHref").setAttribute('href',      c1LinkErmit[c1], 1);
    document.getElementById("c1DsWechselMoreHref").setAttribute('target',    c1Target[c1], 1);
    c1fade();
  }
}

function c1fade(step) {
  step = step || 0;

  document.getElementById("c1DsWechselFoto").style.opacity = step/100;
  document.getElementById("c1DsWechselFoto").style.filter  = "alpha(opacity=" + step + ")"; 

  step = step + 2;

  if (step <= 100) {
    window.setTimeout(function () { c1fade(step); }, 1);
  } 
  else {
    window.setTimeout("c1Wechsel()", 30000);
  }
}




/*----------------------------------------------------------------------------*/
function d1Wechsel() {
  if (d1Anz > 1) {
    d1 = d1 + 1;
    if (d1 == d1Anz) d1 = 0;
    document.getElementById("d1DsWechselTitleHref").firstChild.nodeValue   = d1Title[d1];
    document.getElementById("d1DsWechselTitleHref").setAttribute('href',     d1LinkErmit[d1], 1);
    document.getElementById("d1DsWechselTitleHref").setAttribute('target',   d1Target[d1], 1);

    document.getElementById("d1DsWechselFoto").src                         = d1Foto[d1].src;
    document.getElementById("d1DsWechselFotoHref").setAttribute('href',      d1LinkErmit[d1], 1);
    document.getElementById("d1DsWechselFotoHref").setAttribute('target',    d1Target[d1], 1);

    document.getElementById("d1DsWechselDatumAuthor").firstChild.nodeValue = d1DatumAuthor[d1];
    document.getElementById("d1DsWechselText").firstChild.nodeValue        = d1Text[d1];

    document.getElementById("d1DsWechselMoreHref").setAttribute('href',      d1LinkErmit[d1], 1);
    document.getElementById("d1DsWechselMoreHref").setAttribute('target',    d1Target[d1], 1);
    d1fade();
  }
}

function d1fade(step) {
  step = step || 0;

  document.getElementById("d1DsWechselFoto").style.opacity = step/100;
  document.getElementById("d1DsWechselFoto").style.filter  = "alpha(opacity=" + step + ")"; 

  step = step + 2;

  if (step <= 100) {
    window.setTimeout(function () { d1fade(step); }, 1);
  } 
  else {
    window.setTimeout("d1Wechsel()", 30000);
  }
}




/*--------------------------------------------------------------------------- */
function slWechsel() {
  if (slAnz >= 2) {
    sl = sl + 1;
    if (sl == slAnz) sl = 0;
    document.getElementById("slVollFoto").src = slFoto[sl].src;
    slfade();
  }
}

function slfade(step) {
  step = step || 0;

  document.getElementById("slVollFoto").style.opacity = step/100;
  document.getElementById("slVollFoto").style.filter  = "alpha(opacity=" + step + ")";

  step = step + 30;

  if (step <= 100) {
    window.setTimeout(function() { slfade(step); }, 1);
  } 
  else {
    window.setTimeout("slWechsel()", 5000);
  }
}

function klickWechsel(richtung) {
  if (richtung=="+") {
    sl = sl + 1;
    if (sl == slAnz) sl = 0;
  }
  else {
    sl = sl - 1;
    if (sl == -1) sl = slAnz - 1;
  }
  document.getElementById("slVollFoto").src = slFoto[sl].src;
}

function slTest() {
  if (sl_tuBam == 0 || sl_tuBam == 1) tuBam = 2; else tuBam = 1;
  location.href="?slStart="+escape(sl)+"&menu="+sl_menu+"&bai="+sl_bai+"&sE="+sl_sE+"&sF="+sl_sF+"&gA="+sl_gA+"&mn="+sl_mn+"&ba="+sl_ba+"&b1="+sl_b1+"&ca="+sl_ca+"&c1="+sl_c1+"&da="+sl_da+"&d1="+sl_d1+"&xx="+sl_xx+"&bg="+sl_bg+"&tuBam="+tuBam+"#leftDiv";
}




/*----------------------------------------------------------------------------*/
function groesseAendern() {
  document.getElementById("video").setAttribute('width',  '740px');
  document.getElementById("video").setAttribute('height', '480px');
}





