function url(id, url){
  document.location=id+'-'+url+'.htm';
}

function url_admin(id){
  document.location='edit.php?id='+id;
}

function maus(id){
  id.style.cursor='pointer';
}

function popup(url, width, height) {
  if(width < 100)  width  = 100
  if(height < 100) height = 100
  var left = (screen.availWidth - width)   / 2;
  var top  = (screen.availHeight - height) / 2;
  fenster  = window.open(url, 'Bild', 'width='+width+',height='+height+',left='+left+',top='+top+',resizable=no,scrollbars=no,status=no,location=no');
  if(fenster){
    fenster.focus();
    return false;
  }
  else{
    return true;
  }
}

function Animation(){
  if(document.forms[0].manuell.checked == false){
    AnimationCounterUpdate();
    aktiv = window.setTimeout('Animation()', time);
  }
}
function AnimationVor(){
  direction = 'vor';
  AnimationStart();
}
function AnimationZurueck(){
  direction = 'zurueck';
  AnimationStart();
}
function AnimationWechsel(){
  if(document.getElementById('bild')){
    document.getElementById('bild').src    = b[i].src;
    document.getElementById('bild').width  = b[i].width;
    document.getElementById('bild').height = b[i].height;
    document.getElementById('bild').alt    = b[i].alt;
  }
  if(document.getElementById('text')){
    document.getElementById('text').firstChild.data = t[i];
  }
}
function AnimationStart(){
  window.clearTimeout(aktiv);
  if(document.forms[0].manuell.checked == false){
    Animation(time);
  }
  else{
    AnimationCounterUpdate();
  }
}
function AnimationTimeUpdate(timeNew){
  time = timeNew;
  if(document.forms[0].manuell.checked == false){
    AnimationStart();
  }
}
function AnimationCounterUpdate(){
  if (direction == 'vor'){
    i = i+1;
    if(i == b.length) i = 0;
  }
  else if (direction != 'vor'){
    i = i-1;
    if(i == -1){
      i = b.length-1;
    }
  }
  AnimationWechsel();
}

