/* [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','6501',jdecode('Home'),jdecode(''),'/6501.html','true',[],''],
	['PAGE','8201',jdecode('NO+RAPTURE+%28Exerpts%29'),jdecode(''),'/8201.html','true',[],''],
	['PAGE','12201',jdecode('NO+RAPTURE+Front+Cover+'),jdecode(''),'/12201.html','true',[],''],
	['PAGE','15101',jdecode('Our+Author'),jdecode(''),'/15101.html','true',[],''],
	['PAGE','8501',jdecode('Comment+and+Email'),jdecode(''),'/8501.html','true',[],''],
	['PAGE','8601',jdecode('Panaxus+Blog'),jdecode(''),'/8601.html','true',[],''],
	['PAGE','6552',jdecode('Contact'),jdecode(''),'/6552.html','true',[],'']];
var siteelementCount=7;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20091008-151407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6552',
internalId:  '',
customField: '20090921-234848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8201',
internalId:  '',
customField: '20091008-152317'
};
webappMappings['7008']=webappMappings['7008-18273']={
webappId:    '7008',
documentId:  '8501',
internalId:  '18273',
customField: 'language:en;country:US;'
};
webappMappings['7050']=webappMappings['7050-10533']={
webappId:    '7050',
documentId:  '8601',
internalId:  '10533',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8501',
internalId:  '',
customField: '20090702-193404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8601',
internalId:  '',
customField: '20090921-231748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12201',
internalId:  '',
customField: '20091008-152927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15101',
internalId:  '',
customField: '20090922-000718'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0IN325Z';
var companyName   = 'Panaxus%2C+Inc.';
var htmlTitle	  = 'No+Rapture';
var metaKeywords  = 'Stephan+Zimmermann%2C+No+Rapture%2C+Damascus%2C+Syria%2C+Syrian+Jews%2C+Cantara+Suhayar%2C+Islam%2C+Christianity%2C+Judaism%2C+Rosh+Hashana%2C+Jewish+New+Year%2C+Ramadan+holiday%2C+mosques+of+Damascus%2C++Middle+Eastern+oil%2C+oil%2C+Tel+Aviv%2C+Jerusalem%2C+Israel%2C+IDF%2C+Israeli+Defense+Forces%2C+IDF%2C+Mossad%2C+Sephardic%2C+Sephardic+rabbi%2C+Ashkenazy%2C+synagogue%2C+Abu+Daoud%2C+Stephan+Zimmermann%2C+physics%2C+physicist%2C+Cambridge%2C+Christmas+Strike%2C+Sonja+Factor%2C+Dogwood+Murders.';
var metaContents  = 'NO+RAPTURE+is+author+STEPHAN+ZIMMERMANNs+fourth+novel%2C+taking+the+reader+for+a+suspenseful+and+turbulent+ride+to+the+international+world+of+big+oil+and+big+religion.Set+in+Damascus%2C+NO+RAPTURE+soon+immerses+you+in+a+monstrous+plot+to+dominate+Middle+Eastern+oil%2C+while+confronting+the+reality+of+nuclear+war.+An+Islamic+woman+physicist+from+Cambridige%2C+a+Sephardic+rabbi+returned+to+Syria+to+restore+a+synagogue%2C+and+a+mysterious%2C+born+again+American+comprise+the+key+protagonists.+Through+their+backgrounds+and+actions%2C+Zimmermann+sheds+invaluable+insights+on+the+three+dominant+western+religions.+Zimmermann+follows+the+success+of+hi+previous+novels%2C+The+Christmas+Strike%2C+The+Sonja+Factor+and+The+Dogwood+Murders+in+the+realm+of+classic+suspense+and+intrigue.++';
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();
};
