/* [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','71',jdecode('Products'),jdecode(''), jdecode('%2F71%2Findex.html'), 'true',[ 
		['PAGE','1562',jdecode('Products+%28follow+up+page%29'),jdecode(''), jdecode('%2F71%2F1562.html'), 'false',[],'','']
	],'',''],
	['PAGE','107',jdecode('Catalogue+List'),jdecode(''), jdecode('%2F107%2Findex.html'), 'true',[ 
		['PAGE','2389',jdecode('Catalogue+List+%28follow+up+page%29'),jdecode(''), jdecode('%2F107%2F2389.html'), 'false',[],'','']
	],'',''],
	['PAGE','6636',jdecode('message+continue'),jdecode(''), jdecode('%2F6636.html'), 'true',[],'',''],
	['PAGE','7126',jdecode('Obtain+your+promise'),jdecode(''), jdecode('%2F7126.html'), 'true',[],'',''],
	['PAGE','6381',jdecode('Message'),jdecode(''), jdecode('%2F6381.html'), 'true',[],'',''],
	['PAGE','7403',jdecode('Path+to+destiny'),jdecode(''), jdecode('%2F7403.html'), 'true',[],'',''],
	['PAGE','5964',jdecode('Meditation'),jdecode(''), jdecode('%2F5964.html'), 'true',[],'',''],
	['PAGE','53',jdecode('About+us'),jdecode(''), jdecode('%2F53.html'), 'true',[],'',''],
	['PAGE','125',jdecode('Contact'),jdecode(''), jdecode('%2F125.html'), 'true',[],'',''],
	['PAGE','1236',jdecode('Guestbook'),jdecode(''), jdecode('%2F1236%2Findex.html'), 'true',[ 
		['PAGE','1235',jdecode('Read+Guestbook'),jdecode(''), jdecode('%2F1236%2F1235.html'), 'false',[],'','']
	],'',''],
	['PAGE','47401',jdecode('Haiti+News+and+blog'),jdecode(''), jdecode('%2F47401.html'), 'true',[],'',''],
	['PAGE','32',jdecode('Home'),jdecode(''), jdecode('%2F32.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Europe';
theSitetree.paletteFamily='87A3D5';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11106';
theSitetree.graphicsetId='11885';
theSitetree.contentColor='35477E';
theSitetree.contentBGColor='B0C4E7';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'optimum',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Europe',
				paletteFamily: 	'87A3D5',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11106',
				graphicsetId: 	'11885',
				contentColor: 	'35477E',
				contentBGColor: 'B0C4E7',
				a_color: 		'9BB6E6',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6636',
internalId:  '',
customField: '20100602-135202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47401',
internalId:  '',
customField: '20091117-091247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32',
internalId:  '',
customField: '20110728-122253'
};
webappMappings['7008']=webappMappings['7008-7913']={
webappId:    '7008',
documentId:  '107',
internalId:  '7913',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7126',
internalId:  '',
customField: '20091001-185627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6381',
internalId:  '',
customField: '20100829-181942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7403',
internalId:  '',
customField: '20081126-100109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5964',
internalId:  '',
customField: '20071012-150236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53',
internalId:  '',
customField: '20081126-100513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71',
internalId:  '',
customField: '20101108-092929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1562',
internalId:  '',
customField: '20070427-230301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107',
internalId:  '',
customField: '20101108-094019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2389',
internalId:  '',
customField: '20061005-000651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125',
internalId:  '',
customField: '20090316-133345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1236',
internalId:  '',
customField: '20090117-101913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1235',
internalId:  '',
customField: '20060822-153502'
};
webappMappings['7008']=webappMappings['7008-621']={
webappId:    '7008',
documentId:  '1236',
internalId:  '621',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '32',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-7912']={
webappId:    '7008',
documentId:  '71',
internalId:  '7912',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '32',
internalId:  '1501',
customField: '1501'
};
webappMappings['7050']=webappMappings['7050-977']={
webappId:    '7050',
documentId:  '47401',
internalId:  '977',
customField: 'language:en;country:US;'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050IN2MDS';
var companyName   = 'CHRISTIAN+JUBILEE';
var htmlTitle	  = 'ChristianJubilee';
var metaKeywords  = 'prosperity';
var metaContents  = 'prosperity+and+%2Fmeditation';
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();
};

