/* [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','501',jdecode('Home+Page'),jdecode(''),'/501/index.html','true',[ 
		['PAGE','13301',jdecode('Who+We+Are'),jdecode(''),'/501/13301.html','true',[],''],
		['PAGE','90501',jdecode('Newsletter+%26+Bulletins'),jdecode(''),'/501/90501.html','true',[],''],
		['PAGE','8848',jdecode('Links'),jdecode(''),'/501/8848.html','true',[],''],
		['PAGE','552',jdecode('Our+Staff'),jdecode(''),'/501/552.html','true',[],''],
		['PAGE','166401',jdecode('StudentPastor'),jdecode(''),'/501/166401.html','false',[],'']
	],''],
	['PAGE','573',jdecode('Events'),jdecode(''),'/573.html','true',[],''],
	['PAGE','35701',jdecode('Small+Groups'),jdecode(''),'/35701/index.html','true',[ 
		['PAGE','8764',jdecode('Sunday+Morning'),jdecode(''),'/35701/8764.html','true',[],''],
		['PAGE','35722',jdecode('Home+Groups'),jdecode(''),'/35701/35722.html','true',[],''],
		['PAGE','35743',jdecode('Crown+Financial'),jdecode(''),'/35701/35743.html','true',[],'']
	],''],
	['PAGE','2801',jdecode('Ministries'),jdecode(''),'/2801/index.html','true',[ 
		['PAGE','144001',jdecode('Preschool'),jdecode(''),'/2801/144001.html','true',[],''],
		['PAGE','2843',jdecode('Children'),jdecode(''),'/2801/2843.html','true',[],''],
		['PAGE','2822',jdecode('Youth'),jdecode(''),'/2801/2822.html','true',[],''],
		['PAGE','10801',jdecode('College+%26+Career'),jdecode(''),'/2801/10801.html','true',[],''],
		['PAGE','8743',jdecode('Senior+Adult'),jdecode(''),'/2801/8743.html','true',[],''],
		['PAGE','8722',jdecode('Mission+Action'),jdecode(''),'/2801/8722.html','true',[],''],
		['PAGE','15601',jdecode('Women%26%23x27%3Bs+Ministry'),jdecode(''),'/2801/15601.html','true',[],''],
		['PAGE','76501',jdecode('Men%26%23x27%3Bs+Ministry'),jdecode(''),'/2801/76501.html','true',[],''],
		['PAGE','8701',jdecode('Worship+%26+Music'),jdecode(''),'/2801/8701.html','true',[],''],
		['PAGE','134301',jdecode('Choir'),jdecode(''),'/2801/134301.html','false',[],''],
		['PAGE','134322',jdecode('Worship+Teams'),jdecode(''),'/2801/134322.html','false',[],''],
		['PAGE','134343',jdecode('Special+Music'),jdecode(''),'/2801/134343.html','false',[],''],
		['PAGE','134364',jdecode('Media+Teams'),jdecode(''),'/2801/134364.html','false',[],''],
		['PAGE','134385',jdecode('TwiceBorn'),jdecode(''),'/2801/134385.html','false',[],''],
		['PAGE','134406',jdecode('Children%26%23x27%3Bs+Choir'),jdecode(''),'/2801/134406.html','false',[],'']
	],''],
	['PAGE','160101',jdecode('Photo+Album'),jdecode(''),'/160101/index.html','true',[ 
		['PAGE','141701',jdecode('Ribbon+Cutting+Ceremony'),jdecode(''),'/160101/141701.html','false',[],''],
		['PAGE','27901',jdecode('Alaska+Mission+Trip'),jdecode(''),'/160101/27901.html','false',[],'']
	],''],
	['PAGE','8827',jdecode('Find+us%2FContact'),jdecode(''),'/8827/index.html','true',[ 
		['PAGE','152001',jdecode('Our+Campus'),jdecode(''),'/8827/152001.html','true',[],'']
	],'']];
var siteelementCount=32;
theSitetree.topTemplateName='Bow';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='12025';
theSitetree.keyvisualName='kv_12025.jpg';
theSitetree.fontsetId='33250';
theSitetree.graphicsetId='14117';
theSitetree.contentColor='333333';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Bow',
				paletteFamily: 	'000000',
				keyvisualId: 	'12025',
				keyvisualName: 	'kv_12025.jpg',
				fontsetId: 		'33250',
				graphicsetId: 	'14117',
				contentColor: 	'333333',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'F2F5F8',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-0ed9bfa213ea572bf6dc10aac6004737']={
webappId:    '7060',
documentId:  '27901',
internalId:  '0ed9bfa213ea572bf6dc10aac6004737',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '160101',
internalId:  '',
customField: '20100126-165521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100612-193831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20100624-194012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13301',
internalId:  '',
customField: '20100123-183219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90501',
internalId:  '',
customField: '20100602-232836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8848',
internalId:  '',
customField: '20100113-173843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20100612-195223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35701',
internalId:  '',
customField: '20100123-183937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8764',
internalId:  '',
customField: '20100602-232015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35722',
internalId:  '',
customField: '20100223-205037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35743',
internalId:  '',
customField: '20090219-225820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2801',
internalId:  '',
customField: '20100123-184216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2843',
internalId:  '',
customField: '20091124-230823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2822',
internalId:  '',
customField: '20100602-232959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10801',
internalId:  '',
customField: '20100602-233254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134301',
internalId:  '',
customField: '20090907-165429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8743',
internalId:  '',
customField: '20091124-230232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8722',
internalId:  '',
customField: '20100202-205505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27901',
internalId:  '',
customField: '20100126-165356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15601',
internalId:  '',
customField: '20100106-192444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76501',
internalId:  '',
customField: '20100113-183610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8701',
internalId:  '',
customField: '20100117-160413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8827',
internalId:  '',
customField: '20100123-184412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '152001',
internalId:  '',
customField: '20100123-184500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134322',
internalId:  '',
customField: '20090910-213456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134343',
internalId:  '',
customField: '20090910-213120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134364',
internalId:  '',
customField: '20090907-165753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134385',
internalId:  '',
customField: '20090523-215750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134406',
internalId:  '',
customField: '20091124-231059'
};
webappMappings['7060']=webappMappings['7060-b023719fecc2944e342249f2b16703b7']={
webappId:    '7060',
documentId:  '141701',
internalId:  'b023719fecc2944e342249f2b16703b7',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '141701',
internalId:  '',
customField: '20100126-165059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '144001',
internalId:  '',
customField: '20100123-184127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '166401',
internalId:  '',
customField: '20100602-230859'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABRI10INXXCB';
var companyName   = 'God+has+called+us+to+%22make+disciples.%22';
var htmlTitle	  = 'Village+Meadows+Baptist+Church+-+Making+Disciples';
var metaKeywords  = 'Christianity%2C+Sierra+Vista%2C+Church%2C+Baptist%2C+arizona+southern+baptist+convention%2C+village+meadows%2C+fireproof+youth+ministry%2C+worship+services%2C+Jesus+Christ%2C+evangelical+christian%2C+Mark+Pitts%2C+Gale+Trow%2C+Brian+Ellsworth%2C+Jim+Hurlburt%2C+churches%2C+Southern+Baptist%2C+AWANA';
var metaContents  = 'Village+Meadows+Baptist+Church%2C+Sierra+Vista%2C+AZ.+Making+disciples+of+Jesus+Christ+in+Sierra+Vista%2C+Cochise+County%2C+Arizona%2C+and+the+world.';
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();
};
