/* [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','58401',jdecode('The+Great+Fatted+Bull'),jdecode(''), jdecode('%2F58401.html'), 'true',[],'',''],
	['PAGE','119112',jdecode('Introduction'),jdecode(''), jdecode('%2F119112.html'), 'true',[],'',''],
	['PAGE','37901',jdecode('Tablet+%2336'),jdecode(''), jdecode('%2F37901.html'), 'true',[],'',''],
	['PAGE','1822',jdecode('Translation'),jdecode(''), jdecode('%2F1822.html'), 'true',[],'',''],
	['PAGE','19401',jdecode('Annotations'),jdecode(''), jdecode('%2F19401.html'), 'true',[],'',''],
	['PAGE','20001',jdecode('Transliteration'),jdecode(''), jdecode('%2F20001.html'), 'true',[],'',''],
	['PAGE','71412',jdecode('Sumerian+Images'),jdecode(''), jdecode('%2F71412.html'), 'true',[],'',''],
	['PAGE','509245',jdecode('The+Royal+Tombs+of+Ur'),jdecode(''), jdecode('%2F509245%2Findex.html'), 'true',[ 
		['PAGE','509266',jdecode('Exploration'),jdecode(''), jdecode('%2F509245%2F509266.html'), 'true',[],'',''],
		['PAGE','499545',jdecode('Lyres'),jdecode(''), jdecode('%2F509245%2F499545.html'), 'true',[],'',''],
		['PAGE','509329',jdecode('Vessels'),jdecode(''), jdecode('%2F509245%2F509329.html'), 'true',[],'',''],
		['PAGE','509308',jdecode('Jewelry'),jdecode(''), jdecode('%2F509245%2F509308.html'), 'true',[],'',''],
		['PAGE','651845',jdecode('Miscellaneous'),jdecode(''), jdecode('%2F509245%2F651845.html'), 'true',[],'',''],
		['PAGE','509350',jdecode('Weapons'),jdecode(''), jdecode('%2F509245%2F509350.html'), 'true',[],'','']
	],'',''],
	['PAGE','612045',jdecode('The+Standard+of+Ur%3A++War'),jdecode(''), jdecode('%2F612045.html'), 'true',[],'',''],
	['PAGE','744045',jdecode('The+Standard+of+Ur%3A++King'),jdecode(''), jdecode('%2F744045%2Findex.html'), 'true',[ 
		['PAGE','739645',jdecode('Akkadian+Seals'),jdecode(''), jdecode('%2F744045%2F739645.html'), 'true',[],'','']
	],'',''],
	['PAGE','836845',jdecode('The+%22Standard%22+of+Ur%3F'),jdecode(''), jdecode('%2F836845.html'), 'true',[],'',''],
	['PAGE','800745',jdecode('Eannatum'),jdecode(''), jdecode('%2F800745.html'), 'true',[],'',''],
	['PAGE','792345',jdecode('Vulture+Stele+Translation'),jdecode(''), jdecode('%2F792345.html'), 'true',[],'',''],
	['PAGE','687045',jdecode('Sumerian+War+Chariots'),jdecode(''), jdecode('%2F687045.html'), 'true',[],'',''],
	['PAGE','963056',jdecode('War+Chariot+Deconstructed'),jdecode(''), jdecode('%2F963056.html'), 'true',[],'',''],
	['PAGE','78712',jdecode('Ur-Namma+Translation'),jdecode(''), jdecode('%2F78712.html'), 'true',[],'',''],
	['PAGE','373712',jdecode('The+Face+of+Ur-Namma'),jdecode(''), jdecode('%2F373712.html'), 'true',[],'',''],
	['PAGE','403712',jdecode('Face+of+Ur-Namma%2C+part+II'),jdecode(''), jdecode('%2F403712.html'), 'true',[],'',''],
	['PAGE','441045',jdecode('I+am+Ur-Namma'),jdecode(''), jdecode('%2F441045.html'), 'true',[],'',''],
	['PAGE','67812',jdecode('Gudea+Translation'),jdecode(''), jdecode('%2F67812%2Findex.html'), 'true',[ 
		['PAGE','83412',jdecode('Gudea+Tablet'),jdecode(''), jdecode('%2F67812%2F83412.html'), 'true',[],'','']
	],'',''],
	['PAGE','846845',jdecode('The+Face+of+Gudea'),jdecode(''), jdecode('%2F846845.html'), 'true',[],'',''],
	['PAGE','96612',jdecode('Adventures+in+Cuneiform'),jdecode(''), jdecode('%2F96612.html'), 'true',[],'',''],
	['PAGE','265412',jdecode('The+Scribe'),jdecode(''), jdecode('%2F265412%2Findex.html'), 'true',[ 
		['PAGE','764945',jdecode('Scribal+Social+Rankings'),jdecode(''), jdecode('%2F265412%2F764945.html'), 'true',[],'',''],
		['PAGE','127912',jdecode('Early+Old+Babylonian%3F'),jdecode(''), jdecode('%2F265412%2F127912.html'), 'true',[],'','']
	],'',''],
	['PAGE','144812',jdecode('A+Masterpiece'),jdecode(''), jdecode('%2F144812.html'), 'true',[],'',''],
	['PAGE','166112',jdecode('Links'),jdecode(''), jdecode('%2F166112.html'), 'true',[],'',''],
	['PAGE','46801',jdecode('Contact'),jdecode(''), jdecode('%2F46801.html'), 'true',[],'',''],
	['PAGE','168112',jdecode('Site+Map'),jdecode(''), jdecode('%2F168112.html'), 'true',[],'',''],
	['PAGE','675645',jdecode('Necklaces%2C+Tombs+of+Ur'),jdecode(''), jdecode('%2F675645.html'), 'false',[],'',''],
	['PAGE','479645',jdecode('Ur-Namma%2C+only'),jdecode(''), jdecode('%2F479645.html'), 'false',[],'',''],
	['PAGE','441145',jdecode('Sources%2C++I+am+Ur-Namma'),jdecode(''), jdecode('%2F441145.html'), 'false',[],'',''],
	['PAGE','509287',jdecode('enl'),jdecode(''), jdecode('%2F509287.html'), 'false',[],'','']];
var siteelementCount=41;
theSitetree.topTemplateName='Objects';
theSitetree.paletteFamily='154C68';
theSitetree.keyvisualId='6541';
theSitetree.keyvisualName='kv_6541.jpg';
theSitetree.fontsetId='11180';
theSitetree.graphicsetId='11992';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFE2A7';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'powweb',
  product: 'WSCSYSSSSLY0XRN4'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Objects',
				paletteFamily: 	'154C68',
				keyvisualId: 	'6541',
				keyvisualName: 	'kv_6541.jpg',
				fontsetId: 		'11180',
				graphicsetId: 	'11992',
				contentColor: 	'000000',
				contentBGColor: 'FFE2A7',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1822',
internalId:  '',
customField: '20120209-181051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '836845',
internalId:  '',
customField: '20120117-022041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19401',
internalId:  '',
customField: '20120209-181241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20001',
internalId:  '',
customField: '20120130-011355'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '58401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37901',
internalId:  '',
customField: '20111007-004304'
};
webappMappings['7008']=webappMappings['7008-9736']={
webappId:    '7008',
documentId:  '46801',
internalId:  '9736',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46801',
internalId:  '',
customField: '20111201-140841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71412',
internalId:  '',
customField: '20120209-180859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58401',
internalId:  '',
customField: '20120102-182248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67812',
internalId:  '',
customField: '20111031-234545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78712',
internalId:  '',
customField: '20111218-003032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '441045',
internalId:  '',
customField: '20111225-142355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83412',
internalId:  '',
customField: '20101213-213958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96612',
internalId:  '',
customField: '20120101-100515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '265412',
internalId:  '',
customField: '20111207-192847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119112',
internalId:  '',
customField: '20120209-203704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '127912',
internalId:  '',
customField: '20110906-131352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '403712',
internalId:  '',
customField: '20120205-153809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '144812',
internalId:  '',
customField: '20120106-045809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '166112',
internalId:  '',
customField: '20111124-120242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '168112',
internalId:  '',
customField: '20120116-061157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '441145',
internalId:  '',
customField: '20110825-015813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '373712',
internalId:  '',
customField: '20111126-231159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '479645',
internalId:  '',
customField: '20101021-224132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '499545',
internalId:  '',
customField: '20120209-022600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '509245',
internalId:  '',
customField: '20120205-014857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '509266',
internalId:  '',
customField: '20120209-180356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '509287',
internalId:  '',
customField: '20120209-204442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '509308',
internalId:  '',
customField: '20120205-011034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '509329',
internalId:  '',
customField: '20120127-181009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '509350',
internalId:  '',
customField: '20120127-205600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '612045',
internalId:  '',
customField: '20120129-234825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '651845',
internalId:  '',
customField: '20120125-004816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '675645',
internalId:  '',
customField: '20101220-132035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '687045',
internalId:  '',
customField: '20120126-164630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '739645',
internalId:  '',
customField: '20110909-014821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '744045',
internalId:  '',
customField: '20120206-005427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '764945',
internalId:  '',
customField: '20111207-192253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '792345',
internalId:  '',
customField: '20120129-005055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '800745',
internalId:  '',
customField: '20120129-010916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '846845',
internalId:  '',
customField: '20111219-005049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '963056',
internalId:  '',
customField: '20120209-022755'
};
var webAppHostname = 'cgiwsc.enhancedsitebuilder.com:80';
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INE4LA';
var companyName   = 'Sumerian+Shakespeare';
var htmlTitle	  = 'Sumerian+Shakespeare%3A++The+Great+Fatted+Bull%2C+the+world%27s+first+political+satire+and+murder+mystery.';
var metaKeywords  = 'great+fatted+bull%2Csumerian+shakespeare%2Cworlds+first+political+satire%2Cworlds+first+comedy%2Cworlds+first+murder+mystery%2Ccuneiform%2Cgudea%2Cur-namma%2Cur-nammu%2Csumerian%2Csumerian+scribe+';
var metaContents  = 'The+Great+Fatted+Bull.+The+worlds+first+political+satire%2C+a+literary+masterpiece+written+by+a+Sumerian+Shakespeare.+A+translation+of+Tablet+%2336+in+the+Library+of+Congress.';
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();
};

