/* [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','1201',jdecode('Home'),jdecode(''),'/1201.html','true',[],''],
	['PAGE','1252',jdecode('About+Us'),jdecode(''),'/1252/index.html','true',[ 
		['PAGE','7101',jdecode('Our+Mission'),jdecode(''),'/1252/7101.html','true',[],'']
	],''],
	['PAGE','7143',jdecode('Board+of+Directors'),jdecode(''),'/7143.html','true',[],''],
	['PAGE','15112',jdecode('Clinics'),jdecode(''),'/15112/index.html','true',[ 
		['PAGE','23112',jdecode('Trinity+Health+Clinic'),jdecode(''),'/15112/23112.html','true',[],''],
		['PAGE','23133',jdecode('Hayfork+Health+Clinic'),jdecode(''),'/15112/23133.html','true',[],''],
		['PAGE','23154',jdecode('Trinity+Dental+Clinic'),jdecode(''),'/15112/23154.html','true',[],'']
	],''],
	['PAGE','1336',jdecode('Contact+Us'),jdecode(''),'/1336/index.html','true',[ 
		['PAGE','1378',jdecode('How+to+find+us'),jdecode(''),'/1336/1378.html','true',[],'']
	],''],
	['PAGE','7311',jdecode('Employment+Opportunities'),jdecode(''),'/7311.html','true',[],''],
	['PAGE','36012',jdecode('Home+Health'),jdecode(''),'/36012.html','true',[],''],
	['PAGE','7206',jdecode('Hospital+Foundation'),jdecode(''),'/7206.html','true',[],''],
	['PAGE','7248',jdecode('Hospital+News'),jdecode(''),'/7248.html','true',[],''],
	['PAGE','1399',jdecode('Interesting+Links'),jdecode(''),'/1399.html','true',[],''],
	['PAGE','7269',jdecode('Patient+Information'),jdecode(''),'/7269.html','true',[],''],
	['PAGE','1315',jdecode('Patient+Safety'),jdecode(''),'/1315.html','true',[],''],
	['PAGE','7185',jdecode('Physicians'),jdecode(''),'/7185.html','true',[],''],
	['PAGE','15412',jdecode('Tax+Office'),jdecode(''),'/15412.html','true',[],''],
	['PAGE','7290',jdecode('Visitor+Information'),jdecode(''),'/7290.html','true',[],''],
	['PAGE','7227',jdecode('Volunteers'),jdecode(''),'/7227.html','true',[],'']];
var siteelementCount=21;
theSitetree.topTemplateName='Aeskulap';
theSitetree.paletteFamily='012253';
theSitetree.keyvisualId='2494';
theSitetree.keyvisualName='arzt.jpg';
theSitetree.fontsetId='433';
theSitetree.graphicsetId='483';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Aeskulap',
				paletteFamily: 	'012253',
				keyvisualId: 	'2494',
				keyvisualName: 	'arzt.jpg',
				fontsetId: 		'433',
				graphicsetId: 	'483',
				contentColor: 	'000066',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				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:  '1201',
internalId:  '',
customField: '20091128-142114'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '1378',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1252',
internalId:  '',
customField: '20091218-143144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1336',
internalId:  '',
customField: '20100215-113332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1378',
internalId:  '',
customField: '20091120-182145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7101',
internalId:  '',
customField: '20091222-172444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7143',
internalId:  '',
customField: '20100226-171106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7185',
internalId:  '',
customField: '20091120-181125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1315',
internalId:  '',
customField: '20100114-105755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7206',
internalId:  '',
customField: '20091120-181531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7227',
internalId:  '',
customField: '20100222-103121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7248',
internalId:  '',
customField: '20091120-181721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7269',
internalId:  '',
customField: '20100114-102354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7290',
internalId:  '',
customField: '20091128-150311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7311',
internalId:  '',
customField: '20100204-155629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1399',
internalId:  '',
customField: '20100114-110343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23112',
internalId:  '',
customField: '20091120-181203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15112',
internalId:  '',
customField: '20100215-112932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15412',
internalId:  '',
customField: '20091120-181751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23133',
internalId:  '',
customField: '20091120-181223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23154',
internalId:  '',
customField: '20091127-155637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36012',
internalId:  '',
customField: '20100202-164218'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INVT8K';
var companyName   = 'Mountain+Communities+Healthcare+District+';
var htmlTitle	  = 'Mountain+Communities+Healthcare+Distrct';
var metaKeywords  = 'Trinity+HospitalMountain+Communities+Healthcare+DistrictMCHD';
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();
};
