var HowManyOnInRow = 2;
var HowManyOnInRow = 3;
var ColumnWidth = "33.3%";
var HowManyOnPage = HowManyOnInRow*3;

// Figures out what page you are on
var stringloc4 = unescape(document.location.toString());
var stringloc=stringloc4.toLowerCase();

var NameLink = new Array(

"9.  Ashley Reed", "http://www.mastersofthearts.com/photo_ashleyreed.html"
,"8.  Kristi Elias", "http://www.mastersofthearts.com/photo_kristielias.html"
,"7. Vanessa Reed", "http://www.mastersofthearts.com/photo_vanessareed.html"					 
,"6. Alain Bali", "http://www.mastersofthearts.com/photo_alainbali.html"	 
,"5. Cassy", "http://www.mastersofthearts.com/photo_cassy.html"
,"4. Alexis Trujillo", "http://www.mastersofthearts.com/photo_atrujillo.html"
,"3. Dinus Czund", "http://www.mastersofthearts.com/photo_dinusczund.html"
,"2. Bryan Ferreira", "http://www.mastersofthearts.com/photo_bryanferreira.html"
,"1. Steph Anie Jones", "http://www.mastersofthearts.com/photo_stephaniejones.html"
	
	);

if (stringloc.lastIndexOf(".html?page=") == -1) {
	var ThisPageNumber=1;
	var RealPageNumber = 0;
	}
else {
	var URLcutUP = stringloc.split(".html?page=");
	var RealPageNumber = parseInt(URLcutUP[1]);
	var ThisPageNumber = ((parseInt(URLcutUP[1]))+1);
	if (ThisPageNumber=="") { ThisPageNumber = 1; }
	}
var StartAt = (((ThisPageNumber*HowManyOnPage)-HowManyOnPage));
var NextPageCnt = ThisPageNumber;
     NextPageCnt = NextPageCnt+1;

if (stringloc.lastIndexOf(".html") == -1) {
	PlaceMainURL = stringloc+"photo_gallery.html";
	AllURLCutURL ="photo_gallery.html?page=0";
	}
else if (stringloc.lastIndexOf("?page=") != -1) {
	AllininURLCut = stringloc.split("?page=");
	PlaceMainURL = AllininURLCut[0]+"?page="+NextPageCnt;
	AllURLCutURL = AllininURLCut[0]+"?page=0";
	}
else {
	PlaceMainURL = stringloc+"?page="+NextPageCnt;
	AllURLCutURL = stringloc+"?page=0";
	}
//document.write('<img src="images/gallery/gallery_head.gif" alt="all types of artists" width="350" height="30">');
document.write('<h1>SELECT A PHOTOGRAPHER</h1>');
document.write('<table width="100%"><tr><td valign="top" width="'+ColumnWidth+'">');

GenCounter=1; Counter=1; CounterCells=1;
//StartAt = StartAt-1;
if (StartAt == -1) { StartAt = 0; }
for (var loop = StartAt; loop < NameLink.length; loop++) {
	PersonsName = NameLink[loop]; loop++; PersonsLink = NameLink[loop];
	PersonsLink = PersonsLink+"?page="+RealPageNumber;
	document.write('<a href="'+PersonsLink+'">'+PersonsName+'</a><br>');
	if (CounterCells == HowManyOnInRow && Counter != HowManyOnPage) {
	document.write('</td><td valign="top" width="'+ColumnWidth+'">');
		CounterCells=1;
		}
	else { CounterCells++; }
	GenCounter=loop+1;
	if (Counter == HowManyOnPage) { loop = 99999999999; } else { Counter++; }
	}

	document.write('</td></tr></table>');

	document.write('<table width="93%" border="0" height="35"><tr><td align="right" valign="middle" width="'+ColumnWidth+'">');
if (GenCounter == NameLink.length) { loop = NameLink.length; }
else { }

if (loop == 100000000000) {
	document.write('<a href="'+PlaceMainURL+'">MORE ARTISTS &raquo;</a>');
	}
else {
	document.write('<a href="'+AllURLCutURL+'">BACK TO THE BEGINNING &raquo;</a>');
	}
	document.write('</td></tr></table>');