/* [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','401',jdecode('HOME'),jdecode(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','12679',jdecode('MESQUITE+HARVESTING'),jdecode(''), jdecode('%2F12679.html'), 'true',[],'',''],
	['PAGE','12706',jdecode('LAND+CLEARING'),jdecode(''), jdecode('%2F12706.html'), 'true',[],'',''],
	['PAGE','12715',jdecode('GRASS+SEEDING'),jdecode(''), jdecode('%2F12715.html'), 'true',[],'',''],
	['PAGE','8901',jdecode('RIGHT+OF+WAY+CLEARING'),jdecode(''), jdecode('%2F8901.html'), 'true',[],'',''],
	['PAGE','12213',jdecode('ROAD+CONSTRUCTION'),jdecode(''), jdecode('%2F12213.html'), 'true',[],'',''],
	['PAGE','452',jdecode('EQUIPMENT'),jdecode(''), jdecode('%2F452.html'), 'true',[],'',''],
	['PAGE','12724',jdecode('REFERENCES'),jdecode(''), jdecode('%2F12724.html'), 'false',[],'',''],
	['PAGE','473',jdecode('BRUSH+CLEARING'),jdecode(''), jdecode('%2F473.html'), 'false',[],'',''],
	['PAGE','494',jdecode('PHOTOS+OF+WORK'),jdecode(''), jdecode('%2F494.html'), 'true',[],'',''],
	['PAGE','515',jdecode('CONTACT+'),jdecode(''), jdecode('%2F515.html'), 'true',[],'',''],
	['PAGE','536',jdecode('SERVICES'),jdecode(''), jdecode('%2F536.html'), 'true',[],'',''],
	['PAGE','557',jdecode('ABOUT+US'),jdecode(''), jdecode('%2F557.html'), 'true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Angkor';
theSitetree.paletteFamily='C5A858';
theSitetree.keyvisualId='6901';
theSitetree.keyvisualName='kv_6901.jpg';
theSitetree.fontsetId='11212';
theSitetree.graphicsetId='12034';
theSitetree.contentColor='64511A';
theSitetree.contentBGColor='DABB67';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'valueweb',
  product: 'WSCSYSSSSLYTCR7P'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Angkor',
				paletteFamily: 	'C5A858',
				keyvisualId: 	'6901',
				keyvisualName: 	'kv_6901.jpg',
				fontsetId: 		'11212',
				graphicsetId: 	'12034',
				contentColor: 	'64511A',
				contentBGColor: 'DABB67',
				a_color: 		'DABB67',
				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:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20111209-112210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20111130-131513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8901',
internalId:  '',
customField: '20111209-112854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20090404-150818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20111201-090943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20111130-132909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20111201-094254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20111201-091548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12213',
internalId:  '',
customField: '20090404-150622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12679',
internalId:  '',
customField: '20111201-094213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12706',
internalId:  '',
customField: '20111209-112623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12715',
internalId:  '',
customField: '20111209-112655'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12724',
internalId:  '',
customField: '20111130-103013'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker01.chi.us.siteprotect.com';
var accountId     = 'AHW050INEZGJ';
var companyName   = 'SOUTH+TEXAS+LAND+CLEARING';
var htmlTitle	  = 'SOUTH+TEXAS+BRUSH+CLEARING%2C+LAND+CLEARING+%26+TEXAS+RIGHT+OF+WAY+CLEARING';
var metaKeywords  = 'mesquite+land+clearing%2C+prickly+pear+land+clearing%2C+cactus+land+clearing%2C+mesquite+chips+for+biomass%2C+pipline%2C+utility+line%2C+south+texas+brush+clearing%2C+south+texas+brush+removal%2C+south+texas+land+clearing%2C+south+texas+brush+grinding%2C+south+texas+brush+mulching%2C+south+texas+right+of+way+clearing%2C+south+texas+utility+line+clearing%2C+grinding%2C+Kinney+County%2C+Uvalde+County%2C+Maverick+County%2C+Edwards+County%2C+Zavala+County%2C+Dimmit+County%2C+Frio+County%2C+Atascosa+County%2C+Karnes+County%2C+McMullen+County%2C+Live+Oak+County%2C+Jim+Wells+County%2C+Duval+County%2C+Webb+County%2C+Kleberg+County%2C+Brooks+County%2C+Jim+Hogg+County%2C+Kenedy+County%2C+Zapata+County%2C+Brooks+County+and+many+more.+Our+brush+clearing+and+land+clearing+services+are+available+in+and+around+Uvalde%2C+Batesville%2C+Brackettville%2C+Del+Rio%2C+Crystal+City%2C+Catarina%2C+Encinal%2C+Alice%2C+San+Antonio%2C+Kingsville%2C+Corpus+Christi%2C+Freer%2C+Hebbronville%2C+Laredo%2C+McAllen%2C+Premont%2C+Falfurrias%2C+Raymondville%2C+Victoria%2C+';
var metaContents  = 'mesquite+and+prickly+pear+land+clearing%2C+pipeline+clearing%2C+pipeline+land+clearing%2C+texas+pipeline+clearing%2C+texas+pipeline+land+clearing%2C+south+texas+land+clearing%2C+land+clearing+in+south+texas%2C+south+texas+brush+clearing%2C+south+texas+brush+removal%2C+south+texas+land+clearing%2C+south+texas+brush+grinding%2C+south+texas+brush+mulching%2C+south+texas+right+of+way+clearing%2C+south+texas+utility+line+clearing%2C+pipeline+clearing+south+texas%2C+south+texas+pipeline+clearing%2C+brush+mulching+south+texas%2C+brush+grinding+south+texas%2C+pipeline+land+clearing+texas%2C+texas+pipeline+land+clearing%2C+Kinney+County%2C+Uvalde+County%2C+Maverick+County%2C+Edwards+County%2C+Zavala+County%2C+Dimmit+County%2C+Frio+County%2C+Atascosa+County%2C+Karnes+County%2C+McMullen+County%2C+Live+Oak+County%2C+Jim+Wells+County%2C+Duval+County%2C+Webb+County%2C+Kleberg+County%2C+Brooks+County%2C+Jim+Hogg+County%2C+Kenedy+County%2C+Zapata+County%2C+Brooks+County+and+many+more.+Our+brush+clearing+and+land+clearing+services+are+available+in+and+around+Uvalde%2C+Batesville%2C+Brackettville%2C+Del+Rio%2C+Crystal+City%2C+Catarina%2C+Encinal%2C+Alice%2C+San+Antonio%2C+Kingsville%2C+Corpus+Christi%2C+Freer%2C+Hebbronville%2C+Laredo%2C+McAllen%2C+Premont%2C+Falfurrias%2C+Raymondville%2C+Victoria%2C+Texas+Right+of+Way+Clearing%2C+Pipeline+right+of+way+clearing%2C+utility+line+right+of+way+clearing%2C+electric+line+right+of+way%2C+water+line+right+of+way%2C+pipeline+site+prep+land+clearing%2C+wind+turbine+site+prep%2C+wind+turbine+land+clearing%2C+wind+turbine+line+cutting%2C+pipeline+land+clearing%2C+southern+united+states+right+of+way+services%2C+Texas+right+of+way+services%2C+pipeline+site+prep%2C+right+of+way+site+prep%2C+pipeline+land+clearing%2C+pipeline+services%2C+right+of+way+services%2C+right+of+way+clearing%2C+right+of+way+cutting%2C+pipeline+cutting%2C+Texas+right+of+way+land+clearing%2C+Texas+Seismograph+land+Clearing+services+%2C+Texas+Seismic+work%2C+Texas+seismic+line+cutting+services%2C+seismic+land+clearing+services%2C+oil+field+site+prep+services%2C+seismic+site+prep+services%2C+seismograph+site+prep+services%2C+Texas+oil+field+land+clearing+%2C+oil+field+land+clearing+services%2C+Texas+seismic+line+brush+clearing%2C++seismic+brush+clearing+services%2C+Railroad+right+of+way+land+clearing%2C+railroad+right+of+way+brush+clearing%2C+Texas+right+of+way+services%2C+Right+of+way+services%2C+Texas+right+of+way+maintenance%2C+Right+of+way+maintenance+Texas%2C+Utility+line+services%2C+Pipeline+right+of+way+services%2C+Texas+site+prep+services';
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();
};

