/* [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','3901',jdecode('HOME'),jdecode(''),'/3901.html','true',[],''],
	['PAGE','7801',jdecode('TAXONOMY'),jdecode(''),'/7801.html','true',[],''],
	['PAGE','3952',jdecode('SPECIES'),jdecode(''),'/3952.html','true',[],''],
	['PAGE','3973',jdecode('ANATOMY'),jdecode(''),'/3973.html','true',[],''],
	['PAGE','3994',jdecode('EGGS'),jdecode(''),'/3994.html','true',[],''],
	['PAGE','4015',jdecode('HOST+STEMS'),jdecode(''),'/4015.html','true',[],''],
	['PAGE','43001',jdecode('HATCHING'),jdecode(''),'/43001.html','true',[],''],
	['PAGE','4036',jdecode('NYMPHS'),jdecode(''),'/4036.html','true',[],''],
	['PAGE','4057',jdecode('INSTARS'),jdecode(''),'/4057.html','true',[],''],
	['PAGE','4099',jdecode('SINGING+MALES'),jdecode(''),'/4099.html','true',[],''],
	['PAGE','23101',jdecode('Black-horned'),jdecode(''),'/23101.html','true',[],''],
	['PAGE','23122',jdecode('Forbes%26%23x27%3B'),jdecode(''),'/23122.html','true',[],''],
	['PAGE','23143',jdecode('Pine'),jdecode(''),'/23143.html','true',[],''],
	['PAGE','55201',jdecode('Fast-calling'),jdecode(''),'/55201.html','true',[],''],
	['PAGE','23164',jdecode('Four-spotted'),jdecode(''),'/23164.html','true',[],''],
	['PAGE','23185',jdecode('Two-spotted'),jdecode(''),'/23185.html','true',[],''],
	['PAGE','23206',jdecode('Snowy'),jdecode(''),'/23206.html','true',[],''],
	['PAGE','23227',jdecode('Alexander%26%23x27%3Bs'),jdecode(''),'/23227.html','true',[],''],
	['PAGE','23248',jdecode('Narrow-winged'),jdecode(''),'/23248.html','true',[],''],
	['PAGE','55801',jdecode('Different-horned'),jdecode(''),'/55801.html','true',[],''],
	['PAGE','55822',jdecode('Western'),jdecode(''),'/55822.html','true',[],''],
	['PAGE','4120',jdecode('MATING'),jdecode(''),'/4120.html','true',[],''],
	['PAGE','32501',jdecode('SPERMATOPHORE'),jdecode(''),'/32501.html','true',[],''],
	['PAGE','4141',jdecode('OVIPOSITION'),jdecode(''),'/4141.html','true',[],''],
	['PAGE','4162',jdecode('MOLTING'),jdecode(''),'/4162.html','true',[],''],
	['PAGE','4078',jdecode('LIFE+CYCLE'),jdecode(''),'/4078.html','true',[],''],
	['PAGE','4183',jdecode('BEHAVIORS'),jdecode(''),'/4183.html','true',[],''],
	['PAGE','4204',jdecode('HABITATS'),jdecode(''),'/4204.html','true',[],''],
	['PAGE','4225',jdecode('LOCATIONS'),jdecode(''),'/4225.html','true',[],''],
	['PAGE','4246',jdecode('SOUND+ANALYSIS'),jdecode(''),'/4246.html','true',[],''],
	['PAGE','4267',jdecode('WORLD+SPECIES'),jdecode(''),'/4267.html','true',[],''],
	['PAGE','11901',jdecode('WHO%26%23x27%3BS+WHO'),jdecode(''),'/11901.html','true',[],''],
	['PAGE','4288',jdecode('HISTORY'),jdecode(''),'/4288.html','true',[],''],
	['PAGE','4309',jdecode('SCIENTIFIC+DATA'),jdecode(''),'/4309.html','true',[],''],
	['PAGE','4330',jdecode('GLOSSARY'),jdecode(''),'/4330.html','true',[],''],
	['PAGE','19101',jdecode('LINKS'),jdecode(''),'/19101.html','true',[],''],
	['PAGE','53401',jdecode('2010++observations'),jdecode(''),'/53401.html','true',[],''],
	['PAGE','53201',jdecode('Contact+Us'),jdecode(''),'/53201.html','true',[],''],
	['PAGE','59401',jdecode('Children%26%23x27%3Bs+Book'),jdecode(''),'/59401.html','true',[],'']];
var siteelementCount=39;
theSitetree.topTemplateName='Grace';
theSitetree.paletteFamily='A1E57B';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32047';
theSitetree.graphicsetId='13870';
theSitetree.contentColor='484848';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Grace',
				paletteFamily: 	'A1E57B',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32047',
				graphicsetId: 	'13870',
				contentColor: 	'484848',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3901',
internalId:  '',
customField: '20100306-133443'
};
webappMappings['1501']=webappMappings['1501-25956856']={
webappId:    '1501',
documentId:  '3901',
internalId:  '25956856',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3952',
internalId:  '',
customField: '20100228-123757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3973',
internalId:  '',
customField: '20100301-224624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3994',
internalId:  '',
customField: '20100225-200310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4015',
internalId:  '',
customField: '20100125-222629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4036',
internalId:  '',
customField: '20100125-210758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4057',
internalId:  '',
customField: '20100223-223102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4078',
internalId:  '',
customField: '20100217-203758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4099',
internalId:  '',
customField: '20100217-222500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4120',
internalId:  '',
customField: '20091226-070452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4141',
internalId:  '',
customField: '20100301-224422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4162',
internalId:  '',
customField: '20100128-014113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4183',
internalId:  '',
customField: '20091226-070452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4204',
internalId:  '',
customField: '20100222-213633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4225',
internalId:  '',
customField: '20100126-223917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4246',
internalId:  '',
customField: '20100303-224443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4267',
internalId:  '',
customField: '20100305-224249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4288',
internalId:  '',
customField: '20091226-070452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4309',
internalId:  '',
customField: '20100306-133240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4330',
internalId:  '',
customField: '20100228-060545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7801',
internalId:  '',
customField: '20100228-123950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11901',
internalId:  '',
customField: '20100130-194308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19101',
internalId:  '',
customField: '20100306-133346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23206',
internalId:  '',
customField: '20100124-054402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23101',
internalId:  '',
customField: '20100123-223136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23122',
internalId:  '',
customField: '20100123-221308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23227',
internalId:  '',
customField: '20100123-221520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23185',
internalId:  '',
customField: '20100124-054313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23164',
internalId:  '',
customField: '20100123-221804'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23143',
internalId:  '',
customField: '20100123-222646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23248',
internalId:  '',
customField: '20100304-221729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32501',
internalId:  '',
customField: '20100220-195234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43001',
internalId:  '',
customField: '20100225-221535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53201',
internalId:  '',
customField: '20100228-130600'
};
webappMappings['7050']=webappMappings['7050-15297']={
webappId:    '7050',
documentId:  '53401',
internalId:  '15297',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55801',
internalId:  '',
customField: '20100302-214110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53401',
internalId:  '',
customField: '20100228-132119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55201',
internalId:  '',
customField: '20100302-202736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55822',
internalId:  '',
customField: '20100304-214615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59401',
internalId:  '',
customField: '20100306-131619'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INVXJG';
var companyName   = '+++OECANTHINAE+-+Tree+Crickets';
var htmlTitle	  = 'Tree+cricket+information+with+photos+and+videos';
var metaKeywords  = 'tree%2C+cricket%2C+tree+cricket%2C+oecanthinae%2C+oecanthus%2C+neoxabea%2C+alexanderi%2C+argentinus%2C+bipunctata%2C+californicus%2C+celerinictus%2C+exclamationis%2C+forbesi%2C+formosa%2C+fultoni+%2Claricis%2C+latipennis%2C+leptogrammus%2C+nigricornis%2C+niveus%2C+pini%2C+quadripunctatus%2C+rileyi%2C+varicornis%2C+Walker%2C+B.B.+Fulton%2C+Blatchley%2C+DeGeer%2C+Alexander%2C+orthoptera%2C+trilling%2C+ovipositor%2C+metanotal%2C+ensifera';
var metaContents  = 'Tree+cricket+information+with+photos+and+videos.++Includes%3A++Species%2C+Locations%2C+Behaviors%2C+Song+Analysis%2C+Calling+males%2C+History+and+Life+Cycle.++Photos+and+videos+of+species+found+within+the+U.S.++General+information+on+species+found+throughout+the+world.++Links+to+important+websites.++This+website+has+been+developed++to+increase+awareness+of+these+fascinating+little+creatures.';
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();
};
