
var theLogos = new Array()
theLogos[0]  = 'images/loghi/logo_yoshimura.png'
theLogos[1]  = 'images/loghi/logo_acerbis.png'
theLogos[2]  = 'images/loghi/logo_agv.png'
theLogos[3]  = 'images/loghi/logo_airoh.png'
theLogos[4]  = 'images/loghi/logo_akrapovic.png'
theLogos[5]  = 'images/loghi/logo_arai.png'
theLogos[6]  = 'images/loghi/logo_ariete.png'
theLogos[7]  = 'images/loghi/logo_arrow.png'
theLogos[8]  = 'images/loghi/logo_astar.png'
theLogos[9]  = 'images/loghi/logo_avon.png'
theLogos[10] = 'images/loghi/logo_barracuda.png'
theLogos[11] = 'images/loghi/logo_bc.png'
theLogos[12] = 'images/loghi/logo_bitubo.png'
theLogos[13] = 'images/loghi/logo_bmc.png'
theLogos[14] = 'images/loghi/logo_bosch.png'
theLogos[15] = 'images/loghi/logo_braking.png'
theLogos[16] = 'images/loghi/logo_brembo.png'
theLogos[17] = 'images/loghi/logo_bridgestone.png'
theLogos[18] = 'images/loghi/logo_buff.png'
theLogos[19] = 'images/loghi/logo_carbonelorraine.png'
theLogos[20] = 'images/loghi/logo_castrol.png'
theLogos[21] = 'images/loghi/logo_champion.png'
theLogos[22] = 'images/loghi/logo_dainese.png'
theLogos[23] = 'images/loghi/logo_ducati.png'
theLogos[24] = 'images/loghi/logo_dunlop.png'
theLogos[25] = 'images/loghi/logo_dynojet.png'
theLogos[26] = 'images/loghi/logo_euroracing.png'
theLogos[27] = 'images/loghi/logo_givi.png'
theLogos[28] = 'images/loghi/logo_hebo.png'
theLogos[29] = 'images/loghi/logo_hiflofiltro.png'
theLogos[30] = 'images/loghi/logo_honda.png'
theLogos[31] = 'images/loghi/logo_kawasaki.png'
theLogos[32] = 'images/loghi/logo_ktm.png'
theLogos[33] = 'images/loghi/logo_laser.png'
theLogos[34] = 'images/loghi/logo_leovinci.png'
theLogos[35] = 'images/loghi/logo_lightech.png'
theLogos[36] = 'images/loghi/logo_lucas-oil.png'
theLogos[37] = 'images/loghi/logo_lucas.png'
theLogos[38] = 'images/loghi/logo_malossi.png'
theLogos[39] = 'images/loghi/logo_marzocchi.png'
theLogos[40] = 'images/loghi/logo_michelin.png'
theLogos[41] = 'images/loghi/logo_motacc.png'
theLogos[42] = 'images/loghi/logo_motorex.png'
theLogos[43] = 'images/loghi/logo_motul.png'
theLogos[44] = 'images/loghi/logo_ngk.png'
theLogos[45] = 'images/loghi/logo_pirelli.png'
theLogos[46] = 'images/loghi/logo_polini.png'
theLogos[47] = 'images/loghi/logo_progrip.png'
theLogos[48] = 'images/loghi/logo_rapidbike.png'
theLogos[49] = 'images/loghi/logo_richa.png'
theLogos[50] = 'images/loghi/logo_rizoma.png'
theLogos[51] = 'images/loghi/logo_rk.png'
theLogos[52] = 'images/loghi/logo_sb.png'
theLogos[53] = 'images/loghi/logo_scorpion.png'
theLogos[54] = 'images/loghi/logo_shark.png'
theLogos[55] = 'images/loghi/logo_shoei.png'
theLogos[56] = 'images/loghi/logo_sprint.png'
theLogos[57] = 'images/loghi/logo_suzuki.png'
theLogos[58] = 'images/loghi/logo_tcx.png'
theLogos[59] = 'images/loghi/logo_tucano.png'
theLogos[60] = 'images/loghi/logo_winxxgrip.png'
theLogos[61] = 'images/loghi/logo_wp.png'
theLogos[62] = 'images/loghi/logo_yamaha.png'
theLogos[63] = 'images/loghi/logo_yokohama.png'

var theImages = new Array()
theImages[0]  = 'images/folies/folies00b.jpg'
theImages[1]  = 'images/folies/folies01b.jpg'
theImages[2]  = 'images/folies/folies02b.jpg'
theImages[3]  = 'images/folies/folies03b.jpg'
theImages[4]  = 'images/folies/folies04b.jpg'
theImages[5]  = 'images/folies/folies05b.jpg'
theImages[6]  = 'images/folies/folies06b.jpg'
theImages[7]  = 'images/folies/folies07b.jpg'
theImages[8]  = 'images/folies/folies08b.jpg'
theImages[9]  = 'images/folies/folies09b.jpg'
theImages[10] = 'images/folies/folies10b.jpg'
theImages[11] = 'images/folies/folies11b.jpg'
theImages[12] = 'images/folies/folies12b.jpg'
theImages[13] = 'images/folies/folies13b.jpg'

var n = 8
var p = theLogos.length;
var q = theImages.length;

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

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

var whichImage = Math.round(Math.random()*(q-1))

var whichLogo = new Array()
whichLogo[0] = Math.round(Math.random()*(p-1))
for (i = 1; i < n; i++){
   if (whichLogo[i-1] + 1 < p) {
      whichLogo[i] = whichLogo[i-1] + 1;
   }
   else {
      whichLogo[i] = 0;
   }
}

function showLogos(){
document.write('<img src="'+theLogos[whichLogo[0]]+'" width="100" alt=""></img><br/>');
document.write('<img src="'+theLogos[whichLogo[1]]+'" width="100" alt=""></img><br/>');
document.write('<img src="'+theLogos[whichLogo[2]]+'" width="100" alt=""></img><br/>');
document.write('<img src="'+theLogos[whichLogo[3]]+'" width="100" alt=""></img><br/>');
document.write('<img src="'+theLogos[whichLogo[4]]+'" width="100" alt=""></img><br/>');
document.write('<img src="'+theLogos[whichLogo[5]]+'" width="100" alt=""></img><br/>');
document.write('<img src="'+theLogos[whichLogo[6]]+'" width="100" alt=""></img><br/>');
document.write('<img src="'+theLogos[whichLogo[7]]+'" width="100" alt=""></img><br/>');
}

function showImage(){
document.write('<img src="'+theImages[whichImage]+'" width="280"></img>');
}


