/* [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','1101',jdecode('Home'),jdecode(''),'/1101.html','true',[],''],
	['PAGE','1152',jdecode('About+us'),jdecode(''),'/1152/index.html','true',[ 
		['PAGE','1173',jdecode('Our+Foresters'),jdecode(''),'/1152/1173.html','true',[],'']
	],''],
	['PAGE','1194',jdecode('Land+for+Sale'),jdecode(''),'/1194/index.html','true',[ 
		['PAGE','19801',jdecode('Bibb+County%2C+78+acres'),jdecode(''),'/1194/19801.html','true',[],''],
		['PAGE','13501',jdecode('Dekalb+County%2C+80+acres'),jdecode(''),'/1194/13501.html','true',[],''],
		['PAGE','21492',jdecode('Blount+County%2C+60+acres'),jdecode(''),'/1194/21492.html','true',[],''],
		['PAGE','21510',jdecode('Dekalb+County%2C+75+acres'),jdecode(''),'/1194/21510.html','true',[],''],
		['PAGE','21501',jdecode('Sumter+County+Property'),jdecode(''),'/1194/21501.html','true',[],'']
	],''],
	['PAGE','1215',jdecode('Contact'),jdecode(''),'/1215.html','true',[],'']];
var siteelementCount=10;
theSitetree.topTemplateName='Education';
theSitetree.paletteFamily='793F3F';
theSitetree.keyvisualId='7321';
theSitetree.keyvisualName='kv_7321.jpg';
theSitetree.fontsetId='16462';
theSitetree.graphicsetId='12159';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='875959';
var theTemplate={
				name: 			'Education',
				paletteFamily: 	'793F3F',
				keyvisualId: 	'7321',
				keyvisualName: 	'kv_7321.jpg',
				fontsetId: 		'16462',
				graphicsetId: 	'12159',
				contentColor: 	'FFFFFF',
				contentBGColor: '875959',
				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: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7060']=webappMappings['7060-95f08c4875170b04600996eccec3c7d0']={
webappId:    '7060',
documentId:  '13501',
internalId:  '95f08c4875170b04600996eccec3c7d0',
customField: 'language:en;country:US;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1101',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-0fba526f825e24606ab5de9b852d2b4b']={
webappId:    '7060',
documentId:  '19801',
internalId:  '0fba526f825e24606ab5de9b852d2b4b',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-12de08d9bd5336736380e36140db248f']={
webappId:    '7060',
documentId:  '13501',
internalId:  '12de08d9bd5336736380e36140db248f',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1101',
internalId:  '',
customField: '20090716-221958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1152',
internalId:  '',
customField: '20070918-232146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1173',
internalId:  '',
customField: '20071006-145645'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1194',
internalId:  '',
customField: '20090716-224008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19801',
internalId:  '',
customField: '20090716-225519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20071221-125119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1215',
internalId:  '',
customField: '20071221-125447'
};
webappMappings['1501']=webappMappings['1501-5425669']={
webappId:    '1501',
documentId:  '1101',
internalId:  '5425669',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21492',
internalId:  '',
customField: '20090716-224242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21510',
internalId:  '',
customField: '20090716-224356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21501',
internalId:  '',
customField: '20090716-224242'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INEBOR';
var companyName   = 'BANKHEAD+LAND+%26+TIMBER+COMPANY%2C+INC.';
var htmlTitle	  = '';
var metaKeywords  = 'Timber+buyers%2C+Logging%2C+Alabama+Land+for+sale%2C+Sawmill%2C+Pulpwood%2C+Land+for+sale%2C+Timberland%2C+Timber%2C+Timber+Harvesting%2C++Foresters%2C+Alabama+Foresters%2C+Forestry+Services';
var metaContents  = 'Alabama+Timber+Buyers%2C+Timber+Harvesting%2C+Logging%2C+Land+for+sale+in+Alabama%2C+Serving+north-central%2C+and+north+Alabama.';
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();
};
