/* [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','4519',jdecode('Home'),jdecode(''),'/4519.html','true',[],'',''],
	['PAGE','4630',jdecode('Actions'),jdecode(''),'/4630/index.html','true',[ 
		['PAGE','4684',jdecode('Model+P'),jdecode(''),'/4630/4684.html','true',[],'',''],
		['PAGE','4657',jdecode('Model+PL'),jdecode(''),'/4630/4657.html','true',[],'',''],
		['PAGE','17469',jdecode('Model+PT'),jdecode(''),'/4630/17469.html','true',[],'',''],
		['PAGE','17944',jdecode('Model+P-Chey'),jdecode(''),'/4630/17944.html','true',[],'',''],
		['PAGE','14462',jdecode('Model+S'),jdecode(''),'/4630/14462.html','true',[],'',''],
		['PAGE','14192',jdecode('Model+SM'),jdecode(''),'/4630/14192.html','true',[],'',''],
		['PAGE','17478',jdecode('Model+GP'),jdecode(''),'/4630/17478.html','true',[],'','']
	],'',''],
	['PAGE','17487',jdecode('%26%23x27%3B07%26%23x27%3B+Rifle'),jdecode(''),'/17487.html','true',[],'',''],
	['PAGE','30401',jdecode('%26%23x27%3B10%26%23x27%3B+Rifle'),jdecode(''),'/30401.html','true',[],'',''],
	['PAGE','18314',jdecode('%26%23x27%3BGP%26%23x27%3B+Rifle'),jdecode(''),'/18314.html','true',[],'',''],
	['PAGE','14489',jdecode('Stocks+%26+Stock+Materials'),jdecode(''),'/14489.html','true',[],'',''],
	['PAGE','4711',jdecode('Accessories'),jdecode(''),'/4711.html','true',[],'',''],
	['PAGE','17496',jdecode('Barnard+Trigger'),jdecode(''),'/17496/index.html','true',[ 
		['PAGE','18323',jdecode('Instructions+'),jdecode(''),'/17496/18323.html','true',[],'','']
	],'',''],
	['PAGE','18424',jdecode('Actions+%26+Remington+Triggers'),jdecode(''),'/18424/index.html','true',[ 
		['PAGE','18130',jdecode('Models+P%2CPL%2CPT'),jdecode(''),'/18424/18130.html','true',[],'',''],
		['PAGE','18332',jdecode('Model+S+Trigger'),jdecode(''),'/18424/18332.html','true',[],'','']
	],'',''],
	['PAGE','4576',jdecode('Images'),jdecode(''),'/4576.html','true',[],'',''],
	['PAGE','4603',jdecode('Users+Images+'),jdecode(''),'/4603.html','true',[],'',''],
	['PAGE','18341',jdecode('Hall+of+Fame'),jdecode(''),'/18341.html','true',[],'',''],
	['PAGE','18510',jdecode('Technical+Information'),jdecode(''),'/18510/index.html','true',[ 
		['PAGE','18520',jdecode('Barrel+thread+drgs'),jdecode(''),'/18510/18520.html','true',[],'',''],
		['PAGE','19701',jdecode('Action+drgs'),jdecode(''),'/18510/19701.html','true',[],'','']
	],'',''],
	['PAGE','4792',jdecode('Agents'),jdecode(''),'/4792/index.html','true',[ 
		['PAGE','4819',jdecode('Addresses'),jdecode(''),'/4792/4819.html','true',[],'','']
	],'',''],
	['PAGE','4846',jdecode('Contact+Us'),jdecode(''),'/4846.html','true',[],'','']];
var siteelementCount=28;
theSitetree.topTemplateName='Moonflight';
theSitetree.paletteFamily='AF5367';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='445';
theSitetree.graphicsetId='502';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Moonflight',
				paletteFamily: 	'AF5367',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'445',
				graphicsetId: 	'502',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'98223B',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4519',
internalId:  '',
customField: '20091216-163541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17487',
internalId:  '',
customField: '20090924-210400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4630',
internalId:  '',
customField: '20090928-175756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4684',
internalId:  '',
customField: '20090924-215856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4657',
internalId:  '',
customField: '20070904-031856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17469',
internalId:  '',
customField: '20091119-183418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17944',
internalId:  '',
customField: '20090924-212135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14462',
internalId:  '',
customField: '20090924-212814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14192',
internalId:  '',
customField: '20091208-210508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17478',
internalId:  '',
customField: '20090924-214952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18314',
internalId:  '',
customField: '20090813-214656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14489',
internalId:  '',
customField: '20070830-042513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4711',
internalId:  '',
customField: '20070826-200036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17496',
internalId:  '',
customField: '20080506-015358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18323',
internalId:  '',
customField: '20091214-145308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18424',
internalId:  '',
customField: '20080506-025757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18130',
internalId:  '',
customField: '20080506-022752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18332',
internalId:  '',
customField: '20080506-025100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4603',
internalId:  '',
customField: '20091216-162636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4576',
internalId:  '',
customField: '20091216-162732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18341',
internalId:  '',
customField: '20091216-162406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4792',
internalId:  '',
customField: '20091216-161828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4819',
internalId:  '',
customField: '20050526-190826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4846',
internalId:  '',
customField: '20091216-161858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18510',
internalId:  '',
customField: '20091216-153855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18520',
internalId:  '',
customField: '20100321-152130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19701',
internalId:  '',
customField: '20100218-173304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30401',
internalId:  '',
customField: '20100721-162504'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10IN2GSM';
var companyName   = 'BARNARD+PRECISION';
var htmlTitle	  = '';
var metaKeywords  = 'RifleTarget+RifleTactical+rifle+BMGChey-tac';
var metaContents  = 'Rifle+actionTarget+RiflePrecision+TriggerTactical+Rifle';
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();
};
