/* [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'),jdecode(''),'/501.html','true',[],''],
	['PAGE','552',jdecode('About+us'),jdecode(''),'/552.html','true',[],''],
	['PAGE','5701',jdecode('A+word+from+the+Pastor...'),jdecode(''),'/5701.html','true',[],''],
	['PAGE','93212',jdecode('Contact'),jdecode(''),'/93212.html','true',[],''],
	['PAGE','95412',jdecode('The+Way'),jdecode(''),'/95412.html','true',[],''],
	['PAGE','51501',jdecode('New+at+Scott'),jdecode(''),'/51501.html','true',[],''],
	['PAGE','657',jdecode('United+Methodist+Women'),jdecode(''),'/657.html','true',[],''],
	['PAGE','678',jdecode('United+Methodist+Men'),jdecode(''),'/678.html','true',[],''],
	['PAGE','19501',jdecode('Scott+Chancel+Choir'),jdecode(''),'/19501.html','true',[],''],
	['PAGE','24301',jdecode('Angel+Food+Ministries'),jdecode(''),'/24301.html','true',[],''],
	['PAGE','22801',jdecode('Project+%3A+Feed+the+Hungry'),jdecode(''),'/22801.html','true',[],''],
	['PAGE','87512',jdecode('News'),jdecode(''),'/87512.html','true',[],'']];
var siteelementCount=12;
theSitetree.topTemplateName='Zoe';
theSitetree.paletteFamily='243356';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='410';
theSitetree.graphicsetId='456';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Zoe',
				paletteFamily: 	'243356',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'410',
				graphicsetId: 	'456',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'1B2B52',
				e_color: 		'676F74',
				f_color: 		'FE7F01',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7080']=webappMappings['7080-116']={
webappId:    '7080',
documentId:  '501',
internalId:  '116',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-f19446ead2e3254b2955d9d20589bb46']={
webappId:    '7060',
documentId:  '657',
internalId:  'f19446ead2e3254b2955d9d20589bb46',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20091103-232250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20090917-104135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20091013-120657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51501',
internalId:  '',
customField: '20091013-133546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24301',
internalId:  '',
customField: '20091013-102656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20091013-103131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '678',
internalId:  '',
customField: '20091013-104052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19501',
internalId:  '',
customField: '20091103-232416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22801',
internalId:  '',
customField: '20090312-141342'
};
webappMappings['7060']=webappMappings['7060-485eed710fabe89cb523d8c6bfcf5317']={
webappId:    '7060',
documentId:  '19501',
internalId:  '485eed710fabe89cb523d8c6bfcf5317',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '501',
internalId:  '1501',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-0a4c82648738dffa377c00db34e6e244']={
webappId:    '7060',
documentId:  '51501',
internalId:  '0a4c82648738dffa377c00db34e6e244',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-5129654b63dad70581fcfd576c679e25']={
webappId:    '7060',
documentId:  '678',
internalId:  '5129654b63dad70581fcfd576c679e25',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '93212',
internalId:  '',
customField: '20091013-103800'
};
webappMappings['7060']=webappMappings['7060-c49c04b5dcf3878b093b2b6b1b0b2de6']={
webappId:    '7060',
documentId:  '552',
internalId:  'c49c04b5dcf3878b093b2b6b1b0b2de6',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-7976534']={
webappId:    '1501',
documentId:  '501',
internalId:  '7976534',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87512',
internalId:  '',
customField: '20091013-130306'
};
webappMappings['7008']=webappMappings['7008-7412']={
webappId:    '7008',
documentId:  '24301',
internalId:  '7412',
customField: 'language:en;country:US;'
};
webappMappings['7050']=webappMappings['7050-3204']={
webappId:    '7050',
documentId:  '5701',
internalId:  '3204',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-11984']={
webappId:    '7008',
documentId:  '93212',
internalId:  '11984',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95412',
internalId:  '',
customField: '20091103-221626'
};
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INZCAJ';
var companyName   = 'Scott+United+Methodist+Church';
var htmlTitle	  = 'www.scottumet.org';
var metaKeywords  = '';
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();
};
