/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','9301',jdecode('Wellness+Services'),jdecode(''),'/9301/index.html','true',[ 
		['PAGE','9322',jdecode('Colon+Hydrotherapy'),jdecode(''),'/9301/9322.html','true',[],'',''],
		['PAGE','9364',jdecode('Aromatherapy'),jdecode(''),'/9301/9364.html','true',[],'',''],
		['PAGE','9343',jdecode('Reiki'),jdecode(''),'/9301/9343.html','true',[],'','']
	],'',''],
	['PAGE','25501',jdecode('Articles'),jdecode(''),'/25501.html','true',[],'',''],
	['PAGE','25701',jdecode('Liver+Cleanse'),jdecode(''),'/25701.html','true',[],'',''],
	['PAGE','16343',jdecode('Products+%26+Services'),jdecode(''),'/16343.html','true',[],'',''],
	['PAGE','17801',jdecode('Links'),jdecode(''),'/17801.html','true',[],'',''],
	['PAGE','620',jdecode('Contact'),jdecode(''),'/620.html','true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Angkor';
theSitetree.paletteFamily='879ED6';
theSitetree.keyvisualId='6858';
theSitetree.keyvisualName='kv_6858.jpg';
theSitetree.fontsetId='11212';
theSitetree.graphicsetId='12030';
theSitetree.contentColor='354B86';
theSitetree.contentBGColor='94AAE1';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Angkor',
				paletteFamily: 	'879ED6',
				keyvisualId: 	'6858',
				keyvisualName: 	'kv_6858.jpg',
				fontsetId: 		'11212',
				graphicsetId: 	'12030',
				contentColor: 	'354B86',
				contentBGColor: '94AAE1',
				a_color: 		'94AAE1',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9301',
internalId:  '',
customField: '20090909-140144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100414-140502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9364',
internalId:  '',
customField: '20100414-143537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9322',
internalId:  '',
customField: '20090113-141327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17801',
internalId:  '',
customField: '20100702-152224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16343',
internalId:  '',
customField: '20100414-135929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9343',
internalId:  '',
customField: '20080630-163220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '620',
internalId:  '',
customField: '20090416-101128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25501',
internalId:  '',
customField: '20100414-144436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25701',
internalId:  '',
customField: '20080929-170308'
};
webappMappings['1501']=webappMappings['1501-1850260']={
webappId:    '1501',
documentId:  '401',
internalId:  '1850260',
customField: '1501'
};
var canonHostname = 'cm4all01.west-datacenter.net';
var accountId     = 'AWH020IN25ML';
var companyName   = 'Rising+Sun+Renewal';
var htmlTitle	  = 'Rising+Sun+Renewal+%7E+Cleanse%2C+Rebuild%2C+Renew%21';
var metaKeywords  = 'Holistic%2C+Rejuvenate%2C+Colonic%2C+Reiki%2C+Essential+Oils%2C+Wellness%2C+Cleanse%2C+Purify%2C+Colon+Hydro+Therapy%2C+Fasting%2C+Inner+Balance%2C+Colon+Care%2C+Health%2C+Natural+Health%2C+Weight+Loss%2C+Natural+Weight+Loss%2C+wholistic%2C+cleansing%2C+candida%2C+parasites%2C+allergies%2C+natural+health+care%2C+colon+health%2C+colon+cleansing%2C+fibromyalgia%2C+diabetes%2C+constipation%2C+fatigue%2C+skin+problems%2C+heartburn%2C+gas%2C+bloating%2C+hepatitis%2C+diet%2C+gallstones%2C+liver%2C+colonoscopy%2C+kidney+stones%2C+coughs%2C+Park+City%2C+Utah%2C+Heber+City%2C++Utah%2C+Midway%2C+Daniells%2C+Charleston%2C+Francis%2C+Kamas%2C+Marion%2C+Oakley%2C+Summit+County%2C+Wasatch+County%2C+Salt+Lake+City%2C+Kimball+Junction%2C+Woodland%2C+Peoa%2C+Wanship%2C+Coalville%2C+Henifer%2C+Morgan%2C+Morgan+County%2C+illness%2C+mucoid+plaque%2C+Body+Ecology+Diet%2C+nutrition%2C+colon+health%2C+Slo-Fil+Method%2C+Detolo%2C+closed+system%2C+disposable+speculums%2C+holistic%2C+colonic+business%2C+International+Association+for+Colon+Hydrotherapy%2C+Denise+Walz%2C+Denise%2C+CT';
var metaContents  = 'Denise+Walz+%7E+I-ACT+Certified+Colon+Hydrotherapist%2C+Reiki+Master%2C+Aromatherapy%2C+Wellness+Education.++Serving+the+Park+City+and+Summit%2FWasatch+County+Area.++Gentle+cleansing+to+remove+built+up+toxins+that+create+illness%2C+with+a+focus+on+rebuilding+your+body+thru+nutritional+support+based+on+The+Body+Ecology+Diet+by+Donna+Gates.++Cleanse%2C+Rebuild%2C+Renew%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();
};
