<!--
// The Central Randomizer 1.3 (C) 1997 by Paul Houle (houle@msc.cornell.edu)
// See:  http://www.msc.cornell.edu/~houle/javascript/randomizer.html
// See:  http://developer.irt.org/script/343.htm

rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd() {
        rnd.seed = (rnd.seed*9301+49297) % 233280;
        return rnd.seed/(233280.0);
};

function rand(number) {
        return Math.ceil(rnd()*number);
};

// end central randomizer. -->


	/**
	 * adbanner.js
	 * author: Chris Markiewicz
	 * date: January 12, 2002
	 * 
	 * Cycles through various images (configurable) at
	 * a configurable frequency.
	 */

	/**
	 * numberOfImages - the number of images in the cycle.
	 */
	var numberOfImages = 6;

	/**
	 * viewDurationMilliseconds - the number of milliseconds for
	 * which a given image should be shown.
	 * to determine the number of milliseconds, multiply the number
	 * of seconds by one thousand (1000).
	 * examples:
	 * 1 second = 1000 milliseconds
	 * 3 seconds = 3000 milliseconds
	 */
	var viewDurationMilliseconds = 10000;

	/**
	 * bannerImages - an array of image names.
	 * to populate the array, assign a string value
	 * to an indexed element of the array.
	 * remember that first element in array has an 
	 * index of 0 (zero).
	 *
	 * format: bannerImages[i].src = "pathhere";
	 * example: bannerImages[2].src = images/ourlogo.gif";
	 */
	var bannerImages = new Array(numberOfImages);
	for (var i=0; i<numberOfImages; i++) {
		bannerImages[i] = new Image();
	}
	bannerImages[0].src = "../banners/fmcflbannera.gif";
	bannerImages[1].src = "../banners/tibannera.gif";
	bannerImages[2].src = "../banners/ttibannera.gif";
	bannerImages[3].src = "../banners/whitmerea.gif";
	bannerImages[4].src = "../banners/ehrlichaniya.gif";
	bannerImages[5].src = "../banners/demandcsa.gif"

	
	

	/**
	 * bannerLinks - an array of links associated with
	 * the images in the bannerImages array.
	 * to populate the array, assign a string value
	 * to an indexed element of the array.
	 * remember that first element in array has an 
	 * index of 0 (zero).
	 *
	 * format: bannerLinks[i] = "pathhere";
	 * example: bannerLinks[2] = http://www.ourcompany.com";
	 */
	var bannerLinks = new Array(numberOfImages);
	bannerLinks[0] = "http://pestsolutions.fmc.com";
	bannerLinks[1] = "http://pestsolutions.fmc.com";
	bannerLinks[2] = "http://pestsolutions.fmc.com";
	bannerLinks[3] = "http://www.wmmg.com";
	bannerLinks[4] = "http://victorpest.com";
	bannerLinks[5] = "http://www.syngentaprofessionalproducts.com"
	

	var frame=rand(numberOfImages);
	var adjustedIndex = frame - 1;
	var adjustedLinkIndex = adjustedIndex;
	var timeout_id = null;

	function animate() {
		document.animation.src = bannerImages[adjustedIndex].src;
		adjustedLinkIndex = adjustedIndex;
		adjustedIndex = (adjustedIndex+1)%numberOfImages;
		timeout_id = setTimeout("animate()", viewDurationMilliseconds);
	}

	/**
	 * function sbmt()
	 * called when a user clicks on an image in the banner...
	 * opens a new browser and sets the location from the bannerLinks array...
	 */
	function sbmt() {
		window.open (bannerLinks[adjustedLinkIndex], 'newWin', 'scrollbars=yes,status=yes,menubar=yes,resizable=yes,directories=yes,location=yes,toolbar=yes')
		//location.href=bannerLinks[adjustedLinkIndex];
	}



