/* [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','901',jdecode('BCEMS+Home'),jdecode(''),'/901.html','true',[],'',''],
	['PAGE','162689',jdecode('EMST+TRANSITION'),jdecode(''),'/162689.html','true',[],'',''],
	['PAGE','952',jdecode('Inside+BCEMS'),jdecode(''),'/952/index.html','true',[ 
		['PAGE','973',jdecode('Get+to+Know+Us'),jdecode(''),'/952/973.html','true',[],'',''],
		['PAGE','994',jdecode('Operations+Division'),jdecode(''),'/952/994.html','true',[],'',''],
		['PAGE','1015',jdecode('Clinical+Division'),jdecode(''),'/952/1015.html','true',[],'',''],
		['PAGE','1036',jdecode('Rescue+Division'),jdecode(''),'/952/1036.html','true',[],'',''],
		['PAGE','150589',jdecode('DMSU'),jdecode(''),'/952/150589.html','true',[],'',''],
		['PAGE','118489',jdecode('Chaplain+Division'),jdecode(''),'/952/118489.html','true',[],'',''],
		['PAGE','29801',jdecode('BCEMS+Photos'),jdecode(''),'/952/29801.html','true',[],'','']
	],'',''],
	['PAGE','152089',jdecode('BCEMS+History'),jdecode(''),'/152089.html','true',[],'',''],
	['PAGE','129789',jdecode('Employment+'),jdecode(''),'/129789.html','true',[],'',''],
	['PAGE','1078',jdecode('Public+Programs'),jdecode(''),'/1078/index.html','true',[ 
		['PAGE','137089',jdecode('2010+Public+CPR'),jdecode(''),'/1078/137089.html','false',[],'',''],
		['PAGE','116889',jdecode('Public+Safety'),jdecode(''),'/1078/116889.html','true',[],'',''],
		['PAGE','1120',jdecode('Vial+for+Life'),jdecode(''),'/1078/1120.html','true',[],'','']
	],'',''],
	['PAGE','1057',jdecode('Billing+FAQ'),jdecode(''),'/1057.html','true',[],'',''],
	['PAGE','1183',jdecode('Contact+Us'),jdecode(''),'/1183.html','true',[],'',''],
	['PAGE','1225',jdecode('Cards+of+Thanks'),jdecode(''),'/1225.html','true',[],'',''],
	['PAGE','125889',jdecode('Brown+Memoriam'),jdecode(''),'/125889.html','true',[],'',''],
	['PAGE','9706',jdecode('GUESTBOOK'),jdecode(''),'/9706.html','true',[],'',''],
	['PAGE','1288',jdecode('Web+Links'),jdecode(''),'/1288/index.html','true',[ 
		['PAGE','138089',jdecode('Employee+Links'),jdecode(''),'/1288/138089.html','true',[],'','']
	],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Aeskulap';
theSitetree.paletteFamily='012253';
theSitetree.keyvisualId='2494';
theSitetree.keyvisualName='arzt.jpg';
theSitetree.fontsetId='433';
theSitetree.graphicsetId='484';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Aeskulap',
				paletteFamily: 	'012253',
				keyvisualId: 	'2494',
				keyvisualName: 	'arzt.jpg',
				fontsetId: 		'433',
				graphicsetId: 	'484',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-9706aendu0inxhpb']={
webappId:    '1002',
documentId:  '9706',
internalId:  '9706aendu0inxhpb',
customField: 'icq=false'
};
webappMappings['7008']=webappMappings['7008-888']={
webappId:    '7008',
documentId:  '1120',
internalId:  '888',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '901',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-c83c6202e8c16cffa875fdbc71796710']={
webappId:    '7060',
documentId:  '29801',
internalId:  'c83c6202e8c16cffa875fdbc71796710',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '901',
internalId:  '',
customField: '20100707-231047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '952',
internalId:  '',
customField: '20101110-155521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '973',
internalId:  '',
customField: '20110103-112440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '162689',
internalId:  '',
customField: '20101206-170146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118489',
internalId:  '',
customField: '20090612-113725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116889',
internalId:  '',
customField: '20090527-232717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '152089',
internalId:  '',
customField: '20100805-110214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '137089',
internalId:  '',
customField: '20100825-111145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138089',
internalId:  '',
customField: '20100108-140346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '150589',
internalId:  '',
customField: '20100519-141354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29801',
internalId:  '',
customField: '20090401-140055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '994',
internalId:  '',
customField: '20100519-135226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1015',
internalId:  '',
customField: '20101008-133240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1036',
internalId:  '',
customField: '20100517-113631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1057',
internalId:  '',
customField: '20081212-160332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1078',
internalId:  '',
customField: '20101110-155244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125889',
internalId:  '',
customField: '20100131-211223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1120',
internalId:  '',
customField: '20090527-230422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1183',
internalId:  '',
customField: '20090522-164607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129789',
internalId:  '',
customField: '20101222-110838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1225',
internalId:  '',
customField: '20090722-163723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9706',
internalId:  '',
customField: '20091224-001553'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1288',
internalId:  '',
customField: '20100416-100715'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0INXHPB';
var companyName   = 'Butler+County+EMS+Online';
var htmlTitle	  = 'Butler+County+EMS+Online';
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();
};

