/* [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','2901',jdecode('Home'),jdecode(''), jdecode('%2F2901.html'), 'true',[],'',''],
	['PAGE','2952',jdecode('PROGRAMS%2FPRODUCTS'),jdecode(''), jdecode('%2F2952.html'), 'true',[],'',''],
	['PAGE','2973',jdecode('Contact'),jdecode(''), jdecode('%2F2973.html'), 'true',[],'',''],
	['PAGE','31312',jdecode('Healthy+Smarts+Natural+Living'),jdecode(''), jdecode('%2F31312.html'), 'true',[],'',''],
	['PAGE','32112',jdecode('Beyond+Organic+products'),jdecode(''), jdecode('%2F32112%2Findex.html'), 'true',[ 
		['PAGE','32133',jdecode('Natural+Health+Links'),jdecode(''), jdecode('%2F32112%2F32133.html'), 'true',[],'',''],
		['PAGE','32154',jdecode('Wholesome+recipes'),jdecode(''), jdecode('%2F32112%2F32154.html'), 'true',[],'',''],
		['PAGE','32175',jdecode('Dictionary'),jdecode(''), jdecode('%2F32112%2F32175.html'), 'true',[],'','']
	],'',''],
	['PAGE','31333',jdecode('+Client+Testimonials'),jdecode(''), jdecode('%2F31333.html'), 'true',[],'',''],
	['PAGE','31354',jdecode('Buying+Club+Membership'),jdecode(''), jdecode('%2F31354.html'), 'true',[],'',''],
	['PAGE','35212',jdecode('Store+events+%26+classes'),jdecode(''), jdecode('%2F35212.html'), 'true',[],'','']];
var siteelementCount=11;
theSitetree.topTemplateName='Antique';
theSitetree.paletteFamily='E58F12';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='11063';
theSitetree.graphicsetId='11833';
theSitetree.contentColor='D1C3A6';
theSitetree.contentBGColor='856A3B';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'comcast',
  product: 'WSCSYSSSSLYTC24M'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Antique',
				paletteFamily: 	'E58F12',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'11063',
				graphicsetId: 	'11833',
				contentColor: 	'D1C3A6',
				contentBGColor: '856A3B',
				a_color: 		'664F23',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2901',
internalId:  '',
customField: '20120118-182434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2952',
internalId:  '',
customField: '20120104-140737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2973',
internalId:  '',
customField: '20120118-182520'
};
webappMappings['7050']=webappMappings['7050-3476']={
webappId:    '7050',
documentId:  '31312',
internalId:  '3476',
customField: 'language:en;country:US;'
};
webappMappings['1002']=webappMappings['1002-31333ahw050inle8v']={
webappId:    '1002',
documentId:  '31333',
internalId:  '31333ahw050inle8v',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31312',
internalId:  '',
customField: '20110414-130041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31333',
internalId:  '',
customField: '20110414-130508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31354',
internalId:  '',
customField: '20110712-084922'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2901',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32112',
internalId:  '',
customField: '20120104-135523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32133',
internalId:  '',
customField: '20110414-130413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32154',
internalId:  '',
customField: '20110618-082023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32175',
internalId:  '',
customField: '20110414-130453'
};
webappMappings['5003']=webappMappings['5003-tid:1;pid:WSCSYSSSSLYTC245']={
webappId:    '5003',
documentId:  '31312',
internalId:  'tid:1;pid:WSCSYSSSSLYTC245',
customField: 'en:US::;language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35212',
internalId:  '',
customField: '20120104-135912'
};
var webAppHostname = 'cgi-wsc.chi.us.siteprotect.com:80';
var canonHostname = 'wsc-worker02.chi.us.siteprotect.com';
var accountId     = 'AHW050INLE8V';
var companyName   = 'HARVESTED+HEALTH+LLC.+%22Back+to+basics%22';
var htmlTitle	  = 'Harvested+Health+LLC.';
var metaKeywords  = 'Harvested+health%2C+Back+to+basics%2C+Natural+Health+Consulting%2C+Organic+lifestyles%2C+infrared+Saunas%2C+Schererville%2C+Indiana%2C+Northwest+Indiana%2C+Quantative+Fluid+Assessment%2C+Nutritional+counseling%2C+stress+management%2C+immune%2C+weight+loss%2C+inflammation%2CHERBS%2C+SUPPLEMENTS%2C+Heavy+Metal+detoxification%2C+acne%2C+colon%2C+kidneys%2C+liver%2C+lungs%2Flymphatics%2C+cleansing%2Cnature%2C+sunshine%2C+naturessunshine%2C+raw+food%2C+juicing%2C+colon+cleansing%2C+body+cleansing%2C+sauna%2C+cardio%2C+weight+loss%2C+weight-loss%2C+lose+weight%2C+sleep%2C+menopause%2C+fibromyalgia%2Cgaps+diet%2C';
var metaContents  = 'Harvested+Health%2C+Do+you+suffer+from+a+lack+of+vitality%3F';
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();
};

