/* [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','5601',jdecode('Home'),jdecode(''),'/5601.html','true',[],''],
	['PAGE','5652',jdecode('About'),jdecode(''),'/5652.html','true',[],''],
	['PAGE','5673',jdecode('Frequently+Asked+Questions'),jdecode(''),'/5673.html','true',[],''],
	['PAGE','5694',jdecode('Links'),jdecode(''),'/5694.html','true',[],''],
	['PAGE','5715',jdecode('Location'),jdecode(''),'/5715.html','true',[],''],
	['PAGE','5736',jdecode('Nature+Information'),jdecode(''),'/5736/index.html','true',[ 
		['PAGE','5757',jdecode('Amphibians'),jdecode(''),'/5736/5757.html','true',[],''],
		['PAGE','5778',jdecode('Aquatic+Plants'),jdecode(''),'/5736/5778.html','true',[],''],
		['PAGE','5799',jdecode('Beaver+Feeding+Program'),jdecode(''),'/5736/5799.html','true',[],''],
		['PAGE','5820',jdecode('Beavers'),jdecode(''),'/5736/5820.html','true',[],''],
		['PAGE','5841',jdecode('Birds'),jdecode(''),'/5736/5841.html','true',[],''],
		['PAGE','5862',jdecode('Fish+Habitat'),jdecode(''),'/5736/5862.html','true',[],''],
		['PAGE','5883',jdecode('Tree+Squirrels'),jdecode(''),'/5736/5883.html','true',[],''],
		['PAGE','5904',jdecode('Trees'),jdecode(''),'/5736/5904.html','true',[],''],
		['PAGE','5925',jdecode('Wetlands'),jdecode(''),'/5736/5925.html','true',[],'']
	],''],
	['PAGE','5946',jdecode('Photo+Gallery'),jdecode(''),'/5946.html','true',[],''],
	['PAGE','41801',jdecode('Blog'),jdecode(''),'/41801.html','true',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10892';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10892',
				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: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5652',
internalId:  '',
customField: '20081203-190751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20091029-200555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5673',
internalId:  '',
customField: '20090506-115502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5694',
internalId:  '',
customField: '20091031-170827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5715',
internalId:  '',
customField: '20090520-200948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5736',
internalId:  '',
customField: '20081203-103138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5757',
internalId:  '',
customField: '20081203-103920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5778',
internalId:  '',
customField: '20081203-104831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5799',
internalId:  '',
customField: '20081203-105245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5820',
internalId:  '',
customField: '20091031-171553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5841',
internalId:  '',
customField: '20081203-112900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5862',
internalId:  '',
customField: '20081128-121239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5883',
internalId:  '',
customField: '20090221-212518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5904',
internalId:  '',
customField: '20081203-110801'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5925',
internalId:  '',
customField: '20081203-115330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5946',
internalId:  '',
customField: '20091031-171321'
};
webappMappings['7060']=webappMappings['7060-a2266fae3d58444f13466f3a38e2241f']={
webappId:    '7060',
documentId:  '5946',
internalId:  'a2266fae3d58444f13466f3a38e2241f',
customField: 'language:en;country:US;'
};
webappMappings['7050']=webappMappings['7050-6460']={
webappId:    '7050',
documentId:  '41801',
internalId:  '6460',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41801',
internalId:  '',
customField: '20091031-171510'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5601',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INENQP';
var companyName   = 'The+Beaver+Boardwalk';
var htmlTitle	  = 'Beaver+Boardwalk';
var metaKeywords  = 'Beaver+Boardwalk+Hinton+Alberta+Canada';
var metaContents  = 'The+1.5+km+Beaver+Boardwalk+is+a+unique%2C+wooden+pathway+that+winds+its+way+through+wetlands+and+a+living%2C+fully+functioning+beaver+pond+in+Hinton%2C+Alberta%2C+Canada.';
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();
};
