/* [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','10901',jdecode('Home'),jdecode(''),'/10901.html','true',[],'',''],
	['PAGE','11036',jdecode('About+Us'),jdecode(''),'/11036/index.html','true',[ 
		['PAGE','102982',jdecode('What+is+Barbershop%3F'),jdecode(''),'/11036/102982.html','true',[],'',''],
		['PAGE','117582',jdecode('Helpful+Links'),jdecode(''),'/11036/117582.html','true',[],'','']
	],'',''],
	['PAGE','10952',jdecode('Directors'),jdecode(''),'/10952.html','true',[],'',''],
	['PAGE','116082',jdecode('Quartets'),jdecode(''),'/116082.html','true',[],'',''],
	['PAGE','11015',jdecode('Events%2FCalendar+'),jdecode(''),'/11015.html','true',[],'',''],
	['PAGE','11057',jdecode('Join+Us'),jdecode(''),'/11057.html','true',[],'',''],
	['PAGE','26957',jdecode('Hire+Us+or+Contact+Us'),jdecode(''),'/26957/index.html','true',[ 
		['PAGE','84282',jdecode('Location'),jdecode(''),'/26957/84282.html','true',[],'','']
	],'',''],
	['PAGE','83471',jdecode('Chorus+Members+Only'),jdecode(''),'/83471/index.html','true',[ 
		['PAGE','108182',jdecode('Fox+Sounds+members'),jdecode(''),'/83471/108182.html','true',[],'',''],
		['PAGE','34957',jdecode('Blog+Spot'),jdecode(''),'/83471/34957.html','true',[],'','']
	],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Citylights';
theSitetree.paletteFamily='333366';
theSitetree.keyvisualId='10443';
theSitetree.keyvisualName='kv_10443.jpg';
theSitetree.fontsetId='26570';
theSitetree.graphicsetId='13392';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333366';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Citylights',
				paletteFamily: 	'333366',
				keyvisualId: 	'10443',
				keyvisualName: 	'kv_10443.jpg',
				fontsetId: 		'26570',
				graphicsetId: 	'13392',
				contentColor: 	'FFFFFF',
				contentBGColor: '333366',
				a_color: 		'3E3535',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10952',
internalId:  '',
customField: '20100824-012737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20100901-233931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11057',
internalId:  '',
customField: '20100826-152220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11015',
internalId:  '',
customField: '20100830-183649'
};
webappMappings['1501']=webappMappings['1501-16424850']={
webappId:    '1501',
documentId:  '10901',
internalId:  '16424850',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11036',
internalId:  '',
customField: '20100826-154023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26957',
internalId:  '',
customField: '20100824-013118'
};
webappMappings['7008']=webappMappings['7008-15366']={
webappId:    '7008',
documentId:  '26957',
internalId:  '15366',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '117582',
internalId:  '',
customField: '20100901-234054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34957',
internalId:  '',
customField: '20100505-233532'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '10901',
internalId:  '1006',
customField: '1006'
};
webappMappings['7050']=webappMappings['7050-8721']={
webappId:    '7050',
documentId:  '34957',
internalId:  '8721',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-cddf7b75e169485c838faf42d106f80d']={
webappId:    '7060',
documentId:  '83471',
internalId:  'cddf7b75e169485c838faf42d106f80d',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83471',
internalId:  '',
customField: '20100820-110121'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '84282',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84282',
internalId:  '',
customField: '20100824-010228'
};
webappMappings['7060']=webappMappings['7060-b98240cb56c06d44016480ce1d1f35b3']={
webappId:    '7060',
documentId:  '108182',
internalId:  'b98240cb56c06d44016480ce1d1f35b3',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102982',
internalId:  '',
customField: '20100820-025043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108182',
internalId:  '',
customField: '20100806-183058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116082',
internalId:  '',
customField: '20100824-004718'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN34I6';
var companyName   = 'Fox+Valley+Chorus+of+Sweet+Adelines';
var htmlTitle	  = 'Foxvalleychorus.org';
var metaKeywords  = 'Sweet+Adeline%27s++Fox+Valley+Chorus++4+part+Harmony++Appleton+Sweet+Adeline%27s++Barbershop++Neenah+Sweet+Adelines+Woman%27s+Chorus+Singing+Group+in+the+Fox+Valley+Acappella+singing';
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();
};
