/* [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','2501',jdecode('Home'),jdecode(''),'/2501.html','true',[],'',''],
	['PAGE','2552',jdecode('About+us'),jdecode(''),'/2552.html','true',[],'',''],
	['PAGE','2573',jdecode('Services'),jdecode(''),'/2573/index.html','true',[ 
		['PAGE','23201',jdecode('Waterproofing'),jdecode(''),'/2573/23201.html','true',[],'',''],
		['PAGE','23222',jdecode('Specialty+Coatings'),jdecode(''),'/2573/23222.html','true',[],'',''],
		['PAGE','23243',jdecode('Masonry+%26+Concrete+Repair'),jdecode(''),'/2573/23243.html','true',[],'',''],
		['PAGE','24801',jdecode('Concrete+Grinding+%26+Polishing'),jdecode(''),'/2573/24801.html','true',[],'',''],
		['PAGE','23264',jdecode('Water+Jetting+%26+Chemical+Cleaning'),jdecode(''),'/2573/23264.html','true',[],'',''],
		['PAGE','38365',jdecode('Parapet+Cap+Installation+%26+Repair'),jdecode(''),'/2573/38365.html','true',[],'',''],
		['PAGE','24822',jdecode('Terra+Cotta+%26+Detail+Replication'),jdecode(''),'/2573/24822.html','true',[],'',''],
		['PAGE','23701',jdecode('Commercial+Roofing'),jdecode(''),'/2573/23701.html','true',[],'',''],
		['PAGE','23285',jdecode('Consulting'),jdecode(''),'/2573/23285.html','true',[],'','']
	],'',''],
	['PAGE','33095',jdecode('Cost-Saving+Solutions'),jdecode(''),'/33095.html','true',[],'',''],
	['PAGE','39065',jdecode('Green+Incentives'),jdecode(''),'/39065.html','true',[],'',''],
	['PAGE','2594',jdecode('Projects'),jdecode(''),'/2594.html','true',[],'',''],
	['PAGE','2615',jdecode('References'),jdecode(''),'/2615.html','true',[],'',''],
	['PAGE','2636',jdecode('Press'),jdecode(''),'/2636.html','true',[],'',''],
	['PAGE','2657',jdecode('Contact'),jdecode(''),'/2657/index.html','true',[ 
		['PAGE','26953',jdecode('E-mail+Form'),jdecode(''),'/2657/26953.html','true',[],'','']
	],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Mote';
theSitetree.paletteFamily='C20404';
theSitetree.keyvisualId='11107';
theSitetree.keyvisualName='kv_11107.jpg';
theSitetree.fontsetId='31998';
theSitetree.graphicsetId='13831';
theSitetree.contentColor='565656';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Mote',
				paletteFamily: 	'C20404',
				keyvisualId: 	'11107',
				keyvisualName: 	'kv_11107.jpg',
				fontsetId: 		'31998',
				graphicsetId: 	'13831',
				contentColor: 	'565656',
				contentBGColor: 'FFFFFF',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2501',
internalId:  '',
customField: '20090326-123857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2552',
internalId:  '',
customField: '20090406-132310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2573',
internalId:  '',
customField: '20090325-153130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2594',
internalId:  '',
customField: '20090402-121621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23243',
internalId:  '',
customField: '20090401-183919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2615',
internalId:  '',
customField: '20090314-175245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2636',
internalId:  '',
customField: '20090317-180822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2657',
internalId:  '',
customField: '20100122-183143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24822',
internalId:  '',
customField: '20090314-180329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23201',
internalId:  '',
customField: '20090401-171951'
};
webappMappings['7008']=webappMappings['7008-5441']={
webappId:    '7008',
documentId:  '26953',
internalId:  '5441',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26953',
internalId:  '',
customField: '20090313-173054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23222',
internalId:  '',
customField: '20090401-163806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24801',
internalId:  '',
customField: '20090401-194248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23264',
internalId:  '',
customField: '20090401-192004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23701',
internalId:  '',
customField: '20090405-111751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23285',
internalId:  '',
customField: '20090317-181557'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2501',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-13743139']={
webappId:    '1501',
documentId:  '2501',
internalId:  '13743139',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33095',
internalId:  '',
customField: '20090402-123027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38365',
internalId:  '',
customField: '20090401-133323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39065',
internalId:  '',
customField: '20090402-121546'
};
var canonHostname = 'diywk01.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVFL30INH9U7';
var companyName   = 'SURMAC%2C+INC.+-+Speciality+Contractors';
var htmlTitle	  = 'Building+Restoration%2C+Waterproofing%2C+Specialty+Coatings%2C+Masonry+%26+Concrete+Repair%2C+Commercial+Roofing%2C+Water+Jetting+%26+Chemical+Cleaning';
var metaKeywords  = '';
var metaContents  = '';
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();
};
