var mySites = new Array(
"ChurchAtTheGate", "ApostlesBand", "BoydBristow",												
"SiouxFallsHVAC", "MyNeedlesHighway", "LakelandGraphics",
"UALocal300", "NewLifeChurchSF", "BubbaDig",
"TheDesignStudioInc", "GatewayHomes", "InertiaSportsMedia",
"LightAndSiren", "SealsSwimTeam", "BlackSheepCoffee",
"AndysTreesSF", "AAATreesSF", "AATreesSF",
"MomentumHandbook", "CodyMatz", "AJConstruction",
"DellRapidsAreaNews", "IntegroEnergy", "NattyNames",
"StevenMCollinsBlog", "YanktonBoneAndJoint", "SouthernHillsUMC",
"StaggersForMayor", "FunkyMonkeyFotos", "SupplyTattoo",
"PMMusicDJ", "AToZWorldLanguages", "SozoCounselingCare",
"TargetFarms", "StevenMCollins", "MissSudanUSA",
"EdieEdwardsDesigns", "iCareForKids", "UlmOrgelwerke",
"ReviverBus", "WeaveGotMaille", "SiouxFallsCornerstone",
"InspirationForOurNation", "RoyalEntertainmentLLC", "EverlastingMoments",
"Youve-BeenFramed", "Youve-BeenFramed", "Youve-BeenFramed"
);

var firstSiteOnRow
var totSites = mySites.length;

function hideAll() {
	for(var i=0; i<totSites; i++) {
		var e = document.getElementById("div"+mySites[i]); e.style.visibility = "hidden";
		var e = document.getElementById("img"+mySites[i]); e.style.visibility = "hidden";			
	}	
}
function showDiv(id) {var e = document.getElementById(id); e.style.visibility = "visible";}
function showImg(id) {var e = document.getElementById(id); e.style.visibility = "visible";}		
function ChangePage(Direction)
{
	if (Direction == "Nxt") {
		if (firstSiteOnRow < totSites - 3) {
			firstSiteOnRow = firstSiteOnRow + 3; }
		else {
			firstSiteOnRow = 0; }
	 }
	else if (Direction == "Prv") {
		if(firstSiteOnRow > 3) {
			firstSiteOnRow = firstSiteOnRow - 3; }
		else {
			firstSiteOnRow = totSites - 3; }
		}
	else {
		firstSiteOnRow = 0;
	}
		hideAll();
		showDiv("div"+mySites[firstSiteOnRow]);showDiv("div"+mySites[firstSiteOnRow+1]);showDiv("div"+mySites[firstSiteOnRow+2]);
		showImg("img"+mySites[firstSiteOnRow]);showImg("img"+mySites[firstSiteOnRow+1]);showImg("img"+mySites[firstSiteOnRow+2]);	
}
