/* [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','3101',jdecode('Home'),jdecode(''),'/3101.html','true',[],'',''],
	['PAGE','3152',jdecode('About+us'),jdecode(''),'/3152/index.html','true',[ 
		['PAGE','3173',jdecode('Contact+Information'),jdecode(''),'/3152/3173.html','true',[],'',''],
		['PAGE','12401',jdecode('Key+Personnel'),jdecode(''),'/3152/12401.html','true',[],'','']
	],'',''],
	['PAGE','3194',jdecode('Maintenance+Service'),jdecode(''),'/3194.html','true',[],'',''],
	['PAGE','25132',jdecode('Pool+Service'),jdecode(''),'/25132.html','true',[],'',''],
	['PAGE','3215',jdecode('Installations'),jdecode(''),'/3215.html','true',[],'',''],
	['PAGE','7501',jdecode('Lighting'),jdecode(''),'/7501.html','true',[],'',''],
	['PAGE','25025',jdecode('News'),jdecode(''),'/25025.html','true',[],'',''],
	['PAGE','25141',jdecode('Photo+Album'),jdecode(''),'/25141.html','true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='echo';
theSitetree.paletteFamily='7B4B70';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10623';
theSitetree.graphicsetId='10629';
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: 			'echo',
				paletteFamily: 	'7B4B70',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10623',
				graphicsetId: 	'10629',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3101',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3101',
internalId:  '',
customField: '20080326-164825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3152',
internalId:  '',
customField: '20070803-130739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3173',
internalId:  '',
customField: '20080326-164911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12401',
internalId:  '',
customField: '20100122-123358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3194',
internalId:  '',
customField: '20070803-130412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3215',
internalId:  '',
customField: '20100315-161640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20070803-130655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25025',
internalId:  '',
customField: '20100315-160050'
};
webappMappings['7060']=webappMappings['7060-35f5c4bafddbaa47d236e2b65afcf991']={
webappId:    '7060',
documentId:  '25141',
internalId:  '35f5c4bafddbaa47d236e2b65afcf991',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25132',
internalId:  '',
customField: '20100825-133327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25141',
internalId:  '',
customField: '20100315-160209'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050INEW86';
var companyName   = '';
var htmlTitle	  = 'Majestic+Landscape+Maintenance+%26+Majestic+Pool+Service+-+Professional+Maintenance+in+Sacramento';
var metaKeywords  = 'landscape++contractor++commercial++maintenance++lighting+++irrigation++drainage+sod+installation+repairs+nightscaping+majestic++fixture++monthly++service++professional++Sacramento++Nightscape++chemical+application+yard+design+custom+apartment++%0D%0A%0D%0A%3Cmeta+name%3D%22keywords%22+content%3D%22keyword1%2C+keyword2%2Cnsw-8mrf16eoqoxmagodyeb6df6li165j0ny6xin6qe9bca4mfarb-wanh9ys1o5n3u8palsgob2xmesqufymixg9kmhsr6-okzpak5zuepk909u0wjlkp70llc3v3asl9sb%22%2F%3E+%0D%0A%0D%0A%3Ca+title%3D%22Click+for+the+Business+Review+of+California+Majestic+Landscape+and+Maintenance%2C+Inc.%2C+a+Landscape+Contractors+in+Sacramento+CA%22+href%3D%22http%3A%2F%2Fwww.bbb.org%2Fnortheast-california%2Fbusiness-reviews%2Flandscape-contractors%2Fcalifornia-majestic-landscape-and-maintenance-in-sacramento-ca-47016131%23sealclick%22%3E%3Cimg+alt%3D%22California+Majestic+Landscape+and+Maintenance%2C+Inc.+is+a+BBB+Accredited+Business.+Click+for+the+BBB+Business+Review+of+this+Landscape+Contractors+in+Sacramento+CA%22+style%3D%22border%3A+0%3B%22+src%3D%22http%3A%2F%2Fseal-Necal.bbb.org%2Fseals%2Fblue-seal-120-61-californiamajesticlandscapeandmaintenanceinc-47016131.png%22+%2F%3E%3C%2Fa%3E%0D%0A';
var metaContents  = 'landscape+contractor++commercial+landscape+contractor++landscape+maintenance+Nightscape+lighting+commercial+landscape+maintenance++professional+landscape+maintenance++Sacramento+area++chemical+application++yard+design++custom+design++commercial+maintenance++apartment+maintenance++monthly+landscape+service++++';
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();
};

