var theImages = new Array();

theImages[0] = 'images/frontpage/kielce.jpg';
theImages[1] = 'images/frontpage/krakowiak.jpg';
theImages[2] = 'images/frontpage/kujawiak.jpg';
theImages[3] = 'images/frontpage/mass.jpg';
theImages[4] = 'images/frontpage/opocno.jpg';
theImages[5] = 'images/frontpage/podhalanki.jpg';
theImages[6] = 'images/frontpage/polonezmazur.jpg';
theImages[7] = 'images/frontpage/slask.jpg';
theImages[8] = 'images/frontpage/Promo2009_01.jpg';
theImages[9] = 'images/frontpage/Promo2009_02.jpg';
theImages[10] = 'images/frontpage/Promo2009_03.jpg';

var j = 0;
var p = theImages.length;

var preBuffer = new Array();
for (i = 0; i < p; i++){
   preBuffer[i] = new Image();
   preBuffer[i].src = theImages[i];
}

var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
    document.write('<img src="'+theImages[whichImage]+'" border="3">');
}