/* [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','17801',jdecode('Bienvenue'),jdecode(''),'/17801.html','true',[],'',''],
	['PAGE','18401',jdecode('Qui+suis-je+%3F'),jdecode(''),'/18401.html','true',[],'',''],
	['PAGE','19601',jdecode('Contact'),jdecode(''),'/19601.html','true',[],'',''],
	['PAGE','19122',jdecode('Mes+services'),jdecode(''),'/19122.html','true',[],'',''],
	['PAGE','18422',jdecode('PNL'),jdecode(''),'/18422.html','true',[],'',''],
	['PAGE','19101',jdecode('Hypnose'),jdecode(''),'/19101.html','true',[],'',''],
	['PAGE','19401',jdecode('S%C3%A9ance-Lieu-Prix'),jdecode(''),'/19401.html','true',[],'',''],
	['PAGE','31301',jdecode('T%C3%A9moignages'),jdecode(''),'/31301.html','true',[],'',''],
	['PAGE','19701',jdecode('Liens'),jdecode(''),'/19701.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Picture';
theSitetree.paletteFamily='E1E2FD';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10428';
theSitetree.graphicsetId='10753';
theSitetree.contentColor='4D3B17';
theSitetree.contentBGColor='E1E2FD';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Picture',
				paletteFamily: 	'E1E2FD',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10428',
				graphicsetId: 	'10753',
				contentColor: 	'4D3B17',
				contentBGColor: 'E1E2FD',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17801',
internalId:  '',
customField: '20091021-121010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18401',
internalId:  '',
customField: '20100312-153509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18422',
internalId:  '',
customField: '20090712-200604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19122',
internalId:  '',
customField: '20091014-211903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19401',
internalId:  '',
customField: '20100401-123242'
};
webappMappings['7008']=webappMappings['7008-5523']={
webappId:    '7008',
documentId:  '19601',
internalId:  '5523',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19601',
internalId:  '',
customField: '20091014-212358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19701',
internalId:  '',
customField: '20100425-143610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19101',
internalId:  '',
customField: '20090712-203211'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '17801',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-31301abw330ineo3g']={
webappId:    '1002',
documentId:  '31301',
internalId:  '31301abw330ineo3g',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31301',
internalId:  '',
customField: '20100108-215847'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW330INEO3G';
var companyName   = 'Z%C3%A9nitude+Hypno+Coaching';
var htmlTitle	  = '';
var metaKeywords  = 'PNL%2C+hypnose%2C+d%C3%A9veloppement+personnel%2C+coaching%2C+bien-%C3%AAtre%2C+zen%2C+pl%C3%A9nitude%2C+z%C3%A9nitude%2C+sandrine%2C+sandrine+jequier%2C+jequier%2C+renens%2C+lausanne%2C+perte+de+poids%2C+kilos%2C+anxi%C3%A9t%C3%A9%2C+peur%2C+maladie%2C+relaxation%2C+stress';
var metaContents  = 'Hypnose+coaching+PNL+Z%C3%A9nitude+D%C3%A9veloppement+personnel';
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();
};
