/* [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.html','true',[],'',''],
	['PAGE','38227',jdecode('Historical+Fiction%3F'),jdecode(''),'/38227.html','true',[],'',''],
	['PAGE','13801',jdecode('Meet+the+Author'),jdecode(''),'/13801.html','true',[],'',''],
	['PAGE','11101',jdecode('Testimony'),jdecode(''),'/11101.html','true',[],'',''],
	['PAGE','15501',jdecode('Current+Titles'),jdecode(''),'/15501.html','true',[],'',''],
	['PAGE','7701',jdecode('Excerpts'),jdecode(''),'/7701.html','true',[],'',''],
	['PAGE','12701',jdecode('Reviews'),jdecode(''),'/12701.html','true',[],'',''],
	['PAGE','26013',jdecode('News'),jdecode(''),'/26013.html','true',[],'',''],
	['PAGE','18601',jdecode('Events'),jdecode(''),'/18601.html','true',[],'',''],
	['PAGE','15101',jdecode('Historical+Toy+Swords+'),jdecode(''),'/15101.html','true',[],'',''],
	['PAGE','30627',jdecode('Late+Viking+Sword'),jdecode(''),'/30627.html','false',[],'',''],
	['PAGE','29127',jdecode('Norman+Sword'),jdecode(''),'/29127.html','false',[],'',''],
	['PAGE','28527',jdecode('Roman+Gladius'),jdecode(''),'/28527.html','false',[],'',''],
	['PAGE','30027',jdecode('Early+Viking+Sword'),jdecode(''),'/30027.html','false',[],'',''],
	['PAGE','6201',jdecode('Shopping+Cart'),jdecode(''),'/6201.html','true',[],'',''],
	['PAGE','7601',jdecode('Excerpt+-+Warrior+of+the+Son'),jdecode(''),'/7601.html','false',[],'',''],
	['PAGE','7622',jdecode('Excerpt+-+Priests+of+Moloch'),jdecode(''),'/7622.html','false',[],'',''],
	['PAGE','20101',jdecode('Excerpt+-+The+Fields+of+Clon+Miarth'),jdecode(''),'/20101.html','false',[],'',''],
	['PAGE','20501',jdecode('Excerpt+-+Fire+From+the+Earth'),jdecode(''),'/20501.html','false',[],'',''],
	['PAGE','34327',jdecode('Excerpt+-+The+Queen%26%23x27%3Bs+Own'),jdecode(''),'/34327.html','false',[],'',''],
	['PAGE','10801',jdecode('Photo+Album'),jdecode(''),'/10801.html','true',[],'',''],
	['PAGE','14401',jdecode('Contact+the+author'),jdecode(''),'/14401.html','true',[],'',''],
	['PAGE','12401',jdecode('The+Artist'),jdecode(''),'/12401.html','true',[],'',''],
	['PAGE','12601',jdecode('Laurie%26%23x27%3Bs+Work'),jdecode(''),'/12601.html','false',[],'',''],
	['PAGE','14901',jdecode('Favorite+Literature'),jdecode(''),'/14901.html','true',[],'',''],
	['PAGE','16201',jdecode('Glossary'),jdecode(''),'/16201.html','true',[],'',''],
	['PAGE','13701',jdecode('Links'),jdecode(''),'/13701.html','true',[],'','']];
var siteelementCount=27;
theSitetree.topTemplateName='Mondrian';
theSitetree.paletteFamily='3E51B5';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10460';
theSitetree.graphicsetId='10886';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3E51B5';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Mondrian',
				paletteFamily: 	'3E51B5',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10460',
				graphicsetId: 	'10886',
				contentColor: 	'FFFFFF',
				contentBGColor: '3E51B5',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'D3D3D3',
				e_color: 		'D3D3D3',
				f_color: 		'D3D3D3',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20100419-045002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2501',
internalId:  '',
customField: '20100419-020607'
};
webappMappings['4001']=webappMappings['4001-1558368']={
webappId:    '4001',
documentId:  '6201',
internalId:  '1558368',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20090122-115913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7601',
internalId:  '',
customField: '20100419-032222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7622',
internalId:  '',
customField: '20090128-125745'
};
webappMappings['7060']=webappMappings['7060-82750d05601fbcf4b33893579685a081']={
webappId:    '7060',
documentId:  '10801',
internalId:  '82750d05601fbcf4b33893579685a081',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10801',
internalId:  '',
customField: '20090122-153502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11101',
internalId:  '',
customField: '20100419-050743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12401',
internalId:  '',
customField: '20090128-100415'
};
webappMappings['7060']=webappMappings['7060-a28ca3b8e581ad3682a43477ac6d3d55']={
webappId:    '7060',
documentId:  '12601',
internalId:  'a28ca3b8e581ad3682a43477ac6d3d55',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12701',
internalId:  '',
customField: '20090202-133210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12601',
internalId:  '',
customField: '20090220-144226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13801',
internalId:  '',
customField: '20090128-101003'
};
webappMappings['7008']=webappMappings['7008-301']={
webappId:    '7008',
documentId:  '14401',
internalId:  '301',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14401',
internalId:  '',
customField: '20090123-142622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13701',
internalId:  '',
customField: '20100716-053359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14901',
internalId:  '',
customField: '20090616-112058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15101',
internalId:  '',
customField: '20100419-053006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15501',
internalId:  '',
customField: '20100419-042934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16201',
internalId:  '',
customField: '20090128-131740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18601',
internalId:  '',
customField: '20100419-044615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20101',
internalId:  '',
customField: '20090128-130241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20501',
internalId:  '',
customField: '20090128-130604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26013',
internalId:  '',
customField: '20100419-030142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28527',
internalId:  '',
customField: '20090615-114635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29127',
internalId:  '',
customField: '20090615-114825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30027',
internalId:  '',
customField: '20090615-121132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30627',
internalId:  '',
customField: '20090615-122950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34327',
internalId:  '',
customField: '20100503-075729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38227',
internalId:  '',
customField: '20100720-055401'
};
var canonHostname = 'localhost';
var accountId     = 'ANFI10INXE19';
var companyName   = 'CHRISTIAN+WARRIOR+BOOKS';
var htmlTitle	  = '';
var metaKeywords  = 'Christian+Fantasy%2C+Christian+Fiction%2C+Epic+Fantasy%2C+Fantasy%2C+Christian+Fantasy+Series';
var metaContents  = 'Christian+Fantasy+books++by+author+Samuel+Schiller.+In+the+tradition+of+J.R.R.+Tolkien+and++C.S.+Lewis%2C+this+ongoing+series+presents+all+the+elements+of+the+Fantasy+genre+while+adding+the+Mercy+and+awesome+Power+of+God.';
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();
};
