/****
* Banner Ad Rotater v3.02
* Modified by Bax - so that begin banner display at random number banner, then proceed sequentially (alphabetically 
* through banners.
*
* Original Author: Anarchos > anarchos3@hotmail.com > http://anarchos.xs.mw/bannerad.phtml
* Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
**/

function fill_in_banners(){
// Parameters:  myAd.Ad(image source file, web site URL, target, mouseover text) 
// Bax:  place ads in alphabetical order
myAd.Ad( "chairman_circle_logos/cc_ac_white.jpg", "http://www.acwhite.com/", "blank", "A.C. WHITE RELOCATIONS");
myAd.Ad( "chairman_circle_logos/cc_adp.jpg", "http://www.nas.adp.com/", "blank", "ADP NATIONAL ACCOUNT SERVICES");
myAd.Ad( "chairman_circle_logos/cc_alph_con_visit_bureau.jpg", "chairman_circle_no_url.html", "blank", "ALPHARETTA CONVENTION &amp; VISITORS BUREAU");
myAd.Ad( "chairman_circle_logos/cc_agg.jpg", "http://www.agg.com", "blank", "ARNALL GOLDEN GREGORY LLP ");
myAd.Ad( "chairman_circle_logos/cc_atlanta_gas_light.jpg", "http://www.aglresources.com/", "blank", "ATLANTA GAS LIGHT CO.");
myAd.Ad( "chairman_circle_logos/cc_att.jpg", "http://www.att.com", "blank", "ATT");
myAd.Ad( "chairman_circle_logos/cc_bank_north_georgia.jpg", "  http://banknorthgeorgia.com", "blank", "BANK OF NORTH GEORGIA ");
myAd.Ad( "chairman_circle_logos/cc_bbt.jpg", "http://www.bbt.com/bbt/default.html", "blank", "BBT ");
myAd.Ad( "chairman_circle_logos/cc_berkow.jpg", "chairman_circle_no_url.html", "blank", "GEORGE BERKOW INC. ");
myAd.Ad( "chairman_circle_logos/cc_briskinlaw.jpg", "http://www.briskinlaw.com", "blank", "BRISKIN, CROSS AND SANFORD, LLC ");
myAd.Ad( "chairman_circle_logos/cc_CH2MHill.jpg", "http://www.ch2mhill.com", "blank", "CH2MHILL");
myAd.Ad( "chairman_circle_logos/cc_alpharetta.jpg", "http://alpharetta.ga.us", "blank", "CITY OF ALPHARETTA ");
myAd.Ad( "chairman_circle_logos/cc_city_johns_creek.jpg", "chairman_circle_no_url.html", "blank", "CITY OF JOHNS CREEK");
myAd.Ad( "chairman_circle_logos/cc_city_milton.jpg", "chairman_circle_no_url.html", "blank", "CITY OF MILTON");
myAd.Ad( "chairman_circle_logos/cc_roswell.jpg", "http://roswellgov.com", "blank", "CITY OF ROSWELL ");
myAd.Ad( "chairman_circle_logos/cc_city_sandy_springs.jpg", "http://sandyspringsga.org", "blank", "CITY OF SANDY SPRINGS ");
myAd.Ad( "chairman_circle_logos/cc_clayton_cameracraft.jpg", "http://www.atlantaphotographer.com/", "blank", "CLAYTON CAMERACRAFT"); 
myAd.Ad( "chairman_circle_logos/cc_coleman_talley.jpg", "http://www.colemantalley.com", "blank", "COLEMAN TALLEY");
myAd.Ad( "chairman_circle_logos/cc_comcast.jpg", "http://comcast.com", "blank", "COMCAST ");
myAd.Ad( "chairman_circle_logos/cc_cousins.jpg", "http://www.cousinsproperties.com", "blank", "COUSINS PROPERTIES ");
myAd.Ad( "chairman_circle_logos/cc_cwm_contracting.jpg", "http://www.cwmatthews.com", "blank", "C.W.M. Contracting Co. ");
myAd.Ad( "chairman_circle_logos/cc_dekalb_office.jpg", "http://www.dekalboffice.com/", "blank", "DEKALB OFFICE");
myAd.Ad( "chairman_circle_logos/cc_doubletree.jpg", "http://www.gnfcc.com/chairman_circle_no_url.html", "blank", "DOUBLETREE");
myAd.Ad( "chairman_circle_logos/cc_duke_realty.jpg", "http://dukerealty.com", "blank", "DUKE REALTY ");
myAd.Ad( "chairman_circle_logos/cc_johnscreek.jpg", "chairman_circle_no_url.html", "blank", "EMORY JOHNS CREEK HOSPITAL");
myAd.Ad( "chairman_circle_logos/cc_frazier.jpg", "http://www.frazierdeeter.com/", "blank", "FRAZIER AND DEETER, LLC ");
myAd.Ad( "chairman_circle_logos/cc_fulton_county.jpg", "http://www.co.fulton.ga.us", "blank", "FULTON COUNTY GOVERNMENT ");
myAd.Ad( "chairman_circle_logos/cc_g4s_wackenhut.jpg", "http://www.wackenhut.com", "blank", "G4S  WACKENHUT");
myAd.Ad( "chairman_circle_logos/cc_gas_south.jpg", "http://www.gas-south.com", "blank", "GAS SOUTH");
myAd.Ad( "chairman_circle_logos/cc_georgia_power.jpg", "http://www.georgiapower.com/", "blank", "GEORGIA POWER CO.");
/* myAd.Ad( "chairman_circle_logos/cc_georgian_bank.jpg", "http://www.georgianbank.com", "blank", "GEORGIAN BANK "); */
myAd.Ad( "chairman_circle_logos/cc_global_vehicles.jpg", "http://www.gv-usa.com", "blank", "GLOBAL VEHICLES");
myAd.Ad( "chairman_circle_logos/cc_hampton_inn.jpg", "http://www.gnfcc.com/chairman_circle_no_url.html", "blank", "HAMPTON INN");
myAd.Ad( "chairman_circle_logos/cc_hampton_suites.jpg", "http://www.gnfcc.com/chairman_circle_no_url.html", "blank", "HAMPTON INN AND SUITES");
myAd.Ad( "chairman_circle_logos/cc_kimberly_clark.jpg", "http://www.kimberly-clark.com", "blank", "KIMBERLY-CLARK");
myAd.Ad( "chairman_circle_logos/cc_lexisnexis.jpg", "http://choicepoint.com", "blank", "LEXISNEXIS");
myAd.Ad( "chairman_circle_logos/cc_lowe_engineers.jpg", "http://www.loweengineers.com/", "blank", "LOWE ENGINEERS");
myAd.Ad( "chairman_circle_logos/cc_merck.jpg", "http://www.merck.com", "blank", "MERCK ");
myAd.Ad( "chairman_circle_logos/cc_merrill_lynch_bank_america.jpg", "http://www.ml.com", "blank", "MERRILL LYNCH ");
myAd.Ad( "chairman_circle_logos/cc_mimms.jpg", "chairman_circle_no_url.html", "blank", "MIMMS ENTERPRISES");
myAd.Ad( "chairman_circle_logos/cc_newell_rubbermaid.jpg", "http://www.newellco.com/", "blank", "NEWELL RUBBERMAID");
myAd.Ad( "chairman_circle_logos/cc_north_atlanta_nb.jpg", "http://www.nanb.com", "blank", "NORTH ATLANTA NATIONAL BANK");
myAd.Ad( "chairman_circle_logos/cc_north_fulton_comm_improve.jpg", "http://www.northfultoncid.com/", "blank", "NORTH FULTON COMMUNITY IMPROVEMENT DISTRICT");
myAd.Ad( "chairman_circle_logos/cc_north_fulton_regional.jpg", "http://www.northfultonregional.com", "blank", "NORTH FULTON REGIONAL HOSPITAL");
myAd.Ad( "chairman_circle_logos/cc_north_point_hospitality.jpg", "chairman_circle_no_url.html", "blank", "NORTH POINT HOSPITALITY GROUP ");
myAd.Ad( "chairman_circle_logos/cc_northside.jpg", "http://www.northside.com", "blank", "NORTHSIDE HOSPITAL ");
myAd.Ad( "chairman_circle_logos/cc_pga_tour_superstore.jpg", "http://www.pgatoursuperstore.com", "blank", "PGA SUPERSTORE"); 
myAd.Ad( "chairman_circle_logos/cc_privatebank.jpg", "http://www.piedmontbankga.com/", "blank", "PrivateBank");
myAd.Ad( "chairman_circle_logos/cc_rbc_centura.jpg", "http://www.rbccentura.com/", "blank", "RBC CENTURA ");
myAd.Ad( "chairman_circle_logos/cc_regent.jpg", "http://www.regentpartners.com/", "blank", "REGENT PARTNERS"); 
myAd.Ad( "chairman_circle_logos/cc_regions.jpg", "http://www.regions.com/", "blank", "REGIONS BANK"); 
myAd.Ad( "chairman_circle_logos/cc_russell_landscaping.jpg", "http://www.russelllandscapegroup.com/", "blank", "RUSSELL LANDSCAPE GROUP");
myAd.Ad( "chairman_circle_logos/cc_st_josephs.jpg", "http://www.stjosephsatlanta.org", "blank", "SAINT JOSEPH'S HOSPITAL ");
myAd.Ad( "chairman_circle_logos/cc_sams_club.jpg", "http://www.samsclub.com", "blank", "SAM'S CLUB");
myAd.Ad( "chairman_circle_logos/cc_state_bank.jpg", "http://www.securitybank.net/", "blank", "STATE BANK");
myAd.Ad( "chairman_circle_logos/cc_siemens.jpg", "http://www.siemens.com", "blank", "SIEMENS");
myAd.Ad( "chairman_circle_logos/cc_suntrust.jpg", "http://www.suntrust.com", "blank", "SUNTRUST");
myAd.Ad( "chairman_circle_l	ogos/cc_verizon.jpg", "http://www22.verizon.com/", "blank", "VERIZON");
myAd.Ad( "chairman_circle_logos/cc_wachovia.jpg", "http://www.wachovia.com", "blank", "WACHOVIA BANK ");
myAd.Ad( "chairman_circle_logos/cc_walmart.jpg", "http://www.walmart.com", "blank", "WAL-MART");
return true;

}

