/* [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','501',jdecode('Home'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','615',jdecode('About+Prickett%26%23x27%3Bs+Nursery'),jdecode(''), jdecode('%2F615.html'), 'true',[],'',''],
	['PAGE','552',jdecode('Contact+us'),jdecode(''), jdecode('%2F552%2Findex.html'), 'true',[ 
		['PAGE','573',jdecode('How+to+find+us'),jdecode(''), jdecode('%2F552%2F573.html'), 'true',[],'','']
	],'',''],
	['PAGE','657',jdecode('This+Week%26%23x27%3Bs+Specials'),jdecode(''), jdecode('%2F657.html'), 'true',[],'',''],
	['PAGE','12801',jdecode('Bareroot+Fruit'),jdecode(''), jdecode('%2F12801.html'), 'true',[],'',''],
	['PAGE','13401',jdecode('Bare+Root+Roses'),jdecode(''), jdecode('%2F13401.html'), 'true',[],'',''],
	['PAGE','762',jdecode('Winter+in+the+Garden'),jdecode(''), jdecode('%2F762.html'), 'true',[],'',''],
	['PAGE','54001',jdecode('Spring+Gardening+Tips'),jdecode(''), jdecode('%2F54001.html'), 'false',[],'',''],
	['PAGE','54022',jdecode('Edibles'),jdecode(''), jdecode('%2F54022.html'), 'false',[],'',''],
	['PAGE','41201',jdecode('E-+Newsletter+Sign+Up'),jdecode(''), jdecode('%2F41201.html'), 'true',[],'',''],
	['PAGE','41801',jdecode('Photo+Gallery'),jdecode(''), jdecode('%2F41801.html'), 'true',[],'',''],
	['PAGE','783',jdecode('Employment'),jdecode(''), jdecode('%2F783.html'), 'true',[],'',''],
	['PAGE','47001',jdecode('Upcoming+Events'),jdecode(''), jdecode('%2F47001.html'), 'true',[],'',''],
	['PAGE','43701',jdecode('Weather'),jdecode(''), jdecode('%2F43701.html'), 'true',[],'',''],
	['PAGE','33201',jdecode('Christmas+Trees...'),jdecode(''), jdecode('%2F33201.html'), 'true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Tendril';
theSitetree.paletteFamily='D9F4D5';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33093';
theSitetree.graphicsetId='14058';
theSitetree.contentColor='3B8030';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'grp35-attweb',
  product: 'WSCSYSSSSLY0X9RC'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Tendril',
				paletteFamily: 	'D9F4D5',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33093',
				graphicsetId: 	'14058',
				contentColor: 	'3B8030',
				contentBGColor: 'FFFFFF',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20110329-140143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '657',
internalId:  '',
customField: '20120201-202459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20110505-185736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20100120-145107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '615',
internalId:  '',
customField: '20110222-191646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '762',
internalId:  '',
customField: '20120113-194719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '783',
internalId:  '',
customField: '20120131-184527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12801',
internalId:  '',
customField: '20120131-181808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13401',
internalId:  '',
customField: '20120114-195128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33201',
internalId:  '',
customField: '20120105-161519'
};
webappMappings['7008']=webappMappings['7008-14369']={
webappId:    '7008',
documentId:  '41201',
internalId:  '14369',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41201',
internalId:  '',
customField: '20100921-130728'
};
webappMappings['7008']=webappMappings['7008-14373']={
webappId:    '7008',
documentId:  '552',
internalId:  '14373',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-f163bd82391487f7b7668e1728bf4542']={
webappId:    '7060',
documentId:  '41801',
internalId:  'f163bd82391487f7b7668e1728bf4542',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41801',
internalId:  '',
customField: '20100120-153159'
};
webappMappings['7008']=webappMappings['7008-14377']={
webappId:    '7008',
documentId:  '657',
internalId:  '14377',
customField: 'language:en;country:US;'
};
webappMappings['7080']=webappMappings['7080-636']={
webappId:    '7080',
documentId:  '43701',
internalId:  '636',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43701',
internalId:  '',
customField: '20100120-175007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47001',
internalId:  '',
customField: '20110630-144424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54001',
internalId:  '',
customField: '20100330-223108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54022',
internalId:  '',
customField: '20100330-223108'
};
var webAppHostname = 'diycgi.cluster.stngva01.us.diy-servers.net:80';
var canonHostname = 'diywk02.verio.stngva01.us.diy-servers.net';
var accountId     = 'AVEC10INPGEJ';
var companyName   = '';
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();
};

