/* [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','3801',jdecode('Home'),jdecode(''), jdecode('%2F3801.html'), 'true',[],'',''],
	['PAGE','3852',jdecode('Therapies'),jdecode(''), jdecode('%2F3852%2Findex.html'), 'true',[ 
		['PAGE','4801',jdecode('Healing+Touch'),jdecode(''), jdecode('%2F3852%2F4801.html'), 'true',[],'',''],
		['PAGE','4822',jdecode('PSYCH-K'),jdecode(''), jdecode('%2F3852%2F4822.html'), 'true',[],'',''],
		['PAGE','4843',jdecode('Body+Mind+Healing+Therapy'),jdecode(''), jdecode('%2F3852%2F4843.html'), 'true',[],'','']
	],'',''],
	['PAGE','5001',jdecode('Teen+Programs'),jdecode(''), jdecode('%2F5001.html'), 'true',[],'',''],
	['PAGE','24801',jdecode('Teen+Self-Help+Book'),jdecode(''), jdecode('%2F24801.html'), 'true',[],'',''],
	['PAGE','5043',jdecode('Price+List'),jdecode(''), jdecode('%2F5043.html'), 'true',[],'',''],
	['PAGE','5201',jdecode('Testimonials'),jdecode(''), jdecode('%2F5201.html'), 'true',[],'',''],
	['PAGE','10401',jdecode('Contact+Us'),jdecode(''), jdecode('%2F10401.html'), 'true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Oblique';
theSitetree.paletteFamily='DD9390';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33311';
theSitetree.graphicsetId='14185';
theSitetree.contentColor='B83E3A';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'en',
  country: 'US'
};
var prodDef={
  wl_name: 'brinkster',
  product: 'WSCSYSSSSLYTCVUR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Oblique',
				paletteFamily: 	'DD9390',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33311',
				graphicsetId: 	'14185',
				contentColor: 	'B83E3A',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Palatino Linotype, Book Antiqua, Palatino, serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3801',
internalId:  '',
customField: '20111027-110758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3852',
internalId:  '',
customField: '20100202-131220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4801',
internalId:  '',
customField: '20100424-145841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4822',
internalId:  '',
customField: '20100203-181504'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4843',
internalId:  '',
customField: '20110901-173850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20110901-180047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10401',
internalId:  '',
customField: '20111117-100731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5043',
internalId:  '',
customField: '20111027-101248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20110320-235529'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24801',
internalId:  '',
customField: '20110422-212206'
};
var webAppHostname = 'wsc.brinkster.com:80';
var canonHostname = 'wsc1.brinkster.com';
var accountId     = 'ABR330INZ5GX';
var companyName   = 'Twin+Connection+Energy+Healing';
var htmlTitle	  = 'Twin+Connection+Energy+Healing+Inc.';
var metaKeywords  = 'Natural+healing%2C+alternative+healing%2C+Calgary+workshops%2C+teen+workshops%2C+Calgary%2C+energy+healing%2C+NOOKbook%2C+Kindle%2C+ebook%2C++healing+for+animals%2C+healing+touch%2C+PSYCH-K%2C+hypnotherapy%2C+Calgary+hypnotherapy%2C+registered+clinical+hypnotherapy%2C+healing%2C+healthy+alternatives%2C+teen%2C+Calgary+teen%2C+Jane+Berthiaume%2C+twin+connection+energy+healing%2C+teen+programs+calgary%2C+Calgary+teen+workshops%2C+healing+touch+for+animals%2C+healing+for+pets%2C+natural+healing+Calgary%2C+clinical+hypnotherapy+Calgary%2C+Calgary+hypnosis%2C+help+for+teens%2C+teen+help+Calgary%2C+teen+counselling%2C+Calgary+healing+touch+for+animals%2C+troubled+teens%2C+troubled+teens+Calgary%2C+retreats%2C+Calgary+retreats%2C+trouble+conceiving%2C+pregnancy+issues%2C+headache%2C+migraine%2C+surgery%2C+teen+books%2C+self-help+books%2C+self+help+book%2C+books+for+sale%2C+hypnosis%2C+reiki%2C+A+Teen+Guide+to+Smart+Choices%2Cfamily+training%2C+reiki+training+';
var metaContents  = 'Twin+Connection+Energy+Healing+is+a+company+based+out+of+Calgary+Alberta+Canada+that+provides+natural+healing+and+alternative+healing+modalities+such+as+Healing+Touch%2C+Healing+Touch+for+Animals%2C+Reiki%2C+PSYCH-K%2C+and+Hypnotherapy.++We+specialize+in+teen+programs+and+workshops+in+the+Calgary+area+and+provide+individual+sessions+to+anyone%2C+any+age+seeking+natural+healing.+';
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();
};

