tops = new Array(); // Њассив вариантов
tops[0] = new Array ();
tops[0][0] = new Array ('g-01', 'g-02');
tops[0][1] = new Array ('g-03');
tops[1] = new Array ();
tops[1][0] = new Array ('g-02', 'g-03');
tops[1][1] = new Array ('g-04');    
tops[2] = new Array ();
tops[2][0] = new Array ('g-03', 'g-04');
tops[2][1] = new Array ('g-05');
tops[3] = new Array ();
tops[3][0] = new Array ('g-04', 'g-05');
tops[3][1] = new Array ('g-06');
tops[4] = new Array ();
tops[4][0] = new Array ('g-05', 'g-06');
tops[4][1] = new Array ('g-07');
tops[5] = new Array ();
tops[5][0] = new Array ('g-06', 'g-07');
tops[5][1] = new Array ('g-01');
tops[6] = new Array ();
tops[6][0] = new Array ('g-07', 'g-01');
tops[6][1] = new Array ('g-02');

tps = new Array(); // ‘плошной массив вариантов

m = 0;
for (i=0; i<=5; i++) {
  for (j=0; j<=tops[i][0].length-1; j++) {
    for (k=0; k<=tops[i][1].length-1; k++) {
      tps[m] = tops[i][0][j];
      m++;
      tps[m] = tops[i][1][k];
      m++;
    }
  }
}

// Вывести число комбинаций
// document.write(tps.length/2);

function write_top() {
  i = Math.floor(Math.random()*(tps.length/2));
  if (tps[i*2].charAt(0) == 'g') {
  }
  ostr = '<a href="about.shtml"><img src=../pic/' + tps[i*2] + '.jpg border=0 height=300' + ' alt="фирма &#148;КОМПАН Марин&#148;"></a>';
  document.write(ostr);
}
