// JavaScript Document
<!-- Begin HTML comment that hides the script ---------------------------------------------
function imgNavigate(szLocation, szRecKey) {
// Prior to navigating to the final page location, we need to use the szRecKey value to update
// the Clicks field in the tbladverts of Ironman database.  Either pass the value in a form field
// using a submit action (most likely how I will need to do it) or find an AJAX way to do it.

//	form.action = szLocation;
//	form.imageClick.value = szRecKey;
//	form.submit();


// Although the below line of code works, it will likely be replaced by a form action assignment
// and form submit.
	top.location.href = szLocation;
}
//-----------------------------------------------------------------------------------------
function strLoadOnClick(szLocation,szRecKey) {
	return "imgNavigate('" + szLocation + "'," + szRecKey + ");";
}
//-----------------------------------------------------------------------------------------
function imgLoadAds() {
	var intPositionCount = 1;
	for(i=1; i<7; i++) {
		imgElement = eval("document.adimage" + i);
		if (intPositionCount == i) {
			try {
				l = eval("position" + i + ".length");
				rnd_no = Math.floor(l*Math.random());
				imgsrc = eval("position" + i + "[rnd_no][0]");
				imglnk = eval("position" + i + "[rnd_no][1]");
				imgsze = eval("position" + i + "[rnd_no][2]");
				imgkey = eval("position" + i + "[rnd_no][3]");
				imgElement.height = (151 * imgsze) + (3 * (imgsze - 1));
				imgElement.src = imgsrc;
				imgElement.onclick = new Function(strLoadOnClick(imglnk,imgkey));
				intPositionCount = intPositionCount + imgsze;
				imgElement.style.display = 'block';
			}
			catch (e) {
				imgElement.style.display = 'none';
			}
		} else {
			imgElement.style.display = 'none';
		}
	}
	t = setTimeout("imgLoadAds()",10000);
}
//-----------------------------------------------------------------------------------------
function imgLoadLeftAds() {
// Left side ads only have one position (currently)
	imgElement = eval("document.leftadimage");
	l = leftads.length;
	rnd_no = Math.floor(l*Math.random());
	imgsrc = leftads[rnd_no][0];
	imglnk = leftads[rnd_no][1];
//	imgsze = leftads[rnd_no][2];
	imgkey = leftads[rnd_no][3];
// All images are the same size (currently)
//	imgElement.height = (151 * imgsze) + (3 * (imgsze - 1));
	imgElement.src = imgsrc;
	imgElement.onclick = new Function(strLoadOnClick(imglnk,imgkey));
	t = setTimeout("imgLoadLeftAds()",10000);
}
//-------------------------------------------------------------------- End HTML Comment --> 