// The following calls the function in the main frameset to load the correct location tab

function runYouAreHere() {
	if (self.name == "Main" && self != top) {	//if page is loaded into frameset
		parent.noSearchFlag = true
		parent.youAreHere()	//set "you are here" arrow
	} else {
		// The following reloads the page in a frameset if it is not already there
		var numButs = 8	//  = global variable designating number of pages in site
		var i = 0	//  counter variable

		var pageLinks = new Array(numButs)  // array holding page file names
		pageLinks[0] = "home.html"
		pageLinks[1] = "Services.html"
		pageLinks[2] = "insplans.html"
		pageLinks[3] = "directions.html"
		pageLinks[4] = "bio.html"
		pageLinks[5] = "links.html"
		pageLinks[6] = "faq"		// was faq.html
		pageLinks[7] = "contact.html"
		pageLinks[8] = "search.html"

		var pageFrame = new Array(numButs)  // array holding page frameset names
		pageFrame[0] = "index.html"
		pageFrame[1] = "srvframe.html"
		pageFrame[2] = "insframe.html"
		pageFrame[3] = "dirframe.html"
		pageFrame[4] = "bioframe.html"
		pageFrame[5] = "lnkframe.html"
		pageFrame[6] = "faqframe.html"
		pageFrame[7] = "cntframe.html"
		pageFrame[8] = "schframe.html"

		var wname = self.location.href.substring((self.location.href.lastIndexOf("/"))+1)
		for (i = 0; i < numButs; i++) {
			if (wname.indexOf(pageLinks[i]) != -1)  { // if location is matched within pageLinks[i]
				break
			}
		}
		if (wname.indexOf("#privpol") != -1)	{	//if linking to privacy policy
			top.location.replace("privfrm.html")
		} else {
			top.location.replace(pageFrame[i])
		}
	}
}

function leavePage() {
	if (self.name == "Main" && self != top) {	//if page is loaded into frameset
		parent.clearLocTab()
		parent.noSearchFlag = false
	}
}

