/* [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','5001',jdecode('HOME'),jdecode(''),'/5001.html','true',[],'',''],
	['PAGE','22943',jdecode('ONLINE+GIVING'),jdecode(''),'/22943.html','true',[],'',''],
	['PAGE','23664',jdecode('SENIOR+PASTORS'),jdecode(''),'/23664.html','true',[],'',''],
	['PAGE','23685',jdecode('WHAT+WE+BELIEVE'),jdecode(''),'/23685.html','true',[],'',''],
	['PAGE','37443',jdecode('AFFINITY+GROUPS'),jdecode(''),'/37443.html','true',[],'',''],
	['PAGE','37401',jdecode('ANNOUNCEMENTS'),jdecode(''),'/37401.html','true',[],'',''],
	['PAGE','92601',jdecode('CALENDAR'),jdecode(''),'/92601.html','true',[],'',''],
	['PAGE','36901',jdecode('WORSHIP'),jdecode(''),'/36901.html','true',[],'',''],
	['PAGE','36964',jdecode('LIFE+GROUPS'),jdecode(''),'/36964.html','true',[],'',''],
	['PAGE','22985',jdecode('HIGH+SCHOOL+YOUTH'),jdecode(''),'/22985.html','true',[],'',''],
	['PAGE','23006',jdecode('JR.+HIGH+YOUTH'),jdecode(''),'/23006.html','true',[],'',''],
	['PAGE','23027',jdecode('WOMEN%26%23x27%3BS+GROUP'),jdecode(''),'/23027.html','true',[],'',''],
	['PAGE','36722',jdecode('MEN%26%23x27%3BS+GROUP'),jdecode(''),'/36722.html','true',[],'',''],
	['PAGE','36743',jdecode('CHILDRENS+CHURCH'),jdecode(''),'/36743.html','true',[],'',''],
	['PAGE','37422',jdecode('C.L.A.S.S.'),jdecode(''),'/37422.html','true',[],'',''],
	['PAGE','36922',jdecode('JOURNALING'),jdecode(''),'/36922.html','true',[],'',''],
	['PAGE','37464',jdecode('OVERCOMERS'),jdecode(''),'/37464.html','false',[],'',''],
	['PAGE','101801',jdecode('PHOTOS'),jdecode(''),'/101801.html','true',[],'',''],
	['PAGE','23727',jdecode('SERMONS'),jdecode(''),'/23727/index.html','true',[ 
		['PAGE','23748',jdecode('ELIJAH'),jdecode(''),'/23727/23748.html','true',[],'',''],
		['PAGE','23706',jdecode('MIRACLES'),jdecode(''),'/23727/23706.html','true',[],'',''],
		['PAGE','23769',jdecode('GOT+JOY%3F'),jdecode(''),'/23727/23769.html','true',[],'','']
	],'',''],
	['PAGE','92622',jdecode('MAP'),jdecode(''),'/92622.html','true',[],'',''],
	['PAGE','36701',jdecode('DIRECTIONS'),jdecode(''),'/36701.html','true',[],'',''],
	['PAGE','36943',jdecode('CONTACT+US'),jdecode(''),'/36943.html','true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Collage';
theSitetree.paletteFamily='6683B6';
theSitetree.keyvisualId='2454';
theSitetree.keyvisualName='generationen.jpg';
theSitetree.fontsetId='403';
theSitetree.graphicsetId='461';
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: 			'Collage',
				paletteFamily: 	'6683B6',
				keyvisualId: 	'2454',
				keyvisualName: 	'generationen.jpg',
				fontsetId: 		'403',
				graphicsetId: 	'461',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'6683B6',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20110601-144323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23727',
internalId:  '',
customField: '20100816-223025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22943',
internalId:  '',
customField: '20101021-173752'
};
webappMappings['7060']=webappMappings['7060-1d5e8914b74c675c873f7cda4f243f96']={
webappId:    '7060',
documentId:  '23706',
internalId:  '1d5e8914b74c675c873f7cda4f243f96',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-7fa18a6d224c5381a9d6cf776531e160']={
webappId:    '7060',
documentId:  '23748',
internalId:  '7fa18a6d224c5381a9d6cf776531e160',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-f54c04b7051c718b5eca1542f6f9cacc']={
webappId:    '7060',
documentId:  '23769',
internalId:  'f54c04b7051c718b5eca1542f6f9cacc',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23706',
internalId:  '',
customField: '20100814-155331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92601',
internalId:  '',
customField: '20100812-231322'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '36701',
internalId:  'routing',
customField: 'en_US'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23748',
internalId:  '',
customField: '20100814-010954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36701',
internalId:  '',
customField: '20100812-181235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23664',
internalId:  '',
customField: '20100812-000254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22985',
internalId:  '',
customField: '20100812-001635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23027',
internalId:  '',
customField: '20100825-220329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23685',
internalId:  '',
customField: '20100826-172140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36922',
internalId:  '',
customField: '20100827-070033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36964',
internalId:  '',
customField: '20101020-222056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36943',
internalId:  '',
customField: '20101020-233421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37422',
internalId:  '',
customField: '20101020-234005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36901',
internalId:  '',
customField: '20100825-211943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37464',
internalId:  '',
customField: '20100824-223601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36722',
internalId:  '',
customField: '20101020-233526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23769',
internalId:  '',
customField: '20100814-011024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101801',
internalId:  '',
customField: '20100825-210959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37401',
internalId:  '',
customField: '20100825-190431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37443',
internalId:  '',
customField: '20101020-231622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23006',
internalId:  '',
customField: '20100825-213713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36743',
internalId:  '',
customField: '20100826-171918'
};
webappMappings['7060']=webappMappings['7060-060f8d12efe17a64ee65d5bc2c08ec06']={
webappId:    '7060',
documentId:  '101801',
internalId:  '060f8d12efe17a64ee65d5bc2c08ec06',
customField: 'language:en;country:US;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '92622',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92622',
internalId:  '',
customField: '20100812-231359'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INZ2YD';
var companyName   = 'New+Song+Church';
var htmlTitle	  = 'New+Song+Foursquare+Church+Colorado+Springs+Colorado';
var metaKeywords  = 'New+Song+Church%2C+Foursquare+church%2C+Colorado+Springs+Church%2C+miltary+family+church%2C+spanish+american+church%2C+overcomers%2C+Pastor+Jim+Van+Dyke%2C+Julie+Van+Dyke.+Church+in+the+80915+area.+Harvest+Fest.';
var metaContents  = 'New+Song+Church+in+Colorado+Springs%2C+Colorado.++';
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();
};

