/* [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','55171',jdecode('About+PCE'),jdecode(''), jdecode('%2F55171%2Findex.html'), 'true',[ 
		['PAGE','11143',jdecode('Office+Location'),jdecode(''), jdecode('%2F55171%2F11143.html'), 'true',[],'',''],
		['PAGE','12101',jdecode('Mission%2FVision%2FCorporate+Values'),jdecode(''), jdecode('%2F55171%2F12101.html'), 'true',[],'',''],
		['PAGE','21327',jdecode('Services+-+Water'),jdecode(''), jdecode('%2F55171%2F21327.html'), 'true',[],'',''],
		['PAGE','21348',jdecode('Services+-+Civil'),jdecode(''), jdecode('%2F55171%2F21348.html'), 'true',[],'','']
	],'',''],
	['PAGE','11248',jdecode('Experience'),jdecode(''), jdecode('%2F11248%2Findex.html'), 'true',[ 
		['PAGE','9322',jdecode('Engineering'),jdecode(''), jdecode('%2F11248%2F9322.html'), 'true',[],'',''],
		['PAGE','24927',jdecode('Resumes'),jdecode(''), jdecode('%2F11248%2F24927.html'), 'true',[],'','']
	],'',''],
	['PAGE','21369',jdecode('News+and+Views'),jdecode(''), jdecode('%2F21369%2Findex.html'), 'true',[ 
		['PAGE','11311',jdecode('Awards'),jdecode(''), jdecode('%2F21369%2F11311.html'), 'true',[],'',''],
		['PAGE','11290',jdecode('Newsletters'),jdecode(''), jdecode('%2F21369%2F11290.html'), 'true',[],'',''],
		['PAGE','11332',jdecode('Publications'),jdecode(''), jdecode('%2F21369%2F11332.html'), 'true',[],'','']
	],'',''],
	['PAGE','30427',jdecode('Careers'),jdecode(''), jdecode('%2F30427%2Findex.html'), 'true',[ 
		['PAGE','30527',jdecode('Openings'),jdecode(''), jdecode('%2F30427%2F30527.html'), 'true',[],'',''],
		['PAGE','30548',jdecode('Life+at+PCE'),jdecode(''), jdecode('%2F30427%2F30548.html'), 'true',[],'',''],
		['PAGE','30569',jdecode('Benefits'),jdecode(''), jdecode('%2F30427%2F30569.html'), 'true',[],'',''],
		['PAGE','30590',jdecode('Growth+Support'),jdecode(''), jdecode('%2F30427%2F30590.html'), 'true',[],'','']
	],'',''],
	['PAGE','89093',jdecode('Projects+For+Bid'),jdecode(''), jdecode('%2F89093.html'), 'true',[],'',''],
	['PAGE','30248',jdecode('Links'),jdecode(''), jdecode('%2F30248.html'), 'true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Cuy';
theSitetree.paletteFamily='F7FDFD';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='385';
theSitetree.graphicsetId='438';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F7FDFD';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'comcast',
  product: 'WSCSYSSSSLYTC245'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Cuy',
				paletteFamily: 	'F7FDFD',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'385',
				graphicsetId: 	'438',
				contentColor: 	'000000',
				contentBGColor: 'F7FDFD',
				a_color: 		'F7FDFD',
				b_color: 		'E4E5C0',
				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:  '30248',
internalId:  '',
customField: '20120110-111532'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21327',
internalId:  '',
customField: '20120110-102742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12101',
internalId:  '',
customField: '20100423-135054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9322',
internalId:  '',
customField: '20120110-104056'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11332',
internalId:  '',
customField: '20120203-093316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11311',
internalId:  '',
customField: '20110916-134505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11290',
internalId:  '',
customField: '20120203-093709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11143',
internalId:  '',
customField: '20110201-100305'
};
webappMappings['7060']=webappMappings['7060-73bcb46ab398b8b99642b23efbbc59a8']={
webappId:    '7060',
documentId:  '55171',
internalId:  '73bcb46ab398b8b99642b23efbbc59a8',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21348',
internalId:  '',
customField: '20120110-102639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89093',
internalId:  '',
customField: '20120206-101030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21369',
internalId:  '',
customField: '20100408-100718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24927',
internalId:  '',
customField: '20120110-102904'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '55171',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11248',
internalId:  '',
customField: '20120110-102820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30427',
internalId:  '',
customField: '20100408-102224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30527',
internalId:  '',
customField: '20100406-114511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30548',
internalId:  '',
customField: '20100406-133732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30590',
internalId:  '',
customField: '20100921-152845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30569',
internalId:  '',
customField: '20100406-134435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55171',
internalId:  '',
customField: '20120110-100631'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INVNHQ';
var companyName   = 'Progressive+Consulting+Engineers%2C+Inc.';
var htmlTitle	  = 'Progressive+Consulting+Engineers%2C+Inc.';
var metaKeywords  = 'PCE%2C+Progressive+Consulting+Engineers%2C+Inc.%2C+Engineering+Services%2C+Engineering+Design%2C+Civil+Engineering%2C+Water+Resources%2C+Water+Treatment%2C+Newsletter%2C+Infrastructure+Planning+and+Development%2C+Site+Development%2C+Construction%2C+Drinking+Water%2C+Water+System+Consulting%2C+Water+System+Engineering%2C+Water+Rate+Study%2C+Sewer+Rate+Study%2C+Cost+of+Service%2C+Capital+Improvement+Planning%2C+Water+System+Modeling%2C+Naeem+Qureshi%2C+Nuzhat+Qureshi%2C+Utility+Planning%2C+Wells%2C+Water%2C+Utility%2C+Utilities%2C+Utilities+Relocation%2C+Light+Rail+Transit%2C+Iron+and+Manganese+Removal';
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();
};

