/* [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','1701',jdecode('HOME'),jdecode(''),'/1701.html','true',[],'',''],
	['PAGE','9101',jdecode('Famous+VISITORS'),jdecode(''),'/9101.html','true',[],'',''],
	['PAGE','9401',jdecode('PIX'),jdecode(''),'/9401.html','true',[],'',''],
	['PAGE','94860',jdecode('Earth+Map'),jdecode(''),'/94860.html','false',[],'',''],
	['PAGE','94881',jdecode('Nuldoid+Map'),jdecode(''),'/94881.html','false',[],'',''],
	['PAGE','9122',jdecode('READ+Some'),jdecode(''),'/9122/index.html','true',[ 
		['PAGE','9143',jdecode('Chapter+One'),jdecode(''),'/9122/9143.html','true',[],'',''],
		['PAGE','9164',jdecode('Chapter+Two'),jdecode(''),'/9122/9164.html','true',[],'',''],
		['PAGE','144496',jdecode('Chapter+Three'),jdecode(''),'/9122/144496.html','true',[],'',''],
		['PAGE','148396',jdecode('Chapter+Four'),jdecode(''),'/9122/148396.html','true',[],'',''],
		['PAGE','165224',jdecode('Chapter+Five'),jdecode(''),'/9122/165224.html','true',[],'',''],
		['PAGE','48827',jdecode('Random+Excerpts'),jdecode(''),'/9122/48827.html','true',[],'','']
	],'',''],
	['PAGE','74155',jdecode('Nuldoid+MAP'),jdecode(''),'/74155.html','true',[],'',''],
	['PAGE','22601',jdecode('Book+Cover'),jdecode(''),'/22601.html','false',[],'',''],
	['PAGE','9464',jdecode('GLOSSARY'),jdecode(''),'/9464.html','true',[],'',''],
	['PAGE','132586',jdecode('ORDER+YOURS'),jdecode(''),'/132586.html','false',[],'',''],
	['PAGE','9422',jdecode('Author+%26+Artist'),jdecode(''),'/9422.html','true',[],'',''],
	['PAGE','67555',jdecode('Group+Guide'),jdecode(''),'/67555.html','false',[],'',''],
	['PAGE','120971',jdecode('Ask+Ed%21'),jdecode(''),'/120971.html','false',[],'',''],
	['PAGE','117271',jdecode('WRITE+To+Us%21'),jdecode(''),'/117271.html','true',[],'',''],
	['PAGE','124671',jdecode('OPINIONS'),jdecode(''),'/124671.html','true',[],'',''],
	['PAGE','100571',jdecode('Vital+LINKS'),jdecode(''),'/100571.html','true',[],'',''],
	['PAGE','211622',jdecode('MEDIA+Frenzy'),jdecode(''),'/211622.html','true',[],'',''],
	['PAGE','126871',jdecode('Bloggin+Noid'),jdecode(''),'/126871.html','true',[],'',''],
	['PAGE','122471',jdecode('Press'),jdecode(''),'/122471.html','false',[],'',''],
	['PAGE','40801',jdecode('Order+Form'),jdecode(''),'/40801.html','false',[],'',''],
	['PAGE','220436',jdecode('SCHOOLS'),jdecode(''),'/220436.html','true',[],'',''],
	['PAGE','221992',jdecode('INK+DRINKERS+Bookmark'),jdecode(''),'/221992.html','false',[],'',''],
	['PAGE','115671',jdecode('ORDER'),jdecode(''),'/115671.html','true',[],'',''],
	['PAGE','154624',jdecode('Chico+Enterprise+Record'),jdecode(''),'/154624.html','false',[],'',''],
	['PAGE','188038',jdecode('Clay+DETAILS'),jdecode(''),'/188038.html','false',[],'','']];
var siteelementCount=31;
theSitetree.topTemplateName='Circulation';
theSitetree.paletteFamily='FC2323';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10381';
theSitetree.graphicsetId='10561';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Circulation',
				paletteFamily: 	'FC2323',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10381',
				graphicsetId: 	'10561',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1701',
internalId:  '',
customField: '20100714-174252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9101',
internalId:  '',
customField: '20091021-135344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9122',
internalId:  '',
customField: '20100826-153848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9143',
internalId:  '',
customField: '20100826-163115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9164',
internalId:  '',
customField: '20100826-155908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9401',
internalId:  '',
customField: '20100525-111523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9422',
internalId:  '',
customField: '20100617-124634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9464',
internalId:  '',
customField: '20091123-122718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74155',
internalId:  '',
customField: '20100208-105642'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22601',
internalId:  '',
customField: '20090208-225521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40801',
internalId:  '',
customField: '20090817-163152'
};
webappMappings['7008']=webappMappings['7008-9270']={
webappId:    '7008',
documentId:  '9422',
internalId:  '9270',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48827',
internalId:  '',
customField: '20090208-224824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94860',
internalId:  '',
customField: '20090112-190705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124671',
internalId:  '',
customField: '20100608-115945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67555',
internalId:  '',
customField: '20090208-225644'
};
webappMappings['7050']=webappMappings['7050-7624']={
webappId:    '7050',
documentId:  '126871',
internalId:  '7624',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-13229']={
webappId:    '7008',
documentId:  '115671',
internalId:  '13229',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94881',
internalId:  '',
customField: '20090112-191201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100571',
internalId:  '',
customField: '20100429-123252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '122471',
internalId:  '',
customField: '20091225-164631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '120971',
internalId:  '',
customField: '20090215-134958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115671',
internalId:  '',
customField: '20100713-142108'
};
webappMappings['7008']=webappMappings['7008-13387']={
webappId:    '7008',
documentId:  '117271',
internalId:  '13387',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '117271',
internalId:  '',
customField: '20090308-142242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '126871',
internalId:  '',
customField: '20100716-184439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '132586',
internalId:  '',
customField: '20090610-135534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '144496',
internalId:  '',
customField: '20100826-155932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148396',
internalId:  '',
customField: '20100826-155313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '154624',
internalId:  '',
customField: '20090810-163134'
};
webappMappings['1501']=webappMappings['1501-21653398']={
webappId:    '1501',
documentId:  '1701',
internalId:  '21653398',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '165224',
internalId:  '',
customField: '20100826-155742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '188038',
internalId:  '',
customField: '20100302-130311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '211622',
internalId:  '',
customField: '20100604-134546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '220436',
internalId:  '',
customField: '20100616-233121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '221992',
internalId:  '',
customField: '20100616-235120'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INEAGR';
var companyName   = 'The+Wheel+of+Nuldoid%E2%84%A2';
var htmlTitle	  = 'The+Wheel+of+Nuldoid%E2%84%A2';
var metaKeywords  = 'Nuldoid%2Cdwarfs%2Cmunchkins%2Cfantasy%2CHobbits%2CSan+Francisco%2C+Fresno%2C+fantasy+novel';
var metaContents  = 'The+new+fantasy+novel+by+veteran+television+writer+Russ+Woody+%28Murphy+Brown%2C+Cybill%2C+Mad+About+You%2C+Becker%2C+The+Drew+Carey+Show%2C+St.+Elsewhere%2C+Hill+Street+Blues%29.+Three+humans+make+a+wild+journey+to+the+center+of+the+earth+where+the+city+of+Nuldoid+is+inhabited+with+small+quarelsome+creatures+whose+culture+is+based+on+dissent.+There+the+humans+will+see+the+Great+Wheel+of+Nuldoid+and+learn+its+important+secret.';
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();
};