function Banner(refreshTime, width, height, altText, start, random){
// parameters:
//1: time between rotations (seconds), 
//2: width of image
//3: height of image, 
//4: alt text, 
//5: starting banner, and rycca changed to randomly picked ad
//6: random (0 means it iterates through banners, 1 means it randomly picks the next banner

	var NumberofBannersHave = 70;  //BAX - keep value updated, for max value for random calculation

	this.objName = "bannerAd" + (Banner.count++);
	eval(this.objName + "=this");
	if (!refreshTime) 
		this.refreshTime = 5000; 
	else 
		this.refreshTime = refreshTime*1000;
		
	if (!width) 
		this.width = 460; 
	else 
		this.width = width;
		
	if (!height) 
		this.height = 68; 
	else 
		this.height = height;
		
	// BAX - set to 0 to display images sequentially
	this.random = 0; 
		
	this.altText = altText;
	this.ads = [];
	
	//BAX - set start banner to randomly generated number
	if (start) 
		this.currentAd = (Math.round(Math.random() * NumberofBannersHave));
	else 
		start = null;
	
	this.mySize = 0;
	this.Ad = function(src, href, target, mouseover) {
		var tempImage = new Image();
		tempImage.src = src;
		this.ads[this.mySize] = new Object();
		var ad = this.ads[this.mySize];
		ad.src = src;
		if (typeof(target) == "undefined" || target == null) 
			ad.target = "_self"; 
		else 
			ad.target = target;
		ad.href = href;
		ad.mouseover = mouseover;
		this.mySize++;
	}

	this.link = function(){
		var	ad = this.ads[this.currentAd];
		if (ad.target == "_self"){
			location.href = ad.href;
		}
		else if (ad.target == "blank" || ad.target == "new"){
			open(ad.href,this.objName + "Win");
		}
		else 
			top.frames[ad.target].location.href = ad.href;
	}

	this.showStatus = function(){
		var ad = this.ads[this.currentAd];
		if (ad.mouseover) 
			status = ad.mouseover;
		else 
			status = ad.href;
	}

	this.randomAd = function(){
		var n;
		
		// Bax - changed to use round, instead of floor function
	    do { n = (Math.round(Math.random() * (this.mySize))); }
		while(n == this.currentAd);
		this.currentAd = n;
	}

	this.output = function(){
		var tempCode = "";
		if (this.mySize > 1){
			if (this.currentAd == null) 
				this.randomAd();
			if (this.currentAd >= this.mySize) 
				this.currentAd = this.mySize - 1;
			tempCode = '<a href="javascript:'+this.objName+'.link();"';
			tempCode += ' onMouseOver="' + this.objName + '.showStatus(); return true"';
			tempCode += ' onMouseOut="status=\'\';return true">';
			tempCode += '<img src="' + this.ads[this.currentAd].src + '" width="' + this.width;
			tempCode += '" name="' + this.objName + 'Img" height="' + this.height + '" ';
			if (this.altText) 
				tempCode += 'alt="'+this.altText + '" ';
			tempCode += 'border="0" /></a>';
			document.write(tempCode);
			this.nextAd();
		} 
		else 
			document.write("Error: two banners must be defined for the script to work.");
	}

	this.newAd = function(){
		if (!this.random){	
			this.currentAd++;
			if (this.currentAd >= this.mySize)
			   this.currentAd = 0;
		}
		else {
			this.randomAd();
		}
		this.nextAd();
	}

	this.nextAd = function(){
		document.images[this.objName+ 'Img'].src = this.ads[this.currentAd].src;
		setTimeout(this.objName+'.newAd()',this.refreshTime)
	}
}
Banner.count = 0;
