﻿// change the next three lines to reflect the total number of possible ads in each size
var largeAds = 3;
var mediumAds = 4;
var smallAds = 1;

// don't change the next three lines

var largeAdURL = new Array(largeAds);
var mediumAdURL = new Array(mediumAds);
var smallAdURL = new Array(smallAds);

// change the value of the lines below to the website that each ad should click to
// add new lines as necessary, increasing value of number in brackets each time
// include a URL of "#" if there is no website to link to

largeAdURL[0]="http://www.capehealingarts.com/";
largeAdURL[1]="http://www.capehealingarts.com/";
largeAdURL[2]="http://www.seacoastimaging.com/";

mediumAdURL[0]="http://www.openeyecom.com/";
mediumAdURL[1]="http://www.capecodchamber.org/";
mediumAdURL[2]="http://www.joesplacetruepilates.com/";
mediumAdURL[3]="http://www.capecodhealth.org/";
mediumAdURL[4]="http://www.phoenixrisinghealing.com/";
mediumAdURL[5]="http://www.capecodhealth.org/body.cfm?id=111";

smallAdURL[0]="http://www.artsfoundation.org/";
smallAdURL[1]="http://www.capestressreduction.com/";
smallAdURL[2]="http://www.capeandislands.org";
smallAdURL[3]="mailto:sperrychiro@comcast.net";
smallAdURL[4]="http://www.cape.org/";

// don't change anything below this line

	var whichPicA = Math.floor(Math.random()*largeAds);
	var whichPicB = Math.floor(Math.random()*mediumAds);
	var whichPicC = Math.floor(Math.random()*smallAds);
	var whichURLA = largeAdURL[whichPicA];
	var whichURLB = mediumAdURL[whichPicB];
	var whichURLC = smallAdURL[whichPicC];
	
// new stuff for more ads per page

	var whichPicA2 = whichPicA + 1;
	var whichPicB2 = whichPicB + 1;
	var whichPicC2 = whichPicC + 1;
	if (whichPicA2 >= largeAds) {
				whichPicA2 = 0;
				}
	if (whichPicB2 >= mediumAds) {
				whichPicB2 = 0;
				}
	if (whichPicC2 >= smallAds) {
				whichPicC2 = 0;
				}
	var whichURLA2 = largeAdURL[whichPicA2];
	var whichURLB2 = mediumAdURL[whichPicB2];
	var whichURLC2 = smallAdURL[whichPicC2];