// This script and many more are available free online at
// The JavaScript Source!! http://javascript.internet.com

// Set up the image files to be used.
var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.
theImages[0] = 'images/fruit1.jpg'
theImages[1] = 'images/fruit2.jpg'
theImages[2] = 'images/fruit3.jpg'
theImages[3] = 'images/fruit4.jpg'
theImages[4] = 'images/fruit5.jpg'
theImages[5] = 'images/fruit6.jpg'
theImages[6] = 'images/fruit7.jpg'
theImages[7] = 'images/fruit8.jpg'
theImages[8] = 'images/fruit9.jpg'
theImages[9] = 'images/fruit10.jpg'
theImages[10] = 'images/fruit11.jpg'
theImages[11] = 'images/fruit12.jpg'
theImages[12] = 'images/fruit13.jpg'
theImages[13] = 'images/fruit14.jpg'
theImages[14] = 'images/fruit15.jpg'
theImages[15] = 'images/fruit16.jpg'

// do not edit anything below this line
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="0" alt="you win!" />');
}

function windowopen(popurl){
  winpops=window.open( popurl,'project','scrollbars=yes,resizable=yes,width=500,height=400' )
}

function enlarge(imagename,width,height) {
  var left = parseInt((screen.availWidth/2) - (width/2));
  var top = parseInt((screen.availHeight/2) - (height/2));
  var windowFeatures = "width=" + width + ",height=" + height + ",status=no,resizable=no,left=" + left + ",top=" + top + ",screenX=" + left + ",screenY=" + top;
  var popurl =  escape(imagename);
  winpops=window.open( popurl, 'enlarged', windowFeatures );
}
