/* [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','301',jdecode('HOME'),jdecode(''),'/301.html','true',[],'',''],
	['PAGE','25801',jdecode('PURPOSE'),jdecode(''),'/25801.html','true',[],'',''],
	['PAGE','13901',jdecode('AUTHOR'),jdecode(''),'/13901.html','true',[],'',''],
	['PAGE','13922',jdecode('MISSION'),jdecode(''),'/13922.html','true',[],'',''],
	['PAGE','13985',jdecode('VALUES'),jdecode(''),'/13985.html','true',[],'',''],
	['PAGE','14006',jdecode('ESSAYS'),jdecode(''),'/14006/index.html','true',[ 
		['PAGE','15901',jdecode('The+Mess'),jdecode(''),'/14006/15901.html','true',[],'',''],
		['PAGE','14048',jdecode('Why+people+fight'),jdecode(''),'/14006/14048.html','true',[],'',''],
		['PAGE','14069',jdecode('Privacy'),jdecode(''),'/14006/14069.html','true',[],'',''],
		['PAGE','14090',jdecode('Criminal+Justice'),jdecode(''),'/14006/14090.html','true',[],'',''],
		['PAGE','25822',jdecode('Trial+by+Battle'),jdecode(''),'/14006/25822.html','true',[],'',''],
		['PAGE','22201',jdecode('Beyond+Dispute'),jdecode(''),'/14006/22201.html','true',[],'',''],
		['PAGE','23001',jdecode('Cybernetics'),jdecode(''),'/14006/23001.html','true',[],'',''],
		['PAGE','90745',jdecode('Letter+to+Obama'),jdecode(''),'/14006/90745.html','true',[],'',''],
		['PAGE','90766',jdecode('Revolution+in+Thinking'),jdecode(''),'/14006/90766.html','true',[],'','']
	],'',''],
	['PAGE','21501',jdecode('DESIGNING+JUSTICE...'),jdecode(''),'/21501.html','true',[],'',''],
	['PAGE','14132',jdecode('GRANDPARENTS'),jdecode(''),'/14132.html','true',[],'',''],
	['PAGE','14174',jdecode('CONFERENCES'),jdecode(''),'/14174.html','true',[],'',''],
	['PAGE','14237',jdecode('CONTACT+ME'),jdecode(''),'/14237.html','true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='336699';
theSitetree.keyvisualId='1238';
theSitetree.keyvisualName='justizia.jpg';
theSitetree.fontsetId='190';
theSitetree.graphicsetId='230';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Profile',
				paletteFamily: 	'336699',
				keyvisualId: 	'1238',
				keyvisualName: 	'justizia.jpg',
				fontsetId: 		'190',
				graphicsetId: 	'230',
				contentColor: 	'000066',
				contentBGColor: 'FFFFFF',
				a_color: 		'336699',
				b_color: 		'336699',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20110408-085125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13922',
internalId:  '',
customField: '20090413-151745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25801',
internalId:  '',
customField: '20080227-115125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13901',
internalId:  '',
customField: '20090413-151634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14006',
internalId:  '',
customField: '20110419-063115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13985',
internalId:  '',
customField: '20070625-102858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15901',
internalId:  '',
customField: '20100110-070820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14048',
internalId:  '',
customField: '20070617-121417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14069',
internalId:  '',
customField: '20070617-122032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14090',
internalId:  '',
customField: '20070617-122525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25822',
internalId:  '',
customField: '20071208-092008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22201',
internalId:  '',
customField: '20071124-180527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23001',
internalId:  '',
customField: '20071231-170333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21501',
internalId:  '',
customField: '20080805-114126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14132',
internalId:  '',
customField: '20070627-112022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14174',
internalId:  '',
customField: '20071208-100758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14237',
internalId:  '',
customField: '20080805-105612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90745',
internalId:  '',
customField: '20110408-085730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90766',
internalId:  '',
customField: '20110408-090258'
};
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN010IN3XFK';
var companyName   = 'A+JUST+SOCIETY';
var htmlTitle	  = 'A+JUST+SOCIETY+NETWORK';
var metaKeywords  = '';
var metaContents  = '';
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();
};

