/* [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','32',jdecode('Home'),jdecode(''),'/32.html','true',[],'',''],
	['PAGE','1110',jdecode('About+us'),jdecode(''),'/1110/index.html','true',[ 
		['PAGE','1119',jdecode('Officers'),jdecode(''),'/1110/1119.html','true',[],'',''],
		['PAGE','1128',jdecode('Members'),jdecode(''),'/1110/1128.html','true',[],'',''],
		['PAGE','1137',jdecode('Auxilliary'),jdecode(''),'/1110/1137.html','true',[],'','']
	],'',''],
	['PAGE','1656',jdecode('Membership'),jdecode(''),'/1656.html','true',[],'',''],
	['PAGE','1146',jdecode('Contact'),jdecode(''),'/1146/index.html','true',[ 
		['PAGE','1155',jdecode('Adresses'),jdecode(''),'/1146/1155.html','true',[],'',''],
		['PAGE','2671',jdecode('Email+Addresses'),jdecode(''),'/1146/2671.html','true',[],'','']
	],'',''],
	['PAGE','1592',jdecode('RAC+Photo+Album'),jdecode(''),'/1592.html','true',[],'',''],
	['PAGE','2477',jdecode('Members+Area'),jdecode(''),'/2477/index.html','true',[ 
		['PAGE','2579',jdecode('Monthly+Time+Sheet'),jdecode(''),'/2477/2579.html','true',[],'','']
	],'',''],
	['PAGE','1173',jdecode('Links'),jdecode(''),'/1173.html','true',[],'',''],
	['PAGE','1518',jdecode('Guestbook'),jdecode(''),'/1518/index.html','true',[ 
		['PAGE','1517',jdecode('Read+Guestbook'),jdecode(''),'/1518/1517.html','true',[],'','']
	],'',''],
	['PAGE','1536',jdecode('Directions'),jdecode(''),'/1536.html','true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Americanlife';
theSitetree.paletteFamily='A71E1E';
theSitetree.keyvisualId='4233';
theSitetree.keyvisualName='kv_4233.jpg';
theSitetree.fontsetId='10674';
theSitetree.graphicsetId='11194';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='C53131';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Americanlife',
				paletteFamily: 	'A71E1E',
				keyvisualId: 	'4233',
				keyvisualName: 	'kv_4233.jpg',
				fontsetId: 		'10674',
				graphicsetId: 	'11194',
				contentColor: 	'FFFFFF',
				contentBGColor: 'C53131',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '32',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20071210-210633'
};
webappMappings['1002']=webappMappings['1002-1518AHW050IN31DI']={
webappId:    '1002',
documentId:  '1518',
internalId:  '1518AHW050IN31DI',
customField: 'icq=false'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '1536',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:false;'
};
webappMappings['7060']=webappMappings['7060-39e144a4a41e1aecdfc1fe3c15373d3c']={
webappId:    '7060',
documentId:  '1592',
internalId:  '39e144a4a41e1aecdfc1fe3c15373d3c',
customField: 'language:en;country:US;'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '32',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US:'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1110',
internalId:  '',
customField: '20070817-145004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1119',
internalId:  '',
customField: '20090129-124325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1128',
internalId:  '',
customField: '20090129-124118'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1137',
internalId:  '',
customField: '20071206-174954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1656',
internalId:  '',
customField: '20070805-154017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1146',
internalId:  '',
customField: '20071205-142358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1155',
internalId:  '',
customField: '20070805-155559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2671',
internalId:  '',
customField: '20090220-081016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1592',
internalId:  '',
customField: '20070805-152111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2477',
internalId:  '',
customField: '20071210-214829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2579',
internalId:  '',
customField: '20071207-123102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1173',
internalId:  '',
customField: '20071211-150535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1518',
internalId:  '',
customField: '20070805-145717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1517',
internalId:  '',
customField: '20070805-145717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1536',
internalId:  '',
customField: '20070805-150217'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050IN31DI';
var companyName   = 'Ringwood+Ambulance+Corps';
var htmlTitle	  = 'Ringwood+Ambulance+Corps';
var metaKeywords  = 'first+aid%2C+ambulance%2C+volunteer%2C+Ringwood%2C+help%2C+EMT%2C+EMS';
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();
};
