/* [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','4801',jdecode('HOME'),jdecode(''),'/4801.html','true',[],'',''],
	['PAGE','21601',jdecode('ATHENS+PLANT'),jdecode(''),'/21601.html','true',[],'',''],
	['PAGE','22601',jdecode('NEW+LEXINGTON+'),jdecode(''),'/22601.html','true',[],'',''],
	['PAGE','24701',jdecode('AGGREGATES'),jdecode(''),'/24701.html','true',[],'',''],
	['PAGE','27101',jdecode('OUTSIDE+SALES'),jdecode(''),'/27101.html','true',[],'',''],
	['PAGE','26601',jdecode('COMPANY+DIRECTORY'),jdecode(''),'/26601.html','true',[],'',''],
	['PAGE','27801',jdecode('PROJECTS'),jdecode(''),'/27801.html','true',[],'',''],
	['PAGE','29801',jdecode('USEFUL+LINKS'),jdecode(''),'/29801.html','true',[],'',''],
	['PAGE','32801',jdecode('FORMS%2FAPPLICATIONS'),jdecode(''),'/32801.html','true',[],'',''],
	['PAGE','37201',jdecode('EVENTS+%26+WORKSHOPS'),jdecode(''),'/37201.html','true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Transluszent';
theSitetree.paletteFamily='009900';
theSitetree.keyvisualId='9241';
theSitetree.keyvisualName='kv3.swf';
theSitetree.fontsetId='17360';
theSitetree.graphicsetId='12759';
theSitetree.contentColor='009900';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Transluszent',
				paletteFamily: 	'009900',
				keyvisualId: 	'9241',
				keyvisualName: 	'kv3.swf',
				fontsetId: 		'17360',
				graphicsetId: 	'12759',
				contentColor: 	'009900',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'FFFFFF',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4801',
internalId:  '',
customField: '20110721-223814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22601',
internalId:  '',
customField: '20110721-223913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21601',
internalId:  '',
customField: '20110721-223839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24701',
internalId:  '',
customField: '20100508-023356'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4801',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-2080']={
webappId:    '7008',
documentId:  '26601',
internalId:  '2080',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26601',
internalId:  '',
customField: '20110721-225316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27101',
internalId:  '',
customField: '20110721-224153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27801',
internalId:  '',
customField: '20110708-084235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29801',
internalId:  '',
customField: '20100903-073448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32801',
internalId:  '',
customField: '20100504-004005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37201',
internalId:  '',
customField: '20110228-122113'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'ANFI20IN2KK3';
var companyName   = 'HOCKING+VALLEY+CONCRETE';
var htmlTitle	  = 'Hocking+Valley+Concrete';
var metaKeywords  = 'Concrete+Ohio%2C+Ready-Mix+Concrete+Ohio%2C+Concrete+Southeastern+Ohio%2C+Concrete+Logan+Ohio%2C+Concrete+Lancaster+Ohio%2C+Concrete+Fairfield+County+Ohio%2C+Concrete+Hocking+County+Ohio%2C+Concrete+Perry+County+Ohio%2C+Concrete+New+Lexington+Ohio%2C+Concrete+Zanesville+Ohio%2C+Concrete+Concrete+Muskingum+County+Ohio%2C+Concrete+Morgan+County+Ohio%2C+Concrete+McConnelsville+Ohio%2C+Concrete+Glouster+Ohio%2C+Concrete+Trimble+Ohio%2C+Concrete+Athens+County+Ohio%2C+Concrete+Athens+Ohio%2C+Concrete+Washington+County+Ohio%2C+Concrete+Meigs+County+Ohio%2C+Concrete+Pomroy+Ohio%2C+Concrete+Albany+Ohio%2C+Concrete+Vinton+County+Ohio%2C+Concrete+McArthur+Ohio%2C+Concrete+Sugargrove+Ohio%2C+Concrete+Rockbridge+Ohio%2C+Concrete+Stewart+Ohio%2C+Concrete+Coolville+Ohio%2C+Concrete+Tuppers+Plains+Ohio%2C+Concrete+Amesville+Ohio%2C+Concrete+Malta+Ohio%2C+Concrete+Junction+City+Ohio%2C+Concrete+Carbon+Hill+Ohio%2C+Concrete+Buchtel+Ohio%2C+Concrete+Lauraville+Ohio%2C+Concrete+Chauncey+Ohio%2C+Concrete+New+Marshfield+Ohio%2C+Concrete+Millfield+Ohio%2C+Concrete+New+Plymouth+Ohio%2C+ODOT+Approved%2C+Rebar%2C+Wire+Mesh%2C+Block%2C+Concrete+Finishing+Tools%2C+Cultured+Stone%2C+Brick';
var metaContents  = 'The+Premier+Ready-Mix+Concrete+Company+Of+Southeastern+Ohio%21++Since+1956%2C+we+service+10+counties+with+3+Plants+Located+in+Logan%2C+New+Lexington%2C+and+Athens+Ohio.++No+Job+is+Too+Big+or+Too+Small.++We+also+carry+a+full+line+of+aggregates+with+dump+truck+service+available.';
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();
};

