/* Javascripts for http://www.frank-waldecker.de made by Uli T.C. exept see comments inside */
function FWurl(fwurl,theID) {
var BGColor = document.getElementById('colorcache').value;
///alert(fwurl+'-'+theID);
if (BGColor != 0) {
    ziel = fwurl;
    if (BGColor != 'w') {
    document.getElementById(theID).href = ziel+'?'+BGColor;
    document.location.href =(ziel+'?'+BGColor);
    }
}
}
/**********************************************/
/* Original:  Eddie Traversa (psych3@primus.com.au) -->
<!-- Web Site:  http://nirvana.media3.net --> */
function verScroll(dir, spd, loop) {
loop = true;
direction = "up";
speed = 10;
scrolltimer = null;
if (document.layers) {
var page = eval(document.contentLayer);
}
else {
if (document.getElementById) {
var page= eval("document.getElementById('contentLayer').style");
}
else {
if (document.all) {
var page = eval(document.all.contentLayer.style);
      }
   }
}
direction = dir;

speed = parseInt(spd);
var y_pos = parseInt(page.top);
if (loop == true) {
    if (direction == "dn") {
        if  (y_pos >  stop) {
        page.top = (y_pos - (speed));
         if (y_pos <  stop) { stopScroll(); } // T.C.
         else {scrolltimer = setTimeout("verScroll(direction,speed)", 1);  }
         }
    } // T.C.
    else {
    if (direction == "up" && y_pos < 10) {
    if  (y_pos <  -30) {
    page.top = (y_pos + (speed));
    scrolltimer = setTimeout("verScroll(direction,speed)", 1);
    }
    }
    else {
    if (direction == "top") {
    page.top = 10;
    scrolltimer = setTimeout("verScroll(direction,speed)", 1);
      }
   }
}
   }
}
/**********************************************/
function stopScroll() {
loop = false;
clearTimeout(scrolltimer);
}
/**********************************************/
window.status = document.title;
/**********************************************/
function imgCount(aktuell) {
if (aktuell < 10) aktuell = '0' + aktuell;
Anzahl =  imgLname.length;
//alert (imgLname.length +' - '+imgRname.length);
(document.getElementById('imginfo').firstChild.data = '' + aktuell + '/' + Anzahl);
}
/**********************************************/
function ChangeImg(BildNr) {

var thumbdir = "thumb";
var Anzahl =  imgLname.length;
 document.getElementById('imgleft').src = '../img/nix.gif';
 document.getElementById('imgright').src = '../img/nix.gif';

//document.getElementById('stage').style.display = 'none';
document.getElementById('stage').style.visibility = 'hidden';

document.getElementById('imgleft').style.visibility = 'hidden';
document.getElementById('imgright').style.visibility = 'hidden';

document.getElementById('imgleft').style.display = 'none';
document.getElementById('imgright').style.display = 'none';

if (imgRname[BildNr] == '') {
    document.getElementById('imgright').src = '../img/nix.gif';
   // document.getElementById('imgright').style.display = 'none';
    }
else { //if (imgRname[BildNr] != '')
     document.getElementById('imgright').src = '' + imgRname[BildNr]+ '';
     }

document.getElementById('cache').value = BildNr;
document.getElementById('imgleft').src = '' + imgLname[BildNr]+ '';

window.setTimeout("document.getElementById('imgleft').style.display = 'inline'", 40);
window.setTimeout("document.getElementById('imgright').style.display = 'inline'", 40);
window.setTimeout("document.getElementById('imgleft').style.visibility = 'visible'", 390);
window.setTimeout("document.getElementById('imgright').style.visibility = 'visible'", 390);

// window.setTimeout("document.getElementById('stage').style.display = 'inline'", 500);
window.setTimeout("document.getElementById('stage').style.visibility = 'visible'", 500);

var zahl = BildNr +1;

imgCount(zahl);
}/* ChangeImg end */
/**********************************************/
//Time delay between Slides in milliseconds
var delay = 4000;
var lock = false;
var run;
var ImgNum = 0; /** **/
/**********************************************/
function chgImg(direction) {
var ImgLength = imgLname.length - 1;
var ImgNum = Math.round(document.getElementById('cache').value);
//if (document.images) {
ImgNum = ImgNum + direction;
if (ImgNum > ImgLength) {
ImgNum = 0;
}
if (ImgNum < 0) {
ImgNum = ImgLength;
}
//alert (ImgNum);
ChangeImg(ImgNum);
   }
