/* [nodename, id, name, navigationtext, href, isnavigation, childs[], templatename] */

if (typeof(decodeURIComponent) == 'undefined') {
  decodeURIComponent = function(s) {
    return unescape(s);
  }
}

function jdecode(s) {
    s = s.replace(/\+/g, "%20")
    return decodeURIComponent(s);
}

var POS_NODENAME=0;
var POS_ID=1;
var POS_NAME=2;
var POS_NAVIGATIONTEXT=3;
var POS_HREF=4;
var POS_ISNAVIGATION=5;
var POS_CHILDS=6;
var POS_TEMPLATENAME=7;
var POS_TARGET=8;
var theSitetree=[ 
	['PAGE','19',jdecode('Home'),jdecode(''),'/19.html','true',[],'',''],
	['PAGE','1027',jdecode('About+us'),jdecode(''),'/1027/index.html','true',[ 
		['PAGE','91201',jdecode('Mission+%26+Vision'),jdecode(''),'/1027/91201.html','true',[],'','']
	],'',''],
	['PAGE','10701',jdecode('Services'),jdecode(''),'/10701/index.html','true',[ 
		['PAGE','1036',jdecode('Geotechnical'),jdecode(''),'/10701/1036.html','true',[],'',''],
		['PAGE','10722',jdecode('Construction'),jdecode(''),'/10701/10722.html','true',[],'',''],
		['PAGE','10743',jdecode('Laboratory'),jdecode(''),'/10701/10743.html','true',[],'','']
	],'',''],
	['PAGE','10764',jdecode('Staff'),jdecode(''),'/10764/index.html','true',[ 
		['PAGE','10785',jdecode('T.+Michael+McMillen'),jdecode(''),'/10764/10785.html','true',[],'',''],
		['PAGE','10806',jdecode('Michael+P.+McMillen'),jdecode(''),'/10764/10806.html','true',[],'',''],
		['PAGE','19401',jdecode('Wade+A.+Mathes'),jdecode(''),'/10764/19401.html','true',[],'',''],
		['PAGE','10827',jdecode('James+T.+Rutherford'),jdecode(''),'/10764/10827.html','true',[],'','']
	],'',''],
	['PAGE','10869',jdecode('Projects'),jdecode(''),'/10869/index.html','true',[ 
		['PAGE','144201',jdecode('St.+Louis+Art+Museum'),jdecode(''),'/10869/144201.html','true',[],'',''],
		['PAGE','144222',jdecode('St.+Francis+de+Sales'),jdecode(''),'/10869/144222.html','true',[],'',''],
		['PAGE','166601',jdecode('Spirit+of+St.+Louis+Airport'),jdecode(''),'/10869/166601.html','true',[],'',''],
		['PAGE','144243',jdecode('Soil+Nail+%2F+Screw+Walls'),jdecode(''),'/10869/144243.html','true',[],'','']
	],'',''],
	['PAGE','17701',jdecode('News'),jdecode(''),'/17701.html','true',[],'',''],
	['PAGE','1072',jdecode('Careers'),jdecode(''),'/1072/index.html','true',[ 
		['PAGE','10890',jdecode('Anticipated+Openings'),jdecode(''),'/1072/10890.html','true',[],'','']
	],'',''],
	['PAGE','1045',jdecode('Contact+Us'),jdecode(''),'/1045.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='3E6E72';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='354';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='3E6E72';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'3E6E72',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'354',
				contentColor: 	'DDDDDD',
				contentBGColor: '3E6E72',
				a_color: 		'3E6E72',
				b_color: 		'101C1D',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '19',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-2287315']={
webappId:    '1501',
documentId:  '19',
internalId:  '2287315',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19',
internalId:  '',
customField: '20070711-071310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1027',
internalId:  '',
customField: '20090730-141754'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91201',
internalId:  '',
customField: '20070126-130747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10701',
internalId:  '',
customField: '20090730-141854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1036',
internalId:  '',
customField: '20070131-155131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10722',
internalId:  '',
customField: '20070131-155217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10743',
internalId:  '',
customField: '20070126-132411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10764',
internalId:  '',
customField: '20090730-142043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10806',
internalId:  '',
customField: '20081212-110739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19401',
internalId:  '',
customField: '20081212-110712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10827',
internalId:  '',
customField: '20081212-111228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10785',
internalId:  '',
customField: '20070607-103415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10869',
internalId:  '',
customField: '20081212-111313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17701',
internalId:  '',
customField: '20081212-111854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1072',
internalId:  '',
customField: '20080311-091738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10890',
internalId:  '',
customField: '20090420-124435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1045',
internalId:  '',
customField: '20080506-082110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '144201',
internalId:  '',
customField: '20070205-125133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '144222',
internalId:  '',
customField: '20070205-151923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '166601',
internalId:  '',
customField: '20070711-073941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '144243',
internalId:  '',
customField: '20070126-173435'
};
var canonHostname = 'diywk00.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN2J9S';
var companyName   = 'Gateway+Geotechnical%2C+LLC';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
theSitetree.getById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		if (ar[i][POS_ID] == id){
			return ar[i];
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getParentById = function(id, ar) {
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		for (var j = 0; j < ar[i][POS_CHILDS].length; j++) {
			if (ar[i][POS_CHILDS][j][POS_ID] == id) {
				// child found
				return ar[i];
			}
			var result=this.getParentById(id, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getName = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAME];
	}
	return null;
};

theSitetree.getNavigationText = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_NAVIGATIONTEXT];
	}
	return null;
};

theSitetree.getHREF = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_HREF];
	}
	return null;
};

theSitetree.getIsNavigation = function(id) {
	var elem = this.getById(id);
	if (elem != null){
		return elem[POS_ISNAVIGATION];
	}
	return null;
};

theSitetree.getTemplateName = function(id, lastTemplateName, ar) {
	if (typeof(lastTemplateName) == 'undefined'){
		lastTemplateName = this.topTemplateName;
	}
	if (typeof(ar) == 'undefined'){
		ar = this;
	}
	for (var i=0; i < ar.length; i++) {
		var actTemplateName = ar[i][POS_TEMPLATENAME];
		if (actTemplateName == ''){
			actTemplateName = lastTemplateName;
		}
		if (ar[i][POS_ID] == id) {
			return actTemplateName;
		}
		if (ar[i][POS_CHILDS].length > 0) {
			var result=this.getTemplateName(id, actTemplateName, ar[i][POS_CHILDS]);
			if (result != null){
				return result;
			}
		}
	}
	return null;
};

theSitetree.getByXx = function(lookup, xx, ar) {
    if (typeof(ar) == 'undefined'){
    	ar = this;
    }
    for (var i=0; i < ar.length; i++) {
        if (ar[i][xx] == lookup){
        	return ar[i];
        }
        if (ar[i][POS_CHILDS].length > 0) {
        	var result=this.getByXx(lookup, xx, ar[i][POS_CHILDS]);
            if (result != null){
                return result;
               }
        }
    }
    return null;
};

function gotoPage(lookup) {
	if(__path_prefix__ == "/servlet/CMServeRES" && typeof (changePage) == 'function'){
		changePage(lookup);
		return;
	}
	var page = theSitetree.getHREF(lookup);
	if (!page) {
		var testFor = [ POS_NAME, POS_NAVIGATIONTEXT ];
		for (var i=0 ; i < testFor.length ; i++) {
			var p = theSitetree.getByXx(lookup, testFor[i]);
			if (p != null) {
				page = p[POS_HREF];
				break;
			}
		}
	}
	document.location.href = (new URL(__path_prefix__ + page, true, true)).toString();
};
