/* [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','3001',jdecode('Welcome'),jdecode(''),'/3001.html','true',[],'',''],
	['PAGE','9901',jdecode('Quit+Smoking'),jdecode(''),'/9901.html','true',[],'',''],
	['PAGE','66723',jdecode('Lose+Weight+Fast'),jdecode(''),'/66723.html','true',[],'',''],
	['PAGE','66786',jdecode('Office+Hours'),jdecode(''),'/66786.html','true',[],'',''],
	['PAGE','3073',jdecode('Hypnotherapy'),jdecode(''),'/3073.html','true',[],'',''],
	['PAGE','3052',jdecode('Personal+Life+Coaching'),jdecode(''),'/3052.html','true',[],'',''],
	['PAGE','66744',jdecode('Prices%3A+Hypnotherapy'),jdecode(''),'/66744.html','true',[],'',''],
	['PAGE','66765',jdecode('Prices%3A+Life+Coaching'),jdecode(''),'/66765.html','true',[],'',''],
	['PAGE','66807',jdecode('John+Ward+Ph.D.'),jdecode(''),'/66807.html','true',[],'',''],
	['PAGE','66828',jdecode('Our+Office'),jdecode(''),'/66828.html','true',[],'',''],
	['PAGE','3115',jdecode('Location'),jdecode(''),'/3115.html','true',[],'',''],
	['PAGE','66849',jdecode('Contact+Us'),jdecode(''),'/66849.html','true',[],'',''],
	['PAGE','66870',jdecode('Workshops'),jdecode(''),'/66870.html','true',[],'',''],
	['PAGE','4122',jdecode('Coupons+and+Discounts'),jdecode(''),'/4122.html','true',[],'',''],
	['PAGE','66891',jdecode('News'),jdecode(''),'/66891.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Display';
theSitetree.paletteFamily='19120C';
theSitetree.keyvisualId='11080';
theSitetree.keyvisualName='kv_11080.jpg';
theSitetree.fontsetId='31963';
theSitetree.graphicsetId='13800';
theSitetree.contentColor='1B1B1B';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Display',
				paletteFamily: 	'19120C',
				keyvisualId: 	'11080',
				keyvisualName: 	'kv_11080.jpg',
				fontsetId: 		'31963',
				graphicsetId: 	'13800',
				contentColor: 	'1B1B1B',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '3115',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20100610-110921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3052',
internalId:  '',
customField: '20100610-111119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3073',
internalId:  '',
customField: '20100610-111040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20100610-111146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4122',
internalId:  '',
customField: '20100610-111712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66723',
internalId:  '',
customField: '20100610-111216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66744',
internalId:  '',
customField: '20100610-111246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66765',
internalId:  '',
customField: '20100610-111314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3115',
internalId:  '',
customField: '20100610-111551'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66786',
internalId:  '',
customField: '20100610-111400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66807',
internalId:  '',
customField: '20100610-111432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66828',
internalId:  '',
customField: '20100610-111515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66849',
internalId:  '',
customField: '20100610-111618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66870',
internalId:  '',
customField: '20100610-111644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66891',
internalId:  '',
customField: '20100610-111742'
};
webappMappings['7008']=webappMappings['7008-2386']={
webappId:    '7008',
documentId:  '66849',
internalId:  '2386',
customField: 'language:en;country:US;'
};
webappMappings['1501']=webappMappings['1501-21908307']={
webappId:    '1501',
documentId:  '3001',
internalId:  '21908307',
customField: '1501'
};
var canonHostname = 'wscwrk01.ehost-services.com';
var accountId     = 'AEN330INZLMH';
var companyName   = 'Changing+Lives+One+Hour+At+A+Time';
var htmlTitle	  = 'John+Ward%2C+Ph.D.+Quit+Smoking+Nashville%2C+TN+-++Hypnotherapy%2C+Hypnosis%2C+Personal++Life+Coaching';
var metaKeywords  = 'Quit+smoking+Nashville+ennessee%2C+hypnosis%2C+hypnotist%2C+hypnotherapy%2C+coaching%2C+hypnocoaching%2C+life+coach%2C+self-confidence+coach%2C+self+hypnosis%2C+self-hypnosis%2C+Nashville%2C+Tennessee%2C+smoking+cessation%2C+sports+hypnosis%2CHolistic+Life+Coaching%2C+Nashville+Hypnotherapy%2C+Hypnosis+Nashville%2C+Guided+Meditation%2C+Meditation%2C+Alternative+Medicine%2C+smoking%2C+quit+smoking%2C+John+Ward%2C+Institute%2C+Nashville+Hypnosis%2C+Tennessee+Hypnosis%2C+Nashville+Life+Coaching%2C+Tennessee+Life+Coaching%2C+Fast+Pain+Relief%2C+Abundance%2C+Goals%2C+Nashville+TN%2C+Davidson+County%2C+Dr.+John+Ward%2C+John+Ward%2C+Ph.D.%2C+stop+smoking%2C+quit+smoking%2C+lose+weight%2C+lose+weight+fast%2C+fast%2C+hypnotherapy%2C+hypnosis%2C+Donelson%2C+Nashville%2C+Tennessee%2C+TN%2C+weight+loss%2C+diet%2C+lose+weight%2C+smoking+in+tennesse%2C+smoking+gun%2C+personal+life+coach%2C+personal+life+coaching';
var metaContents  = 'Dr.+John+Ward+is+located+in+Nashville+Tennessee+and+offers+Hypnotherapy+and+Personal+Life+Coaching+at+Fidelity+Hypnosis+at+2817+Lebanon+Pike%2C+Suite+211%2C+Nashville%2C+TN+37214.+Dr.+Ward+can+be+reached+at+%28615%29+972-8124+and+at+dr.john%40fidelityhypnosis.com+';
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();
};
