/* [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','5801',jdecode('Home'),jdecode(''),'/5801.html','true',[],''],
	['PAGE','16852',jdecode('Services'),jdecode(''),'/16852/index.html','true',[ 
		['PAGE','20222',jdecode('Custom+Shop'),jdecode(''),'/16852/20222.html','true',[],''],
		['PAGE','20243',jdecode('Mossberg+Warranty+Center'),jdecode(''),'/16852/20243.html','true',[],''],
		['PAGE','20501',jdecode('Mossberg+Distibutor'),jdecode(''),'/16852/20501.html','true',[],''],
		['PAGE','34901',jdecode('ExtremeCoat'),jdecode(''),'/16852/34901.html','true',[],'']
	],''],
	['PAGE','16873',jdecode('Products'),jdecode(''),'/16873/index.html','true',[ 
		['PAGE','20522',jdecode('AIMPROtactical+Shotguns'),jdecode(''),'/16873/20522.html','true',[],''],
		['PAGE','23601',jdecode('AIMPROtactical+185'),jdecode(''),'/16873/23601.html','false',[],''],
		['PAGE','24901',jdecode('500+Urban+Operator'),jdecode(''),'/16873/24901.html','false',[],''],
		['PAGE','26101',jdecode('Urban+Combat'),jdecode(''),'/16873/26101.html','false',[],''],
		['PAGE','27701',jdecode('Warrior'),jdecode(''),'/16873/27701.html','false',[],''],
		['PAGE','28801',jdecode('Urban+Cruiser'),jdecode(''),'/16873/28801.html','false',[],''],
		['PAGE','29601',jdecode('Co-Witness'),jdecode(''),'/16873/29601.html','false',[],''],
		['PAGE','29622',jdecode('Ultimate'),jdecode(''),'/16873/29622.html','false',[],''],
		['PAGE','20285',jdecode('Accessories'),jdecode(''),'/16873/20285.html','true',[],''],
		['PAGE','20264',jdecode('Manufacturing+and+R%26D'),jdecode(''),'/16873/20264.html','true',[],''],
		['PAGE','23401',jdecode('Customer%26%23x27%3Bs+Gallery'),jdecode(''),'/16873/23401.html','true',[],'']
	],''],
	['PAGE','16894',jdecode('Training'),jdecode(''),'/16894/index.html','true',[ 
		['PAGE','20306',jdecode('Law+Enforcement'),jdecode(''),'/16894/20306.html','true',[],''],
		['PAGE','20327',jdecode('Civilian'),jdecode(''),'/16894/20327.html','true',[],''],
		['PAGE','40743',jdecode('Training+Schedule'),jdecode(''),'/16894/40743.html','true',[],'']
	],''],
	['PAGE','5852',jdecode('Contact+Us'),jdecode(''),'/5852.html','true',[],''],
	['PAGE','16915',jdecode('About+us'),jdecode(''),'/16915/index.html','true',[ 
		['PAGE','16936',jdecode('Our+team'),jdecode(''),'/16915/16936.html','true',[],'']
	],''],
	['PAGE','16957',jdecode('How+to+find+our+Shop'),jdecode(''),'/16957.html','true',[],''],
	['PAGE','40643',jdecode('Training+and+Service+Request'),jdecode(''),'/40643.html','true',[],''],
	['PAGE','16978',jdecode('Special+events'),jdecode(''),'/16978.html','true',[],''],
	['PAGE','16999',jdecode('F.A.+Q.'),jdecode(''),'/16999.html','true',[],''],
	['PAGE','43843',jdecode('Cutomer+Feedback'),jdecode(''),'/43843.html','true',[],''],
	['PAGE','43864',jdecode('Links'),jdecode(''),'/43864.html','true',[],'']];
var siteelementCount=31;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='D72B2B';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10461';
theSitetree.graphicsetId='10893';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Alpha',
				paletteFamily: 	'D72B2B',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10461',
				graphicsetId: 	'10893',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'D72B2B',
				e_color: 		'D72B2B',
				f_color: 		'D72B2B',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20091011-153200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20222',
internalId:  '',
customField: '20091007-180605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16852',
internalId:  '',
customField: '20090926-202533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16873',
internalId:  '',
customField: '20091011-193031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16894',
internalId:  '',
customField: '20091010-201543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20243',
internalId:  '',
customField: '20091010-003952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20501',
internalId:  '',
customField: '20091011-192443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20522',
internalId:  '',
customField: '20091011-202457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20285',
internalId:  '',
customField: '20091208-141753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20264',
internalId:  '',
customField: '20091010-004159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20306',
internalId:  '',
customField: '20091010-201444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20327',
internalId:  '',
customField: '20091010-201406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5852',
internalId:  '',
customField: '20091204-121913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16915',
internalId:  '',
customField: '20091012-213202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16936',
internalId:  '',
customField: '20090920-170932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16957',
internalId:  '',
customField: '20091208-140719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16978',
internalId:  '',
customField: '20091208-134427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16999',
internalId:  '',
customField: '20091011-202910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23601',
internalId:  '',
customField: '20090922-170826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24901',
internalId:  '',
customField: '20090923-145344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26101',
internalId:  '',
customField: '20090923-145433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27701',
internalId:  '',
customField: '20090923-145523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28801',
internalId:  '',
customField: '20090923-173122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23401',
internalId:  '',
customField: '20091011-201543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29601',
internalId:  '',
customField: '20090923-170013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29622',
internalId:  '',
customField: '20091011-202551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34901',
internalId:  '',
customField: '20091208-142629'
};
webappMappings['7008']=webappMappings['7008-21854']={
webappId:    '7008',
documentId:  '40643',
internalId:  '21854',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40643',
internalId:  '',
customField: '20091010-201916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43843',
internalId:  '',
customField: '20091011-203749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43864',
internalId:  '',
customField: '20091011-202035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40743',
internalId:  '',
customField: '20091010-195956'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INV54U';
var companyName   = 'AIMPRO+Tactical';
var htmlTitle	  = 'AIMPRO+Tactical';
var metaKeywords  = '';
var metaContents  = '';
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();
};