//}
/**********************************************/
function auto() {
if (lock == true) {
lock = false;
window.clearInterval(run);
}
else if (lock == false) {
lock = true;
chgImg(1);
run = setInterval("chgImg(1)", delay);
   }
}
/**********************************************/
function noslide() {
if (lock == true) {
window.clearInterval(run);
lock = false;
}
else if (lock == false) {
lock = false;
}
}
/**********************************************/
function ViewImg(BildNr) {
noslide();
ChangeImg(BildNr);
}
function PrevNext(direction) {
noslide();
chgImg(direction);
}
/**********************************************/
function ChangeSame(Farbe,ImgPath) {
Farbe = Farbe;
switch (Farbe) {
  case "b":
    Hintergrund = '#000000';
    header_tcOffset = 'right -101px';
    LogoOffset = '-100px';
    Schriftfarbe = '#FAFAFA';
    SchwarzOffset = '-80px';
       GrauOffset = '-60px';
     WeissOffset  = '-20px';
    KnopfbgPos = '-200px 0px';
    document.getElementById('colorcache').value = Farbe;
    break;
  case "g":
    Hintergrund = '#999999';
    header_tcOffset = 'right -50px';
    LogoOffset = '-50px';
    Schriftfarbe = '#F1F1F1';
    SchwarzOffset = '-100px';
       GrauOffset = '-40px';
     WeissOffset  = '-20px';
    KnopfbgPos = '-100px 0px';
    document.getElementById('colorcache').value = Farbe;
    break;
  case "w":
    Hintergrund = '#FFFFFF';
    header_tcOffset = 'right 0px';
    LogoOffset = '0px';
    Schriftfarbe = '#808080';
    SchwarzOffset = '-100px';
       GrauOffset = '-60px';
     WeissOffset  = '0px';
    KnopfbgPos = '0px 0px';
    document.getElementById('colorcache').value = Farbe;
    break;
  default:
    Hintergrund = '#FFFFFF';
    header_tcOffset = 'right 0px';
    LogoOffset = '0px';
    Schriftfarbe = '#808080';
    SchwarzOffset = '';
       GrauOffset = '';
     WeissOffset  = '';
    KnopfbgPos = '0px 0px';
    Infocolor = '#999999';
    document.getElementById('colorcache').value = 'w';
    break;
    }
var knopf = new Array('publications','contact','info','models','travelphotos','news','magazines','calendars','portfolio','lifestyle','men','travel');
y = 1; for (i=0;i<knopf.length;i++) {
document.getElementById(''+knopf[i]+'').style.background = 'url('+ImgPath+'img/'+knopf[i]+'.gif)';
document.getElementById(''+knopf[i]+'').style.backgroundPosition = KnopfbgPos;
y++;
//document.write ("<img src=\"../img/"+knopf[i]+".gif\" alt=\"\" border=\"0\">");
}
document.getElementById('tc').style.backgroundColor = Hintergrund;
document.getElementById('fw-logo').style.top = LogoOffset;
document.getElementById('header_tc').style.backgroundPosition = header_tcOffset;
document.getElementById('schwarz').style.top = SchwarzOffset;
document.getElementById('grau').style.top =  GrauOffset;
document.getElementById('weiss').style.top = WeissOffset;
 }
/**********************************************/

function ChangeColor(Farbe) {
Farbe = Farbe;
ImgPath = '../';
switch (Farbe) {
  case "b":
    SlideshowOffset = '-41px';
    Pfeil_LOffset = '-40px';
    Pfeil_ROffset = '-40px';
    Infocolor = '#FFFFFF';
    break;
  case "g":
    SlideshowOffset = '-21px';
    Pfeil_LOffset = '-20px';
    Pfeil_ROffset = '-20px';
    Infocolor = '#FFFFFF';
    break;
  case "w":
    SlideshowOffset = '-1px';      /* */
    Pfeil_LOffset = '1px';        /* */
    Pfeil_ROffset = '1px';        /* */
    Infocolor = '#999999';        /* */
    break;
  default:
    SlideshowOffset = '-1px';
    Pfeil_LOffset = '1px';
    Pfeil_ROffset = '1px';
    Infocolor = '#999999';
    break;
    }
document.getElementById('slideshow').style.top = SlideshowOffset;
document.getElementById('imginfo').style.color = Infocolor;
document.getElementById('pfeil_r').style.top = Pfeil_ROffset;
document.getElementById('pfeil_l').style.top = Pfeil_LOffset;
ChangeSame(Farbe,ImgPath);
 }
/**********************************************/
function TheColor(Farbe) {
ImgPath = './';
Farbe = Farbe;
switch (Farbe) {
  case "b":
    RioOffset = '-48px';
    break;
  case "g":
    RioOffset = '-24px';
    break;
  case "w":
    RioOffset = '0px';
    break;
  default:
    RioOffset = '0px';
    break;
    }
document.getElementById('rio').style.top = RioOffset;
ChangeSame(Farbe,ImgPath);
}
/**********************************************/
function CheckColor(woher) {
ImgPath = './';
 if (window.location.search != "") {
    var content = location.search.substring(1, location.search.length);
    switch (content) {
  case "b":
    ChangeColorCode = 'b';
    break;
  case "g":
    ChangeColorCode = 'g';
    break;
  case "w":
    ChangeColorCode = 'w';
    break;
  default:
    ChangeColorCode = 'w';
    break;
   }
   switch (woher) {
  case "idx":
    TheColor(ChangeColorCode);
    break;
  case "TC":
    ChangeColor(ChangeColorCode);
    break;
   case "info":
   ChangeSame(ChangeColorCode,ImgPath);
   break;
  //  default:
  //  document.getElementById('colorcache').value = ChangeColorCode;
  //  break;
   }
 }
}
/**********************************************/