/* [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','7501',jdecode('Home'),jdecode(''),'/7501.html','true',[],'',''],
	['PAGE','8501',jdecode('Hypnotherapy'),jdecode(''),'/8501.html','true',[],'',''],
	['PAGE','8522',jdecode('Personal+Life+Coaching'),jdecode(''),'/8522.html','true',[],'',''],
	['PAGE','34512',jdecode('Quit+Smoking'),jdecode(''),'/34512.html','true',[],'',''],
	['PAGE','34712',jdecode('Lose+Weight+Fast'),jdecode(''),'/34712.html','true',[],'',''],
	['PAGE','68212',jdecode('Prices%3A+Hypnotherapy'),jdecode(''),'/68212.html','true',[],'',''],
	['PAGE','72512',jdecode('Prices%3A+Life+Coaching'),jdecode(''),'/72512.html','true',[],'',''],
	['PAGE','77812',jdecode('Office+Hours'),jdecode(''),'/77812.html','true',[],'',''],
	['PAGE','79412',jdecode('John+Ward%2C+Ph.D.'),jdecode(''),'/79412.html','true',[],'',''],
	['PAGE','86223',jdecode('Our+Office'),jdecode(''),'/86223.html','true',[],'',''],
	['PAGE','8543',jdecode('Location'),jdecode(''),'/8543.html','true',[],'',''],
	['PAGE','8564',jdecode('Contact+Us'),jdecode(''),'/8564.html','true',[],'',''],
	['PAGE','74912',jdecode('Work+Shops'),jdecode(''),'/74912.html','true',[],'',''],
	['PAGE','46312',jdecode('Coupons+and+Discounts'),jdecode(''),'/46312.html','true',[],'',''],
	['PAGE','90623',jdecode('News'),jdecode(''),'/90623.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Displace';
theSitetree.paletteFamily='2E2E2E';
theSitetree.keyvisualId='11075';
theSitetree.keyvisualName='kv_11075.jpg';
theSitetree.fontsetId='31958';
theSitetree.graphicsetId='13798';
theSitetree.contentColor='ABA694';
theSitetree.contentBGColor='2E2E2E';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Displace',
				paletteFamily: 	'2E2E2E',
				keyvisualId: 	'11075',
				keyvisualName: 	'kv_11075.jpg',
				fontsetId: 		'31958',
				graphicsetId: 	'13798',
				contentColor: 	'ABA694',
				contentBGColor: '2E2E2E',
				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:  '8543',
internalId:  'location',
customField: 'language:en;country:US;isIncluded:true;'
};
webappMappings['7008']=webappMappings['7008-1874']={
webappId:    '7008',
documentId:  '8564',
internalId:  '1874',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20100226-145536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8501',
internalId:  '',
customField: '20100211-125020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8543',
internalId:  '',
customField: '20091105-140211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8564',
internalId:  '',
customField: '20091105-140245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8522',
internalId:  '',
customField: '20100211-125343'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '7501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34512',
internalId:  '',
customField: '20100211-125602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34712',
internalId:  '',
customField: '20100211-125727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46312',
internalId:  '',
customField: '20091105-140332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68212',
internalId:  '',
customField: '20100123-185301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72512',
internalId:  '',
customField: '20091105-135904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74912',
internalId:  '',
customField: '20091105-140308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86223',
internalId:  '',
customField: '20091105-140144'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77812',
internalId:  '',
customField: '20091105-141550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79412',
internalId:  '',
customField: '20100211-130121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90623',
internalId:  '',
customField: '20100116-090121'
};
webappMappings['1501']=webappMappings['1501-21909422']={
webappId:    '1501',
documentId:  '7501',
internalId:  '21909422',
customField: '1501'
};
var canonHostname = 'wscwrk02.ehost-services.com';
var accountId     = 'AEN330INF9LH';
var companyName   = 'FIDELITY+HYPNOSIS+CENTER+';
var htmlTitle	  = 'Quit+Smoking%2C+Lose+Weight%2C+Hypnosis%2C+Hypnotherapy.+Nashville%2CTN';
var metaKeywords  = 'quit+smoking%2C+lose+weight%2C+fast%2C+hypnotherapy%2C+Nashville%2C+Tennessee%2C+TN';
var metaContents  = 'Come+here+to+Quit+Smoking+and+Lose+Weight+fast+with+hypnotherapy+in+Nashville+Tennessee.';
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();
};
