/* [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','701',jdecode('Home'),jdecode(''),'/701.html','true',[],''],
	['PAGE','6601',jdecode('About+Nancy'),jdecode(''),'/6601.html','true',[],''],
	['PAGE','6643',jdecode('EFT'),jdecode(''),'/6643.html','true',[],''],
	['PAGE','6664',jdecode('Hypnosis'),jdecode(''),'/6664.html','true',[],''],
	['PAGE','53301',jdecode('Hypnotherapy'),jdecode(''),'/53301.html','true',[],''],
	['PAGE','55101',jdecode('For+Children'),jdecode(''),'/55101.html','true',[],''],
	['PAGE','6685',jdecode('NLP'),jdecode(''),'/6685.html','true',[],''],
	['PAGE','14701',jdecode('Weight+Issues'),jdecode(''),'/14701.html','true',[],''],
	['PAGE','6748',jdecode('Quit+Smoking'),jdecode(''),'/6748.html','true',[],''],
	['PAGE','49101',jdecode('Art+Therapy'),jdecode(''),'/49101.html','true',[],''],
	['PAGE','51101',jdecode('Products'),jdecode(''),'/51101.html','true',[],''],
	['PAGE','51122',jdecode('FAQ'),jdecode(''),'/51122.html','true',[],''],
	['PAGE','6727',jdecode('Contact+Us'),jdecode(''),'/6727/index.html','true',[ 
		['PAGE','12401',jdecode('Contact+%28follow+up+page%29'),jdecode(''),'/6727/12401.html','true',[],'']
	],''],
	['PAGE','64501',jdecode('Links'),jdecode(''),'/64501.html','true',[],'']];
var siteelementCount=15;
theSitetree.topTemplateName='Daily';
theSitetree.paletteFamily='D4C3E6';
theSitetree.keyvisualId='7297';
theSitetree.keyvisualName='kv_7297.jpg';
theSitetree.fontsetId='16458';
theSitetree.graphicsetId='12153';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Daily',
				paletteFamily: 	'D4C3E6',
				keyvisualId: 	'7297',
				keyvisualName: 	'kv_7297.jpg',
				fontsetId: 		'16458',
				graphicsetId: 	'12153',
				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: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6643',
internalId:  '',
customField: '20091016-104440'
};
webappMappings['7008']=webappMappings['7008-260']={
webappId:    '7008',
documentId:  '51122',
internalId:  '260',
customField: 'language:en;country:US;'
};
webappMappings['7008']=webappMappings['7008-259']={
webappId:    '7008',
documentId:  '6727',
internalId:  '259',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20091012-163631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51101',
internalId:  '',
customField: '20080403-135024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51122',
internalId:  '',
customField: '20091011-130653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20071208-194351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6664',
internalId:  '',
customField: '20090727-103259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53301',
internalId:  '',
customField: '20071122-132558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55101',
internalId:  '',
customField: '20071122-140948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6685',
internalId:  '',
customField: '20071208-194507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14701',
internalId:  '',
customField: '20061003-205453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6748',
internalId:  '',
customField: '20060510-152255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49101',
internalId:  '',
customField: '20071107-140029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6727',
internalId:  '',
customField: '20071107-150032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12401',
internalId:  '',
customField: '20060522-125216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64501',
internalId:  '',
customField: '20091011-124603'
};
var canonHostname = 'cm4all.aplus.net';
var accountId     = 'AAPLU0IN2B0U';
var companyName   = 'Innovative+Psychotherapy+%2F+Hypnotherapy';
var htmlTitle	  = 'Hypnosis%2C+Hypnotherapy+and+Psychotherapy+in+Toronto%2C+Ontario+with+Innovative+Hypnotherapy';
var metaKeywords  = 'hypnosis%2C+hypnotherapy%2C+emotional+freedom%2C+quit+smoking%2C+hypnotherapist%2C+psychotherapy%2C+psychotherapeutic%2C+hypnotherapeutic%2C+neurolinguistic+programming%2C+neuro+linguistic%2C+art+therapy%2C+art+therapist%2C+NLP%2C+EFT%2C+Toronto%2C+Ontario%2C+depression%2C+anxiety%2C+phobia%2C+trauma%2C+psychotherapist%2C+hypnotherapist%2C+emotional+freedom+technique%2C+relationship%2C+counselling%2C+counsellor%2C+therapist%2C+therapeutic%2C+therapy%2C+mind%2C+emotions%2C+dream%2C+dreams%2C+interpretation%2C+trancework%2C+trance%2C+transformation%2C+mind%2Fbody%2C+mind-body%2C+counselling%2C+counsellor';
var metaContents  = 'Innovative+Hypnotherapy+and+Psychotherapy+is+based+in+Toronto%2C+Ontario.+We+offer+hypnosis%2C+emotional+freedom+techniques+%28EFT%29%2C+psychotherapy+and+NLP+Therapies+for+the+treatment+of+phobias%2C+stop+smoking%2C+post+traumatic+stress%2C+depression%2C+anxiety%2C+weight+loss+and+management.+We+also+offer+Art+Therapy+and+are+located+in+Toronto+Ontario.';
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();
};
