/* [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','33432',jdecode('Guest+book'),jdecode(''),'/33432.html','true',[],'',''],
	['PAGE','6112',jdecode('Home'),jdecode(''),'/6112.html','true',[],'',''],
	['PAGE','22112',jdecode('The+Foundation'),jdecode(''),'/22112.html','true',[],'',''],
	['PAGE','20254',jdecode('Who+am+I%3F'),jdecode(''),'/20254.html','true',[],'',''],
	['PAGE','33483',jdecode('Help+Choose+our+next+challenge%21'),jdecode(''),'/33483.html','true',[],'',''],
	['PAGE','33504',jdecode('Come+alive%21'),jdecode(''),'/33504.html','true',[],'',''],
	['PAGE','33525',jdecode('Diet+is+a+hairy+topic%3A+Let%26%23x27%3Bs+talk%21'),jdecode(''),'/33525.html','true',[],'',''],
	['PAGE','33546',jdecode('Ask+a+question%3F'),jdecode(''),'/33546.html','true',[],'',''],
	['PAGE','22133',jdecode('Medical+Nutrition'),jdecode(''),'/22133.html','true',[],'',''],
	['PAGE','22154',jdecode('Offers'),jdecode(''),'/22154.html','true',[],'',''],
	['PAGE','20233',jdecode('Imprint'),jdecode(''),'/20233.html','true',[],'',''],
	['PAGE','23512',jdecode('Code+of+Ethics'),jdecode(''),'/23512.html','true',[],'',''],
	['PAGE','20212',jdecode('Contact'),jdecode(''),'/20212.html','true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Bubbles';
theSitetree.paletteFamily='A7C516';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='13';
theSitetree.graphicsetId='12';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Bubbles',
				paletteFamily: 	'A7C516',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'13',
				graphicsetId: 	'12',
				contentColor: 	'000066',
				contentBGColor: 'FFFFFF',
				a_color: 		'A7C516',
				b_color: 		'BD940E',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6112',
internalId:  '',
customField: '20100713-145845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20212',
internalId:  '',
customField: '20090127-134343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20233',
internalId:  '',
customField: '20090224-121324'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20254',
internalId:  '',
customField: '20100713-150604'
};
webappMappings['1002']=webappMappings['1002-33432ahw050invlgb']={
webappId:    '1002',
documentId:  '33432',
internalId:  '33432ahw050invlgb',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22133',
internalId:  '',
customField: '20090120-073310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22112',
internalId:  '',
customField: '20100713-150435'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '33432',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '33432',
internalId:  '1501',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22154',
internalId:  '',
customField: '20100713-151014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23512',
internalId:  '',
customField: '20090120-074829'
};
webappMappings['7005']=webappMappings['7005-625']={
webappId:    '7005',
documentId:  '33483',
internalId:  '625',
customField: 'language:en;country:US;'
};
webappMappings['7060']=webappMappings['7060-b834cd1bf6f85b15d4dc111e961fb402']={
webappId:    '7060',
documentId:  '33504',
internalId:  'b834cd1bf6f85b15d4dc111e961fb402',
customField: 'language:en;country:US;'
};
webappMappings['1003']=webappMappings['1003-ahw050invlgb12a621ad492']={
webappId:    '1003',
documentId:  '33525',
internalId:  'ahw050invlgb12a621ad492',
customField: 'en:US'
};
webappMappings['7008']=webappMappings['7008-9194']={
webappId:    '7008',
documentId:  '33546',
internalId:  '9194',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33432',
internalId:  '',
customField: '20100811-120251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33483',
internalId:  '',
customField: '20100811-120252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33504',
internalId:  '',
customField: '20100811-120252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33525',
internalId:  '',
customField: '20100811-120259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33546',
internalId:  '',
customField: '20100811-120259'
};
webappMappings['1501']=webappMappings['1501-3327335']={
webappId:    '1501',
documentId:  '33432',
internalId:  '3327335',
customField: '1501'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INVLGB';
var companyName   = 'The+Wellness+Medicine';
var htmlTitle	  = 'Nutrition+and+Fitness+as+your+health+and+wellness+prescription%21';
var metaKeywords  = 'eating%2C+dinner%2C+nutrition%2C+fitness%2C+wellness%2C+dining%2C+plate%2C+eat%2C+vitamin%2C+supplement%2C+assessment%2C+evaluation%2C+culinary%2C+professional%2C+dietetic%2C+minority%2C+african-american%2C+history%2C+diet%2C+health%2C+plan%2C+workout%2C+dietitian%2C+registered%2C+association%2C+sports%2C+medicine%2C+walking%2C+cycling%2C+running%2C+travel%2C+black%2C+food';
var metaContents  = 'Food%2CNutrition%2C+Fitness+and+wellness+is+all+the+medicine+you+need%21++The+Wellness+Medicine+offers+nutrition+communication+products+and+services+for+the+client+who+wants+a+down+to+earth+interpretation+of+current+scientific+information%2C+up+to+date+and+served+on+your+plate%21';
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();
};
