// JavaScript Document

<!-- Original:  Nicholas Lupien (smylex@aol.com) -->
var rand1 = 0;
var useRand = 0;

images = new Array;
images[1] = new Image();
images[1].src = "../images/capitalFarmCredit.jpg";

imgURL = new Array;
imgURL[1] = new String;
imgURL[1].href = 'http://www.capitalfarmcredit.com';

images[2] = new Image();
images[2].src = "../images/texasAg.jpg";

imgURL[2] = new String();
imgURL[2].href = 'http://www.texasagfinance.com';

function swapPic() {
	imgnum = images.length - 1;
	
	do {
		randnum = Math.random();
		rand1 = Math.round((imgnum - 1) * randnum) + 1;
		}
	while (rand1 == useRand);
	
	useRand = rand1;
	document.randimg.src = images[useRand].src;
	document.getElementById('randLink').href = imgURL[useRand].href;
}
