/////////////////////////////////////////////////////////////
// ThorLoki Universal "last / next" navigation
// (c) 2007 ThorLoki, LLC All Rights Reserved.
// http://www.ThorLoki.com
//
// By: Joe Melberg and Brant Waltrous
// D:   This script allows dynamic last/next style navigation 
// 		through pages listed in an array.
//      The array is targeted on call from the link as such:
//      <a href="javascript:tl_simplenav ('arrayname','next')">NEXT</a>
//
//      Arrays may be explicitly listed or constructed on-the-fly 
//      by a server side technology.
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
var windows = 	[
	
	[1,'100628.html'],
[1,'100103.html'],
[1,'W-069.html'],
	[1,'080814-win.html'],
	[1,'French-open.html'],
	[1,'W-066.html'],

	[1,'W-067.html'],
	[1,'W-047.html'],
	[1,'W-046.html'],
	[1,'W-062.html'],

	[1,'W-063.html'],
	[1,'GW5321.html'],
	[1,'GW54211.html'],
	[1,'W-050.html'],

	[1,'W-049.html'],
	[1,'W-006.html'],
	[1,'test.html'],
	[1,'W-022.html'],

	[2,'W-025.html'],
	[2,'W-026.html'],
	[2,'W-027.html'],
	[2,'W-028.html'],

	[2,'W-029.html'],
	[2,'W-030.html'],
	[2,'W-031.html'],
	[2,'W-032.html'],

	[2,'W-033.html'],
	[2,'W-035.html'],
	[2,'W-036.html'],

	[2,'W-037.html'],
	[2,'W-038.html'],
	[2,'W-039.html'],
	[2,'W-040.html'],

	[3,'W-004.html'],
	[3,'W-008.html'],
	[3,'W-009.html'],
	[3,'W-010.html'],

	[3,'W-011.html'],
	[3,'W-013.html'],
	[3,'W-014.html'],
	[3,'W-016.html'],

	[3,'W-017.html'],
	[3,'W-023.html'],
	[3,'W-024.html'],
	[3,'W-002.html'],

	[3,'W-054.html'],
	[3,'W-055.html'],
	[3,'W-056.html'],
	[3,'W-057.html'],

	[3,'W-053.html'],
	[3,'W-052.html'],
	[3,'W-051.html'],
	[3,'W-048.html'],

	[4,'W-041.html'],
	[4,'W-068.html'],
	[4,'W-045.html'],
	[4,'W-044.html'],
	
[0,0]];



var projects = [
	
	[1,'100628.html'],	
[1,'100104.html'],
[1,'4131.html'],
[1,'081106-prj.html'],
	[1,'P-031.html'],
	[1,'080814-prj.html'],
	[1,'P-030.html'],
	[1,'P-029.html'], 
	[1,'P-028.html'],
	[1,'P-005.html'], 

	[1,'Miller.html'], 
	[1,'P-023.html'], 
	[1,'P-013.html'], 
	[1,'P-015.html'], 

	[1,'P-021.html'], 
	[1,'P-026.html'], 
	[1,'P-020.html'], 
	[1,'P-019.html'], 

	[1,'P-018.html'], 
	[1,'P-017.html'],
	[1,'P-004.html'], 
	[2,'P-010.html'], 
	

	[2,'P-014.html'], 
	[2,'P-007.html'], 
	[2,'P-003.html'], 
	[2,'P-012.html'],

	[2,'P-016.html'], 
	[2,'P-001.html'],
	[2,'P-027.html'],
	[2,'P-011.html'],

	[2,'P-002.html'], 
	[2,'P-008.html'], 
	[2,'P-006.html'],

[0,0]];



var liftslidedoors = [

	[1,'100628.html'],
[1,'091110.html'],
[1,'4131.html'],
[1,'090401.html'],
[1,'090402.html'],
[1,'081124.html'],
	[1,'LSD-013.html'],
	[1,'LSD-014.html'],
	[1,'LSD-009.html'],

	[1,'LSD-010.html'],
	[1,'LSD-011.html'],
	[1,'LSD-012.html'],
	[1,'LSD-008.html'],

	[1,'LSD-001.html'],
	[1,'LSD-002.html'],
	[1,'LSD-003.html'],
	[1,'LSD-004.html'],
 
	[2,'LSD-005.html'],
	[2,'LSD-007.html'],

[0,0]];



