/* [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','5201',jdecode('Page+d%26%23x27%3Baccueil'),jdecode(''),'/5201.html','true',[],'',''],
	['PAGE','6701',jdecode('Hypnose+protocolaire'),jdecode(''),'/6701.html','true',[],'',''],
	['PAGE','7401',jdecode('Qui+sommes-nous+%3F'),jdecode(''),'/7401.html','true',[],'',''],
	['PAGE','10501',jdecode('Contact'),jdecode(''),'/10501.html','true',[],'',''],
	['PAGE','5252',jdecode('Conf%C3%A9rences'),jdecode(''),'/5252.html','true',[],'',''],
	['PAGE','5273',jdecode('Formation+2'),jdecode(''),'/5273.html','false',[],'',''],
	['PAGE','25201',jdecode('Formation'),jdecode(''),'/25201.html','true',[],'',''],
	['PAGE','12201',jdecode('Th%C3%A9rapeutes+agr%C3%A9%C3%A9s'),jdecode(''),'/12201.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Architekt';
theSitetree.paletteFamily='A95C61';
theSitetree.keyvisualId='2055';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='301';
theSitetree.graphicsetId='345';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='A95C61';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Architekt',
				paletteFamily: 	'A95C61',
				keyvisualId: 	'2055',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'301',
				graphicsetId: 	'345',
				contentColor: 	'000000',
				contentBGColor: 'A95C61',
				a_color: 		'A95C61',
				b_color: 		'7F162D',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20100318-204928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5252',
internalId:  '',
customField: '20100221-195905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5273',
internalId:  '',
customField: '20100426-092030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12201',
internalId:  '',
customField: '20100725-115053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20100318-205208'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20100307-134554'
};
webappMappings['7008']=webappMappings['7008-8446']={
webappId:    '7008',
documentId:  '10501',
internalId:  '8446',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20091223-155000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25201',
internalId:  '',
customField: '20100725-142252'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INERZY';
var companyName   = 'Institut+d%27Hypnose+Protocolaire+%C2%A9';
var htmlTitle	  = '';
var metaKeywords  = 'hypnose%2C+protocolaire%2C+Geneve%2C+formation%2C+cours%2C+institut%2C+Gen%C3%A8ve%2C+';
var metaContents  = 'L%27hypnose+protocolaire+utilise+des+protocoles+th%C3%A9rapeutiques+bien+d%C3%A9finis+permettant+au+patient+de+prendre+une+part+active%2C+et+non+passive%2C+%C3%A0+sa+gu%C3%A9rison.+Elle+est+compose+d%27un+ensemble+de+protocoles+%2826+protocoles+nomm%C3%A9s+Alphabet+protocolaire%29+permettant+au+patient+d%27utiliser+toutes+ses+ressources%2C+conscientes+et+inconscientes+dans+le+cadre+d%27une+probl%C3%A9matique+donn%C3%A9e+ou+d%27une+%C3%A9volution+souhait%C3%A9e.+Chacun+de+ces+protocoles+sera+choisi+par+le+th%C3%A9rapeute+en+fonction+du+trouble+%C3%A0+soigner+et+devra+s%27adapter+au+ressenti+de+chaque+patient.+Le+th%C3%A9rapeute+ne+d%C3%A9passera+pas+quatre+protocoles+par+s%C3%A9ance.%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0Ahypnose+protocolaire';
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();
};
