/* [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','3001',jdecode('HOME'),jdecode(''),'/3001.html','true',[],'',''],
	['PAGE','102201',jdecode('ABOUT+US'),jdecode(''),'/102201/index.html','true',[ 
		['PAGE','112001',jdecode('Sadie+and+Harry+Davis+Foundation'),jdecode(''),'/102201/112001.html','true',[],'',''],
		['PAGE','111501',jdecode('Advisory+Committee'),jdecode(''),'/102201/111501.html','true',[],'',''],
		['PAGE','111701',jdecode('MaineHealth+Staff'),jdecode(''),'/102201/111701.html','true',[],'',''],
		['PAGE','111722',jdecode('MaineGeneral+Health+Staff'),jdecode(''),'/102201/111722.html','true',[],'',''],
		['PAGE','111743',jdecode('EMHS+Staff'),jdecode(''),'/102201/111743.html','true',[],'',''],
		['PAGE','111764',jdecode('CREEDD'),jdecode(''),'/102201/111764.html','true',[],'',''],
		['PAGE','112101',jdecode('Phase+One+Partners'),jdecode(''),'/102201/112101.html','true',[],'',''],
		['PAGE','128901',jdecode('Maine+Participating+Practices'),jdecode(''),'/102201/128901.html','true',[],'','']
	],'',''],
	['PAGE','120801',jdecode('WHAT%26%23x27%3BS+NEW%3F'),jdecode(''),'/120801.html','true',[],'',''],
	['PAGE','56501',jdecode('CONFERENCE+'),jdecode(''),'/56501/index.html','true',[ 
		['PAGE','54401',jdecode('Presentations'),jdecode(''),'/56501/54401.html','true',[],'',''],
		['PAGE','56522',jdecode('Conference+Evaluation'),jdecode(''),'/56501/56522.html','true',[],'','']
	],'',''],
	['PAGE','7364',jdecode('HEALTH+CARE+PROVIDERS'),jdecode(''),'/7364/index.html','true',[ 
		['PAGE','61301',jdecode('FTFT+Training+'),jdecode(''),'/7364/61301.html','true',[],'',''],
		['PAGE','119401',jdecode('Other+Training'),jdecode(''),'/7364/119401.html','true',[],'',''],
		['PAGE','119601',jdecode('Training+Videos'),jdecode(''),'/7364/119601.html','true',[],'',''],
		['PAGE','108422',jdecode('Fluoride+Varnish+Ordering'),jdecode(''),'/7364/108422.html','true',[],'','']
	],'',''],
	['PAGE','123101',jdecode('ARTICLES'),jdecode(''),'/123101/index.html','true',[ 
		['PAGE','123801',jdecode('Early+Childhood+Caries'),jdecode(''),'/123101/123801.html','true',[],'',''],
		['PAGE','123201',jdecode('Preventive+Dental+in+Primary+Care'),jdecode(''),'/123101/123201.html','true',[],'',''],
		['PAGE','109401',jdecode('Fluoride+Varnish+'),jdecode(''),'/123101/109401.html','true',[],'','']
	],'',''],
	['PAGE','7301',jdecode('PARENT+AND+FAMILIES'),jdecode(''),'/7301/index.html','true',[ 
		['PAGE','27601',jdecode('Info+for+Parents'),jdecode(''),'/7301/27601.html','true',[],'',''],
		['PAGE','7801',jdecode('Baby+Teeth+Q+%26+A'),jdecode(''),'/7301/7801.html','true',[],'','']
	],'',''],
	['PAGE','107601',jdecode('DENTAL+REFERRAL+LIST'),jdecode(''),'/107601.html','true',[],'',''],
	['PAGE','95264',jdecode('WATER+FLUORIDATION'),jdecode(''),'/95264.html','true',[],'',''],
	['PAGE','47101',jdecode('POLICY'),jdecode(''),'/47101.html','true',[],'',''],
	['PAGE','11822',jdecode('LINKS'),jdecode(''),'/11822/index.html','true',[ 
		['PAGE','31801',jdecode('Maine+Oral+Health+Funders'),jdecode(''),'/11822/31801.html','true',[],'','']
	],'',''],
	['PAGE','111785',jdecode(''),jdecode(''),'/111785.html','true',[],'',''],
	['PAGE','111806',jdecode(''),jdecode(''),'/111806.html','true',[],'','']];
var siteelementCount=33;
theSitetree.topTemplateName='Family';
theSitetree.paletteFamily='D6C4AB';
theSitetree.keyvisualId='3820';
theSitetree.keyvisualName='kv_3820.jpg';
theSitetree.fontsetId='10484';
theSitetree.graphicsetId='11022';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='D6C4AB';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Family',
				paletteFamily: 	'D6C4AB',
				keyvisualId: 	'3820',
				keyvisualName: 	'kv_3820.jpg',
				fontsetId: 		'10484',
				graphicsetId: 	'11022',
				contentColor: 	'000000',
				contentBGColor: 'D6C4AB',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'AEAEAF',
				e_color: 		'AEAEAF',
				f_color: 		'AEAEAF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20100805-085838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111722',
internalId:  '',
customField: '20100319-132650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7301',
internalId:  '',
customField: '20100429-153500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7801',
internalId:  '',
customField: '20090826-115018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112101',
internalId:  '',
customField: '20100324-165643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7364',
internalId:  '',
customField: '20100820-085744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108422',
internalId:  '',
customField: '20100312-200520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '109401',
internalId:  '',
customField: '20100405-151053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111501',
internalId:  '',
customField: '20100325-075544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '112001',
internalId:  '',
customField: '20100407-152822'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27601',
internalId:  '',
customField: '20090928-152110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11822',
internalId:  '',
customField: '20100222-144034'
};
webappMappings['1501']=webappMappings['1501-15391851']={
webappId:    '1501',
documentId:  '3001',
internalId:  '15391851',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111701',
internalId:  '',
customField: '20100319-132241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31801',
internalId:  '',
customField: '20090518-143514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111806',
internalId:  '',
customField: '20100316-141253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '107601',
internalId:  '',
customField: '20100407-153153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119401',
internalId:  '',
customField: '20100402-151210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56522',
internalId:  '',
customField: '20100129-145821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56501',
internalId:  '',
customField: '20100220-183847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54401',
internalId:  '',
customField: '20100220-184655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47101',
internalId:  '',
customField: '20100412-160501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61301',
internalId:  '',
customField: '20100517-135411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111785',
internalId:  '',
customField: '20100316-141253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95264',
internalId:  '',
customField: '20100313-142125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111743',
internalId:  '',
customField: '20100319-150911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111764',
internalId:  '',
customField: '20100324-172513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102201',
internalId:  '',
customField: '20100407-152729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119601',
internalId:  '',
customField: '20100324-184541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '120801',
internalId:  '',
customField: '20100413-093841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123101',
internalId:  '',
customField: '20100405-143504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123201',
internalId:  '',
customField: '20100405-145500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123801',
internalId:  '',
customField: '20100405-152616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '128901',
internalId:  '',
customField: '20100706-143056'
};
var canonHostname = 'cmworker01.yourhostingaccount.com';
var accountId     = 'AENDU0INEPD3';
var companyName   = 'From+The+First+Tooth';
var htmlTitle	  = '';
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();
};
