/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','552',jdecode('About+Our+Company'),jdecode(''),'/552.html','true',[],'',''],
	['PAGE','573',jdecode('Painting+Projects'),jdecode(''),'/573.html','true',[],'',''],
	['PAGE','594',jdecode('Contact+Us'),jdecode(''),'/594.html','true',[],'',''],
	['PAGE','615',jdecode('Tips+%26+Tricks'),jdecode(''),'/615.html','true',[],'','']];
var siteelementCount=5;
theSitetree.topTemplateName='Snapshot';
theSitetree.paletteFamily='555F8C';
theSitetree.keyvisualId='3633';
theSitetree.keyvisualName='kv_3633.jpg';
theSitetree.fontsetId='10755';
theSitetree.graphicsetId='10876';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='555F8C';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Snapshot',
				paletteFamily: 	'555F8C',
				keyvisualId: 	'3633',
				keyvisualName: 	'kv_3633.jpg',
				fontsetId: 		'10755',
				graphicsetId: 	'10876',
				contentColor: 	'FFFFFF',
				contentBGColor: '555F8C',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FC5E7B',
				e_color: 		'BFBFBF',
				f_color: 		'050001',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20110824-101952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20110824-102856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20110111-082608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20110111-082632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20110111-082652'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INX3RT';
var companyName   = 'Atlantic+Painting+Systems%2C+Inc.';
var htmlTitle	  = 'Painters+West+Palm+Beach%2C+Florida+++-+++Atlantic+Painting+Systems%2C+Inc.+++-+++Painting+Contractor';
var metaKeywords  = 'Painter%2C+Painters%2C+Painting+Contractor%2C+Commercial+Painting%2C+Painting+Company%2C+House+Painting%2C+House+Painters%2C+Exterior+House+Painting.+House+Painter%2C+Painting+Estimate%2C+Professional+Painters%2C+Painting+Service%2C+Interior+Painters%2C+Paint+Contractors%2C+Residential+Painting+Contractor%2C+Home+Painters%2C+Exterior+Painters%2C+Commercial+Painting+Contractor%2C+Interior+Residential+Painting+Contractors%2C+Residential+Painting+Contractors%2C+Wall+Painting%2C+Exterior+House+Painters%2C+Residential+Painter%2C+Painting+Business%2C+Commercial+Painting+Contractors%2C+Painting+And+Decorating%2C+Painter+And+Decorator%2C+Home+Painter%2C+Painting+Companies%2C+Residential+Painters%2C+Commercial+Painters%2C+Exterior+Painting+Contractor%2C+Commercial+Painter%2C+Professional+Painting%2C+Exterior+Paint%2C+Home+Painting%2C+Exterior+Residential+Painting+Contractors%2C+Painting+And+Paper%2C+Painting+And+Paper+Hanging%2C+Painting+And+Wall+Covering%2C+Painting+And+Wall+Covering+Contractors%2C+Painting+Contractors%2C+Painting+Systems%2C+Paper+Hanging%2C+Wall+Covering%2C+Wall+Covering+Contractors%2C+Wall+Paper%2C+Faux+Finishes%2C+Office+Painting%2C+Palm+Beach+Painters%2C+Florida+Painters%2C+Pressure+Washing%2C+Pressure+Cleaning%2C+Power+Washing%2C+Shopping+Center+Painting%2C+Caulking%2C+Waterproofing%2C+hospital+painting+services%2C+Commercial+building+painting%2C+west+palm+beach%2C+wellington%2C+palm+beach%2C+north+palm+beach%2C+jupiter%2C+palm+beach+gardens%2C+royal+palm+beach%2C+lake+worth%2C+boynton+beach%2C+delray+beach%2C+industrial+painting+paint+interior+painting+exterior+painting+green+painting+lead+free+painting+lead+renovator%2C+nsw-teqb--rtrf94zx98rupx9x49k1idwcsvwkg0t7a514cwl1f08s7ulzncqyztnw21hbf7nzdq5s0d6kqgi7jb739y0qm7nf-csi2ou2ezvniyj8x4f25xoj70k9k7k15-';
var metaContents  = 'Painter+in+West+Palm+Beach%2C+Florida.++Also+servicing+Wellington%2C+Palm+Beach%2C+Jupiter%2C+Palm+Beach+Gardens%2C+Belle+Glade%2C+Royal+Palm+Beach%2C+North+Palm+Beach%2C+Boynton+Beach%2C+Lake+Worth.++Commercial%2C+Residential%2C+Industrial+Painting+Contractor.++';
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();
};

