/* [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','501',jdecode('Home'),jdecode(''),'/501.html','true',[],''],
	['PAGE','552',jdecode('What+is+Naturopathy%3F'),jdecode(''),'/552.html','true',[],''],
	['PAGE','37101',jdecode('Hair+Analysis'),jdecode(''),'/37101.html','true',[],''],
	['PAGE','2601',jdecode('Healing+Children'),jdecode(''),'/2601.html','true',[],''],
	['PAGE','8301',jdecode('About+Samantha'),jdecode(''),'/8301.html','true',[],''],
	['PAGE','10901',jdecode('Courses'),jdecode(''),'/10901.html','true',[],''],
	['PAGE','594',jdecode('Articles+and+Links'),jdecode(''),'/594.html','true',[],''],
	['PAGE','2206',jdecode('Guestbook'),jdecode(''),'/2206/index.html','true',[ 
		['PAGE','2201',jdecode('Read+Guestbook'),jdecode(''),'/2206/2201.html','false',[],'']
	],''],
	['PAGE','573',jdecode('Contact'),jdecode(''),'/573.html','true',[],'']];
var siteelementCount=10;
theSitetree.topTemplateName='Occasions';
theSitetree.paletteFamily='1752B4';
theSitetree.keyvisualId='6667';
theSitetree.keyvisualName='kv_6667.jpg';
theSitetree.fontsetId='11194';
theSitetree.graphicsetId='12002';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='1752B4';
var localeDef={
  language: 'en',
  country: 'US'
};
var theTemplate={
				name: 			'Occasions',
				paletteFamily: 	'1752B4',
				keyvisualId: 	'6667',
				keyvisualName: 	'kv_6667.jpg',
				fontsetId: 		'11194',
				graphicsetId: 	'12002',
				contentColor: 	'FFFFFF',
				contentBGColor: '1752B4',
				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:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-2206abri10in2vvv']={
webappId:    '1002',
documentId:  '2206',
internalId:  '2206abri10in2vvv',
customField: 'icq=false'
};
webappMappings['7008']=webappMappings['7008-251']={
webappId:    '7008',
documentId:  '573',
internalId:  '251',
customField: 'language:en;country:US;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100723-093805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20100723-091715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20081125-132837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2601',
internalId:  '',
customField: '20061128-085813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8301',
internalId:  '',
customField: '20080131-131300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20080828-063800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20100723-092010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2206',
internalId:  '',
customField: '20061120-140512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20061115-043946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37101',
internalId:  '',
customField: '20100723-093603'
};
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABRI10IN2VVV';
var companyName   = 'Samantha+Hurst+N.C+++++Naturopath';
var htmlTitle	  = 'samantha+hurst%2C+Kingsleigh+Clinic%2C+Naturopath%2C+Rayleigh%2C+Essex%2C+UK';
var metaKeywords  = 'Spiritual%2C+psychic%2C+pendulums%2C+dowsing%2C+emotional%2C+physical%2C+naturopathy%2C+naturopath%2C+healing%2C+crystals%2C+regression%2C+hynotherapy%2C+kingsleigh+clinic%2C+uk%2C+rayleigh%2C+naturopathic%2C+homeopathy%2C+energy%2C+aura%2C+chakras%2C+chakra%2C+nadis%2C+meridians%2C+emotional+body%2C+etheric+field%2C+courses%2C+spiritual+crisis.+breakdown%2C+nervous.+healing.+kabbalah+healing%2C+subtle+bodies.+unknown+diseases.+light.+mental+illness%2C+astral+body%2C+';
var metaContents  = 'I+invite+you+to+a+system+of+healthcare+that+treats+from+the+emotional+and+spiritual+aspects+of+dis-ease.+If+you+are+unwell+there+will+be+an+emotional+or+spiritual+cause+at+the+seed+of+the+problem.+This+style+of+natural+medicine+can+help+with+any+complaint+be+it+physical%2C+emotional+or+spiritual.+It+is+all+about+finding+that+seed.+I+use+a+variety+of+natural+medicines+to+help+you+back+to+health+and+vitality%2C+from+homeopathy%2C+herbs+and+flower+essences+to+past+life+and+karmic+essences+and+much+more.+If+you+are+unwell+or+would+just+like+a+physical%2C+emotional+or+spiritual+check+up+please+do+not+hesitate+to+contact+me.';
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();
};
