/* [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','1801',jdecode('Home'),jdecode(''),'/1801.html','true',[],''],
	['PAGE','1852',jdecode('About+us'),jdecode(''),'/1852/index.html','true',[ 
		['PAGE','1873',jdecode('Our+History'),jdecode(''),'/1852/1873.html','true',[],''],
		['PAGE','1894',jdecode('How+to+find+us'),jdecode(''),'/1852/1894.html','true',[],'']
	],''],
	['PAGE','1915',jdecode('Aircraft'),jdecode(''),'/1915.html','true',[],''],
	['PAGE','1936',jdecode('Gallery'),jdecode(''),'/1936/index.html','true',[ 
		['PAGE','7201',jdecode('Sea+Fury'),jdecode(''),'/1936/7201.html','true',[],''],
		['PAGE','11723',jdecode('T-33'),jdecode(''),'/1936/11723.html','true',[],''],
		['PAGE','13523',jdecode('Lebanon+2009'),jdecode(''),'/1936/13523.html','true',[],'']
	],''],
	['PAGE','9523',jdecode('PX'),jdecode(''),'/9523.html','true',[],''],
	['PAGE','1957',jdecode('Dates%2FEvents'),jdecode(''),'/1957.html','true',[],''],
	['PAGE','1978',jdecode('Newsletter'),jdecode(''),'/1978.html','true',[],''],
	['PAGE','1999',jdecode('Join'),jdecode(''),'/1999.html','true',[],''],
	['PAGE','2020',jdecode('Forum'),jdecode(''),'/2020.html','true',[],''],
	['PAGE','2041',jdecode('Contact'),jdecode(''),'/2041.html','true',[],''],
	['PAGE','7222',jdecode('Weather'),jdecode(''),'/7222.html','true',[],''],
	['PAGE','9544',jdecode('Links'),jdecode(''),'/9544.html','true',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Plainly';
theSitetree.paletteFamily='ABC600';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32114';
theSitetree.graphicsetId='13925';
theSitetree.contentColor='6e6e6d';
theSitetree.contentBGColor='fbfae8';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Plainly',
				paletteFamily: 	'ABC600',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32114',
				graphicsetId: 	'13925',
				contentColor: 	'6e6e6d',
				contentBGColor: 'fbfae8',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '1894',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['7050']=webappMappings['7050-6465']={
webappId:    '7050',
documentId:  '1978',
internalId:  '6465',
customField: 'language:en;country:US;'
};
webappMappings['1003']=webappMappings['1003-aendu0ineuh811df9210388']={
webappId:    '1003',
documentId:  '2020',
internalId:  'aendu0ineuh811df9210388',
customField: 'en:US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20100520-101558'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1852',
internalId:  '',
customField: '20081213-202054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1873',
internalId:  '',
customField: '20081213-203113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1894',
internalId:  '',
customField: '20081213-203227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1915',
internalId:  '',
customField: '20081213-203327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1936',
internalId:  '',
customField: '20081204-084950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1957',
internalId:  '',
customField: '20100709-142149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1978',
internalId:  '',
customField: '20081203-111211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1999',
internalId:  '',
customField: '20100224-180431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2020',
internalId:  '',
customField: '20081203-111356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2041',
internalId:  '',
customField: '20100224-180538'
};
webappMappings['7060']=webappMappings['7060-4f0f96dbddec48c4c354373c33dc5691']={
webappId:    '7060',
documentId:  '7201',
internalId:  '4f0f96dbddec48c4c354373c33dc5691',
customField: 'language:en;country:US;'
};
webappMappings['7080']=webappMappings['7080-335']={
webappId:    '7080',
documentId:  '7222',
internalId:  '335',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7222',
internalId:  '',
customField: '20081204-085752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7201',
internalId:  '',
customField: '20081204-092013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13523',
internalId:  '',
customField: '20090620-110725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9523',
internalId:  '',
customField: '20081213-204926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9544',
internalId:  '',
customField: '20100224-181202'
};
webappMappings['7060']=webappMappings['7060-f51f242caad11622b4e7cf34ceec266b']={
webappId:    '7060',
documentId:  '11723',
internalId:  'f51f242caad11622b4e7cf34ceec266b',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11723',
internalId:  '',
customField: '20090501-140955'
};
webappMappings['7060']=webappMappings['7060-bd983fb4f7b3352b24e9937655f991b4']={
webappId:    '7060',
documentId:  '13523',
internalId:  'bd983fb4f7b3352b24e9937655f991b4',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INEUH8';
var companyName   = 'Memphis+Squadron';
var htmlTitle	  = 'Memphis+Squadron+of+the+Commemorative+Air+Force';
var metaKeywords  = 'warbird+hawker+seafury+sea+fury+caf+commemorative+air+force+memphis+squadron+airplane+fighter';
var metaContents  = 'The+Memphis+Squadron+of+the+Commemorative+Air+Force+is+located+at+General+Dewitt+Spain+airport+in+Memphis%2C+TN.++We+operate+a+Hawker+Sea+Fury+fighter+aircraft+that+is+available+for+airshows%2C+static+displays+and+film+work.++Our+hangar+and+classroom+area+is+available+for+rent+for+use+as+a+reception+hall+or+media+event.';
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();
};
