//// variable declarations //////////////////////////////////////////////////////
var currentPage=window.location.href;
var urlArray=currentPage.split("/");
var urlArrayLength=urlArray.length;


function getContainingFolder(){  /// checks what section of site you're in ///////////////////////////////
	var containingFolder = urlArray[urlArrayLength-2]
	return containingFolder;
	}

function checkContainingFolder(siteSection){  /// checks what section of site you're in ///////////////////////////////
	if(urlArray[urlArrayLength-2]==siteSection){return true;}
	else return false; 
	}

function findPageDepths(webRoot1, webRoot2, webRoot3, webRoot4, webRoot5){   // find page depths ///////////////////////////////////////////////////////////////////////
	var pathToRoot = new Array();
	var i = containingDirIndex = urlArrayLength-2;
	var tempIndex = urlArrayLength;

	while (urlArray[tempIndex] != webRoot1 && 
		   urlArray[tempIndex] != webRoot2 && 
		   urlArray[tempIndex] != webRoot3 && 
		   urlArray[tempIndex] != webRoot4 && 
		   urlArray[tempIndex] != webRoot5){
		//confirm("Current Index: " + tempIndex + "  Current Folder: " + urlArray[tempIndex]);
		tempIndex--;
		}

	var rootIndex = tempIndex;
		
	while (i>rootIndex){
		pathToRoot = pathToRoot + '../';
		i--;
		}
	
	return pathToRoot;
}
