/* [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','4434',jdecode('PAGE+D%26%23x27%3BACCUEIL'),jdecode(''),'/4434.html','true',[],'',''],
	['PAGE','4461',jdecode('stages+ART+GESTALT'),jdecode(''),'/4461/index.html','true',[ 
		['PAGE','4518',jdecode('MUSIQUE+%26+VOIX'),jdecode(''),'/4461/4518.html','true',[],'',''],
		['PAGE','4545',jdecode('ODYSSEE'),jdecode(''),'/4461/4545.html','true',[],'',''],
		['PAGE','242527',jdecode('IMPACTS'),jdecode(''),'/4461/242527.html','true',[],'',''],
		['PAGE','4572',jdecode('CELEBRATIONS'),jdecode(''),'/4461/4572.html','true',[],'',''],
		['PAGE','4599',jdecode('ARCANES'),jdecode(''),'/4461/4599.html','true',[],'',''],
		['PAGE','143002',jdecode('LEGENDES+MYTHIQUES'),jdecode(''),'/4461/143002.html','true',[],'','']
	],'',''],
	['PAGE','148402',jdecode('SUPERVISION'),jdecode(''),'/148402.html','true',[],'',''],
	['PAGE','4626',jdecode('AGENDA+%26+LIEUX'),jdecode(''),'/4626.html','true',[],'',''],
	['PAGE','4653',jdecode('TARIFS'),jdecode(''),'/4653.html','true',[],'',''],
	['PAGE','68685',jdecode('INSCRIPTIONS'),jdecode(''),'/68685.html','true',[],'',''],
	['PAGE','46115',jdecode('ANIMATION'),jdecode(''),'/46115.html','true',[],'',''],
	['PAGE','73264',jdecode('LA+GESTALT'),jdecode(''),'/73264.html','true',[],'',''],
	['PAGE','46142',jdecode('LIENS'),jdecode(''),'/46142.html','true',[],'',''],
	['PAGE','46169',jdecode('DIVERS'),jdecode(''),'/46169.html','true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Toronto';
theSitetree.paletteFamily='8756A7';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='16882';
theSitetree.graphicsetId='12320';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='8756A7';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Toronto',
				paletteFamily: 	'8756A7',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'16882',
				graphicsetId: 	'12320',
				contentColor: 	'FFFFFF',
				contentBGColor: '8756A7',
				a_color: 		'8756A7',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4434',
internalId:  '',
customField: '20100101-102626'
};
webappMappings['7008']=webappMappings['7008-3628']={
webappId:    '7008',
documentId:  '68685',
internalId:  '3628',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148402',
internalId:  '',
customField: '20091102-002021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4461',
internalId:  '',
customField: '20100101-102949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '242527',
internalId:  '',
customField: '20091202-223740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4518',
internalId:  '',
customField: '20091202-223712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4545',
internalId:  '',
customField: '20091202-223725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4572',
internalId:  '',
customField: '20091202-223753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4599',
internalId:  '',
customField: '20091202-223807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143002',
internalId:  '',
customField: '20091202-223824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4626',
internalId:  '',
customField: '20091119-140933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4653',
internalId:  '',
customField: '20100101-102654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68685',
internalId:  '',
customField: '20100101-102751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46115',
internalId:  '',
customField: '20100101-103151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73264',
internalId:  '',
customField: '20071031-215915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46142',
internalId:  '',
customField: '20100101-103239'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46169',
internalId:  '',
customField: '20091102-002246'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXEVJ';
var companyName   = 'Art+Gestalt';
var htmlTitle	  = 'Art+Gestalt';
var metaKeywords  = 'artgestalt%2C+art+gestalt%2C+artsgestalt%2C+arts+gestalt%2C+art+et+gestalt%2C+arts+et+gestalt%2C+mamie%2C+patrick+mamie%2C+Gestalt%2C+gestalt%2C+Gestalt-th%C3%A9rapie%2C+gestalt-th%C3%A9rapie%2C+art+th%C3%A9rapie%2C+art-th%C3%A9rapie%2C+art+et+th%C3%A9rapie%2C+art+gestalt+th%C3%A9rapie%2C+arts+gestalt+th%C3%A9rapie%2C+th%C3%A9rapie%2C+psychoth%C3%A9rapie%2C+voix%2C+stage+voix%2C+musique%2C+musique+et+voix%2C+odyss%C3%A9e%2C+impacts%2C+c%C3%A9l%C3%A9brations%2C+arcanes%2C+l%C3%A9gendes+mythiques%2C+th%C3%A9%C3%A2tre%2C+supervision%2C+supervision+Gestalt%2C+supervision+Gestalt-th%C3%A9rapie%2C+stages+d%C3%A9t%C3%A9%2C+stages+%C3%A0+th%C3%A8me%2C+hameau+de+lEtoile%2C+le+hameau+de+l%C3%A9toile%2C+accord%C3%A9on%2C+accord%C3%A9ons%2C+formation+musicale%2C+p%C3%A9dagogie+musicale%2C+solf%C3%A8ge%2C+progression%2C+progressions%2C+instrument%2C+rythme%2C+rythmes%2C+notes%2C+gamme%2C+gammes%2C+intervalle%2C+intervalles%2C+accord%2C+accords%2C+harmonie%2C+composition%2C+m%C3%A9thode+solf%C3%A8ge%2C+m%C3%A9thode+Willems%2C+epg%2C+cifp';
var metaContents  = 'art+gestalt+%3A+activit%C3%A9s+artistiques+et+th%C3%A9rapeutiques+de+Patrick+Mamie.+Stages+%C3%A0+th%C3%A8mes+alliant+Art+et+Gestalt-th%C3%A9rapie.+Supervision+pour+Gestalt-th%C3%A9rapeutes.+Solf%C3%A8ge.+Formation+musicale.+Chansons.';
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();
};
