if(typeof(topPix)=='undefined') topPix=[];

var topI1=rand(topPix.length);
var topI2=topI1; while(topI2 == topI1) topI2=rand(topPix.length);
var topI3=topI1; while(topI3 == topI1 || topI3 == topI2) topI3=rand(topPix.length);

var pic1=new Image(); pic1.src='images/drawings/'+topPix[topI1]+'.jpg';
var pic2=new Image(); pic2.src='images/drawings/'+topPix[topI2]+'.jpg';
var pic3=new Image(); pic3.src='images/drawings/'+topPix[topI3]+'.jpg';

window.onload=function()
 {
  var o1=document.getElementById('menu'); if(!o1) return;
  var o2=o1.rows.item(0); 
  for(var i=0;i<o2.cells.length;i++)
  { o2.cells.item(i).onmouseover=hover; o2.cells.item(i).onmouseout=hout;}
  showTopImages();
 };
function hover()
{
 this.style.backgroundColor='#272727';
 var o=document.getElementById(this.id+'sub');
 if(o) o.style.visibility='visible';
}
function hout()
{
 this.style.backgroundColor='#272727';
 var o=document.getElementById(this.id+'sub');
 if(o) o.style.visibility='hidden';
}
function showTopImages()
{
 var o=document.getElementById('leftTopImage');
 if(o) o.src=pic1.src;
 o=document.getElementById('centerTopImage');
 if(o) o.src=pic2.src;
 o=document.getElementById('rightTopImage');
 if(o) o.src=pic3.src;
} 

function rand(n) { return Math.floor(n*(Math.random()-0.001));}


