/* [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','1901',jdecode('Home'),jdecode(''), jdecode('%2F1901.html'), 'true',[],'',''],
	['PAGE','40501',jdecode('About+Terron'),jdecode(''), jdecode('%2F40501%2Findex.html'), 'true',[ 
		['PAGE','6411',jdecode('What%26%23x27%3Bs+On+My+Mind'),jdecode(''), jdecode('%2F40501%2F6411.html'), 'false',[],'',''],
		['PAGE','6222',jdecode('Personal+Background'),jdecode(''), jdecode('%2F40501%2F6222.html'), 'true',[],'',''],
		['PAGE','6243',jdecode('Professional+Experience'),jdecode(''), jdecode('%2F40501%2F6243.html'), 'true',[],'','']
	],'',''],
	['PAGE','6264',jdecode('In+the+Community'),jdecode(''), jdecode('%2F6264.html'), 'true',[],'',''],
	['PAGE','40522',jdecode('Published+Works'),jdecode(''), jdecode('%2F40522%2Findex.html'), 'true',[ 
		['PAGE','38401',jdecode('%22Hands+of+Honor%22'),jdecode(''), jdecode('%2F40522%2F38401.html'), 'true',[],'',''],
		['PAGE','28901',jdecode('%22With+Honor+In+Hand%22'),jdecode(''), jdecode('%2F40522%2F28901.html'), 'true',[],'','']
	],'',''],
	['PAGE','6432',jdecode('Terron+in+the+Press'),jdecode(''), jdecode('%2F6432.html'), 'true',[],'',''],
	['PAGE','40543',jdecode('On+the+Issues'),jdecode(''), jdecode('%2F40543%2Findex.html'), 'true',[ 
		['PAGE','40564',jdecode('Local'),jdecode(''), jdecode('%2F40543%2F40564.html'), 'true',[],'',''],
		['PAGE','40585',jdecode('National'),jdecode(''), jdecode('%2F40543%2F40585.html'), 'true',[],'',''],
		['PAGE','40606',jdecode('Global'),jdecode(''), jdecode('%2F40543%2F40606.html'), 'true',[],'','']
	],'',''],
	['PAGE','8301',jdecode('Photo+Album'),jdecode(''), jdecode('%2F8301.html'), 'true',[],'',''],
	['PAGE','4022',jdecode('Links+of+Interest'),jdecode(''), jdecode('%2F4022.html'), 'true',[],'',''],
	['PAGE','6601',jdecode('Contact'),jdecode(''), jdecode('%2F6601.html'), 'true',[],'',''],
	['PAGE','8343',jdecode('Guest+Book'),jdecode(''), jdecode('%2F8343.html'), 'true',[],'',''],
	['PAGE','8322',jdecode('Search'),jdecode(''), jdecode('%2F8322.html'), 'true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Travel';
theSitetree.paletteFamily='4060B8';
theSitetree.keyvisualId='6975';
theSitetree.keyvisualName='kv_6975.jpg';
theSitetree.fontsetId='13627';
theSitetree.graphicsetId='12072';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='4060B8';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'enom',
  product: 'WSCENOSSSLYTC21T'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Travel',
				paletteFamily: 	'4060B8',
				keyvisualId: 	'6975',
				keyvisualName: 	'kv_6975.jpg',
				fontsetId: 		'13627',
				graphicsetId: 	'12072',
				contentColor: 	'FFFFFF',
				contentBGColor: '4060B8',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'9DB0E2',
				e_color: 		'9DB0E2',
				f_color: 		'9DB0E2',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1901',
internalId:  '',
customField: '20110726-124340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4022',
internalId:  '',
customField: '20110726-123913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38401',
internalId:  '',
customField: '20110726-124450'
};
webappMappings['7060']=webappMappings['7060-ade046bba6d75777fd195f5520b70637']={
webappId:    '7060',
documentId:  '8301',
internalId:  'ade046bba6d75777fd195f5520b70637',
customField: 'language:en;country:US;'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '8322',
internalId:  'search',
customField: 'language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-8343aen330infkw4']={
webappId:    '1002',
documentId:  '8343',
internalId:  '8343aen330infkw4',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8343',
internalId:  '',
customField: '20090721-122721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6222',
internalId:  '',
customField: '20110726-123529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40522',
internalId:  '',
customField: '20110908-074354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6243',
internalId:  '',
customField: '20110929-131244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6264',
internalId:  '',
customField: '20110929-131530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40585',
internalId:  '',
customField: '20110908-071618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40606',
internalId:  '',
customField: '20110908-072217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40543',
internalId:  '',
customField: '20110908-070757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40564',
internalId:  '',
customField: '20110908-072435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6411',
internalId:  '',
customField: '20100817-085359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6432',
internalId:  '',
customField: '20110726-123806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8301',
internalId:  '',
customField: '20090703-143519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20091114-210602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8322',
internalId:  '',
customField: '20090629-122400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28901',
internalId:  '',
customField: '20100819-115850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40501',
internalId:  '',
customField: '20110908-063651'
};
var webAppHostname = 'wsc.ehost-services.com:80';
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN330INFKW4';
var companyName   = 'We+the+People...';
var htmlTitle	  = 'Terron+Sims%2C+II';
var metaKeywords  = 'Terron+Sims+politics+Democratic+Party+Iraq+Afghanistan+Iran+kids+education+West+Point+US+Army';
var metaContents  = 'Take+a+small+look+at+the+world+through+the+eyes+of+Terron+Sims%2C+II.';
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();
};

