/* [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','2001',jdecode('Home'),jdecode(''),'/2001.html','true',[],''],
	['PAGE','69056',jdecode('%22Desert+Life%22+2009-10'),jdecode(''),'/69056.html','true',[],''],
	['PAGE','2220',jdecode('NHECM%26%23x27%3Bs+Programs'),jdecode(''),'/2220/index.html','true',[ 
		['PAGE','46101',jdecode('School+%26+Library+visits'),jdecode(''),'/2220/46101.html','true',[],''],
		['PAGE','44301',jdecode('Earth+Day+%26+Special+events'),jdecode(''),'/2220/44301.html','true',[],''],
		['PAGE','36443',jdecode('Fundraising+Events'),jdecode(''),'/2220/36443.html','true',[],'']
	],''],
	['PAGE','2073',jdecode('Educational+Resources'),jdecode(''),'/2073/index.html','true',[ 
		['PAGE','54101',jdecode('More+Info+on+our+Animals'),jdecode(''),'/2073/54101.html','true',[],''],
		['PAGE','2199',jdecode('08-09%3A+Exotic+Invasives'),jdecode(''),'/2073/2199.html','true',[],'']
	],''],
	['PAGE','2241',jdecode('Calendar+%26+Scrapbook'),jdecode(''),'/2241.html','true',[],''],
	['PAGE','2052',jdecode('Our+School+Friends'),jdecode(''),'/2052.html','true',[],''],
	['PAGE','2262',jdecode('Links+to+learn+more'),jdecode(''),'/2262.html','true',[],''],
	['PAGE','6906',jdecode('NHECM%26%23x27%3Bs+Guestbook'),jdecode(''),'/6906/index.html','true',[ 
		['PAGE','6901',jdecode('Read+Guestbook'),jdecode(''),'/6906/6901.html','false',[],'']
	],''],
	['PAGE','2094',jdecode('About+us'),jdecode(''),'/2094/index.html','true',[ 
		['PAGE','2115',jdecode('Our+team'),jdecode(''),'/2094/2115.html','true',[],''],
		['PAGE','2178',jdecode('Contact+us'),jdecode(''),'/2094/2178.html','true',[],'']
	],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Sportive';
theSitetree.paletteFamily='FADE8A';
theSitetree.keyvisualId='2677';
theSitetree.keyvisualName='naturpur.jpg';
theSitetree.fontsetId='222';
theSitetree.graphicsetId='261';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FADE8A';
var theTemplate={
				name: 			'Sportive',
				paletteFamily: 	'FADE8A',
				keyvisualId: 	'2677',
				keyvisualName: 	'naturpur.jpg',
				fontsetId: 		'222',
				graphicsetId: 	'261',
				contentColor: 	'000000',
				contentBGColor: 'FADE8A',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FADE8A',
				b_color: 		'D0B976',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2001',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-6906AHW050INEA1S']={
webappId:    '1002',
documentId:  '6906',
internalId:  '6906AHW050INEA1S',
customField: 'icq=false'
};
webappMappings['1501']=webappMappings['1501-962948']={
webappId:    '1501',
documentId:  '2001',
internalId:  '962948',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-0bd49a81f088cfa187695d27159904dc']={
webappId:    '7060',
documentId:  '44301',
internalId:  '0bd49a81f088cfa187695d27159904dc',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-85cfd7191f456f3865725e7b4c5aca96']={
webappId:    '7060',
documentId:  '46101',
internalId:  '85cfd7191f456f3865725e7b4c5aca96',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20090715-200527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2094',
internalId:  '',
customField: '20080409-134128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2115',
internalId:  '',
customField: '20081129-170435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2178',
internalId:  '',
customField: '20080224-011720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2199',
internalId:  '',
customField: '20090311-223057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2220',
internalId:  '',
customField: '20090311-222547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46101',
internalId:  '',
customField: '20080409-134305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44301',
internalId:  '',
customField: '20080409-134330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36443',
internalId:  '',
customField: '20080603-224301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2052',
internalId:  '',
customField: '20081129-162807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2073',
internalId:  '',
customField: '20090311-215558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54101',
internalId:  '',
customField: '20080416-000125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2241',
internalId:  '',
customField: '20090311-225018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2262',
internalId:  '',
customField: '20080409-135354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69056',
internalId:  '',
customField: '20090830-225247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6906',
internalId:  '',
customField: '20080404-225427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6901',
internalId:  '',
customField: '20080404-225937'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INEA1S';
var companyName   = 'Now+you%27re+thinking+outside+the+cage%21';
var htmlTitle	  = 'NHECM';
var metaKeywords  = 'Wildlife%2C+Education%2C+Conservation%2C+Teaching%2C+Animalogy%2C+Biology%2C+Live+animals%2C+School+programs%2C+Presentations%2C+Assembly%2C+Snakes%2C+Reptiles%2C+Birds+of+Prey%2C+Raptors%2C+Turtles%2C+Frogs%2C++Midsouth%2C++Library%2C+Boy+Scouts%2C+Kids%2C+Summer+programs%2C+Earth+Day%2C+Tennessee%2C+Alabama%2C+Arkansas%2C+Mississippi%2C+Illinois%2C+Natural+History%2C+Bob+Tarter%2C+Rainforest+animals%2C+Exotic+Invasives+';
var metaContents  = 'Natural+History+Education+and+Wildlife+presentations.++meta+name%3Dverify-v1+content%3DNbx32B%2BfHb0zQY3Texun54Xv%2BRiiDiNxqQLatr9yF7I%3D+%2F+++googlehostedservice.html%2C+google76bd7fa82cd566dd++++';
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();
};
