// JavaScript Document/* start of display next, previous pages -  javascript *///declare an array variablevar hyperlinks=new Array();// initialize variable which will decide whether to load previous page or home page.var pageprevious="page";//add values to an arrayhyperlinks=["projectsUrbanHabitat.html", // Urban Habitat			"projectsWilliamsburg2.html", // Williamsburg Loft			"projectsDinnerstein.html", //Dinnerstein			"projectsTeddy.html", // Teddy’s Bar & Grill			"projectsW77.html", // P20 West 77    			"projectsHamlin.html", // 333 East 66		    "projectsC2C.html", // C2C			"projectsTwoFamily.html", // Two Family House			"projectsBirthCenter.html",	// Birth Center				"projectsPowerPlant.html", // Ame Powerplant			"projectsUrbanLagoon.html", // Urban Lagoon			"projectsChase.html", // Chase-McNamara									"projectsHirotaJackall.html",// Hirota-Jackall			]; //retrieve length of arrayvar ArrCount=hyperlinks.length;// function to load next page.function loadNext(){		//retrieving index of the current page in array	indexval=getIndex();		//checking for indexval	if(indexval != "fail" && indexval<ArrCount-1)	{		//incremnting the indexval		indexval=indexval+1;			//calling corresponding file from the array		location.href=hyperlinks[indexval];	}}// function to load previous page or home page.function loadPrevious(){		//retrieving index of the current page in array	indexval=getIndex();	//checking for indexval	if(indexval != "fail" && indexval>0)	{		//decrementing the indexval		indexval=indexval-1;		// check whether to display previous page or home page		if(pageprevious=='page')		{			//load corresponding file from the array			location.href=hyperlinks[indexval];		}		else		{			//load the home page			location.href=hyperlinks[0];		}	}}// function which returns the index of the current page in the array.function getIndex(){// split the current url and store in a arrayvar page_url = (location.href).split("/");//get the name of the file.var pagename=page_url[page_url.length-1];	//traverse through array to get the indexval of the pagename	for(index=0;index<ArrCount;index++)	{		//check for the pagename		if(hyperlinks[index]==pagename)		{			//return index value						return index;		}	}	// if the page does not exist in the array return fail	return "fail";}/* end of display next, previous pages -  javascript */