/* [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','2501',jdecode('Home'),jdecode(''),'/2501/index.html','true',[ 
		['PAGE','26922',jdecode('Vision'),jdecode(''),'/2501/26922.html','true',[],'',''],
		['PAGE','26943',jdecode('Organisational+Values'),jdecode(''),'/2501/26943.html','true',[],'','']
	],'',''],
	['PAGE','2552',jdecode('About+us'),jdecode(''),'/2552/index.html','true',[ 
		['PAGE','13701',jdecode('Founding+Members'),jdecode(''),'/2552/13701.html','true',[],'',''],
		['PAGE','6501',jdecode('Board+of+Trustees'),jdecode(''),'/2552/6501.html','true',[],'',''],
		['PAGE','2573',jdecode('Contact'),jdecode(''),'/2552/2573.html','true',[],'','']
	],'',''],
	['PAGE','26822',jdecode('History'),jdecode(''),'/26822/index.html','true',[ 
		['PAGE','5401',jdecode('Order+of+Baobab'),jdecode(''),'/26822/5401.html','true',[],'',''],
		['PAGE','28901',jdecode('Legacy+of+Wilgespruit'),jdecode(''),'/26822/28901.html','true',[],'','']
	],'',''],
	['PAGE','35601',jdecode('Appreciative+Inquiry'),jdecode(''),'/35601/index.html','true',[ 
		['PAGE','36301',jdecode('A+Centre+for+Excellence'),jdecode(''),'/35601/36301.html','true',[],'',''],
		['PAGE','35643',jdecode('AI+Offer+%40+WFC'),jdecode(''),'/35601/35643.html','true',[],'',''],
		['PAGE','35664',jdecode('Contacts'),jdecode(''),'/35601/35664.html','true',[],'','']
	],'',''],
	['PAGE','37901',jdecode('What+Wilgespruit+Offers...'),jdecode(''),'/37901/index.html','true',[ 
		['PAGE','37922',jdecode('Benedictine+Retreat'),jdecode(''),'/37901/37922.html','true',[],'',''],
		['PAGE','37943',jdecode('Eco+Spirituality+Retreat'),jdecode(''),'/37901/37943.html','true',[],'',''],
		['PAGE','37964',jdecode('Spiritual+Formation+Retreat'),jdecode(''),'/37901/37964.html','true',[],'',''],
		['PAGE','37985',jdecode('Permaculture+for+a+Threatened+Cosmos+'),jdecode(''),'/37901/37985.html','true',[],'',''],
		['PAGE','38101',jdecode('Self+Development+Courses'),jdecode(''),'/37901/38101.html','true',[],'','']
	],'',''],
	['PAGE','3722',jdecode('Conference+Facility'),jdecode(''),'/3722/index.html','true',[ 
		['PAGE','3701',jdecode('Guest+House'),jdecode(''),'/3722/3701.html','true',[],'',''],
		['PAGE','21001',jdecode('Email+Us'),jdecode(''),'/3722/21001.html','true',[],'','']
	],'',''],
	['PAGE','26801',jdecode('Programmes'),jdecode(''),'/26801/index.html','true',[ 
		['PAGE','19222',jdecode('Eco+Hope'),jdecode(''),'/26801/19222.html','true',[],'',''],
		['PAGE','32201',jdecode('Computer+Training'),jdecode(''),'/26801/32201.html','true',[],'',''],
		['PAGE','20501',jdecode('CISCO'),jdecode(''),'/26801/20501.html','true',[],'','']
	],'',''],
	['PAGE','2615',jdecode('Employee%26%23x27%3Bs'),jdecode(''),'/2615.html','true',[],'',''],
	['PAGE','2636',jdecode('Donations'),jdecode(''),'/2636.html','true',[],'',''],
	['PAGE','2657',jdecode('Photo+Gallery'),jdecode(''),'/2657.html','true',[],'',''],
	['PAGE','33301',jdecode('Galleries'),jdecode(''),'/33301.html','true',[],'','']];
var siteelementCount=31;
theSitetree.topTemplateName='Pain';
theSitetree.paletteFamily='0E5586';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10721';
theSitetree.graphicsetId='10553';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='0e5586';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Pain',
				paletteFamily: 	'0E5586',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10721',
				graphicsetId: 	'10553',
				contentColor: 	'FFFFFF',
				contentBGColor: '0e5586',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				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:  '2501',
internalId:  '',
customField: '20091107-110628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2552',
internalId:  '',
customField: '20091106-124420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2573',
internalId:  '',
customField: '20091106-093212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3722',
internalId:  '',
customField: '20100209-140013'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2615',
internalId:  '',
customField: '20090819-144011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2636',
internalId:  '',
customField: '20100812-093459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2657',
internalId:  '',
customField: '20090501-200437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36301',
internalId:  '',
customField: '20100811-145500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3701',
internalId:  '',
customField: '20100107-170144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20091106-133333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20091106-125819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13701',
internalId:  '',
customField: '20091106-125021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20501',
internalId:  '',
customField: '20100308-180947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19222',
internalId:  '',
customField: '20091026-204203'
};
webappMappings['7008']=webappMappings['7008-2714']={
webappId:    '7008',
documentId:  '21001',
internalId:  '2714',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21001',
internalId:  '',
customField: '20100209-140401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26922',
internalId:  '',
customField: '20091106-113708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26943',
internalId:  '',
customField: '20091106-120626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28901',
internalId:  '',
customField: '20091106-133414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26801',
internalId:  '',
customField: '20100302-135928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26822',
internalId:  '',
customField: '20091106-132924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32201',
internalId:  '',
customField: '20100302-140643'
};
webappMappings['7060']=webappMappings['7060-5495f05daa8f345b72071257935cc47f']={
webappId:    '7060',
documentId:  '33301',
internalId:  '5495f05daa8f345b72071257935cc47f',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33301',
internalId:  '',
customField: '20100317-095655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35601',
internalId:  '',
customField: '20100811-144357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35643',
internalId:  '',
customField: '20100811-151732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35664',
internalId:  '',
customField: '20100812-094105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37901',
internalId:  '',
customField: '20100819-154947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37922',
internalId:  '',
customField: '20100819-120825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37943',
internalId:  '',
customField: '20100819-111648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37964',
internalId:  '',
customField: '20100819-121307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37985',
internalId:  '',
customField: '20100819-121747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38101',
internalId:  '',
customField: '20100819-123836'
};
var canonHostname = 'sitebuilder1.jnb2.host-h.net';
var accountId     = 'AHTZ10IN2K76';
var companyName   = 'Wilgespruit+Fellowship+Centre';
var htmlTitle	  = '';
var metaKeywords  = '%3CHEAD%3EWFC%2C+Wilgespruit+Fellowship+Centre%2CChurch%2C+NGO%2C+Wilgespruit+Conference+Centre%2C+Accommodation%2C+Guest+House%2C++Work%2C+Worship+and+Witness%2C2010%2C+Cisco%2C+Conference+Facilities%3CHEAD%3E';
var metaContents  = '%3CHEAD%3EWFC%2C+Wilgespruit+Fellowship+Centre%2CChurch%2C+NGO%2C+Wilgespruit+Conference+Centre%2C+Accommodation%2C+Guest+House%2C+Work%2C+Worship+and+Witness%2C2010%2C+Cisco%2C+Conference+Facilities%3CHEAD%3E';
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();
};
