/* [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','601',jdecode('Home'),jdecode(''),'/601.html','true',[],''],
	['PAGE','694',jdecode('News+and+Events'),jdecode(''),'/694.html','true',[],''],
	['PAGE','14601',jdecode('New+Fire+Station'),jdecode(''),'/14601/index.html','true',[ 
		['PAGE','22101',jdecode('Progress+%26+Scheduling'),jdecode(''),'/14601/22101.html','true',[],'']
	],''],
	['PAGE','12625',jdecode('Merger%2FConsolidation'),jdecode(''),'/12625/index.html','false',[ 
		['PAGE','12804',jdecode('NWFD+Initial+Perspective'),jdecode(''),'/12625/12804.html','false',[],''],
		['PAGE','12815',jdecode('PRFD+Q+%26+A'),jdecode(''),'/12625/12815.html','false',[],''],
		['PAGE','13501',jdecode('Union+Merger+Cmte+Q+%26+A'),jdecode(''),'/12625/13501.html','false',[],''],
		['PAGE','19401',jdecode('Merger%2FConsolidation+links'),jdecode(''),'/12625/19401.html','false',[],''],
		['PAGE','30601',jdecode('News+Articles'),jdecode(''),'/12625/30601.html','false',[],''],
		['PAGE','13124',jdecode('What+do+you+think%3F'),jdecode(''),'/12625/13124.html','false',[],'']
	],''],
	['PAGE','50204',jdecode('Merger%2FConsolidation+Ends'),jdecode(''),'/50204.html','true',[],''],
	['PAGE','652',jdecode('Services'),jdecode(''),'/652/index.html','true',[ 
		['PAGE','2101',jdecode('Fire+Prevention+%26+Education'),jdecode(''),'/652/2101.html','true',[],''],
		['PAGE','2122',jdecode('Fire+Codes'),jdecode(''),'/652/2122.html','true',[],''],
		['PAGE','2143',jdecode('Burn+Permit+Information'),jdecode(''),'/652/2143.html','true',[],''],
		['PAGE','2164',jdecode('Desert+Pest+Removal'),jdecode(''),'/652/2164.html','true',[],''],
		['PAGE','2185',jdecode('Emergency+Medical+Services'),jdecode(''),'/652/2185.html','true',[],'']
	],''],
	['PAGE','7301',jdecode('Board+of+Directors'),jdecode(''),'/7301.html','true',[],''],
	['PAGE','7322',jdecode('Agenda'),jdecode(''),'/7322.html','true',[],''],
	['PAGE','7343',jdecode('Minutes'),jdecode(''),'/7343.html','true',[],''],
	['PAGE','13186',jdecode('Annual+Budget+FY+2009%2F2010'),jdecode(''),'/13186.html','true',[],''],
	['PAGE','736',jdecode('About+us'),jdecode(''),'/736.html','true',[],''],
	['PAGE','12289',jdecode('Employment'),jdecode(''),'/12289.html','true',[],''],
	['PAGE','715',jdecode('Links'),jdecode(''),'/715.html','true',[],''],
	['PAGE','673',jdecode('Contact+Us'),jdecode(''),'/673.html','true',[],''],
	['PAGE','3401',jdecode('Privacy+Notice'),jdecode(''),'/3401.html','true',[],''],
	['PAGE','23101',jdecode('Website+Disclaimer'),jdecode(''),'/23101.html','true',[],'']];
var siteelementCount=28;
theSitetree.topTemplateName='Desert';
theSitetree.paletteFamily='9D3F2B';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10617';
theSitetree.graphicsetId='11008';
theSitetree.contentColor='A00000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Desert',
				paletteFamily: 	'9D3F2B',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10617',
				graphicsetId: 	'11008',
				contentColor: 	'A00000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'9D3F2B',
				e_color: 		'9D3F2B',
				f_color: 		'9D3F2B',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20100426-155332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7322',
internalId:  '',
customField: '20100315-181039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '736',
internalId:  '',
customField: '20080317-144018'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20080207-180811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20071115-173343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2122',
internalId:  '',
customField: '20090816-002359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2143',
internalId:  '',
customField: '20080229-181102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2164',
internalId:  '',
customField: '20071129-181225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2185',
internalId:  '',
customField: '20080228-171521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '673',
internalId:  '',
customField: '20090816-002931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7301',
internalId:  '',
customField: '20100223-112629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7343',
internalId:  '',
customField: '20090909-201323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50204',
internalId:  '',
customField: '20090911-004508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '694',
internalId:  '',
customField: '20091019-114739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12289',
internalId:  '',
customField: '20100426-144908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '715',
internalId:  '',
customField: '20090731-163314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3401',
internalId:  '',
customField: '20071115-170646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12625',
internalId:  '',
customField: '20090723-162502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22101',
internalId:  '',
customField: '20090712-223856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23101',
internalId:  '',
customField: '20090701-162318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12804',
internalId:  '',
customField: '20090622-153049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12815',
internalId:  '',
customField: '20090831-174705'
};
webappMappings['1002']=webappMappings['1002-13124ahw050inxs3m']={
webappId:    '1002',
documentId:  '13124',
internalId:  '13124ahw050inxs3m',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13124',
internalId:  '',
customField: '20090815-142731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13186',
internalId:  '',
customField: '20090619-123957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20090831-174508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14601',
internalId:  '',
customField: '20100114-203922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19401',
internalId:  '',
customField: '20090723-105156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30601',
internalId:  '',
customField: '20090816-001011'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INXS3M';
var companyName   = 'PICTURE+ROCKS+FIRE+DISTRICT';
var htmlTitle	  = 'Picture+Rocks+Fire+District';
var metaKeywords  = 'Picture+Rocks+fire+district';
var metaContents  = 'Picture+Rocks+Fire+District%2C+Tucson%2C+Arizona';
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();
};