var doorsandentryways = [

	[1,'100628.html'],
[1,'4118.html'],
	[1,'090402.html'],
[1,'DAE-037.html'],
[1,'DAE-036.html'],
	[1,'080814-door.html'],
	[1,'DAE-033.html'],
	[1,'DAE-031.html'],
	[1,'DAE-032.html'],
	[1,'DAE-001.html'],

	[1,'DAE-002.html'],
	[1,'DAE-003.html'],
	[1,'DAE-004.html'],
	[1,'DAE-005.html'],

	[1,'DAE-006.html'],
	[1,'DAE-007.html'],
	[1,'DAE-008.html'],
	[1,'DAE-010.html'],

	[1,'DAE-014.html'],
	[1,'DAE-015.html'],
	[1,'DAE-030.html'],
	[1,'DAE-029.html'],


	[2,'DAE-016.html'],
	[2,'DAE-017.html'],
	[2,'DAE-018.html'],
	[2,'DAE-019.html'],

	[2,'DAE-020.html'],
	[2,'DAE-021.html'],
	[2,'DAE-022.html'],
	[2,'DAE-023.html'],

	[2,'DAE-024.html'],
	[2,'DAE-025.html'],
	[2,'DAE-026.html'],
	[2,'DAE-028.html'],
	
	[2,'DAE-034.html'],
	[2,'DAE-035.html'],

[0,0]];



var pivot = [
	[1,'4109.html'],
	[1,'090402.html'],
	[1,'090401.html'],
	[1,'pivot-01.html'],
	[1,'pivot-02.html'],
	[1,'pivot-03.html'],
	[1,'pivot-04.html'],
	[1,'pivot-05.html'],
	[1,'pivot-06.html'],
	[1,'pivot-07.html'],

[0,0]];



var foldslide = [

	[1,'100628.html'],
	[1,'FSWD-015.html'],
[1,'lake_wa.html'],
	[1,'08-08-14.html'],
	[1,'Neiman.html'],
	[1,'06-09-19-01.html'],
	[1,'06-09-19-02.html'],
	[1,'06-09-19-03.html'],

	[1,'06-09-19-04.html'],
	[1,'06-09-19-05.html'],
	[1,'06-09-19-06.html'],
	[1,'FS-06-09-02-a.html'],

	[1,'FS-06-09-02-b.html'],
	[1,'FS-06-09-02-c.html'],
	[1,'FS-06-09-02-d.html'],
	[1,'FS-5671.html'],

	[1,'FS-5711.html'],
	[1,'FSWD-001.html'],
	[1,'FSWD-002.html'],
	[1,'FSWD-003.html'],

	[2,'FSWD-004.html'],
	[2,'FSWD-005.html'],
	[2,'FSWD-006.html'],
	[2,'FSWD-007.html'],

	[2,'FSWD-008.html'],
	[2,'FSWD-009.html'],
	[2,'FSWD-010.html'],
	[2,'FSWD-014.html'],

	[2,'FSWD-013.html'],
	[2,'FSWD-012.html'],
	[2,'FSWD-011.html'],

[0,0]];

function tl_simplenav (theMenu, theDirection) {
	if (theMenu && theDirection) {
		// declare vars
		var myArrayLocation = null;	
		// point "the menu" to the propper JS Array onject.
		var theMenu = eval(theMenu);
		// parse URL to get our current location as a file name
	 	var myUrlBits = window.location.href.split("/");
		var myFileLocation = myUrlBits.length - 1;
		var myFileName = myUrlBits[myFileLocation];
		// find our location within the nav array
		// note:  For some reason theMenu.length is returning a number 1 higher than expected.
		// cont...also I don't understand the purpose of the [0,0] entry in these vars so I subract 2 from length.
		var listEnd = theMenu.length - 2;
		for ( var i = 0; i <= listEnd; i++ ){
			if (theMenu.length > 0) {
				if (theMenu[i][1] == myFileName) {
					myArrayLocation = i;
				}
			}
		}
		// set direction to move n the array
		var newLocation = myArrayLocation + 1;
		if (theDirection == "next") {
			if (newLocation > listEnd) {
				newLocation = 0;
			}
		}
		else {
			newLocation = myArrayLocation - 1;
			if (newLocation < 0 ) {
				newLocation = listEnd;
			}
		}
		// recosntruct the full page url.
		myUrlBits.pop();
		myUrlBits.push(theMenu[newLocation][1]);
		newUrl = myUrlBits.join("/");
		// set window lodation to that listing
		window.location = newUrl;
	}
}