/* [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','2201',jdecode('About+Johnny+Roberts'),jdecode(''),'/2201.html','true',[],'',''],
	['PAGE','9322',jdecode('About+Johnny%26%23x27%3Bs+Book'),jdecode(''),'/9322.html','true',[],'',''],
	['PAGE','9301',jdecode('Voice+of+TUMS+Racing'),jdecode(''),'/9301.html','false',[],'',''],
	['PAGE','14273',jdecode('Inspirational+Thoughts'),jdecode(''),'/14273.html','true',[],'',''],
	['PAGE','9343',jdecode('Facebook+%26+Contact+Info'),jdecode(''),'/9343.html','true',[],'',''],
	['PAGE','22101',jdecode('A+FREE+GIFT+For+YOU%21'),jdecode(''),'/22101.html','true',[],'','']];
var siteelementCount=6;
theSitetree.topTemplateName='Livinginamerica';
theSitetree.paletteFamily='A9915F';
theSitetree.keyvisualId='6330';
theSitetree.keyvisualName='kv_6330.jpg';
theSitetree.fontsetId='11151';
theSitetree.graphicsetId='11959';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E2D4B7';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Livinginamerica',
				paletteFamily: 	'A9915F',
				keyvisualId: 	'6330',
				keyvisualName: 	'kv_6330.jpg',
				fontsetId: 		'11151',
				graphicsetId: 	'11959',
				contentColor: 	'000000',
				contentBGColor: 'E2D4B7',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20100904-002615'
};
webappMappings['7008']=webappMappings['7008-26209']={
webappId:    '7008',
documentId:  '9343',
internalId:  '26209',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9301',
internalId:  '',
customField: '20100608-091545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9322',
internalId:  '',
customField: '20100610-152951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9343',
internalId:  '',
customField: '20100610-154328'
};
webappMappings['7050']=webappMappings['7050-15278']={
webappId:    '7050',
documentId:  '14273',
internalId:  '15278',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-26352']={
webappId:    '7008',
documentId:  '22101',
internalId:  '26352',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14273',
internalId:  '',
customField: '20100323-134457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22101',
internalId:  '',
customField: '20100608-213423'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0INL9PS';
var companyName   = 'Johnny+Roberts++-++Inspirational+Author+%26+Speaker';
var htmlTitle	  = 'Johnny+Roberts+-+Author+of+%22I+Believe+In+You%21%22';
var metaKeywords  = 'Johnny+Roberts%2C+Johnny+Roberts%2C+Johnny+Roberts%2C+Johnny+Roberts+Motivational+Speaker%2C+motivational+speaker%2C+Christian+Motivational+Speaker%2C+Inspirational+Author%2C+motivational+speaker+johnson+city%2C+church+speaker%2C+church+speaker+johnson+city%2C+corporate+speaker+johnson+city%2C+Success%2C+I+Believe+In+You%21%2C+I+Believe+In+You%21+How+You+Can+Live+the+Life+of+Your+Dreams+and+Retire+Rich%2C+free+ebook%2C+need+a+speaker%2C+Johnny+Roberts%2C+Johnny+Roberts+is+the+The+Voice+of+TUMS+Racing%2C+an+Inspirational+Author+and+a+Motivational+Speaker.+Since+landing+the+dream+job+as+The+Voice+of+TUMS+Racing+in+October+2007%2C+Blountville+Tennessee+native+Johnny+Roberts+has+addressed+over+one+million+NASCAR+fans+in+major+cities+all+across+America.In+July+of+2009%2C+Johnny+released+his+debut+inspirational+book%2C+I+Believe+in+You%21+How+You+Can+Live+the+Life+of+Your+Dreams+Now+and+Retire+Rich+';
var metaContents  = 'Johnny+Roberts%2C+Inspirational+Author++Speaker%3A+Johnny+Roberts+is+the+The+Voice+of+TUMS+Racing%2C+an+Inspirational+Author+and+Speaker.+Since+landing+the+dream+job+as+The+Voice+of+TUMS+Racing+in+October+2007%2C+Blountville+Tennessee+native+Johnny+Roberts+has+addressed+over+one+million+NASCAR+fans+in+major+cities+all+across+America.In+July+of+2009%2C+Johnny+released+his+debut+inspirational+book%2C+I+Believe+in+You%21+How+You+Can+Live+the+Life+of+Your+Dreams+Now+and+Retire+Rich+The+Voice+of+TUMS+Racing%2C+Christian+Motivational+Speaker+Johnson+City%2C+church+speaker+johnson+city%2C+corporate+speaker%2C+johnson+city+motivational+speaker%2C+christian+motivational+speaker%2C+I+Believe+In+You%21%2C+I+Believe+In+You%21+How+You+Can+Live+the+Life+of+Your+Dreams+Now+and+Retire+Rich%21%2C+The+Voice+of+TUMS+Racing%2C+free+ebook+';
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();
};
