/* [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 theSitetree=[ 
	['PAGE','11501',jdecode('Home'),jdecode(''),'/11501/index.html','true',[ 
		['PAGE','37601',jdecode('FAQ'),jdecode(''),'/11501/37601.html','false',[],''],
		['PAGE','37701',jdecode('Rationale'),jdecode(''),'/11501/37701.html','true',[],''],
		['PAGE','37722',jdecode('Make+your+own%3F'),jdecode(''),'/11501/37722.html','true',[],'']
	],''],
	['PAGE','11552',jdecode('Products'),jdecode(''),'/11552/index.html','true',[ 
		['PAGE','23285',jdecode('8L+model'),jdecode(''),'/11552/23285.html','true',[],''],
		['PAGE','23201',jdecode('6L+model'),jdecode(''),'/11552/23201.html','true',[],''],
		['PAGE','23222',jdecode('6M+%26+6S+models'),jdecode(''),'/11552/23222.html','true',[],''],
		['PAGE','23264',jdecode('4S+model'),jdecode(''),'/11552/23264.html','true',[],'']
	],''],
	['PAGE','23701',jdecode('Order+page'),jdecode(''),'/23701.html','true',[],''],
	['PAGE','12701',jdecode('Future+products'),jdecode(''),'/12701.html','true',[],''],
	['PAGE','12301',jdecode('Contact'),jdecode(''),'/12301.html','true',[],''],
	['PAGE','12322',jdecode('Horizon+Scan+blog'),jdecode(''),'/12322.html','true',[],''],
	['PAGE','56101',jdecode('On+Vacation'),jdecode(''),'/56101.html','false',[],'']];
var siteelementCount=14;
theSitetree.topTemplateName='Explore';
theSitetree.paletteFamily='363875';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10431';
theSitetree.graphicsetId='10766';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Explore',
				paletteFamily: 	'363875',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10431',
				graphicsetId: 	'10766',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'CBCBCB',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11501',
internalId:  '',
customField: '20090927-225010'
};
webappMappings['7008']=webappMappings['7008-13561']={
webappId:    '7008',
documentId:  '12301',
internalId:  '13561',
customField: 'language:en;country:US;'
};
webappMappings['7050']=webappMappings['7050-7875']={
webappId:    '7050',
documentId:  '12322',
internalId:  '7875',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12301',
internalId:  '',
customField: '20090215-130343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12322',
internalId:  '',
customField: '20090215-123457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11552',
internalId:  '',
customField: '20100209-113518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12701',
internalId:  '',
customField: '20090303-012908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23701',
internalId:  '',
customField: '20100209-102715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23201',
internalId:  '',
customField: '20100209-102452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23222',
internalId:  '',
customField: '20100209-105502'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '11501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37722',
internalId:  '',
customField: '20090411-141917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37701',
internalId:  '',
customField: '20090306-070647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23264',
internalId:  '',
customField: '20090928-001502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23285',
internalId:  '',
customField: '20090701-145112'
};
webappMappings['4001']=webappMappings['4001-15666581']={
webappId:    '4001',
documentId:  '23701',
internalId:  '15666581',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37601',
internalId:  '',
customField: '20090225-232136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56101',
internalId:  '',
customField: '20100102-195626'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INEHPN';
var companyName   = 'Preparedness+Equipment';
var htmlTitle	  = 'Preparedness+Equipment%2C+LLC';
var metaKeywords  = 'SurvivalSurvival+strategyPreparednessPublic+panicCivil+unrestFood+riotsEconomic+collapseMeltdownConfiscationanti-gun+FEMA+campsNew+World+OrderBug+out+bagFood+storageStocking+upGunGunsRifleRiflesFirearmFirearmsWeaponWeaponsBorder+conflictWMD+attackHome+defense911-like+attack';
var metaContents  = 'Preparedness+Equipment%2C+LLC+manufactures+and+markets+hermetic+buried+cache+systems+for+concealment+and+safeguarding+of+valuables+and+critical+survival+items.';
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();
};
