/* [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','3101',jdecode('Main'),jdecode(''), jdecode('%2F3101.html'), 'true',[],'',''],
	['PAGE','65923',jdecode('2012+PROGRAMS'),jdecode(''), jdecode('%2F65923.html'), 'true',[],'',''],
	['PAGE','44823',jdecode('Radio+Interview'),jdecode(''), jdecode('%2F44823.html'), 'true',[],'',''],
	['PAGE','33023',jdecode('Free+Healing+Program'),jdecode(''), jdecode('%2F33023.html'), 'true',[],'',''],
	['PAGE','4001',jdecode('Healing+Help'),jdecode(''), jdecode('%2F4001.html'), 'true',[],'',''],
	['PAGE','4101',jdecode('Training++'),jdecode(''), jdecode('%2F4101.html'), 'true',[],'',''],
	['PAGE','4201',jdecode('Emergency+Mass+Con+'),jdecode(''), jdecode('%2F4201.html'), 'true',[],'',''],
	['PAGE','4322',jdecode('Books+and+Articles'),jdecode(''), jdecode('%2F4322.html'), 'true',[],'',''],
	['PAGE','32623',jdecode('TESTIMONIALS'),jdecode(''), jdecode('%2F32623.html'), 'true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Stars';
theSitetree.paletteFamily='3C5284';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10466';
theSitetree.graphicsetId='10913';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3C5284';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'endurance',
  product: 'WSCSYSSSSLY0XRNC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Stars',
				paletteFamily: 	'3C5284',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10466',
				graphicsetId: 	'10913',
				contentColor: 	'FFFFFF',
				contentBGColor: '3C5284',
				a_color: 		'3C5284',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7050']=webappMappings['7050-17010']={
webappId:    '7050',
documentId:  '32623',
internalId:  '17010',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3101',
internalId:  '',
customField: '20120107-175100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4101',
internalId:  '',
customField: '20111101-063829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4001',
internalId:  '',
customField: '20111105-134128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4201',
internalId:  '',
customField: '20111105-130015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32623',
internalId:  '',
customField: '20100904-112449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4322',
internalId:  '',
customField: '20110909-124812'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '3101',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65923',
internalId:  '',
customField: '20111229-111831'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4201',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4001',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4101',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '4322',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44823',
internalId:  '',
customField: '20111202-150528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33023',
internalId:  '',
customField: '20111205-124617'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INLSRZ';
var companyName   = 'World+Service+Institute';
var htmlTitle	  = '';
var metaKeywords  = 'Applying+Divine+Love%2C+Apply+Your+Birthright%2C+Surviving+Chaos%2CSurviving+Chaos%3AHealing+With+Divine+Love%2C+surviving+chaos%2C+Healing+Help%2C+healing+help%2C+Healing+Help+Conference+Call%2C+healing+help+conference+call%2C+Virtual+Healing+Group%2C+virtual+healing+group%2C+Mass+Consciousness+And+Environmental+Healing+Conference+Call%2C+mass+consciousness+and+environmental+healing+conference+call%2C+Training+Conference+Call%2C+mind+and+body%2C+soul+and+mind+and+body+spirituality%2C+spiritual%2C+self+healing%2C+intention%2C+healing+intention%2C+spiritual+healing%2C+healing%2C+alternative+healing%2C+energy+healing%2C+self+help+techniques%2C+self-help+techniques%2C+Robert+G+Fritchie%2C+Divine+Love+Group+Healing+Process%2C+DLGHP%2C+emotional+abuse%2C+addictions%2C+heart+disease%2C+self-esteem%2C+miracles%2C+stress%2C+trauma%2C+toxins%2C+adhesions%2C+bacteria%2C+blood+diseases%2C+hearing%2C+nerve+disorders%2C+allergies%2C+bone+healing%2C+stroke%2C+sight%2C+eating+disorders%2C+c%2Cancers%2C+substance+abuse%2C+chemical+poisoning%2C+STD%2C+Post+Traumatic+Stress+Disorder%2C+health%2C+health+news%2C+holistic%2C+holistic+healing%2C+holistic+health%2C+holistic+spiritual+healing%2C+environmental+healing%2C+pollution+healing%2C+radiation+healing';
var metaContents  = 'APPLYING+DIVINE+LOVE';
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();
};

