/* [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','301',jdecode('Home'),jdecode(''),'/301.html','true',[],''],
	['PAGE','4822',jdecode('Soins+et+techniques'),jdecode(''),'/4822/index.html','true',[ 
		['PAGE','4843',jdecode('Coaching+et+soins'),jdecode(''),'/4822/4843.html','true',[],''],
		['PAGE','4864',jdecode('Kin%C3%A9siologie'),jdecode(''),'/4822/4864.html','true',[],''],
		['PAGE','4885',jdecode('Th%C3%A9rapies+du+corps'),jdecode(''),'/4822/4885.html','true',[],'']
	],''],
	['PAGE','36201',jdecode('Run%26%23x27%3BUP'),jdecode(''),'/36201.html','true',[],''],
	['PAGE','25701',jdecode('Tarifs+et+assurances'),jdecode(''),'/25701.html','true',[],''],
	['PAGE','25722',jdecode('Contact'),jdecode(''),'/25722.html','true',[],'']];
var siteelementCount=8;
theSitetree.topTemplateName='Seasons_summer';
theSitetree.paletteFamily='FFE185';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='21092';
theSitetree.graphicsetId='13192';
theSitetree.contentColor='2E2E2E';
theSitetree.contentBGColor='FFE185';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				name: 			'Seasons_summer',
				paletteFamily: 	'FFE185',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'21092',
				graphicsetId: 	'13192',
				contentColor: 	'2E2E2E',
				contentBGColor: 'FFE185',
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20090313-121610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4822',
internalId:  '',
customField: '20090618-115726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4843',
internalId:  '',
customField: '20090313-121745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4864',
internalId:  '',
customField: '20090503-181714'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4885',
internalId:  '',
customField: '20090618-120103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36201',
internalId:  '',
customField: '20090318-162051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25701',
internalId:  '',
customField: '20090313-123458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25722',
internalId:  '',
customField: '20090313-123624'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INEM45';
var companyName   = 'MAIN+DANS+LA+MAIN+-+Cathia+Meyer';
var htmlTitle	  = 'Main+dans+la+Main%2C+Cathia+Meyer%2C+kin%C3%A9siologie+et+soins+naturels';
var metaKeywords  = 'main+dans+la+main%2Ccoaching%2Ckinesiologie%2Cmassages%2Cdrainage+lymphatique%2Creflexologie%2Ccabinet+de+soins+naturels%2CMonthey%2CBlonay%2CCathia+Meyer%2Cpierres+chaudes%2Cmetamorphique%2C';
var metaContents  = 'Main+dans+la+Main%2C+Cathia+Meyer%2C+Kin%C3%A9siologie+et+soins+naturels+';
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();
};
