var theImages = new Array();
var theURLs = new Array();

// To add more image files, continue with the
// pattern below, adding to the array.

theImages[0] = 'themes/blackcandy/images/banners/beef_banner_image.jpg';
theURLs[0] = 'products/dairy-beef-systems/';

theImages[1] = 'themes/blackcandy/images/banners/get_less_dry_matter.jpg';
theURLs[1] = 'home/';

theImages[2] = 'themes/blackcandy/images/banners/lifetime_of_value.jpg';
theURLs[2] = 'home/';

theImages[3] = 'themes/blackcandy/images/banners/slurrystore_banner_image.jpg';
theURLs[3] = 'products/slurrystore-systems/';

theImages[4] = 'themes/blackcandy/images/banners/swine_banner_image.jpg';
theURLs[4] = 'products/swine-systems/';

theImages[5] = 'themes/blackcandy/images/banners/total_package_banner_image.jpg';
theURLs[5] = 'benefits/';

theImages[6] = 'themes/blackcandy/images/banners/unloader_banner.jpg';
theURLs[6] = 'products/grain-unloaders-auger/';

theImages[7] = 'themes/blackcandy/images/banners/service_banner_image.jpg';
theURLs[7] = 'services/';

theImages[8] = 'themes/blackcandy/images/banners/15point_banner.jpg';
theURLs[8] = 'services/harvestore-15-point-inspection/';

theImages[9] = 'themes/blackcandy/images/banners/sand_separator_banner.jpg';
theURLs[9] = 'products/sand-manure-seperator/';

theImages[10] = 'themes/blackcandy/images/banners/XL_UNloader_ad_banner.jpg';
theURLs[10] = 'products/haylage-unloaders-chain/';

theImages[11] = 'themes/blackcandy/images/banners/header_biogas.jpg';
theURLs[11] = 'products/biogas-systems/';

// 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 prevImage = 'x';
	var whichImage = 'x';
	function showImage(){
		while (whichImage==prevImage) {
		      whichImage = Math.round(Math.random()*(p));
		}
		prevImage=whichImage;
		document.write('<a href="' + theURLs[whichImage] + '" target="new"><img src="'+theImages[whichImage]+'" border="0"></a>');
	}
