function linksTabs ( vals , FName ) {
  this.vals = vals
  this.fire = FName
  this.write = tabs_write
// colours inactive
  this.cIB = 'gray'   // B = border
  this.cIC = 'silver' // cell
  this.cIT = 'gray'   // text
// colours active
  this.cAB = 'red'
  this.cAC = 'white'
  this.cAT = 'red'
// bg-colour body
  this.cBo = 'white'
// body margin / Probleme mit N4.7x
  this.bmT = 5 // top
  this.bmL = 0 // left
  this.bmR = 0 // right
// pixel
  this.pxB =  2 // 4 border
  this.pxL =  5 // b4 left tab
  this.pxT =  0 // text-height / < 1 := auto
  this.pxF = 35 // full-height / frameHight := +10    wg. N4.7x
// more ...
  this.lcA = '' // last cell attributes
  this.lcC = '' // ......... contents
  this.iPath = ''
}
function tabs_write ( d , isSel ) {
  var L = this.vals.length
  var N = 2 * L + 1
  var tC = this.pxF - this.bmT - 2 * this.pxB
  var tH = this.pxT > 0 ? this.pxT : ( tC - 2 * 3 )
  if ( tH < 1 ) tH = 50 // 50 = warning
  if ( isSel >= L ) isSel = - 1
  var img = '><img src="' + this.iPath + 'transp.gif" height="1" width="' + this.pxL + '" /></td>'
  var cL1 = this.pxL < 1 ? '' : ( '<td' + img )
  var cL3 = this.pxL < 1 ? '' : ( '<td bgcolor=' + this.cAB + img )
  var tr1 , tr3
  img = '><img src="' + this.iPath + 'transp.gif" height="' + this.pxB + '" width="' + this.pxB + '" /></td>'
  if ( isSel < 0 ) {
    tr1 = '<tr>' + cL1 + '<td colspan=' + N + ' bgcolor=' + this.cIB + img
    tr3 = '<tr>' + cL3 + '<td width="100%" colspan=' + ( N + 1 ) + ' bgcolor=' + this.cAB + img + '</tr>'
  }
  else {
    var li = isSel + isSel
    var re = N - li - 3
    tr1 = '<tr>' + cL1 +
          ( li < 1 ? '' : ( '<td colspan=' + li + ' bgcolor=' + this.cIB + img ) ) +
          ( '<td colspan=3 bgcolor=' + this.cAB + img ) +
          ( re < 1 ? '' : ( '<td colspan=' + re + ' bgcolor=' + this.cIB + img ) )
    li++
    re  +=2
    tr3 = '<tr>' + cL3 +
          ( '<td colspan=' + li + ' bgcolor=' + this.cAB + img ) +
          ( '<td bgcolor=' + this.cAC + img ) +
          ( '<td colspan=' + re + ' bgcolor=' + this.cAB + img )
  }
  tr1 += '<td width="100%"' + img + '</tr>'
  var hr1 = '<a href="javascript:' + this.fire + '('
  var hr2 = ')" style="color:' + this.cIT + '; text-decoration:none;">'
  d.open ()
  d.writeln ( '<html><head>' )
  d.writeln ( '</head><body style="margin-top:' +  this.bmT + '; margin-left:' +  this.bmL +
              '; margin-right:' +  this.bmR + '; color:' +  this.cAT +
              ( (this.cBo) ? ( '; background-color:' + this.cBo ) : '' ) + ';">' )
  d.writeln ( '<table cellspacing=0 cellpadding=0 border=0 width="100%">' )
  d.writeln ( tr1 )
  d.writeln ( '<tr>' + cL1 + '<td height=' + tC + ' bgcolor=' + ( isSel == 0 ? this.cAB : this.cIB ) + img )
  for ( var i = 0 ; i < L ; i++ ) {
    var SEL = ( i == isSel )
    d.writeln ( '<td style="font-size:' + tH + 'px; background-color:' + ( SEL ? this.cAC : this.cIC ) + '">' +
                ( SEL ? '' : ( hr1 + i + hr2 ) ) +
                '&nbsp;' + this.vals [i] + '&nbsp;' + ( SEL ? '' : '</a>' ) + '</td>' )
    d.writeln ( '<td bgcolor=' + ( ( SEL || ( i == isSel - 1 ) ) ? this.cAB : this.cIB ) + img )
  }
  d.writeln ( '<td' + ( this.lcA ? ( ' ' + this.lcA ) : '' ) + '>' +
              ( this.lcC ? this.lcC : '&nbsp;' ) + '</td></tr>' )
  d.writeln ( tr3 )
  d.writeln ( '</table></body></html>' )
  d.close ()
}

