/* [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','17178',jdecode('Home'),jdecode(''),'/17178.html','true',[],'',''],
	['PAGE','92755',jdecode('Vapor+Control'),jdecode(''),'/92755.html','true',[],'',''],
	['PAGE','120455',jdecode('Roofing'),jdecode(''),'/120455.html','true',[],'',''],
	['PAGE','23542',jdecode('Industrial'),jdecode(''),'/23542.html','true',[],'',''],
	['PAGE','91955',jdecode('Waterproofing'),jdecode(''),'/91955.html','true',[],'',''],
	['PAGE','117255',jdecode('Concrete'),jdecode(''),'/117255.html','true',[],'',''],
	['PAGE','118455',jdecode('Restoration'),jdecode(''),'/118455.html','true',[],'',''],
	['PAGE','23563',jdecode('Graffitti+Removal'),jdecode(''),'/23563.html','true',[],'',''],
	['PAGE','88855',jdecode('Floor+Prep'),jdecode(''),'/88855.html','true',[],'',''],
	['PAGE','23584',jdecode('About+Us'),jdecode(''),'/23584.html','true',[],'',''],
	['PAGE','23605',jdecode('Our+Team'),jdecode(''),'/23605.html','true',[],'',''],
	['PAGE','23647',jdecode('Products'),jdecode(''),'/23647.html','true',[],'',''],
	['PAGE','60355',jdecode('Recent+Jobs'),jdecode(''),'/60355.html','true',[],'',''],
	['PAGE','92555',jdecode('References'),jdecode(''),'/92555.html','true',[],'',''],
	['PAGE','23626',jdecode('Locate+Us'),jdecode(''),'/23626.html','true',[],'',''],
	['PAGE','54744',jdecode('Contact'),jdecode(''),'/54744.html','true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Triangle';
theSitetree.paletteFamily='004165';
theSitetree.keyvisualId='12006';
theSitetree.keyvisualName='kv_12006.jpg';
theSitetree.fontsetId='33260';
theSitetree.graphicsetId='14140';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='004165';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Triangle',
				paletteFamily: 	'004165',
				keyvisualId: 	'12006',
				keyvisualName: 	'kv_12006.jpg',
				fontsetId: 		'33260',
				graphicsetId: 	'14140',
				contentColor: 	'FFFFFF',
				contentBGColor: '004165',
				a_color: 		'004165',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17178',
internalId:  '',
customField: '20100507-080953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '117255',
internalId:  '',
customField: '20100318-105848'
};
webappMappings['7060']=webappMappings['7060-690eecfdb16879f77081277b14534805']={
webappId:    '7060',
documentId:  '92755',
internalId:  '690eecfdb16879f77081277b14534805',
customField: 'language:en;country:US;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '23626',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23584',
internalId:  '',
customField: '20100302-150354'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23626',
internalId:  '',
customField: '20091215-110742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23605',
internalId:  '',
customField: '20091212-085729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23647',
internalId:  '',
customField: '20100225-113926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60355',
internalId:  '',
customField: '20100202-093333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92555',
internalId:  '',
customField: '20091214-111531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23542',
internalId:  '',
customField: '20100318-071614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23563',
internalId:  '',
customField: '20100210-112053'
};
webappMappings['7060']=webappMappings['7060-336f1c7ba1e88fb1766948c22405d2fc']={
webappId:    '7060',
documentId:  '23542',
internalId:  '336f1c7ba1e88fb1766948c22405d2fc',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '17178',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91955',
internalId:  '',
customField: '20100106-081849'
};
webappMappings['7008']=webappMappings['7008-2867']={
webappId:    '7008',
documentId:  '54744',
internalId:  '2867',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54744',
internalId:  '',
customField: '20100317-090434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92755',
internalId:  '',
customField: '20100309-123244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88855',
internalId:  '',
customField: '20091227-170827'
};
webappMappings['1501']=webappMappings['1501-21533938']={
webappId:    '1501',
documentId:  '17178',
internalId:  '21533938',
customField: '1501'
};
webappMappings['7060']=webappMappings['7060-269e82dd1e429fd67cedf26011ab8b67']={
webappId:    '7060',
documentId:  '91955',
internalId:  '269e82dd1e429fd67cedf26011ab8b67',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '118455',
internalId:  '',
customField: '20100318-105156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '120455',
internalId:  '',
customField: '20100402-094531'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN330INF5RD';
var companyName   = 'PCS+Coatings';
var htmlTitle	  = 'PCS+Coatings';
var metaKeywords  = 'Industrial+Coatings%2CCoatings%2CPaint%2CEco+Friendly+Coatings%2CWaterproof%2CConcrete+Repair%2CConcrete+Stain%2CConcrete+Repair%2CCrack+Repair%2CStain%2CVapor+Emission+Control%2C';
var metaContents  = 'Industrial+Coatings%2C+Concrete+Repair%2C+Waterproofing%2C+Concrete+Stain%2CVapor+Emission+Control+';
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();
};
