/* [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+Us'),jdecode(''),'/552.html','true',[],'',''],
	['PAGE','594',jdecode('Interior+Painting'),jdecode(''),'/594.html','true',[],'',''],
	['PAGE','615',jdecode('Faux%2FDecorative+Painting'),jdecode(''),'/615.html','true',[],'',''],
	['PAGE','54397',jdecode('Fine+Art'),jdecode(''),'/54397.html','true',[],'',''],
	['PAGE','38612',jdecode('Murals'),jdecode(''),'/38612.html','true',[],'',''],
	['PAGE','57680',jdecode('Countertops'),jdecode(''),'/57680.html','true',[],'',''],
	['PAGE','57360',jdecode('About+Color'),jdecode(''),'/57360.html','true',[],'',''],
	['PAGE','573',jdecode('Exterior+Painting%2FStaining'),jdecode(''),'/573.html','true',[],'',''],
	['PAGE','21601',jdecode('Power+Washing'),jdecode(''),'/21601.html','true',[],'',''],
	['PAGE','37312',jdecode('The+Time+Machine'),jdecode(''),'/37312.html','true',[],'',''],
	['PAGE','16301',jdecode('Before%2FAfter+Pictures'),jdecode(''),'/16301/index.html','true',[ 
		['PAGE','23901',jdecode('Before%2FAfter+Stripes'),jdecode(''),'/16301/23901.html','true',[],'',''],
		['PAGE','19701',jdecode('Before%2FAfter+Skylight'),jdecode(''),'/16301/19701.html','true',[],'',''],
		['PAGE','40312',jdecode('Before%2FAfter+Shelves'),jdecode(''),'/16301/40312.html','true',[],'',''],
		['PAGE','43312',jdecode('Before%2FAfter+Columns'),jdecode(''),'/16301/43312.html','true',[],'',''],
		['PAGE','43333',jdecode('Before%2FAfter+Mantle'),jdecode(''),'/16301/43333.html','true',[],'',''],
		['PAGE','43354',jdecode('Before%2FAfter+Tiles'),jdecode(''),'/16301/43354.html','true',[],'',''],
		['PAGE','44012',jdecode('Before%2FAfter+Cabinets'),jdecode(''),'/16301/44012.html','true',[],'',''],
		['PAGE','52112',jdecode('Before%2FAfter+Faux+Tile'),jdecode(''),'/16301/52112.html','true',[],'',''],
		['PAGE','57544',jdecode('Before%2FAfter+Faux+Vanity'),jdecode(''),'/16301/57544.html','true',[],'','']
	],'',''],
	['PAGE','657',jdecode('Estimates'),jdecode(''),'/657/index.html','true',[ 
		['PAGE','7501',jdecode('Estimates+%28follow+up+page%29'),jdecode(''),'/657/7501.html','false',[],'','']
	],'',''],
	['PAGE','678',jdecode('Contact+Us'),jdecode(''),'/678.html','true',[],'',''],
	['PAGE','699',jdecode('Links'),jdecode(''),'/699.html','true',[],'',''],
	['PAGE','19406',jdecode('Guestbook'),jdecode(''),'/19406/index.html','true',[ 
		['PAGE','19401',jdecode('Read+Guestbook'),jdecode(''),'/19406/19401.html','false',[],'','']
	],'','']];
var siteelementCount=27;
theSitetree.topTemplateName='Education';
theSitetree.paletteFamily='793F3F';
theSitetree.keyvisualId='7304';
theSitetree.keyvisualName='kv_7304.jpg';
theSitetree.fontsetId='16462';
theSitetree.graphicsetId='12159';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='875959';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Education',
				paletteFamily: 	'793F3F',
				keyvisualId: 	'7304',
				keyvisualName: 	'kv_7304.jpg',
				fontsetId: 		'16462',
				graphicsetId: 	'12159',
				contentColor: 	'FFFFFF',
				contentBGColor: '875959',
				a_color: 		'000000',
				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['1501']=webappMappings['1501-50212']={
webappId:    '1501',
documentId:  '501',
internalId:  '50212',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-19406AHW050INXXJ3']={
webappId:    '1002',
documentId:  '19406',
internalId:  '19406AHW050INXXJ3',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20091022-105029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20091009-151351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57680',
internalId:  '',
customField: '20100604-154157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57544',
internalId:  '',
customField: '20100505-155254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20091016-154405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20100830-145623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54397',
internalId:  '',
customField: '20100827-170337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20100505-161658'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38612',
internalId:  '',
customField: '20100827-170125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21601',
internalId:  '',
customField: '20091009-151610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37312',
internalId:  '',
customField: '20091009-151630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16301',
internalId:  '',
customField: '20100505-154906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23901',
internalId:  '',
customField: '20091009-151735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19701',
internalId:  '',
customField: '20091009-151827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40312',
internalId:  '',
customField: '20091009-151859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43312',
internalId:  '',
customField: '20091009-151942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43333',
internalId:  '',
customField: '20091009-152005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43354',
internalId:  '',
customField: '20091009-152039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44012',
internalId:  '',
customField: '20091009-152202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52112',
internalId:  '',
customField: '20100505-154925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20091009-152321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20080313-114856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '678',
internalId:  '',
customField: '20091009-152432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '699',
internalId:  '',
customField: '20091113-111745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19406',
internalId:  '',
customField: '20091009-152526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19401',
internalId:  '',
customField: '20070605-120556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57360',
internalId:  '',
customField: '20091019-131648'
};
webappMappings['7008']=webappMappings['7008-7977']={
webappId:    '7008',
documentId:  '657',
internalId:  '7977',
customField: 'language:en;country:US;'
};
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INXXJ3';
var companyName   = 'Red+Lion+Painting+Company';
var htmlTitle	  = 'Red+Lion+Painting+Company%3B+Murals%3B+Faux+and+Decorative+Finishes';
var metaKeywords  = 'Red+Lion+Painting%2C+RedLion%2C+Paint%2C+Paints%2C+Painter%2C+Painters%2C+Painting%2C+Painted%2C+Painting+Company%2C+Northport+NY%2C+Suffolk+NY%2C+Best+Long+Island+Painter%2C+Painting+Contractor%2C+Contractors%2C+faux+painter%2C+faux+painting%2C+faux+finishes%2C+wall+murals%2C+murals%2C+decorative+painter%2C+speciality+painter%2C+11768';
var metaContents  = 'Red+Lion+Painting+Company%2C+your+full+service+traditional+and+decorative+painter+proudly+serving+Nassau+and+Suffolk.++Coloring+all+of+Long+Island%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();
};
