/* [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','32',jdecode('Home'),jdecode(''), jdecode('%2F32.html'), 'true',[],'',''],
	['PAGE','53',jdecode('About+us'),jdecode(''), jdecode('%2F53%2Findex.html'), 'true',[ 
		['PAGE','2160',jdecode('The+Blade+Community'),jdecode(''), jdecode('%2F53%2F2160.html'), 'true',[],'',''],
		['PAGE','3634',jdecode('Tests%2C+and+Reviews+'),jdecode(''), jdecode('%2F53%2F3634.html'), 'true',[],'','']
	],'',''],
	['PAGE','23107',jdecode('S4+Edged+Systems'),jdecode(''), jdecode('%2F23107%2Findex.html'), 'true',[ 
		['PAGE','23128',jdecode('Responders+Edge'),jdecode(''), jdecode('%2F23107%2F23128.html'), 'true',[],'',''],
		['PAGE','23149',jdecode('Feminine+Edge'),jdecode(''), jdecode('%2F23107%2F23149.html'), 'true',[],'',''],
		['PAGE','23170',jdecode('Ballistic+Edge'),jdecode(''), jdecode('%2F23107%2F23170.html'), 'true',[],'','']
	],'',''],
	['PAGE','23507',jdecode('S4+P.O.I.S.'),jdecode(''), jdecode('%2F23507.html'), 'true',[],'',''],
	['PAGE','23212',jdecode('Center+for+Eschatology'),jdecode(''), jdecode('%2F23212.html'), 'true',[],'',''],
	['PAGE','23191',jdecode('Collections+of+S4'),jdecode(''), jdecode('%2F23191.html'), 'true',[],'',''],
	['PAGE','475',jdecode('S4+Spokes+Models'),jdecode(''), jdecode('%2F475.html'), 'true',[],'',''],
	['PAGE','484',jdecode('Road+Warriors'),jdecode(''), jdecode('%2F484.html'), 'true',[],'',''],
	['PAGE','23528',jdecode('Articles+by+Bladewolf'),jdecode(''), jdecode('%2F23528.html'), 'true',[],'',''],
	['PAGE','587',jdecode('Contact'),jdecode(''), jdecode('%2F587.html'), 'true',[],'',''],
	['PAGE','698',jdecode('News'),jdecode(''), jdecode('%2F698.html'), 'true',[],'',''],
	['PAGE','753',jdecode('Links'),jdecode(''), jdecode('%2F753.html'), 'true',[],'',''],
	['PAGE','1744',jdecode('Aruba'),jdecode(''), jdecode('%2F1744.html'), 'true',[],'',''],
	['PAGE','2965',jdecode('Reiki+Therapy'),jdecode(''), jdecode('%2F2965.html'), 'true',[],'',''],
	['PAGE','3324',jdecode('Tips'),jdecode(''), jdecode('%2F3324%2Findex.html'), 'true',[ 
		['PAGE','3333',jdecode('Safety'),jdecode(''), jdecode('%2F3324%2F3333.html'), 'true',[],'',''],
		['PAGE','3342',jdecode('Survival'),jdecode(''), jdecode('%2F3324%2F3342.html'), 'true',[],'',''],
		['PAGE','3351',jdecode('security'),jdecode(''), jdecode('%2F3324%2F3351.html'), 'true',[],'','']
	],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Americanlife';
theSitetree.paletteFamily='A71E1E';
theSitetree.keyvisualId='4249';
theSitetree.keyvisualName='kv_4249.jpg';
theSitetree.fontsetId='10674';
theSitetree.graphicsetId='11208';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='C53131';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'optimum',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Americanlife',
				paletteFamily: 	'A71E1E',
				keyvisualId: 	'4249',
				keyvisualName: 	'kv_4249.jpg',
				fontsetId: 		'10674',
				graphicsetId: 	'11208',
				contentColor: 	'FFFFFF',
				contentBGColor: 'C53131',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '32',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20070704-175348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '698',
internalId:  '',
customField: '20120118-201436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23107',
internalId:  '',
customField: '20120129-205929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23191',
internalId:  '',
customField: '20120129-205324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '484',
internalId:  '',
customField: '20110727-194016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53',
internalId:  '',
customField: '20120129-200153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2160',
internalId:  '',
customField: '20070330-181759'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3634',
internalId:  '',
customField: '20070725-163251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23507',
internalId:  '',
customField: '20120129-204630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23149',
internalId:  '',
customField: '20120110-202051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23170',
internalId:  '',
customField: '20120129-201330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '475',
internalId:  '',
customField: '20110727-194256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '587',
internalId:  '',
customField: '20060922-163931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '753',
internalId:  '',
customField: '20070126-131639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1744',
internalId:  '',
customField: '20091119-205610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23128',
internalId:  '',
customField: '20120129-210312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2965',
internalId:  '',
customField: '20070412-164342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3324',
internalId:  '',
customField: '20070523-153443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3333',
internalId:  '',
customField: '20070424-144018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3342',
internalId:  '',
customField: '20070523-154300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3351',
internalId:  '',
customField: '20070424-140028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23528',
internalId:  '',
customField: '20120111-210653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23212',
internalId:  '',
customField: '20120118-190525'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INX3ZV';
var companyName   = 'S4+L.L.C.';
var htmlTitle	  = '';
var metaKeywords  = 'safety+security+survival+survivalist+S4+LLC+s44u+blade+knife+axe+tomahawk+american+bladewolf+martial+arts+bladebabe+road+warrior+ATV+RV+truck+motorcycle+scooter+light+flashlight+lantern+bug+out+bag+kits+emergency+disaster+crisis+catastrophe+mitigation+response+alarm+lock+radio+shovel+combat+fighting+weapon+self+civil+defense+association+black+shamrock++++';
var metaContents  = 'Safety+Security+Survival+Sciences+Equipment%2C+training%2C+and+Information.';
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();
};

