/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],''],
	['PAGE','452',jdecode('About+Us'),jdecode(''),'/452.html','true',[],''],
	['PAGE','473',jdecode('What+is+Hypnosis%3F'),jdecode(''),'/473.html','true',[],''],
	['PAGE','494',jdecode('What+is+Hypnotherapy%3F'),jdecode(''),'/494.html','true',[],''],
	['PAGE','515',jdecode('Suggestion+Therapy'),jdecode(''),'/515.html','true',[],''],
	['PAGE','536',jdecode('Analytical+Therapy'),jdecode(''),'/536.html','true',[],''],
	['PAGE','557',jdecode('Phobias%2Ffears%2Fanxiety'),jdecode(''),'/557.html','true',[],''],
	['PAGE','578',jdecode('Weight+loss'),jdecode(''),'/578.html','true',[],''],
	['PAGE','599',jdecode('Social+anxiety'),jdecode(''),'/599.html','true',[],''],
	['PAGE','620',jdecode('Child+Therapy'),jdecode(''),'/620.html','true',[],''],
	['PAGE','641',jdecode('Stopping+Smoking'),jdecode(''),'/641.html','true',[],''],
	['PAGE','662',jdecode('Frequently+asked+questions'),jdecode(''),'/662.html','true',[],''],
	['PAGE','683',jdecode('Fees'),jdecode(''),'/683.html','true',[],''],
	['PAGE','704',jdecode('Contact+us'),jdecode(''),'/704.html','true',[],''],
	['PAGE','725',jdecode('Map%2Flocation'),jdecode(''),'/725.html','true',[],''],
	['PAGE','746',jdecode('Links'),jdecode(''),'/746.html','true',[],'']];
