var activePicture = 1;
var interval;
var anzahl = 1;

function init() {
  for( var i=2; i<=anzahl; i++ )   {
     $('#kopf'+i).hide();
  }
  interval = setInterval("nextPicture()",6000);
}

function nextPicture()   {
  if ( activePicture >= anzahl )   {
    fadePicture( 1 );
  } else {
    fadePicture( activePicture+1 );
  }
}

function fadePicture( number )   {
  if ( number != activePicture )   {
    $('#kopf'+activePicture).fadeOut('slow');
    $('#kopf'+number).fadeIn('slow');
    activePicture = number;
  }
}
