/* [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','32',jdecode('Home'),jdecode(''),'/32.html','true',[],''],
	['PAGE','53',jdecode('About+us'),jdecode(''),'/53/index.html','true',[ 
		['PAGE','2160',jdecode('The+Blade+Community'),jdecode(''),'/53/2160.html','true',[],''],
		['PAGE','3634',jdecode('Tests%2C+and+Reviews+'),jdecode(''),'/53/3634.html','true',[],'']
	],''],
	['PAGE','17707',jdecode('Knives+of+S4'),jdecode(''),'/17707.html','true',[],''],
	['PAGE','62',jdecode('Products'),jdecode(''),'/62/index.html','true',[ 
		['PAGE','71',jdecode('Edged+Tools%2FLights'),jdecode(''),'/62/71.html','true',[],''],
		['PAGE','80',jdecode('Advanced+Survival+Kit'),jdecode(''),'/62/80.html','true',[],''],
		['PAGE','8501',jdecode('Chemical+Weapons'),jdecode(''),'/62/8501.html','true',[],''],
		['PAGE','89',jdecode('Security+%26+Electronics'),jdecode(''),'/62/89.html','true',[],''],
		['PAGE','1462',jdecode('Trunk+Portable+ATV'),jdecode(''),'/62/1462.html','true',[],'']
	],''],
	['PAGE','457',jdecode('American+Bladewolf'),jdecode(''),'/457/index.html','true',[ 
		['PAGE','466',jdecode('Responders+Edge'),jdecode(''),'/457/466.html','true',[],''],
		['PAGE','9501',jdecode('Feminine+Edge'),jdecode(''),'/457/9501.html','true',[],'']
	],''],
	['PAGE','475',jdecode('S4+Spokes+Models'),jdecode(''),'/475.html','true',[],''],
	['PAGE','484',jdecode('Road+Warriors'),jdecode(''),'/484.html','true',[],''],
	['PAGE','587',jdecode('Contact'),jdecode(''),'/587.html','true',[],''],
	['PAGE','698',jdecode('News'),jdecode(''),'/698.html','true',[],''],
	['PAGE','753',jdecode('Links'),jdecode(''),'/753.html','true',[],''],
	['PAGE','1744',jdecode('Aruba'),jdecode(''),'/1744.html','true',[],''],
	['PAGE','2671',jdecode('Highlands+Overwatch'),jdecode(''),'/2671.html','true',[],''],
	['PAGE','2965',jdecode('Reiki+Therapy'),jdecode(''),'/2965.html','true',[],''],
	['PAGE','3324',jdecode('Tips'),jdecode(''),'/3324/index.html','true',[ 
		['PAGE','3333',jdecode('Safety'),jdecode(''),'/3324/3333.html','true',[],''],
		['PAGE','3342',jdecode('Survival'),jdecode(''),'/3324/3342.html','true',[],''],
		['PAGE','3351',jdecode('security'),jdecode(''),'/3324/3351.html','true',[],'']
	],'']];
var siteelementCount=26;
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 theTemplate={
				name: 			'Americanlife',
				paletteFamily: 	'A71E1E',
				keyvisualId: 	'4249',
				keyvisualName: 	'kv_4249.jpg',
				fontsetId: 		'10674',
				graphicsetId: 	'11208',
				contentColor: 	'FFFFFF',
				contentBGColor: 'C53131',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				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: '20090709-190749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62',
internalId:  '',
customField: '20070925-152147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1462',
internalId:  '',
customField: '20070910-185320'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8501',
internalId:  '',
customField: '20090412-213836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '484',
internalId:  '',
customField: '20090412-205826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53',
internalId:  '',
customField: '20090607-172352'
};
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:  '71',
internalId:  '',
customField: '20071008-175308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '80',
internalId:  '',
customField: '20061012-143443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89',
internalId:  '',
customField: '20070910-185214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '457',
internalId:  '',
customField: '20100210-180920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '466',
internalId:  '',
customField: '20090607-201650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '475',
internalId:  '',
customField: '20091119-190550'
};
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:  '2671',
internalId:  '',
customField: '20070212-164213'
};
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:  '9501',
internalId:  '',
customField: '20100210-182812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17707',
internalId:  '',
customField: '20100210-185552'
};
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+S4LLC+s44u+blade+knife+axe+tomahawk+american+bladewolf+martial+arts+bladebabe+road+warrior+ATV+RV+truck+motorcycle+scooter+light+flashlight+lantern+safe-light+bug+out+bag+kits+emergency+disaster+crisis+mitigation+response+alarm+lock+radio+shovel+combat+fighting+weapon+self+civil+defense+association+highlands+NJ+overwatch+++';
var metaContents  = 'Safety+Security+Survival+Sciences+Equipment+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();
};
