/* [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','4601',jdecode('Home'),jdecode(''),'/4601/index.html','true',[ 
		['PAGE','4743',jdecode('About+us'),jdecode(''),'/4601/4743.html','true',[],'']
	],''],
	['PAGE','4764',jdecode('Members'),jdecode(''),'/4764.html','true',[],''],
	['PAGE','4722',jdecode('News'),jdecode(''),'/4722.html','true',[],''],
	['PAGE','4785',jdecode('Equipment'),jdecode(''),'/4785/index.html','true',[ 
		['PAGE','52701',jdecode('Squad+44'),jdecode(''),'/4785/52701.html','true',[],''],
		['PAGE','48001',jdecode('Squad+45'),jdecode(''),'/4785/48001.html','true',[],''],
		['PAGE','48022',jdecode('Squad+46'),jdecode(''),'/4785/48022.html','true',[],''],
		['PAGE','48043',jdecode('Support+47'),jdecode(''),'/4785/48043.html','true',[],''],
		['PAGE','48085',jdecode('Station+700'),jdecode(''),'/4785/48085.html','true',[],'']
	],''],
	['PAGE','23201',jdecode('Links'),jdecode(''),'/23201.html','true',[],''],
	['PAGE','4701',jdecode('Contact'),jdecode(''),'/4701.html','true',[],''],
	['PAGE','45801',jdecode('Guest+Book'),jdecode(''),'/45801.html','true',[],''],
	['PAGE','52901',jdecode('Calls'),jdecode(''),'/52901/index.html','true',[ 
		['PAGE','54601',jdecode('March+2010'),jdecode(''),'/52901/54601.html','true',[],''],
		['PAGE','54501',jdecode('Febuary+2010'),jdecode(''),'/52901/54501.html','true',[],''],
		['PAGE','52922',jdecode('January+2010'),jdecode(''),'/52901/52922.html','true',[],'']
	],''],
	['PAGE','5101',jdecode('Whats+and+Whens'),jdecode(''),'/5101.html','true',[],''],
	['PAGE','56001',jdecode('Pictures'),jdecode(''),'/56001.html','true',[],'']];
var siteelementCount=19;
theSitetree.topTemplateName='Aeskulap';
theSitetree.paletteFamily='012253';
theSitetree.keyvisualId='2494';
theSitetree.keyvisualName='arzt.jpg';
theSitetree.fontsetId='433';
theSitetree.graphicsetId='483';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Aeskulap',
				paletteFamily: 	'012253',
				keyvisualId: 	'2494',
				keyvisualName: 	'arzt.jpg',
				fontsetId: 		'433',
				graphicsetId: 	'483',
				contentColor: 	'000000',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52922',
internalId:  '',
customField: '20100315-131258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4601',
internalId:  '',
customField: '20100324-115055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4764',
internalId:  '',
customField: '20100324-115721'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20100324-115505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4785',
internalId:  '',
customField: '20090503-132515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52901',
internalId:  '',
customField: '20100112-135436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20100315-135212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4722',
internalId:  '',
customField: '20100324-115340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4743',
internalId:  '',
customField: '20100324-115017'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4601',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-9554895']={
webappId:    '1501',
documentId:  '4601',
internalId:  '9554895',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45801',
internalId:  '',
customField: '20081227-110149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23201',
internalId:  '',
customField: '20090503-192551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54501',
internalId:  '',
customField: '20100315-133225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48085',
internalId:  '',
customField: '20090117-154132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48001',
internalId:  '',
customField: '20090117-153819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48022',
internalId:  '',
customField: '20090117-153854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48043',
internalId:  '',
customField: '20090117-153731'
};
webappMappings['1002']=webappMappings['1002-45801aendu0in2sn2']={
webappId:    '1002',
documentId:  '45801',
internalId:  '45801aendu0in2sn2',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52701',
internalId:  '',
customField: '20100315-131120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54601',
internalId:  '',
customField: '20100315-133809'
};
webappMappings['7060']=webappMappings['7060-6e5d5596eb32dc8e7cac1068266b6d6d']={
webappId:    '7060',
documentId:  '56001',
internalId:  '6e5d5596eb32dc8e7cac1068266b6d6d',
customField: 'language:en;country:US;'
};
var canonHostname = 'cmworker02.yourhostingaccount.com';
var accountId     = 'AENDU0IN2SN2';
var companyName   = 'Sandy+Ridge+Volunteer+Rescue+Squad+Inc.';
var htmlTitle	  = 'Sandy+Ridge+Volunteer+Rescue+Squad+Inc.';
var metaKeywords  = 'EMS%2CDickenson+County%2CRescue%2CVolunteer%2CWise+County%2CNora%2CCoeburn';
var metaContents  = 'Sandy+Ridge+Volunteer+Rescue+..+Rural+ems+';
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();
};
