/* [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','14901',jdecode('HOME'),jdecode(''),'/14901.html','true',[],''],
	['PAGE','14973',jdecode('PRODUCTS'),jdecode(''),'/14973/index.html','true',[ 
		['PAGE','14994',jdecode('SOIL+BUILDER'),jdecode(''),'/14973/14994.html','true',[],''],
		['PAGE','15015',jdecode('RED+HOT+CRAWLERS'),jdecode(''),'/14973/15015.html','true',[],''],
		['PAGE','42801',jdecode('HOME+COMPOSTING+KITS'),jdecode(''),'/14973/42801.html','true',[],''],
		['PAGE','34601',jdecode('BI-PRODUCTS'),jdecode(''),'/14973/34601.html','true',[],''],
		['PAGE','39901',jdecode('WORM+COCOONS'),jdecode(''),'/14973/39901.html','false',[],'']
	],''],
	['PAGE','41601',jdecode('EVENTS'),jdecode(''),'/41601.html','true',[],''],
	['PAGE','34201',jdecode('SPECIALS'),jdecode(''),'/34201.html','true',[],''],
	['PAGE','36401',jdecode('EXTREME+MAKEOVER'),jdecode(''),'/36401.html','true',[],''],
	['PAGE','35901',jdecode('BRAG+BOARD'),jdecode(''),'/35901.html','true',[],''],
	['PAGE','15057',jdecode('PURCHASE'),jdecode(''),'/15057.html','true',[],''],
	['PAGE','40822',jdecode('OTHER+LINKS'),jdecode(''),'/40822.html','true',[],''],
	['PAGE','40801',jdecode('GUESTBOOK'),jdecode(''),'/40801.html','true',[],''],
	['PAGE','15036',jdecode('CUSTOMER+SERVICE'),jdecode(''),'/15036.html','true',[],''],
	['PAGE','14952',jdecode('ABOUT+US'),jdecode(''),'/14952.html','true',[],''],
	['PAGE','15078',jdecode('CONTACT'),jdecode(''),'/15078.html','true',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Outdoor';
theSitetree.paletteFamily='47548E';
theSitetree.keyvisualId='3914';
theSitetree.keyvisualName='kv_3914.jpg';
theSitetree.fontsetId='10504';
theSitetree.graphicsetId='11086';
theSitetree.contentColor='47548E';
theSitetree.contentBGColor='CDCBE3';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Outdoor',
				paletteFamily: 	'47548E',
				keyvisualId: 	'3914',
				keyvisualName: 	'kv_3914.jpg',
				fontsetId: 		'10504',
				graphicsetId: 	'11086',
				contentColor: 	'47548E',
				contentBGColor: 'CDCBE3',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'424EB9',
				e_color: 		'424EB9',
				f_color: 		'424EB9',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['4001']=webappMappings['4001-19712566']={
webappId:    '4001',
documentId:  '15057',
internalId:  '19712566',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14901',
internalId:  '',
customField: '20100326-161850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14952',
internalId:  '',
customField: '20090702-113948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15078',
internalId:  '',
customField: '20090803-170525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15036',
internalId:  '',
customField: '20100326-162150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15057',
internalId:  '',
customField: '20100328-193230'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14973',
internalId:  '',
customField: '20100326-162305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15015',
internalId:  '',
customField: '20091029-185016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14994',
internalId:  '',
customField: '20100301-075343'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '14901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34201',
internalId:  '',
customField: '20091106-210311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34601',
internalId:  '',
customField: '20091029-205618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35901',
internalId:  '',
customField: '20090905-200617'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36401',
internalId:  '',
customField: '20090905-200251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39901',
internalId:  '',
customField: '20091026-191420'
};
webappMappings['1002']=webappMappings['1002-40801aendu0in32mb']={
webappId:    '1002',
documentId:  '40801',
internalId:  '40801aendu0in32mb',
customField: 'icq=false'
};
webappMappings['7050']=webappMappings['7050-13121']={
webappId:    '7050',
documentId:  '40822',
internalId:  '13121',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40801',
internalId:  '',
customField: '20091029-193308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40822',
internalId:  '',
customField: '20091029-202406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41601',
internalId:  '',
customField: '20100326-161734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42801',
internalId:  '',
customField: '20100328-200516'
};
var canonHostname = 'cmworker03.yourhostingaccount.com';
var accountId     = 'AENDU0IN32MB';
var companyName   = 'WHITETAIL+ORGANICS';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
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();
};
