/* [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','22',jdecode('Home'),jdecode(''),'/22.html','true',[],'',''],
	['PAGE','364',jdecode('Contact'),jdecode(''),'/364.html','true',[],'',''],
	['PAGE','2712',jdecode('Areas+covered'),jdecode(''),'/2712.html','true',[],'',''],
	['PAGE','72101',jdecode('About+Us'),jdecode(''),'/72101.html','true',[],'',''],
	['PAGE','67201',jdecode('Free+Consulation+click+here'),jdecode(''),'/67201.html','true',[],'',''],
	['PAGE','54001',jdecode('Testimonials+%26+References'),jdecode(''),'/54001.html','true',[],'',''],
	['PAGE','71801',jdecode('Services'),jdecode(''),'/71801.html','true',[],'',''],
	['PAGE','72301',jdecode('Water+Damage+Repairs'),jdecode(''),'/72301.html','true',[],'',''],
	['PAGE','72501',jdecode('Plaster+Repairs'),jdecode(''),'/72501.html','true',[],'',''],
	['PAGE','72901',jdecode('Plaster+Molding'),jdecode(''),'/72901.html','true',[],'',''],
	['PAGE','73101',jdecode('Installation+Services'),jdecode(''),'/73101.html','true',[],'',''],
	['PAGE','1493',jdecode('Photo+Gallery'),jdecode(''),'/1493.html','true',[],'',''],
	['PAGE','76201',jdecode('Links'),jdecode(''),'/76201.html','true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Mondrian';
theSitetree.paletteFamily='3E51B5';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10460';
theSitetree.graphicsetId='10886';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3E51B5';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Mondrian',
				paletteFamily: 	'3E51B5',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10460',
				graphicsetId: 	'10886',
				contentColor: 	'FFFFFF',
				contentBGColor: '3E51B5',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'D3D3D3',
				e_color: 		'D3D3D3',
				f_color: 		'D3D3D3',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '364',
internalId:  '',
customField: '20100326-074618'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '22',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22',
internalId:  '',
customField: '20100326-074649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71801',
internalId:  '',
customField: '20100320-115027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2712',
internalId:  '',
customField: '20100320-123624'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72501',
internalId:  '',
customField: '20100320-121440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1493',
internalId:  '',
customField: '20100320-113636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72301',
internalId:  '',
customField: '20100320-121734'
};
webappMappings['7060']=webappMappings['7060-6777fbd51e93caf67334bba82e1623fe']={
webappId:    '7060',
documentId:  '1493',
internalId:  '6777fbd51e93caf67334bba82e1623fe',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54001',
internalId:  '',
customField: '20100320-123732'
};
webappMappings['7008']=webappMappings['7008-5875']={
webappId:    '7008',
documentId:  '67201',
internalId:  '5875',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73101',
internalId:  '',
customField: '20100320-122934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72901',
internalId:  '',
customField: '20100320-122139'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '22',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '364',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72101',
internalId:  '',
customField: '20100320-115606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67201',
internalId:  '',
customField: '20100320-113704'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '2712',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '1493',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5001']=webappMappings['5001-']={
webappId:    '5001',
documentId:  '54001',
internalId:  '',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76201',
internalId:  '',
customField: '20100808-191155'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050IN3DEL';
var companyName   = 'BESTWALL+PLASTERING+INC';
var htmlTitle	  = 'www.bestwallplastering.com%3B+New+York+Plastering+%7C+New+Jersey+Drywall+%7C+NYC+Ornamental+Plastering+-+Best+Wall+Plastering';
var metaKeywords  = 'New+York+plastering%2FNew+Jersey+plastering%2F+Connecticut+plastering%2FGreenwich+Plastering+Company%2FBronx+plaster+repairs%2FNew+York+plaster+ceiling+repairs%2FConnecticut+Plaster+Repair%2FNew+Jersey+Plaster+Repair%2FNew+York+Plaster+Repair%2FLong+Island+Plaster+Repair%2FFairfield+County+Plastering%2FNew+Haven+Plastering%2FNassau+County+Plastering%2FSkim+coat%2FWestchester+Plaster+Repair%2FPolished+Plaster%2FVenetian+Plaster%2FPlaster+Paris%2F';
var metaContents  = 'New+York+%2F+New+Jersey+and+Connecticut+Premier+Plastering+and+Drywall+Company%2C+Stamford+Plastering+Company%2F+Plastering+Company%2F+New+York+Plastering+company%2F+Best+Wall+Plastering+is+New+Jerseys+choice+for+quality+drywall+and+plaster+repairs%2F+Excellent+craftsmanship+along+with+customer+service+in+ornamental+drywall+and+plastering+repairs%2F.+Bronx+plastering%2F+Brooklyn+plastering%2F+Queens+plastering%2FYonkers+Plastering%2FNew+York+Plaster+Molding%2FConnecticut+Plaster+Molding%2FVeneer+Plastering%2F';
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();
};

