/* [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 theSitetree=[ 
	['PAGE','31815',jdecode('docbones.com'),jdecode(''),'/31815.html','true',[],''],
	['PAGE','305',jdecode('Advice+to+a+Friend'),jdecode(''),'/305.html','true',[],''],
	['PAGE','314',jdecode('Getting+Started'),jdecode(''),'/314.html','true',[],''],
	['PAGE','2227',jdecode('A+Healing+Breath'),jdecode(''),'/2227.html','true',[],''],
	['PAGE','9601',jdecode('Resting+Postures'),jdecode(''),'/9601/index.html','true',[ 
		['PAGE','22901',jdecode('Vinyasa'),jdecode(''),'/9601/22901.html','true',[],'']
	],''],
	['PAGE','2316',jdecode('Reduce+your+Pain'),jdecode(''),'/2316.html','true',[],''],
	['PAGE','350',jdecode('Contact+docbones'),jdecode(''),'/350.html','true',[],''],
	['PAGE','1665',jdecode('Cranial+Electric+Stimulation'),jdecode(''),'/1665/index.html','true',[ 
		['PAGE','1721',jdecode('CES+Research+'),jdecode(''),'/1665/1721.html','true',[],'']
	],''],
	['PAGE','19401',jdecode('Order+DVD'),jdecode(''),'/19401.html','true',[],''],
	['PAGE','22501',jdecode('What%26%23x27%3Bs+Up%3F'),jdecode(''),'/22501.html','true',[],''],
	['PAGE','28615',jdecode('Oregonian+Editorials'),jdecode(''),'/28615.html','true',[],''],
	['PAGE','33615',jdecode('sorry'),jdecode(''),'/33615.html','false',[],''],
	['PAGE','33815',jdecode('send+DVD'),jdecode(''),'/33815.html','false',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Coaster';
theSitetree.paletteFamily='818081';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10476';
theSitetree.graphicsetId='10971';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var theTemplate={
				name: 			'Coaster',
				paletteFamily: 	'818081',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10476',
				graphicsetId: 	'10971',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'858586',
				e_color: 		'858586',
				f_color: 		'858586',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33815',
internalId:  '',
customField: '20090706-141125'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '31815',
internalId:  '1006',
customField: '1006'
};
webappMappings['7060']=webappMappings['7060-972a31cf7739818141e4ea4b93da5a49']={
webappId:    '7060',
documentId:  '22901',
internalId:  '972a31cf7739818141e4ea4b93da5a49',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '305',
internalId:  '',
customField: '20081118-170618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '314',
internalId:  '',
customField: '20091130-133846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2227',
internalId:  '',
customField: '20091130-134208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9601',
internalId:  '',
customField: '20090302-022213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19401',
internalId:  '',
customField: '20100305-003100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2316',
internalId:  '',
customField: '20091130-134947'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '350',
internalId:  '',
customField: '20100220-131131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1665',
internalId:  '',
customField: '20080721-191710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1721',
internalId:  '',
customField: '20080802-195554'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22501',
internalId:  '',
customField: '20091130-141328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22901',
internalId:  '',
customField: '20090304-102700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31815',
internalId:  '',
customField: '20090706-135407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28615',
internalId:  '',
customField: '20090705-190937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33615',
internalId:  '',
customField: '20090706-140512'
};
var canonHostname = 'wsc-worker03.chi.us.siteprotect.com';
var accountId     = 'AHW050INX3IL';
var companyName   = 'docbones.com';
var htmlTitle	  = 'docbones.com';
var metaKeywords  = 'Restorative+yoga%3B+calming+the+mind%3B+stress+reduction%3B+improved+sleep%3B+relief+from+pain%3B+improved+immune+function%3B+appropriate+senior+activity%3B+greater+well-being%3B+retirement+activity%3B+natural+pain+relief%3B+chiropractors+exercises%3B+inner+peacefulness%3B+self-healing%3B+yoga+in+bed%3B+good+posture%3B+the+resting+postures.';
var metaContents  = 'Resting+yoga+poses+with+a+meditative+breath+brings+relief+to+the+most+common+forms+of+body+pain%2C+improves+sleep+patterns%2C+improves+immune+functioning%2C+and+improves+ability+to+handle+stress%2C+when+practiced+over+time.++Adjunctive+advise+on+proper+nutrition+and+lifestyle+choices+for+improved+health+and+well-being.+Appropriate+activity+for+improved+quality+of+life+for+retiring+boomers%2C+or+anyone+seeking+restorative+health.';
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();
};
