/* [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','214',jdecode('Home'),jdecode(''),'/214.html','true',[],''],
	['PAGE','4510',jdecode('Services+offered'),jdecode(''),'/4510.html','true',[],''],
	['PAGE','5612',jdecode('Serviced+areas'),jdecode(''),'/5612.html','true',[],''],
	['PAGE','43659',jdecode('Tree+Services'),jdecode(''),'/43659.html','true',[],''],
	['PAGE','4447',jdecode('Contact'),jdecode(''),'/4447.html','true',[],''],
	['PAGE','50859',jdecode('Misc.+project+pictures'),jdecode(''),'/50859.html','true',[],'']];
var siteelementCount=6;
theSitetree.topTemplateName='Antigua';
theSitetree.paletteFamily='617F92';
theSitetree.keyvisualId='6921';
theSitetree.keyvisualName='kv_6921.jpg';
theSitetree.fontsetId='11216';
theSitetree.graphicsetId='12036';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='809DAF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Antigua',
				paletteFamily: 	'617F92',
				keyvisualId: 	'6921',
				keyvisualName: 	'kv_6921.jpg',
				fontsetId: 		'11216',
				graphicsetId: 	'12036',
				contentColor: 	'FFFFFF',
				contentBGColor: '809DAF',
				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:  '214',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '214',
internalId:  '',
customField: '20080103-181055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4510',
internalId:  '',
customField: '20090222-145945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5612',
internalId:  '',
customField: '20090222-150331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43659',
internalId:  '',
customField: '20080204-171903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4447',
internalId:  '',
customField: '20070310-084559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50859',
internalId:  '',
customField: '20090222-154325'
};
var canonHostname = 'cm4all.aplus.net';
var accountId     = 'AAPLU0INXXPC';
var companyName   = 'Quality+Land+Services%2C+LLC';
var htmlTitle	  = 'Quality+Excavating+Leetonia+Ohio+-+Quality+Land+Services%2C+LLC.';
var metaKeywords  = 'Excavating%2C+excavating%2C+excavating+contractor%2C+trenching%2C+skid+steer%2C+septic%2C++44431%2C+service%2C+44460%2C+44408%2C+44432%2C+Columbiana%2C+Salem%2C+Leetonia%2C+Lisbon%2C+driveway%2C+retaining+wall%2C+footer%2C+french+drain%2C+culvert+pipe%2C+catch+basin%2C++ohio%2C+lawn+aeration%2C+septic+repairs%2C++pond%2C+wet+basement%2C+waterproofing%2C+grading%2C+swale%2C+ditch%2C+downspout%2C+drain%2C+tree%2C+concrete%2C+machine+base';
var metaContents  = 'Quality+Excavating+-+Excavating+contractor+serving+Columbiana+County+Ohio.+Includes+excavating%2C+trenching%2C+and+landscape+excavations.+44431+44432+44408+44460+Excavating%2C+Septic+contractor%2C+Hauling%2C+Digging%2C+Drainage%2C+Utility+trenching%2C++Driveways%2C+Footers%2C+pond%2C+retaining+walls%2C+landscaping%2C+waterproofing%2C+Lisbon%2C+Salem%2C+grading%2C+ohio+ditching+french+drain%2C+downspout+drain%2C+additions%2C+animal+burial+';
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();
};

