<!--
// Initialize body page
var m_intIntervalResult; // used to track ad image rotations
var m_intAdCntr = 0;

// How to use this script file
// ---------------------------
// (1) Add this to the HTML doc:
//
//<script language="JavaScript" src="scripts\initbody.js"></script>
//
// (2) Modify the body tag to include an "onLoad" piece
// 
//<body ... onLoad="InitializeBodyForm('images/bcimages/bc', 15, 2.5)" ...>
// Not that the parts in parentheses represent:
//   1. the relative folder path from this file to the images plus the file prefix (if any)
//   2. the number of pictures to cycle through (all must exist in sequence or you get an "x" picture
//   3. the delay in seconds
//
// (3) Add an image to the HTML document as a place-holder for these rotating images.  Give it a name of "slideshow".
//   This image should be named with a 000 number, such as gc000.jpg.
//
// (4) Set up the pictures in the above specified folder, with the specified prefix, and a three-digit extension.  This will let you cycle through 1000 images.  If you need more, let me know.
//   For example, use bc000.jpg, bc001.jpg, bc002.jpg, ...
//


function InitializeBodyForm(SectionName, LastImageNumber, DelayTime)
{
	ActiveAdTimer(DelayTime * 1000, SectionName, LastImageNumber);
}

function ActiveAdTimer(DelayTimeInMS, SectionName, LastImageNumber)
{
	var strRotationProcedure = "RotatePic('" + SectionName + "', " + LastImageNumber + ")";

	m_intIntervalResult = setInterval(strRotationProcedure, DelayTimeInMS);
}

function RotatePic(SectionName, LastImageNumber)
{/*
	if (m_intAdCntr == undefined || m_intAdCntr == "undefined")
	{
		m_intAdCntr = 0;
	}

	if (m_intAdCntr < 0)
	{
		SectionName = "undefined";
	}

	if (SectionName == undefined || SectionName == "undefined")
	{
		SectionName = "images\";
	}
	if (LastImageNumber == undefined || LastImageNumber == "undefined")
	{
		LastImageNumber = 1;
	}
*/
	m_intAdCntr++;
	var strAdCntr = new String("000" + m_intAdCntr);
	var intLength = strAdCntr.length;
	document.images['slideshow'].src = SectionName + strAdCntr.substring(intLength - 3, intLength) + ".jpg";

/*
// This section is for later use
	if (SectionName == "default_")
	{
		var strNewURL = "";

		switch (m_intAdCntr)
		{// later get this from the DB
			case 0:
			{
				document.images['bodyad'].alt = "San Diego 2 U";
				strNewURL = "www.sandiego2u.com";
				break;
			}
			case 1:
			{
				document.images['bodyad'].alt = "DOGOPOLY - The Game of High Steaks & Bones!";
				strNewURL = "www.dogopoly.com";
				break;
			}
			case 2:
			{
				document.images['bodyad'].alt = "Century 21 Doug Faber";
				strNewURL = "www.dougfaber.com";
				break;
			}
			case 3:
			{
				document.images['bodyad'].alt = "MJS Creations Design Services";
				strNewURL = "www.mjscreations.com";
				break;
			}
			default:
			{
				document.images['bodyad'].alt = "San Diego 2 U";
				strNewURL = "www.sandiego2u.com";
				break;
			}
		}
		document.links[0].href = "http://" + strNewURL;
	}
*/

	if (m_intAdCntr >= LastImageNumber)
	{
		m_intAdCntr = -1;
	}
}
//>
-->