/* [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 theSitetree=[ 
	['PAGE','801',jdecode('HOME'),jdecode(''),'/801.html','true',[],''],
	['PAGE','40201',jdecode('OUR+MACHINES'),jdecode(''),'/40201.html','true',[],''],
	['PAGE','36701',jdecode('CEDAR+REMOVAL'),jdecode(''),'/36701.html','true',[],''],
	['PAGE','20101',jdecode('RANCH+RESTORATION'),jdecode(''),'/20101.html','true',[],''],
	['PAGE','20185',jdecode('RIGHT-OF-WAY+'),jdecode(''),'/20185.html','true',[],''],
	['PAGE','70698',jdecode('ROAD+CONSTRUCTION'),jdecode(''),'/70698.html','true',[],''],
	['PAGE','72748',jdecode('POND+CONSTRUCTION'),jdecode(''),'/72748.html','true',[],''],
	['PAGE','20122',jdecode('LOT+CLEARING'),jdecode(''),'/20122.html','true',[],''],
	['PAGE','20164',jdecode('GRASS+SEEDING'),jdecode(''),'/20164.html','true',[],''],
	['PAGE','20143',jdecode('SHOOTING+LANES'),jdecode(''),'/20143.html','true',[],''],
	['PAGE','20206',jdecode('SERVICES'),jdecode(''),'/20206.html','true',[],''],
	['PAGE','894',jdecode('PHOTO+GALLERY'),jdecode(''),'/894.html','true',[],''],
	['PAGE','915',jdecode('FAQ'),jdecode(''),'/915.html','true',[],''],
	['PAGE','852',jdecode('REFERENCES'),jdecode(''),'/852.html','true',[],''],
	['PAGE','39101',jdecode('CONTACT+US'),jdecode(''),'/39101.html','true',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Billy';
theSitetree.paletteFamily='8D7C50';
theSitetree.keyvisualId='7078';
theSitetree.keyvisualName='kv_7078.jpg';
theSitetree.fontsetId='16379';
theSitetree.graphicsetId='12126';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='8D7C50';
var theTemplate={
				name: 			'Billy',
				paletteFamily: 	'8D7C50',
				keyvisualId: 	'7078',
				keyvisualName: 	'kv_7078.jpg',
				fontsetId: 		'16379',
				graphicsetId: 	'12126',
				contentColor: 	'FFFFFF',
				contentBGColor: '8D7C50',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20091007-192446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40201',
internalId:  '',
customField: '20090805-105457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '894',
internalId:  '',
customField: '20080304-224312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36701',
internalId:  '',
customField: '20090805-110249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20101',
internalId:  '',
customField: '20091127-150000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20185',
internalId:  '',
customField: '20091007-192521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20122',
internalId:  '',
customField: '20090304-111008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20164',
internalId:  '',
customField: '20090407-174925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20143',
internalId:  '',
customField: '20090304-111255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20206',
internalId:  '',
customField: '20091007-192836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '915',
internalId:  '',
customField: '20090308-164227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72748',
internalId:  '',
customField: '20091127-150954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '852',
internalId:  '',
customField: '20090805-104546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39101',
internalId:  '',
customField: '20091127-150209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70698',
internalId:  '',
customField: '20100131-184406'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INE7F4';
var companyName   = 'CEDAR+BEETLE++LAND+CLEARING+++++++++';
var htmlTitle	  = 'Texas+Land+Clearing+%7E+Cedar+Clearing+%26+Brush+Mulching+%7E+Texas+Right+of+Way+Clearing';
var metaKeywords  = 'Land+clearing%2C+texas+hill+country+cedar+removal%2C+cedar+clearing%2C+brush+removal%2C+brush+clearing+in+junction+texas%2C+bandera+texas%2C+new+braunfels+texas%2C+leakey+texas%2C+concan+texas%2C+sabinal+texas%2C+medina+texas%2C+cedar+mulching+texas%2C+brush+mulching%2C+texas+pipeline+clearing%2C+utility+line+clearing%2C+wind+turbine+construction+clearing%2C+road+construction%2C+crushed+rock%2C+crusher%2C+contractor%2C+building%2C+services%2C+work%2C+texas+ranch+road+construction%2C+all+weather+road+construction%2C+builder%2C+contractor+';
var metaContents  = 'Land+clearing+in+Texas%2C+Cedar+Removal%2C+cedar+mulching%2C+ranch+brush+clearing%2C+texas+brush+mulching%2C+texas+cedar+clearing%2C+brush+clearing+texas%2C+Texas+Brush+Clearing%2C+Hill+country+cedar+grinding%2C+texas+no+burning+cedar+clearing%2C+texas+pipeline+clearing%2C+texas+utility+line+clearing%2C+texas+seismic+line+clearing%2C+texas+right+of+way+clearing%2C+Texas+Cedar+Clearing%2C+Texas+Land+Clearing%2C+cedar+clearing+austin+texas%2C+brush+clearing+austin+texas%2C+brush+mulching+austin+texas%2C+cedar+mulching+austin+texas%2C+texas+road+construction%2C+texas+rock+crusher%2C+ranch+road+construction%2C+rock+base+work%2C+texas+road+work%2C+crushed+rock+base+road%2C+texas+road+building%2C+hill+country+road+construction%2C+gravel+road+construction%2C+road+building+contractor%2C+road+construction+services%2C+road+construction%2C+crushed+rock%2C+crusher%2C+contractor%2C+building%2C+services%2C+work%2C+texas+ranch+road+construction%2C+all+weather+road+construction%2C+private+road+construction%2C+crushed+base+road+builder%2C+ranch+road+contractor%2C+ranch+improvment+services%2C+++';
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();
};
