/* [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','801',jdecode('HOME'),jdecode(''),'/801/index.html','true',[ 
		['PAGE','30216',jdecode('Our+Values'),jdecode(''),'/801/30216.html','true',[],'',''],
		['PAGE','978',jdecode('WHO+WE+ARE'),jdecode(''),'/801/978.html','true',[],'',''],
		['PAGE','957',jdecode('WHERE+ARE+WE'),jdecode(''),'/801/957.html','true',[],'','']
	],'',''],
	['PAGE','27268',jdecode('BTI+IT'),jdecode(''),'/27268/index.html','true',[ 
		['PAGE','30164',jdecode('BTI+IT+Phase+1'),jdecode(''),'/27268/30164.html','false',[],'',''],
		['PAGE','30173',jdecode('BTI+IT+Phase+2'),jdecode(''),'/27268/30173.html','false',[],'',''],
		['PAGE','30393',jdecode('ATM+'),jdecode(''),'/27268/30393.html','false',[],'','']
	],'',''],
	['PAGE','28658',jdecode('BTI+Express'),jdecode(''),'/28658/index.html','true',[ 
		['PAGE','30225',jdecode('USPS+Approved+Shipper'),jdecode(''),'/28658/30225.html','true',[],'',''],
		['PAGE','30234',jdecode('TSA+Indirect+Air+Carrier'),jdecode(''),'/28658/30234.html','true',[],'','']
	],'',''],
	['PAGE','31601',jdecode('BTI+Builders'),jdecode(''),'/31601/index.html','true',[ 
		['PAGE','40201',jdecode('Management'),jdecode(''),'/31601/40201.html','true',[],'',''],
		['PAGE','40222',jdecode('Projects'),jdecode(''),'/31601/40222.html','true',[],'','']
	],'',''],
	['PAGE','30352',jdecode('BTI+%26%23x27%3BBeyond+The+%26%23x27%3BI%26%23x27%3B%2C+inc'),jdecode(''),'/30352/index.html','true',[ 
		['PAGE','20001',jdecode('PHOTOS'),jdecode(''),'/30352/20001.html','true',[],'',''],
		['PAGE','16043',jdecode('BLOG'),jdecode(''),'/30352/16043.html','true',[],'','']
	],'',''],
	['PAGE','27304',jdecode('BTVi'),jdecode(''),'/27304.html','true',[],'',''],
	['PAGE','16001',jdecode('CONTACT'),jdecode(''),'/16001.html','true',[],'',''],
	['PAGE','30323',jdecode('EMPLOYEE+ACCESS'),jdecode(''),'/30323.html','true',[],'',''],
	['PAGE','25201',jdecode('Employment+Application'),jdecode(''),'/25201.html','true',[],'',''],
	['PAGE','42301',jdecode('BTI+Collaboration+Central'),jdecode(''),'/42301.html','true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Architekt';
theSitetree.paletteFamily='90A262';
theSitetree.keyvisualId='1705';
theSitetree.keyvisualName='handschlag.jpg';
theSitetree.fontsetId='305';
theSitetree.graphicsetId='344';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='90A262';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Architekt',
				paletteFamily: 	'90A262',
				keyvisualId: 	'1705',
				keyvisualName: 	'handschlag.jpg',
				fontsetId: 		'305',
				graphicsetId: 	'344',
				contentColor: 	'000000',
				contentBGColor: '90A262',
				a_color: 		'90A262',
				b_color: 		'525D37',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '801',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-356686']={
webappId:    '1501',
documentId:  '801',
internalId:  '356686',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-77cd28f9c4247b5a57dae1a42f62cbe7']={
webappId:    '7060',
documentId:  '20001',
internalId:  '77cd28f9c4247b5a57dae1a42f62cbe7',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20100610-005127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27268',
internalId:  '',
customField: '20090717-044704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40222',
internalId:  '',
customField: '20100610-011456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42301',
internalId:  '',
customField: '20100610-171812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27304',
internalId:  '',
customField: '20080914-070030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '957',
internalId:  '',
customField: '20090717-150727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '978',
internalId:  '',
customField: '20100610-010709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16001',
internalId:  '',
customField: '20070206-000525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16043',
internalId:  '',
customField: '20070610-054412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20001',
internalId:  '',
customField: '20070608-002317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25201',
internalId:  '',
customField: '20100610-022759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28658',
internalId:  '',
customField: '20090717-212258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40201',
internalId:  '',
customField: '20100610-021258'
};
webappMappings['7008']=webappMappings['7008-8519']={
webappId:    '7008',
documentId:  '25201',
internalId:  '8519',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30216',
internalId:  '',
customField: '20100610-005447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31601',
internalId:  '',
customField: '20100610-011333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30164',
internalId:  '',
customField: '20090716-050805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30173',
internalId:  '',
customField: '20090716-050713'
};
webappMappings['1003']=webappMappings['1003-ahw050in2c7s11ada467065']={
webappId:    '1003',
documentId:  '16043',
internalId:  'ahw050in2c7s11ada467065',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30323',
internalId:  '',
customField: '20090717-163437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30352',
internalId:  '',
customField: '20090717-165230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30225',
internalId:  '',
customField: '20090717-161904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30393',
internalId:  '',
customField: '20090716-053603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30234',
internalId:  '',
customField: '20090717-214337'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050IN2C7S';
var companyName   = 'Diversified+Portfolio+of+Quality+Services';
var htmlTitle	  = 'BTI%27s+Diversified+Portfolio+of+Quality+Services+%21';
var metaKeywords  = 'American+Samoa%2C+General+Builder%2C+General+Contractor%2C+Armored+Car+Services%2C+Bank+of+Hawaii%2C+FaceBook';
var metaContents  = '%E2%80%9CEvery+job+is+a+self+portrait+of+the+person+who+does+it.+We+autograph+our+work+with+excellence.%E2%80%9D+';
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();
};
