
var sections = new Array();
sections[0] = "<a href='http://www.athenasoftware.net' target=_blank><IMG BORDER=0 SRC=http://www.alliance1.org/value/Athena.gif ALT='Athena Software'></a>";
sections[1] = "<a href='http://www.ccsfundraising.com' target=_blank><IMG BORDER=0 SRC=http://www.alliance1.org/value/CCS_AllianceBannerAd.gif ALT='CCS Fund Raising'></a>";
sections[2] = "<a href='http://www.credibleinc.com' target=_blank><IMG BORDER=0 SRC=http://www.alliance1.org/value/cred-ad.jpg ALT='Credible Behavioral Healthcare Software'></a>";
sections[3] = "<a href='http://www.sceris.com' target=_blank><IMG BORDER=0 SRC=http://www.alliance1.org/value/ScerIS.gif ALT='ScerIS Document Management Services'></a>";
sections[4] = "<a href='http://www.mutualofamerica.com' target=_blank><IMG BORDER=0 SRC=http://www.alliance1.org/value/mutual180x200.gif ALT='Mutual of America'></a>";
sections[5] = "<a href='http://www.esteam.net' target=_blank><IMG BORDER=0 SRC=http://www.alliance1.org/value/esteam.gif ALT='esteam - Deliver Operational Excellence'></a>";
sections[6] = "<a href='http://www.echoman.com' target=_blank><IMG BORDER=0 SRC=http://www.alliance1.org/value/echogroup.gif ALT='The Echo Group'></a>";
sections[7] = "<a href='http://www.bbinslv.com' target=_blank><IMG BORDER=0 SRC=http://www.alliance1.org/value/brown180x200.gif ALT='Brown and Brown'></a>";
sections[8] = "<a href='http://www.kaleidacare.com' target=_blank><IMG BORDER=0 SRC=http://www.alliance1.org/value/kaleidacare.jpg ALT='KaleidaCare'></a>";
sections[9] = "<a href='http://www.CARF.org' target=_blank><IMG BORDER=0 SRC=http://www.alliance1.org/value/logos/CARF.jpg ALT='Commission on Accreditation of Rehabilitation Facilities'></a>";
sections[10] = "<a href='http://www.firststepfasttrac.org' target=_blank><IMG BORDER=0 SRC=http://www.alliance1.org/value/logos/FSF.gif ALT='First Step Fund'></a>";
sections[11] = "<a href='http://www.growingtransitions.com' target=_blank><IMG BORDER=0 SRC=http://www.alliance1.org/value/logos/growingtransitions.jpg ALT='Growing Transitions'></a>";
sections[12] = "<a href='http://www.hillside.com' target=_blank><IMG BORDER=0 SRC=http://www.alliance1.org/value/logos/hillside.jpg ALT='Hillside'></a>";
sections[13] = "<a href='http://www.youthvillages.org' target=_blank><IMG BORDER=0 SRC=http://www.alliance1.org/value/logos/youthvillages.gif ALT='Youth Villages'></a>";
sections[14] = "<a href='http://www.defran.com' target=_blank><IMG BORDER=0 SRC=http://www.alliance1.org/value/dfran.gif ALT='Defran Systems'></a>";
sections[15] = "<a href='http://www.charpp.org' target=_blank><IMG BORDER=0 SRC=http://www.alliance1.org/value/logos/CHARPP.gif ALT='CHARPP'></a>";
sections[16] = "<a href='http://www.essentiallearning.com' target=_blank><IMG BORDER=0 SRC=http://www.alliance1.org/value/logos/EL_web.gif ALT='Essential Learning'></a>";
sections[17] = "<a href='http://www.sosoft.com' target=_blank><IMG BORDER=0 SRC=http://www.alliance1.org/value/logos/sos.gif ALT='Synergistic Office Solutions'></a>";
sections[18] = "<a href='http://www.welligent.com' target=_blank><IMG BORDER=0 SRC=http://www.alliance1.org/value/logos/Welligent.gif ALT='Intelligent Software Solutions'></a>";

/**
	Returns an integer value between minValue and maxValue.
*/
function getRandomInRange(minValue, maxValue)
{
	return Math.floor((Math.random() * maxValue) + minValue);
}

/**
	Creates a $ConferenceAds array with $limit items from $sections.
	
	@param	limit		An integer specifying how many images to retrieve
*/
function getConferenceAds(limit)
{
	var ConferenceAds = new Array();
	var usedNumbers = new Array();
	var currentNumber;
	
	mainLoop:
	while (ConferenceAds.length < limit)
	{
		currentNumber = getRandomInRange(0, sections.length);
		
		// if the chosen number has already been used, try again
		for (i = 0; i < usedNumbers.length; i++)
		{
			if (currentNumber == usedNumbers[i])
			{
				continue mainLoop;
			}
		}
		
		// if execution has gotten to this point, our currentNumber is unique
		/*
			Note that usedNumbers.length will always be the index at which we
			want to insert our next value! If usedNumbers is empty,
			usedNumbers.length is 0. This means we can use it in place of a
			counter variable.
		*/
		ConferenceAds[usedNumbers.length] = sections[currentNumber];
		usedNumbers[usedNumbers.length] = currentNumber;
	}
	
	// now that ConferenceAds.length == limit, we can just return ConferenceAds all filled
	return ConferenceAds;
}
