/* [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','801',jdecode('Home'),jdecode(''),'/801.html','true',[],'',''],
	['PAGE','852',jdecode('About+us'),jdecode(''),'/852.html','true',[],'',''],
	['PAGE','894',jdecode('Products'),jdecode(''),'/894/index.html','true',[ 
		['PAGE','7001',jdecode('Blackberry+Jam'),jdecode(''),'/894/7001.html','true',[],'',''],
		['PAGE','7022',jdecode('Boysenberry+Jam'),jdecode(''),'/894/7022.html','true',[],'',''],
		['PAGE','7043',jdecode('Grandma+Hattie%26%23x27%3Bs+Jam'),jdecode(''),'/894/7043.html','true',[],'',''],
		['PAGE','7064',jdecode('Marionberry+Jam'),jdecode(''),'/894/7064.html','true',[],'',''],
		['PAGE','7085',jdecode('Pear+with+Frangelico+Jam'),jdecode(''),'/894/7085.html','true',[],'',''],
		['PAGE','7106',jdecode('Strawberry+Jam'),jdecode(''),'/894/7106.html','true',[],'',''],
		['PAGE','7127',jdecode('Strawberry-Rhubarb+Jam'),jdecode(''),'/894/7127.html','true',[],'',''],
		['PAGE','7148',jdecode('Tripleberry+Jam'),jdecode(''),'/894/7148.html','true',[],'',''],
		['PAGE','7169',jdecode('Huckleberry+Jelly'),jdecode(''),'/894/7169.html','true',[],'',''],
		['PAGE','7190',jdecode('Marionberry+Jelly'),jdecode(''),'/894/7190.html','true',[],'',''],
		['PAGE','7211',jdecode('Pomegranate+Jelly'),jdecode(''),'/894/7211.html','true',[],'',''],
		['PAGE','7232',jdecode('R.S.+Apricot'),jdecode(''),'/894/7232.html','true',[],'',''],
		['PAGE','7253',jdecode('R.S.+Apricot-Pineapple'),jdecode(''),'/894/7253.html','true',[],'',''],
		['PAGE','7274',jdecode('R.S.+Blueberry'),jdecode(''),'/894/7274.html','true',[],'',''],
		['PAGE','7295',jdecode('R.S.+Cherry'),jdecode(''),'/894/7295.html','true',[],'',''],
		['PAGE','936',jdecode('R.S.+Hot+Pepper'),jdecode(''),'/894/936.html','true',[],'',''],
		['PAGE','7316',jdecode('R.S.+Marionberry'),jdecode(''),'/894/7316.html','true',[],'',''],
		['PAGE','7337',jdecode('R.S.+Peach'),jdecode(''),'/894/7337.html','true',[],'',''],
		['PAGE','7358',jdecode('R.S.+Strawberry'),jdecode(''),'/894/7358.html','true',[],'',''],
		['PAGE','7379',jdecode('R.S.+Tripleberry'),jdecode(''),'/894/7379.html','true',[],'',''],
		['PAGE','7400',jdecode('Apple+Butter'),jdecode(''),'/894/7400.html','true',[],'',''],
		['PAGE','7421',jdecode('Pumpkin+Butter'),jdecode(''),'/894/7421.html','true',[],'',''],
		['PAGE','7442',jdecode('Citrus+Marmalade'),jdecode(''),'/894/7442.html','true',[],'',''],
		['PAGE','7463',jdecode('Lime+Marmalade'),jdecode(''),'/894/7463.html','true',[],'','']
	],'',''],
	['PAGE','8001',jdecode('Return%2FPrivacy+policy'),jdecode(''),'/8001.html','true',[],'',''],
	['PAGE','978',jdecode('Contact'),jdecode(''),'/978.html','true',[],'',''],
	['PAGE','6101',jdecode('Store'),jdecode(''),'/6101.html','true',[],'','']];
var siteelementCount=30;
theSitetree.topTemplateName='Enjoy';
theSitetree.paletteFamily='93A6CC';
theSitetree.keyvisualId='2224';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='366';
theSitetree.graphicsetId='415';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='93A6CC';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Enjoy',
				paletteFamily: 	'93A6CC',
				keyvisualId: 	'2224',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'366',
				graphicsetId: 	'415',
				contentColor: 	'000000',
				contentBGColor: '93A6CC',
				a_color: 		'93A6CC',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20080910-213656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '978',
internalId:  '',
customField: '20080910-190202'
};
var canonHostname = 'wsc-worker04.chi.us.siteprotect.com';
var accountId     = 'AHW050IN2HIQ';
var companyName   = 'Berry+Berry+Good+Produce';
var htmlTitle	  = 'Berry+Berry+Good+Produce';
var metaKeywords  = 'Jams%2C+jelly%2C+jellies%2C+jam%2C+spreads%2C+strawberry%2C+peach%2C+marionberry%2C+lime%2C+apricot%2C+tripleberry%2C+locally+grown%2C+growers+market%2C+Grants+Pass%2C+Oregon%2C+Oregon+grown%2Cunusual+varieties%2C+cherry%2C+huckleberry%2C+Grandma+Hatties+jam%2C+hot+pepper+jam%2C+hot+pepper+spread%2C+strawberry-rhubarb%2C+pear%2C+blackberry%2C+apple+butter%2C+pumpkin+butter%2C+marmalade%2C+lime+marmalade%2C+citrus+marmalade%2C+pomegrante%2C+apricot-pineapple';
var metaContents  = 'Jams%2C+Jellies+and+specialty+jams+at+a+reasonalbe+price.+Locally+grown+fruit+with+fantastic+flavor.+Unusual+varieties%2C+hard+to+find+anywhere+else.+Sold+only+at+Grants+Pass+Growers+Market%2C+not+available+in+stores.';
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();
};

