/* [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','2101',jdecode('Home'),jdecode(''),'/2101.html','true',[],'',''],
	['PAGE','2152',jdecode('Services'),jdecode(''),'/2152.html','true',[],'',''],
	['PAGE','25801',jdecode('Featured+Project'),jdecode(''),'/25801.html','true',[],'',''],
	['PAGE','2173',jdecode('Residential+Projects'),jdecode(''),'/2173.html','true',[],'',''],
	['PAGE','24801',jdecode('Commercial+Projects'),jdecode(''),'/24801.html','true',[],'',''],
	['PAGE','3601',jdecode('Helpful+Links'),jdecode(''),'/3601.html','true',[],'',''],
	['PAGE','2215',jdecode('Contact'),jdecode(''),'/2215.html','true',[],'','']];
var siteelementCount=7;
theSitetree.topTemplateName='Borders';
theSitetree.paletteFamily='C9DFEE';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10432';
theSitetree.graphicsetId='10771';
theSitetree.contentColor='692643';
theSitetree.contentBGColor='F0F2F4';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Borders',
				paletteFamily: 	'C9DFEE',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10432',
				graphicsetId: 	'10771',
				contentColor: 	'692643',
				contentBGColor: 'F0F2F4',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20090714-111237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2152',
internalId:  '',
customField: '20090713-181244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2173',
internalId:  '',
customField: '20100407-184838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25801',
internalId:  '',
customField: '20100407-183311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2215',
internalId:  '',
customField: '20090713-122519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3601',
internalId:  '',
customField: '20100407-185118'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2101',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-4673921']={
webappId:    '1501',
documentId:  '2101',
internalId:  '4673921',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24801',
internalId:  '',
customField: '20091124-165557'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INLRTX';
var companyName   = 'D%26L+Concrete+Sawing+and+Demo+LLC';
var htmlTitle	  = 'D%26L+Concrete+Sawing+and+Demo+LLC%2C+Commercial+%26+Residential+Concrete+Contractor';
var metaKeywords  = 'Concrete+Contractors%2C++Heavy+Construction+Contractors%2C+++Demolition+and+Removal+Residential+Foundations%2C+Residential+Driveways%2C+Walkways%2C+Home+Additions%2C+Residential+Concrete%2C+Home+Projects+commercial+and+residential+drive+approaches%2C+sidewalk+ramp%2C+handrail+installation%2C+concrete+coloring%2C+exposed+aggregate%2C+sidewalk%2C+pool+demolition%2C+core+drill%2C+aspahlt+sawcut%2C+concrete+sawcut%2C+drive%2C+entry+walk%2C+specializing+in+builders%2C+plumbing+trenches%2C+kool+deck%2C+pool+deck%2C+man+holes%2C+water+valves%2C+parking+bumpers%2C+rebar%2C+footings%2C+column+footings%2C+landscape+remodel%2C+landscape+curbing%2C+Mesa%2C+Phoenix%2C+Tempe%2C+Chandler%2C+Apache+Junction%2C+Scottsdale%2C+Peoria%2C+Glendale%2C+Buckeye%2C+Maricopa%2C+Casa+Grande%2C+Queen+Creek%2C+Ocotillo%2C+Sun+Lakes';
var metaContents  = 'Commercial+%26+Residential+Concrete+Contractor%2C+Concrete+Demoltion+Contractor%2C+Specialized+in+contracting+with+builders+for+site+improvements+and+city+finals.+Drive%2C+Entrywalk%2C+Sidewalk%2C+Drive+Approaches%2C+Pool+Deck%2C+Pool+Demolition%2C+ADA+Ramps%2C+Colored+Concrete%2C+Exposed+Aggregate%2C+Core+Drill%2C+Asphalt+Sawcut%2C+Concrete+Sawcut%2C+PLumbing+Trenches%2C+Man+Holes%2C+Water+Valves%2C+Parking+Bumpers%2C+Rebar%2C+Footings%2C+Column+Footings%2C+Landscape+Curbing.+Serving+the+following+areas%3A+Mesa%2C+Phoenix%2C+Chandler%2C+Queen+Creek%2C+Apache+Junction%2C+Scottsdale%2C+Peoria%2C+Glendale%2C+Buckeye%2C+Casa+Grande%2C+Maricopa%2C+Ocotillo%2C+Sun+Lakes.';
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();
};