var siteelementCount=16;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10892';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'GB'
};
var theTemplate={
				name: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10892',
				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: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20090924-154552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20080811-120103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '704',
internalId:  '',
customField: '20080107-165938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20090924-154907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '641',
internalId:  '',
customField: '20080811-120742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20080822-143840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20080811-115535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20080811-115702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '620',
internalId:  '',
customField: '20080822-144110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20080822-143702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '662',
internalId:  '',
customField: '20080104-123906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '683',
internalId:  '',
customField: '20080811-120842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '599',
internalId:  '',
customField: '20080822-144016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '578',
internalId:  '',
customField: '20080822-143948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '725',
internalId:  '',
customField: '20090924-155221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '746',
internalId:  '',
customField: '20081204-190717'
};
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT10IN2QW9';
var companyName   = 'Kettering+Hypnotherapy';
var htmlTitle	  = 'Kettering+Hypnotherapy+-+stop+smoking%2C+help+depression%2C+eliminate+phobias+fears+and+anxieties.';
var metaKeywords  = 'change+one+thing++nicorette+++cigarette+++hypnosis+++hypnotherapy++hipnosis++hypnothrupy++kettering++hypnotherapist++complimentary++complementary++anxiety++panic++attacks++phobias++stutters++stutter++depression++feeling+down++sad++over+eating++eating++weight+loss++losing+weight++emetophobia++emetaphobia++emetephobia++being+sick++fear+of+being+sick++fear+of+vomiting++analysis++psychoanalysis++psychotherapy++emotional++emotion++emotional+problems++nervous++disorders++nervous+disorders++shy+++scared++scared+of++relationship++relationship+problems+++sexual+problems++premature+ejaculation++ejaculation++impotence++pregnant++pregnacy+problems++symptoms++passing+driving+test++driving+test++exams++calm++confidence++lack+conficdence++have+no+confidence++freud++oedipus+complex++edipus+complex++castration+complex++counselling++councelling++mental++fags++homesexual++gay++apiphobia++melissphobia++ornithophobia++hematophobia++eruethophobia++cancerphobia+carcinophobia+necrophobia+thanatophobia+cynophobia+ailurophobia+tocophobia+pnigophobia+chaetophobia+acrophobia+claustrophobia+croprophobia+kaorraphiaphobia+pteronophobia+ichthyophobia+aerophobia+spermophobia+osmophobia+hippophobia+lyssophobia+maniaphobia+entomophobia+zelophobia+androphobia+musophobia+gymophobia+ophidiophobia+halophobia+algophobia+odynephobia+parasitophobia+porthirophobia+erotophobia+maieusiophobia+batraehophobia+harpaxophobia+scholionophobia+didaskalienophobia+genophobia+coitophobia+eyridophobia+belonophobia+hypnophobia+olfaetophobia+phonophobia+stealing+swallowing+phagephobia+odontophobia+fear+of+dentits+dentists+spheksophobia+helminthophobia+gynophobia+graphophobia+bees+fear+of+bees+birds+fear+of+birds+frightened+of+birds+blood+fear+of+blood+dont+like+the+sight+of+blood+blushing+fear+of+blushing+fear+of+being+judged+death+frightened+of+death+dogs+frightened+of+dogs+fear+of+dogs+cats+frightened+of+cats+fear+of+cats+childbirth+frightened+of+childbirth+choking+gagging+hair+frightened+of+hair+heights+frightended+of+heights+enclosed+spaces+cant+go+in+enclosed+spaces+faeces+poo+shit+frightened+of+poo+shit+faeces+failure+scared+of+failure+feathers+frightened+of+feathers+fish+frightened+of+fish+flying+scared+of+flying+germs+dirt+mess+odours+bad+smells+dont+like+odours+and+bad+smells+horses+scrared+of+horses+insects+scared+of+insects+jealousy+over+jealous+mice+musophobia+nakedness+snakes+scared+of+snakes+speaking+in+public+spewing+speaking+in+front+of+someone+pain+painful+dentist+painful+love+physical+love+reptiles+robbers+school+fear+of+school+frightened+of+going+to+school+sharp+objects+sleep+smell+speaking+loudly+speaking+aloud+stealing+swallowing+difficulty+swallowing+cant+swallow+wasps+stings+stick+in+me+worms+writing+psychosmatic+cigs+cigars+smoking+quiting+smoking+quit+smoking+stop+smoking+quitting+cigs+quitting+cigars+quitting+fags+quit+fags+dont+give+up+giving+up+self+presevation++freudian+freudian+slip+parapraxis+frustration+nervous+breakdown+behaviour+human+behaviour+the+way+we+behave+psychology+psychological+hypnosis+and+psychology+concious+unconcious+subconcious+character+types+personality+types+jung+carl+gustav+jung+breuer+josph+breuer+joseph+breuer+complusion+obsession+complusive+obsessive+OCD+psyche++hypnocondria+paranoia+hysteria+hysteric+hysterical+conversion+conversion+hysteria+I+can+make+you+thin+I+can+change+your+life+market+harborough+corby+rutland+stamford+oundle+rothwell+earls+barton+geddington+milton+keynes+uppingham+oakham+nicorette+patches+nicotine+cure+phobias+cure+depression+cure+anxiety+qualified+hypnotherapist+hypno-birthing+hypnobirthing+hypnotism+obsessive+complusive+disorder+shy+baldder+cant+wee+in+front+of+others+dont+like+public+toilets+cant+pee+in+public+toilets+stammer++Kettering+hypnotherapy+hypnotherapist+hypnosis+hypnotist+hypnotism+find+Corby+Wellingborough+Northampton+Market+Harborough+Rushden+Leicester+Peterborough+Northants+private+stress+anxiety+panic+attack+management+fear+phobias+vomit+emetophobia+claustrophobia+acrophobia+heights+sick+sickness+flying+spiders+social+disorder+agoraphobia+treatment+agoraphobia+social+phobia+social+anxiety+ocd+treatment+obsessions+ocd+eating+slimming+sexual+quit+smoking+hypnosis+stop+smoking+low+self+esteem+confidence+self+confidence+paruresis+shy+bladder+stammering+stuttering+blushing+feeling+on+the+spot+premature+ejaculation+sexual+problem+slimming+weight+loss+lose+weight+issue+overweight++';
var metaContents  = 'Caring+and+effective+Hypnotherapy+treatment+at+the+Headlands+Surgery+in+Kettering+Northamptonshire+for+Phobias%2C+depression%2C+anxiety%2C+panic+attacks%2C+stopping+smoking%2C+losing+weight+and+anything+inside+yourself+but+outside+your+own+control.++Free+initial+consultation.';
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();
};
