/* [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','2001',jdecode('Home'),jdecode(''),'/2001.html','true',[],'',''],
	['PAGE','6301',jdecode('Services'),jdecode(''),'/6301.html','true',[],'',''],
	['PAGE','29401',jdecode('Get+A+Free+Estimate+'),jdecode(''),'/29401.html','true',[],'',''],
	['PAGE','6322',jdecode('Business+Profile'),jdecode(''),'/6322/index.html','true',[ 
		['PAGE','21501',jdecode('Mission+Statement'),jdecode(''),'/6322/21501.html','true',[],'',''],
		['PAGE','6343',jdecode('Purdy+Press+Release'),jdecode(''),'/6322/6343.html','true',[],'','']
	],'',''],
	['PAGE','16201',jdecode('PORTFOLIO'),jdecode(''),'/16201.html','true',[],'',''],
	['PAGE','6385',jdecode('Consumer+Information'),jdecode(''),'/6385/index.html','true',[ 
		['PAGE','6406',jdecode('Hiring+A+Contractor'),jdecode(''),'/6385/6406.html','true',[],'',''],
		['PAGE','6427',jdecode('Lead+Paint+Safety'),jdecode(''),'/6385/6427.html','true',[],'',''],
		['PAGE','6448',jdecode('Why+Hire+A+Professional'),jdecode(''),'/6385/6448.html','true',[],'',''],
		['PAGE','6364',jdecode('Hire+Someone+Who+Knows+What+They%26%23x27%3Bre+Doing'),jdecode(''),'/6385/6364.html','true',[],'','']
	],'',''],
	['PAGE','6490',jdecode('Helpful+Links'),jdecode(''),'/6490.html','true',[],'',''],
	['PAGE','6511',jdecode('Contact+Us'),jdecode(''),'/6511/index.html','true',[ 
		['PAGE','22701',jdecode('Contact+Us+%28follow+up+page%29'),jdecode(''),'/6511/22701.html','false',[],'','']
	],'',''],
	['PAGE','22406',jdecode('Guestbook'),jdecode(''),'/22406/index.html','true',[ 
		['PAGE','22401',jdecode('Read+Guestbook'),jdecode(''),'/22406/22401.html','false',[],'','']
	],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Retro';
theSitetree.paletteFamily='990000';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='202';
theSitetree.graphicsetId='247';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Retro',
				paletteFamily: 	'990000',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'202',
				graphicsetId: 	'247',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'990000',
				b_color: 		'FF9900',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'EAEAEA',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-06fc08690c6fe3dfbc2090bcca9a9306']={
webappId:    '7060',
documentId:  '16201',
internalId:  '06fc08690c6fe3dfbc2090bcca9a9306',
customField: 'language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-22406aen010inlwie']={
webappId:    '1002',
documentId:  '22406',
internalId:  '22406aen010inlwie',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20090124-163848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6301',
internalId:  '',
customField: '20080827-093006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29401',
internalId:  '',
customField: '20081019-181442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6322',
internalId:  '',
customField: '20090124-163942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21501',
internalId:  '',
customField: '20080425-073206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16201',
internalId:  '',
customField: '20080827-093227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6385',
internalId:  '',
customField: '20080827-093328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6406',
internalId:  '',
customField: '20090124-164111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6427',
internalId:  '',
customField: '20090124-164225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6448',
internalId:  '',
customField: '20080421-174800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6364',
internalId:  '',
customField: '20080421-165645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6490',
internalId:  '',
customField: '20081019-182854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6511',
internalId:  '',
customField: '20080827-094840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22406',
internalId:  '',
customField: '20080827-093805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6343',
internalId:  '',
customField: '20080401-084144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22701',
internalId:  '',
customField: '20080420-160913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22401',
internalId:  '',
customField: '20080420-153029'
};
webappMappings['7008']=webappMappings['7008-2724']={
webappId:    '7008',
documentId:  '6511',
internalId:  '2724',
customField: 'language:en;country:US;'
};
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN010INLWIE';
var companyName   = 'GrandSon+Painting%2C+Inc.';
var htmlTitle	  = 'Interior+Painting%2C+Wallpaper+Hanging%2C+Decorative+Finishes+at+GrandSon+Painting++Inc.%2C+Grosse+Pointe%2C+Painter%2C+High+Quality%2C+Superior+Craftsmanship%2C+Committed+to+Excellence%2C+Neat++Clean%2C+Finest+Quality+Product%2C+Trustworthy%2C+Macomb+County%2C+Oakland';
var metaKeywords  = '%2FGrandson+Painting+and+Decorating%2C+Grand-Son+Painting+and+Decorating%2C+GrandSon+Painting+Inc.%2CMarkgrandson%2C+Markgrand-son%2C+Interior+Painting%2C+Faux%2C+faux+finishes%2C+sponging%2C+marbling%2C+gold+leaf%2C+silver+leaf%2C+tortoise+shell+finish%2C+decorating%2C+decorative+finishes%2C+wallpaper+hanging%2C+wallpaper+installation%2C+wallcovering+installation%2C+commercial+wallcovering+installation%2Ccommercial+wallpaper+hanging%2C+commercial+wallpaper+installation%2C+wallcovering+removal%2C+wallpaper+removal%2C+wallpaper+repair%2C+wallcovering+repair%2C+kitchen+cabinets%2C+painting+kitchen+cabinets%2C+bathrooms%2C+painting+bathrooms%2C+painting+doors%2C+painting+windows%2C+staining+doors%2C+staining+windows%2C+crown+moulding%2C+crown+molding%2C+lead+paint+safety+procedures%2C+lead+paint+dangers%2C+lead+paint%2C+lead+paint+hazzards%2C+water+damage+repair%2C+plaster+repair%2C+wood+repair%2C+wood+finishing%2C+wood+staining%2C+varnishing%2C+professional+licensed+contractors%2C+professionally+licensed+contractor%2C+licensed+contractors%2C+michigan+licensed+contractors%2C+residential+painting+contractors%2C+interior+painting%2C+interior%2C+residential%2C+professional%2C+licensed%2C+insured%2C+homes%2C+houses%2C+contractors%2C+painting+contractors%2C+painters%2C+eastside+painters%2C+refinishing%2C+commercial%2C+commercial+wallpaper%2C+commercial+wallcovering%2C+brush%2C+roller%2C+decorative+coatings%2C+decorative+finishes%2C+house+painter%2C+home+finishes%2C+interior+finishing%2C+painting%2C+room+painting%2C+painting+rooms%2C+office+finishing%2C+office+painting%2C+painting+office%2C+trim+painting%2C+painting+trim%2C+paint+application%2C+paint+contractors%2C+painting+standards%2C+professional+painting+standards%2C+painting+techniques%2C+quality+application%2C+repaint%2C+repainting%2C+repair%2C+strip%2C+varnish%2C+staining%2C+painting+and+decorating+contractors+of+america%2C+greater+detroit+chapter%2C+greater+detroit+chapter+of+the+painting+and+decorating+contractors+of+america%2C+pdca%2C+ngpp%2C+national+guild+of+professional+paperhangers%2C+find-a-painter%2C+find+a+painter%2C+find+an+interior+painter%2C++find+a+pro%2C+professional+coatings%2C+painting+contractors%2C+Mark+Collinson%2C+Mark+D.+Collinson%2C+collinson%2C+grosse+pointe+painters%2C+eastside+painters%2C+find+local+painters%2C+find+local+grosse+pointe+painters%2C+find+painters%2C+find+local+house+painters%2C+find+house+painters%2C+find+local+grosse+pointe+wallpaper+hangers%2C+find+grosse+pointe+painters%2C+find+macomb+county+painters%2C+find+wallpaperhangers%2C+find+grosse+pointe+wallpaperhangers%2C+find+local+wallpaperhangers%2C+find+east+side+wallpaperhangers%2C+find+macomb+county+wallpaper+hangers%2C+find+oakland+county+wallpaper+hangers%2C+find+wayne+county+wallpaperhangers%2C+accredited+painting+contractor%2C+high+quality%2C+prompt+service%2C+finest+quality+products%2C+finest+quality+materials%2C+committed+to+excellence%2C+neat+and+clean%2C+proper+preparation%2C+complete+cleanup%2C+proper+cleanup%2C+eastside%2C+macomb+county%2C+wayne+county%2C+oakland+county%2C+grosse+pointe%2C+harper+woods%2C+murals%2C+mural+installation%2C+wayne+county+painters%2C+macomb+county+painters%2C+oakland+county+painters%2C+grosse+pointe+wallpaper+hangers%2C+grosse+pointe+wallcovering+hangers%2C+wayne+county+wallpaper+hangers%2C+oakland+county+wallpaper+hangers%2C+macomb+county+wallpaper+hangers%2C+trustworthy%2C+third+generation+contractor%2C+Easy+Estimator%2C+MyPaintBid.com%2C+MyPaintBid%2C+My+Paint+Bid%2C+painters+in+Grosse+Pointe%2C+painters+in+St.+Clair+Shores';
var metaContents  = 'GrandSon+Painting%2C+Inc++is+a+residential+painting+and+wallpaper+hanging+service+in+Southeast+Michigan%2C+Grosse+Pointe%2C+Harper+Woods%2C+Detroit%2C+Macomb+County%2C+Oakland+County+and+Wayne+County+areas.+Properly+licensed+and+insured+the+owner+is+a+third+generation+contractor%2C+using+the+latest+technology+and+finest+materials+with+old+world+craftsmanship+to+produce+a+superior+finished+product.+Proper+preparation+is+the+difference+between+a+good+job+and+a+Great+Job%21';
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();
};
