// Authored by Ara Jamgochian of Highland Consulting Group Inc.
// Copyright (c) 2004-2007 Many Mind LLC. All rights reserved.
// Copying or any other use of this material is strictly prohibited.

// guided tour functionality

var siz   = 18;
var pages = new Array( "index", "churchInfo",
                       "stStepanos", "churchHistory", "churchHistoryDetails",
                       "pastor", "pastorsMessage", "parishCouncil", "choir",
                       "wallpaperStStepanosMural",
                       "serviceSchedule", "specialCelebrations",
                       "armenianSchool", "sundaySchool",
                       "womensGuild", "youthOrganization",
                       "stewardship",
                       "alsoVisit");

var locWrk, locate;
var startIx, endIx;
var pageName, nextPage;
var t = '';
var i, j;

// get window location information
locWrk   = window.location;
document.hidn.locn.value = locWrk;
locate   = document.hidn.locn.value;
startIx  = locate.lastIndexOf("/") + 1;
endIx    = locate.lastIndexOf(".");

// get current page name
if (startIx < endIx)
    pageName = locate.substring(startIx, endIx);
else
    pageName = "index";
if (pageName == "www")
    pageName = "index";

// build next page name
j = siz + 1;
for (i=0; i<siz; i++)
{
     if (pages[i] == pageName)
     {
         j = i + 1;
     }
}
if (j >= siz)
    j = 0;
nextPage = pages[j] + '.html';

// build html
t += '<a href="';
t += nextPage;
t += '">';
t += '<img border="0" src="images/butGuidedTour.gif" width="100" height="23">';
t += '</a>';

// done
document.write(t);
