/* [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','801',jdecode('Ancient+Technology'),jdecode(''),'/801.html','true',[],''],
	['PAGE','322712',jdecode('Ancient+Electroplating'),jdecode(''),'/322712.html','true',[],''],
	['PAGE','224801',jdecode('Ancient+Telescopes'),jdecode(''),'/224801.html','true',[],''],
	['PAGE','219001',jdecode('Ancient+Theaters'),jdecode(''),'/219001.html','true',[],''],
	['PAGE','118901',jdecode('Arc+of+the+Covenant'),jdecode(''),'/118901.html','true',[],''],
	['PAGE','267212',jdecode('Arc+or+Ark+History'),jdecode(''),'/267212.html','true',[],''],
	['PAGE','339212',jdecode('Armageddon+Battle'),jdecode(''),'/339212.html','true',[],''],
	['PAGE','260901',jdecode('Atlantis+Electricity'),jdecode(''),'/260901.html','true',[],''],
	['PAGE','114601',jdecode('Baghdad+Batteries'),jdecode(''),'/114601.html','true',[],''],
	['PAGE','288012',jdecode('Carbon+Arc+Photos'),jdecode(''),'/288012.html','true',[],''],
	['PAGE','348512',jdecode('Demons+%26+Angels'),jdecode(''),'/348512.html','true',[],''],
	['PAGE','252301',jdecode('Electricity+History'),jdecode(''),'/252301.html','true',[],''],
	['PAGE','236401',jdecode('Hebrew+Technology'),jdecode(''),'/236401.html','true',[],''],
	['PAGE','123801',jdecode('Lighthouse+Coins'),jdecode(''),'/123801.html','true',[],''],
	['PAGE','365312',jdecode('Light+Refraction+or+Looming'),jdecode(''),'/365312.html','true',[],''],
	['PAGE','169301',jdecode('Links+Page'),jdecode(''),'/169301.html','true',[],''],
	['PAGE','360912',jdecode('Nikola+Tesla'),jdecode(''),'/360912.html','true',[],''],
	['PAGE','139501',jdecode('Old+Electric+Lights'),jdecode(''),'/139501.html','true',[],''],
	['PAGE','85601',jdecode('Old+Searchlights'),jdecode(''),'/85601.html','true',[],''],
	['PAGE','126901',jdecode('Roman+Electricity'),jdecode(''),'/126901.html','true',[],''],
	['PAGE','344912',jdecode('7+World+Wonders'),jdecode(''),'/344912.html','true',[],''],
	['PAGE','373812',jdecode('Spotlight+or+Searchlight'),jdecode(''),'/373812.html','true',[],''],
	['PAGE','356212',jdecode('Tesla+Interview'),jdecode(''),'/356212.html','true',[],''],
	['PAGE','341712',jdecode('The+Golden+Age'),jdecode(''),'/341712.html','true',[],''],
	['PAGE','85001',jdecode('The+Pharos+Light'),jdecode(''),'/85001.html','true',[],''],
	['PAGE','135101',jdecode('What+say+you%3F'),jdecode(''),'/135101.html','true',[],''],
	['PAGE','271812',jdecode('Where+is+the+Ark'),jdecode(''),'/271812.html','true',[],''],
	['PAGE','350912',jdecode('Vintage+Eyeglasses'),jdecode(''),'/350912.html','true',[],''],
	['PAGE','330712',jdecode('Yahweh+%26+Gods'),jdecode(''),'/330712.html','true',[],'']];
var siteelementCount=29;
theSitetree.topTemplateName='Fantasy';
theSitetree.paletteFamily='906145';
theSitetree.keyvisualId='9904';
theSitetree.keyvisualName='kv4.swf';
theSitetree.fontsetId='17881';
theSitetree.graphicsetId='13064';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Fantasy',
				paletteFamily: 	'906145',
				keyvisualId: 	'9904',
				keyvisualName: 	'kv4.swf',
				fontsetId: 		'17881',
				graphicsetId: 	'13064',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '348512',
internalId:  '',
customField: '20100716-211714'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '365312',
internalId:  '',
customField: '20100716-212438'
};
webappMappings['1003']=webappMappings['1003-abri10in28zx11c7ec894fa']={
webappId:    '1003',
documentId:  '135101',
internalId:  'abri10in28zx11c7ec894fa',
customField: 'en:US:'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20100716-205231'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '344912',
internalId:  '',
customField: '20100716-213610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118901',
internalId:  '',
customField: '20100716-210309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '330712',
internalId:  '',
customField: '20100716-215547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '356212',
internalId:  '',
customField: '20100716-214536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '224801',
internalId:  '',
customField: '20100716-205757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '219001',
internalId:  '',
customField: '20100716-205949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '236401',
internalId:  '',
customField: '20100716-212133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '267212',
internalId:  '',
customField: '20100716-210653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '271812',
internalId:  '',
customField: '20100716-215220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '339212',
internalId:  '',
customField: '20100716-210827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '252301',
internalId:  '',
customField: '20100716-211932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '260901',
internalId:  '',
customField: '20100716-211012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '114601',
internalId:  '',
customField: '20100716-211203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '139501',
internalId:  '',
customField: '20100716-212901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '126901',
internalId:  '',
customField: '20100716-213418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '322712',
internalId:  '',
customField: '20100716-205545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '169301',
internalId:  '',
customField: '20081029-025533'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85601',
internalId:  '',
customField: '20100716-213220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '288012',
internalId:  '',
customField: '20100716-211516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '341712',
internalId:  '',
customField: '20100716-214823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85001',
internalId:  '',
customField: '20100716-215017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123801',
internalId:  '',
customField: '20100716-212307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '135101',
internalId:  '',
customField: '20090123-051903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '350912',
internalId:  '',
customField: '20100716-215350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '360912',
internalId:  '',
customField: '20100716-212644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '373812',
internalId:  '',
customField: '20100716-213821'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABRI10IN28ZX';
var companyName   = 'ANCIENT+TECHNOLOGY';
var htmlTitle	  = 'Ancient+Technology';
var metaKeywords  = 'ancient+technology%2C+Ark+or+Ark+arc+of+the+covenant%2C+searchlights%2C+lighthouses%2C+Tesla%2C+Armageddon%2C+The+Golden+Age%2C+Seven+Wonders+of+the+Ancient+World%2C+Pharos+Lighthouse+of+Alexandria%2C+demons+and+angels%2C+carbon+arc%2C+Yahweh%2C+vintage+eyeglasses%2C+electricity%2C+American+Archives%2C++Hebrew+technology%2C+ancient+gods%2C+searchlights%2C+electric%2C+ancient+Egypt%2C+telescopes%2C+batteries%2C+history%2C+searchlights%2C+Atlantis%2C+coins%2C+Pharos+Lighthouse%2C+the+Seventh+Wonder+of+the+Ancient+World%2C+ancient+electroplating%2C+electricity%2C+electric+lights%2C+looming%2C+light+refraction%2C+Thomas+Edison%2C+movie+theaters+and+houses%2C+movie+projectors+%2C+Saint+Augustine%2C+Lucian%2C+ancient+Egypt%2C+ancient+Egyptian+technology%2C+bibles%2C+religion%2C+Dendera%2C+Denderah%2C+Temple+of+Isis%2C+electric+lighting';
var metaContents  = 'Where+and+what+was+the+Arc+or+Ark+of+the+Covenant+can+be+determined++by+reading+more+in+The+Electric+Mirror+on+the+Pharos+Lighthouse+and+Other+Ancient+Lighting.+';
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();
};
