/* [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','5401',jdecode('Museum'),jdecode(''), jdecode('%2F5401%2Findex.html'), 'true',[ 
		['PAGE','10922',jdecode('Exhibits'),jdecode(''), jdecode('%2F5401%2F10922.html'), 'true',[],'',''],
		['PAGE','10943',jdecode('Events'),jdecode(''), jdecode('%2F5401%2F10943.html'), 'true',[],'','']
	],'',''],
	['PAGE','17801',jdecode('Education'),jdecode(''), jdecode('%2F17801%2Findex.html'), 'true',[ 
		['PAGE','17822',jdecode('Welcome'),jdecode(''), jdecode('%2F17801%2F17822.html'), 'true',[],'',''],
		['PAGE','17843',jdecode('FAQs'),jdecode(''), jdecode('%2F17801%2F17843.html'), 'true',[],'',''],
		['PAGE','17864',jdecode('Making+Reservations'),jdecode(''), jdecode('%2F17801%2F17864.html'), 'true',[],'',''],
		['PAGE','17885',jdecode('Before+Your+Visit'),jdecode(''), jdecode('%2F17801%2F17885.html'), 'true',[],'',''],
		['PAGE','17906',jdecode('Student+Assignment'),jdecode(''), jdecode('%2F17801%2F17906.html'), 'true',[],'','']
	],'',''],
	['PAGE','5452',jdecode('Foundation'),jdecode(''), jdecode('%2F5452%2Findex.html'), 'true',[ 
		['PAGE','5473',jdecode('About+us'),jdecode(''), jdecode('%2F5452%2F5473.html'), 'true',[],'',''],
		['PAGE','5515',jdecode('Join+Us%21'),jdecode(''), jdecode('%2F5452%2F5515.html'), 'true',[],'',''],
		['PAGE','29301',jdecode('Newsletters'),jdecode(''), jdecode('%2F5452%2F29301.html'), 'true',[],'','']
	],'',''],
	['PAGE','38201',jdecode('Museum+Store'),jdecode(''), jdecode('%2F38201.html'), 'true',[],'',''],
	['PAGE','8501',jdecode('Volunteers'),jdecode(''), jdecode('%2F8501.html'), 'true',[],'',''],
	['PAGE','48401',jdecode('Facility+Reservations'),jdecode(''), jdecode('%2F48401.html'), 'true',[],'',''],
	['PAGE','5767',jdecode('Hours%2FDirections'),jdecode(''), jdecode('%2F5767.html'), 'true',[],'',''],
	['PAGE','5788',jdecode('Contact'),jdecode(''), jdecode('%2F5788.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Amaze';
theSitetree.paletteFamily='0A2447';
theSitetree.keyvisualId='2411';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='397';
theSitetree.graphicsetId='444';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='0A2447';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7V'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Amaze',
				paletteFamily: 	'0A2447',
				keyvisualId: 	'2411',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'397',
				graphicsetId: 	'444',
				contentColor: 	'DDDDDD',
				contentBGColor: '0A2447',
				a_color: 		'0A2447',
				b_color: 		'081B35',
				c_color: 		'3268E2',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20111130-155026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5452',
internalId:  '',
customField: '20090428-170059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5788',
internalId:  '',
customField: '20100729-124817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5473',
internalId:  '',
customField: '20090319-093602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48401',
internalId:  '',
customField: '20111130-161018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5515',
internalId:  '',
customField: '20090319-174330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38201',
internalId:  '',
customField: '20100625-135423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17885',
internalId:  '',
customField: '20090626-172615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17906',
internalId:  '',
customField: '20090626-173056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17801',
internalId:  '',
customField: '20110928-123402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17843',
internalId:  '',
customField: '20090626-171948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29301',
internalId:  '',
customField: '20111031-164327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17822',
internalId:  '',
customField: '20090626-165418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10943',
internalId:  '',
customField: '20111130-160114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10922',
internalId:  '',
customField: '20110928-123149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17864',
internalId:  '',
customField: '20090626-172234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5767',
internalId:  '',
customField: '20091228-150804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8501',
internalId:  '',
customField: '20090428-134832'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5401',
internalId:  '1006',
customField: '1006'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INL52N';
var companyName   = 'NAVAL+UNDERSEA+MUSEUM';
var htmlTitle	  = 'Naval+Undersea+Museum';
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();
};

