/* [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(''), jdecode('%2F17178.html'), 'true',[],'',''],
	['PAGE','92755',jdecode('Vapor+Control'),jdecode(''), jdecode('%2F92755.html'), 'true',[],'',''],
	['PAGE','177343',jdecode('If+it%26%23x27%3Bs+on...get+Paid'),jdecode(''), jdecode('%2F177343.html'), 'true',[],'',''],
	['PAGE','120455',jdecode('Roof+coatings'),jdecode(''), jdecode('%2F120455.html'), 'true',[],'',''],
	['PAGE','23542',jdecode('Industrial'),jdecode(''), jdecode('%2F23542.html'), 'true',[],'',''],
	['PAGE','150910',jdecode('Architects'),jdecode(''), jdecode('%2F150910.html'), 'true',[],'',''],
	['PAGE','91955',jdecode('Waterproofing'),jdecode(''), jdecode('%2F91955.html'), 'true',[],'',''],
	['PAGE','23563',jdecode('Graffiti+Removal'),jdecode(''), jdecode('%2F23563.html'), 'true',[],'',''],
	['PAGE','88855',jdecode('Floor+Prep'),jdecode(''), jdecode('%2F88855.html'), 'true',[],'',''],
	['PAGE','23584',jdecode('About+Us'),jdecode(''), jdecode('%2F23584.html'), 'true',[],'',''],
	['PAGE','23605',jdecode('Our+Team'),jdecode(''), jdecode('%2F23605.html'), 'true',[],'',''],
	['PAGE','23647',jdecode('Products'),jdecode(''), jdecode('%2F23647.html'), 'true',[],'',''],
	['PAGE','60355',jdecode('Recent+Jobs'),jdecode(''), jdecode('%2F60355.html'), 'true',[],'',''],
	['PAGE','92555',jdecode('References'),jdecode(''), jdecode('%2F92555.html'), 'true',[],'',''],
	['PAGE','23626',jdecode('Locate+Us'),jdecode(''), jdecode('%2F23626.html'), 'true',[],'',''],
	['PAGE','54744',jdecode('Contact'),jdecode(''), jdecode('%2F54744.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 prodDef={
  wl_name: 'enom',
  product: 'WSCENOSSSLYTC21T'
};
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: '20110926-100409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '177343',
internalId:  '',
customField: '20111011-114001'
};
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: '20101203-133913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23626',
internalId:  '',
customField: '20110523-210938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23605',
internalId:  '',
customField: '20110523-210542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23647',
internalId:  '',
customField: '20110523-211814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60355',
internalId:  '',
customField: '20101106-160254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92555',
internalId:  '',
customField: '20110617-064803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23542',
internalId:  '',
customField: '20110523-205700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23563',
internalId:  '',
customField: '20101203-133022'
};
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: '20101203-132523'
};
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: '20110523-211042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92755',
internalId:  '',
customField: '20101209-131805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88855',
internalId:  '',
customField: '20101203-133613'
};
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:  '150910',
internalId:  '',
customField: '20110104-123724'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '120455',
internalId:  '',
customField: '20110104-125441'
};
var webAppHostname = 'wsc.ehost-services.com:80';
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN330INF5RD';
var companyName   = 'PCS+Coatings';
var htmlTitle	  = 'PCS+Coatings%2C+Preventing+Waterproofing%2C+Seattle+Washington.+';
var metaKeywords  = 'rotting+cardboard%2C+rusty+tools%2C+musty+smell%2C+moisture+damage%2C+vapor+drive%2C+residential+preventive+waterproofing%2C+industrial+preventive+waterproofing+%2C+water+damage%2C+moisture+control+systems%2C+vapor+guard+dc%2C+moisture+vapor+drive%2C+eco+friendly+coating+solutions%2C+vapor+drive%2C+calcium+chloride%2C+moisture+vapor+emission%2C+core+drilling%2C+mold%2C+asr';
var metaContents  = 'Residential+and+Industrial+Preventive+waterproofing+and+water+damage.++PCS+Coating%2C+located+south+of+Seattle+in+Auburn%2C+WA.';
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();
};

