/* [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','9201',jdecode('Home'),jdecode(''),'/9201.html','true',[],'',''],
	['PAGE','9273',jdecode('Pastors+Pulpit'),jdecode(''),'/9273.html','true',[],'',''],
	['PAGE','9315',jdecode('Women+%26+Missions'),jdecode(''),'/9315.html','true',[],'',''],
	['PAGE','9336',jdecode('Youth+Ministry+HBC'),jdecode(''),'/9336.html','true',[],'',''],
	['PAGE','9252',jdecode('Events+%26+Fundraising'),jdecode(''),'/9252.html','true',[],'',''],
	['PAGE','9399',jdecode('Praising+GOD'),jdecode(''),'/9399.html','true',[],'',''],
	['PAGE','9294',jdecode('Community+News+%26+Links'),jdecode(''),'/9294.html','true',[],'',''],
	['PAGE','9357',jdecode('Contact+Us'),jdecode(''),'/9357.html','true',[],'',''],
	['PAGE','9378',jdecode('Guest+Book'),jdecode(''),'/9378.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='003390';
theSitetree.keyvisualId='1739';
theSitetree.keyvisualName='business1.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='353';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='003390';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'003390',
				keyvisualId: 	'1739',
				keyvisualName: 	'business1.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'353',
				contentColor: 	'FFFFFF',
				contentBGColor: '003390',
				a_color: 		'003390',
				b_color: 		'000000',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-4150']={
webappId:    '7008',
documentId:  '9357',
internalId:  '4150',
customField: 'language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-9378aendu0in2b1g']={
webappId:    '1002',
documentId:  '9378',
internalId:  '9378aendu0in2b1g',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9201',
internalId:  '',
customField: '20110106-122205'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '9201',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-9027381']={
webappId:    '1501',
documentId:  '9201',
internalId:  '9027381',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9273',
internalId:  '',
customField: '20100205-195239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9294',
internalId:  '',
customField: '20110106-121641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9315',
internalId:  '',
customField: '20110116-181306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9336',
internalId:  '',
customField: '20080906-161041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9252',
internalId:  '',
customField: '20110116-134832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9357',
internalId:  '',
customField: '20080529-134851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9378',
internalId:  '',
customField: '20091119-192815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9399',
internalId:  '',
customField: '20100514-203729'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN2B1G';
var companyName   = 'Hopewell+Baptist+Church';
var htmlTitle	  = 'Hopewell+Baptist+Church+-+Adams+Run%2C+Sc';
var metaKeywords  = 'Hopewell+Baptist+Church+Adams+Run+Sc%2CJesus+our+Saviour%2CThe+10+Commandments%2C+Churches%2C+HBC%2C+churches+south+carolina%2C+churches+adams+run+sc%2C+Sc+Baptist+Association%2C+Colleton+Co+Baptist+assn.%2C+Hopewell+Baptist+Church%2C+6869+Parkers+Ferry+Rd%2C+Adams+Run%2C+Sc++ministries%2C+community+outreach+programs%2C+Angel+Food+Ministries%2C+WMU%2C+Brotherhood%2C+Childrens+Church%2C+Vacation+Bible+School%2C+Children+Choir%2C+Adult+Choirs%2C+State+and+International+Missions%2C+Discipleship+Training%2C+Evangelistic+Training%2C+5th+Sunday+Sings%2C+3rd+Saturday+Sings%2C+Youth+Minister%2C+Youth+Camps++fund+raisers.+Operation+Christmas+child%2C+Angel+Food+Ministries+Host+Sites%2C+Pastors%2C+preachers%2C+Naveen+Balakrishnan%2C+food%2Cclothes%2C+nursery%2C+community%2C+wkcl+radio%2C+Angel+Food+Ministries+Host+Sites+in+Ravenel%2CAngel+Food+Ministries+Host+Sites+in+Hollywood%2C+Angel+Food+Ministries+Host+Sites+in+Summerville%2C+Angel+Food+Ministries+Host+Sites+in+Jacksonboro%2C+Angel+Food+Ministries+Host+Sites+Adams+Run%2C+Sc.+Calender+of+Events%2C+Vacation+Bible+Schools%2C+Womens+Missions%2C+Girls+Missions%2C+Single+Families+in+Need%2C+Single+Women%2C+Single+Parents%2C+Baptists++What+we+Believe.';
var metaContents  = 'Hopewell+Baptist+Church++6869+Parkers+Ferry+Rd+Adams+Run%2C+Sc+Founded+in+1861+Our+Saviour+Jesus+Christ+directs+us+in+our+ministries%2C+community+outreach+programs+++missions+opportunitys.+WMU%2C+Brotherhood%2C+Childrens+Church%2C+Vacation+Bible+School%2C+Children+Choir%2C+Adult+Choirs%2C+State+and+International+Missions%2C+DiscipleshipTraining%2C++Evangelistic+Training%2C+5th+Sunday+Sings%2C+3rd+Saturday+Sings%2C+Youth+Minister%2C+Youth+Camps++fund+raisers%2C+Angel+food+Ministries';
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();
};

