/* [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','5401',jdecode('Home'),jdecode(''), jdecode('%2F5401%2Findex.html'), 'true',[ 
		['PAGE','5494',jdecode('About+us'),jdecode(''), jdecode('%2F5401%2F5494.html'), 'true',[],'',''],
		['PAGE','5515',jdecode('Contact'),jdecode(''), jdecode('%2F5401%2F5515.html'), 'true',[],'','']
	],'',''],
	['PAGE','29625',jdecode('Instructors'),jdecode(''), jdecode('%2F29625.html'), 'true',[],'',''],
	['PAGE','5452',jdecode('Training'),jdecode(''), jdecode('%2F5452%2Findex.html'), 'true',[ 
		['PAGE','51125',jdecode('HandGuns'),jdecode(''), jdecode('%2F5452%2F51125.html'), 'true',[],'',''],
		['PAGE','56925',jdecode('Tactical+Training'),jdecode(''), jdecode('%2F5452%2F56925.html'), 'true',[],'',''],
		['PAGE','60546',jdecode('Law+Enforcement'),jdecode(''), jdecode('%2F5452%2F60546.html'), 'true',[],'',''],
		['PAGE','60525',jdecode('Armed+Security+Guard++'),jdecode(''), jdecode('%2F5452%2F60525.html'), 'true',[],'',''],
		['PAGE','75336',jdecode('Specials%21%21%21%21%21'),jdecode(''), jdecode('%2F5452%2F75336.html'), 'false',[],'','']
	],'',''],
	['PAGE','20412',jdecode('Laser+Shot'),jdecode(''), jdecode('%2F20412.html'), 'false',[],'',''],
	['PAGE','28725',jdecode('LE+Laser+Shot'),jdecode(''), jdecode('%2F28725.html'), 'false',[],'',''],
	['PAGE','64225',jdecode('Online+Store'),jdecode(''), jdecode('%2F64225%2Findex.html'), 'true',[ 
		['PAGE','77136',jdecode('Scopecoat'),jdecode(''), jdecode('%2F64225%2F77136.html'), 'true',[],'',''],
		['PAGE','88836',jdecode('FAST+LOGO+GEAR'),jdecode(''), jdecode('%2F64225%2F88836.html'), 'true',[],'','']
	],'',''],
	['PAGE','5536',jdecode('Information+Request'),jdecode(''), jdecode('%2F5536.html'), 'true',[],'',''],
	['PAGE','83936',jdecode('Downloads'),jdecode(''), jdecode('%2F83936.html'), 'true',[],'',''],
	['PAGE','48225',jdecode('FAQ'),jdecode(''), jdecode('%2F48225.html'), 'true',[],'',''],
	['PAGE','5701',jdecode('Links'),jdecode(''), jdecode('%2F5701.html'), 'true',[],'',''],
	['PAGE','71136',jdecode('Packing+Heat+in+AZ'),jdecode(''), jdecode('%2F71136.html'), 'true',[],'',''],
	['PAGE','105036',jdecode('FAST+Photo+Albums'),jdecode(''), jdecode('%2F105036%2Findex.html'), 'true',[ 
		['PAGE','99736',jdecode('Photos+-Basic+Handgun'),jdecode(''), jdecode('%2F105036%2F99736.html'), 'true',[],'',''],
		['PAGE','103136',jdecode('Photos+-Tac+Shotgun'),jdecode(''), jdecode('%2F105036%2F103136.html'), 'true',[],'',''],
		['PAGE','103157',jdecode('Photos+-+Tac+Handgun'),jdecode(''), jdecode('%2F105036%2F103157.html'), 'true',[],'','']
	],'',''],
	['PAGE','92136',jdecode('Student+Comments'),jdecode(''), jdecode('%2F92136.html'), 'false',[],'',''],
	['PAGE','134469',jdecode('Recommendations'),jdecode(''), jdecode('%2F134469.html'), 'true',[],'',''],
	['PAGE','129369',jdecode('%21%21NEWS%21%21'),jdecode(''), jdecode('%2F129369.html'), 'true',[],'','']];
var siteelementCount=27;
theSitetree.topTemplateName='Americanlife';
theSitetree.paletteFamily='856C32';
theSitetree.keyvisualId='4249';
theSitetree.keyvisualName='kv_4249.jpg';
theSitetree.fontsetId='10673';
theSitetree.graphicsetId='11204';
theSitetree.contentColor='544116';
theSitetree.contentBGColor='AC8D44';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'hostway_generic',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Americanlife',
				paletteFamily: 	'856C32',
				keyvisualId: 	'4249',
				keyvisualName: 	'kv_4249.jpg',
				fontsetId: 		'10673',
				graphicsetId: 	'11204',
				contentColor: 	'544116',
				contentBGColor: 'AC8D44',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-7508']={
webappId:    '7008',
documentId:  '5536',
internalId:  '7508',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20120105-070206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5452',
internalId:  '',
customField: '20111215-220411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60525',
internalId:  '',
customField: '20100524-222139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5494',
internalId:  '',
customField: '20101120-203809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5536',
internalId:  '',
customField: '20110226-102444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20110328-215750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5515',
internalId:  '',
customField: '20110226-102600'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60546',
internalId:  '',
customField: '20100609-233118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88836',
internalId:  '',
customField: '20100626-222531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20412',
internalId:  '',
customField: '20100518-224421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28725',
internalId:  '',
customField: '20100518-223830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29625',
internalId:  '',
customField: '20110220-090920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56925',
internalId:  '',
customField: '20101120-212533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48225',
internalId:  '',
customField: '20100822-191436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51125',
internalId:  '',
customField: '20111215-221630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64225',
internalId:  '',
customField: '20120105-070258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71136',
internalId:  '',
customField: '20110226-102239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75336',
internalId:  '',
customField: '20100611-200730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77136',
internalId:  '',
customField: '20100612-180121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83936',
internalId:  '',
customField: '20110923-220918'
};
webappMappings['7060']=webappMappings['7060-71cc543e18533ad6d62ed7119aac4a91']={
webappId:    '7060',
documentId:  '103136',
internalId:  '71cc543e18533ad6d62ed7119aac4a91',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92136',
internalId:  '',
customField: '20110518-232850'
};
webappMappings['7060']=webappMappings['7060-105ebe9877a7dd3a5e72f1a20fe735b5']={
webappId:    '7060',
documentId:  '99736',
internalId:  '105ebe9877a7dd3a5e72f1a20fe735b5',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99736',
internalId:  '',
customField: '20100822-212522'
};
webappMappings['7060']=webappMappings['7060-86c9a1aed2b3fa547c14dc8733f139c6']={
webappId:    '7060',
documentId:  '103157',
internalId:  '86c9a1aed2b3fa547c14dc8733f139c6',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103136',
internalId:  '',
customField: '20100822-212605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103157',
internalId:  '',
customField: '20100822-212643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105036',
internalId:  '',
customField: '20100823-213206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129369',
internalId:  '',
customField: '20110127-202226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134469',
internalId:  '',
customField: '20110331-223009'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INZO8F';
var companyName   = 'Firearms+Simulation+Training';
var htmlTitle	  = 'Firearms+Simulation+Training';
var metaKeywords  = 'ccw%2Cconcealed+carry%2Cfirearms+training%2Ctraining%2Cphoenix%2Carizona%2Csimulation%2Ctactical%2Cben+avery%2Cgun%2Cweapons%2Crifle%2Cglock%2C1911%2Ccolt%2Car15%2Claw+enforcement%2Ccivilian%2Csimulation+training%2Cweapons+simulation%2Cair+soft%2Claser+shot';
var metaContents  = 'Firearms+Simulation+Training+-+Training+for+the+REAL+World.++Basic+to+advance+firearms+training+to+include+basic+handgun+to+force-on-force+simulation+training.';
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();
};

