/* [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(''), jdecode('%2F4434.html'), 'true',[],'',''],
	['PAGE','4461',jdecode('STAGES+2012'),jdecode(''), jdecode('%2F4461%2Findex.html'), 'true',[ 
		['PAGE','4518',jdecode('MUSIQUE+%26+VOIX'),jdecode(''), jdecode('%2F4461%2F4518.html'), 'true',[],'',''],
		['PAGE','4545',jdecode('ODYSSEE'),jdecode(''), jdecode('%2F4461%2F4545.html'), 'true',[],'',''],
		['PAGE','242527',jdecode('IMPACTS'),jdecode(''), jdecode('%2F4461%2F242527.html'), 'true',[],'',''],
		['PAGE','4572',jdecode('CELEBRATIONS'),jdecode(''), jdecode('%2F4461%2F4572.html'), 'true',[],'',''],
		['PAGE','4599',jdecode('ARCANES'),jdecode(''), jdecode('%2F4461%2F4599.html'), 'true',[],'',''],
		['PAGE','143002',jdecode('GESTALT+%26++MYTHES'),jdecode(''), jdecode('%2F4461%2F143002.html'), 'true',[],'','']
	],'',''],
	['PAGE','148402',jdecode('SUPERVISION'),jdecode(''), jdecode('%2F148402.html'), 'true',[],'',''],
	['PAGE','4626',jdecode('AGENDA+%26+LIEUX'),jdecode(''), jdecode('%2F4626.html'), 'true',[],'',''],
	['PAGE','4653',jdecode('TARIFS'),jdecode(''), jdecode('%2F4653.html'), 'true',[],'',''],
	['PAGE','68685',jdecode('INSCRIPTIONS'),jdecode(''), jdecode('%2F68685.html'), 'true',[],'',''],
	['PAGE','46115',jdecode('ANIMATION'),jdecode(''), jdecode('%2F46115.html'), 'true',[],'',''],
	['PAGE','246509',jdecode('TEMOIGNAGES'),jdecode(''), jdecode('%2F246509.html'), 'true',[],'',''],
	['PAGE','73264',jdecode('LA+GESTALT'),jdecode(''), jdecode('%2F73264.html'), 'true',[],'',''],
	['PAGE','46142',jdecode('LIENS'),jdecode(''), jdecode('%2F46142.html'), 'true',[],'',''],
	['PAGE','46169',jdecode('DIVERS'),jdecode(''), jdecode('%2F46169.html'), 'true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Theater';
theSitetree.paletteFamily='000003';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10503';
theSitetree.graphicsetId='11140';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Theater',
				paletteFamily: 	'000003',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10503',
				graphicsetId: 	'11140',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'680C0C',
				e_color: 		'680C0C',
				f_color: 		'680C0C',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4434',
internalId:  '',
customField: '20120113-114949'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4434',
internalId:  '1006',
customField: '1006'
};
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: '20111219-224138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4461',
internalId:  '',
customField: '20100909-095927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '242527',
internalId:  '',
customField: '20110913-131518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4518',
internalId:  '',
customField: '20110902-132832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4545',
internalId:  '',
customField: '20120113-115734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4572',
internalId:  '',
customField: '20110902-140508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4599',
internalId:  '',
customField: '20110904-232817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143002',
internalId:  '',
customField: '20110902-141015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4626',
internalId:  '',
customField: '20111004-104622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4653',
internalId:  '',
customField: '20111121-213319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68685',
internalId:  '',
customField: '20110917-094535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46115',
internalId:  '',
customField: '20111030-012703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73264',
internalId:  '',
customField: '20110901-201539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46142',
internalId:  '',
customField: '20111222-200437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46169',
internalId:  '',
customField: '20110829-130859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '246509',
internalId:  '',
customField: '20110915-174659'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
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();
};

