/* [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','2401',jdecode('Home'),jdecode(''),'/2401.html','true',[],'',''],
	['PAGE','85987',jdecode('Visit+our+Candy+Store'),jdecode(''),'/85987.html','true',[],'',''],
	['PAGE','19901',jdecode('Browse+our+Gift+Shop'),jdecode(''),'/19901.html','true',[],'',''],
	['PAGE','88466',jdecode('Sample+our+Teas'),jdecode(''),'/88466.html','true',[],'',''],
	['PAGE','72234',jdecode('Lemon+and+Lime+Trees'),jdecode(''),'/72234.html','true',[],'',''],
	['PAGE','5364',jdecode('Tropical+Houseplants'),jdecode(''),'/5364.html','true',[],'',''],
	['PAGE','5385',jdecode('Berries+and+Fruit'),jdecode(''),'/5385.html','true',[],'',''],
	['PAGE','5301',jdecode('Annuals'),jdecode(''),'/5301/index.html','true',[ 
		['PAGE','61834',jdecode('Annual+List'),jdecode(''),'/5301/61834.html','false',[],'',''],
		['PAGE','61855',jdecode('Annual+List+2'),jdecode(''),'/5301/61855.html','false',[],'','']
	],'',''],
	['PAGE','5322',jdecode('Perennials'),jdecode(''),'/5322/index.html','true',[ 
		['PAGE','56734',jdecode('About+Perennials'),jdecode(''),'/5322/56734.html','true',[],'','']
	],'',''],
	['PAGE','5343',jdecode('Herbs'),jdecode(''),'/5343.html','true',[],'',''],
	['PAGE','18901',jdecode('Vegetables'),jdecode(''),'/18901.html','true',[],'',''],
	['PAGE','5406',jdecode('Trees%2C+Bushes+and+Shrubs'),jdecode(''),'/5406.html','true',[],'',''],
	['PAGE','75366',jdecode('How+to+Place+an+Order'),jdecode(''),'/75366.html','true',[],'',''],
	['PAGE','71234',jdecode('Christmas+Trees'),jdecode(''),'/71234.html','true',[],'',''],
	['PAGE','18922',jdecode('Visit+our+Online+Store'),jdecode(''),'/18922.html','false',[],'',''],
	['PAGE','2452',jdecode('Contact+Us'),jdecode(''),'/2452.html','true',[],'',''],
	['PAGE','33701',jdecode('About+Us'),jdecode(''),'/33701.html','true',[],'',''],
	['PAGE','35601',jdecode('Business+Hours'),jdecode(''),'/35601.html','true',[],'',''],
	['PAGE','60634',jdecode('How+to+Find+us'),jdecode(''),'/60634.html','true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Angkor';
theSitetree.paletteFamily='879ED6';
theSitetree.keyvisualId='6862';
theSitetree.keyvisualName='kv_6862.jpg';
theSitetree.fontsetId='11211';
theSitetree.graphicsetId='12030';
theSitetree.contentColor='354B86';
theSitetree.contentBGColor='94AAE1';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Angkor',
				paletteFamily: 	'879ED6',
				keyvisualId: 	'6862',
				keyvisualName: 	'kv_6862.jpg',
				fontsetId: 		'11211',
				graphicsetId: 	'12030',
				contentColor: 	'354B86',
				contentBGColor: '94AAE1',
				a_color: 		'94AAE1',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2401',
internalId:  '',
customField: '20100818-214945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5301',
internalId:  '',
customField: '20100727-214723'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2452',
internalId:  '',
customField: '20100904-204827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19901',
internalId:  '',
customField: '20100726-181041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33701',
internalId:  '',
customField: '20100720-170435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5343',
internalId:  '',
customField: '20100727-215050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5322',
internalId:  '',
customField: '20100728-212933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18901',
internalId:  '',
customField: '20100727-215149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5364',
internalId:  '',
customField: '20100721-203218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56734',
internalId:  '',
customField: '20100129-201005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5406',
internalId:  '',
customField: '20100727-215225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5385',
internalId:  '',
customField: '20100727-214615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18922',
internalId:  '',
customField: '20100129-210913'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '60634',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60634',
internalId:  '',
customField: '20100205-214615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35601',
internalId:  '',
customField: '20100904-204737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61834',
internalId:  '',
customField: '20100202-182239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61855',
internalId:  '',
customField: '20100202-182412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71234',
internalId:  '',
customField: '20100727-214438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72234',
internalId:  '',
customField: '20100727-214355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85987',
internalId:  '',
customField: '20100727-213635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75366',
internalId:  '',
customField: '20100728-212404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88466',
internalId:  '',
customField: '20100726-192521'
};
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INZ96C';
var companyName   = 'Mile+5.2+Greenhouse+%26+Gift+Shop%2C+LLC';
var htmlTitle	  = 'Mile+5.2+Greenhouse+%26+Gift+Shop%2C+LLC';
var metaKeywords  = 'Plants%2C+Tropical%2C+Greenhouse';
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();
};
