/* [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','3201',jdecode('Home'),jdecode(''),'/3201.html','true',[],''],
	['PAGE','3522',jdecode('I%26%23x27%3Bm+Broke%21++What+do+I+do%3F'),jdecode(''),'/3522.html','true',[],''],
	['PAGE','14701',jdecode('Budget+Help'),jdecode(''),'/14701.html','true',[],''],
	['PAGE','3273',jdecode('Does+tithing+work%3F'),jdecode(''),'/3273.html','true',[],''],
	['PAGE','3294',jdecode('I%26%23x27%3Bve+paid+tithes+-+Now+what%3F'),jdecode(''),'/3294.html','true',[],''],
	['PAGE','3543',jdecode('Wealth+Redistribution'),jdecode(''),'/3543.html','true',[],''],
	['PAGE','3501',jdecode('The+Power+of+Giving'),jdecode(''),'/3501.html','true',[],''],
	['PAGE','3336',jdecode('History%2FContact+Info'),jdecode(''),'/3336.html','true',[],''],
	['PAGE','8201',jdecode('Search%2FFind'),jdecode(''),'/8201.html','true',[],'']];
var siteelementCount=9;
theSitetree.topTemplateName='Office';
theSitetree.paletteFamily='85AB88';
theSitetree.keyvisualId='11145';
theSitetree.keyvisualName='kv_11145.jpg';
theSitetree.fontsetId='32064';
theSitetree.graphicsetId='13880';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Office',
				paletteFamily: 	'85AB88',
				keyvisualId: 	'11145',
				keyvisualName: 	'kv_11145.jpg',
				fontsetId: 		'32064',
				graphicsetId: 	'13880',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3201',
internalId:  '',
customField: '20100427-212138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8201',
internalId:  '',
customField: '20090901-212445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3273',
internalId:  '',
customField: '20091006-190330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3294',
internalId:  '',
customField: '20091013-193352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3501',
internalId:  '',
customField: '20091020-173756'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3522',
internalId:  '',
customField: '20091027-182452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3543',
internalId:  '',
customField: '20091020-173708'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '8201',
internalId:  'search',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3336',
internalId:  '',
customField: '20091027-184030'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14701',
internalId:  '',
customField: '20091013-180158'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN3Z62';
var companyName   = 'After+Tithing+Ministries+-+helping+tithers+achieve+financial+success';
var htmlTitle	  = 'Tithing+coupled+with+good+money+management+produces+financial+increase';
var metaKeywords  = 'money+managementdebt+counselingdebt+eliminationbudgeting+financeseliminate+credit+card+debtdebt+free+livingcredit+debt+helpcredit+card+debt+counselinggetting+out+of+debtfamily+budgetingbudgeting+advicedebt+counselorconsumer+debtfinancial+budgetbudgeting+tipsdebt+counselingeliminate+debtspending+planchristian+financestithingchurch+financeschurch+stewardshipfaithful+with+littlefaithfu+with+moneyfaithful+with+muchmanaging+financesmanaging+moneypersonal+money+managementhome+financesfamily+financessaving+money+budget+helptithegivingofferingbiblical+stewardshipfinancial+successmaking+more+moneymaking+moneystewardshipdave+ramseychristian+stewardshipdebt+free+consolidationchristian+tithingfinancial+prosperityimprove+your+financesgood+stewardgod+and+moneyfinancial+increasetithing+scripturefaithful+stewardtithing+biblechurch+tithingtitherfinancial+blessingsblessed90%2510%25ten+percentninety+percentother+90first+10improving+your+financesimprove+your+financesimprove+your+financial';
var metaContents  = 'If+youve+ever+felt+like+tithing+isnt+working%2C+this+site+will+give+you+the+keys+to+receiving+the+full+financial+benefits+of+tithing.++Tithers+-+use+these+keys+to+make+financial+success+become+a+reality.';
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();
};
