/* [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','401',jdecode('Accueil'),jdecode(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','38201',jdecode('Nos+valeurs'),jdecode(''), jdecode('%2F38201.html'), 'true',[],'',''],
	['PAGE','38222',jdecode('Devenez+membre'),jdecode(''), jdecode('%2F38222.html'), 'true',[],'',''],
	['PAGE','70901',jdecode('Infos+aux+chanteurs'),jdecode(''), jdecode('%2F70901.html'), 'true',[],'',''],
	['PAGE','7101',jdecode('Organes%2FDir.%2FMembres%2F'),jdecode(''), jdecode('%2F7101%2Findex.html'), 'true',[ 
		['PAGE','104301',jdecode('Direction+musicale'),jdecode(''), jdecode('%2F7101%2F104301.html'), 'true',[],'',''],
		['PAGE','76001',jdecode('Membres+actifs'),jdecode(''), jdecode('%2F7101%2F76001.html'), 'true',[],'',''],
		['PAGE','50301',jdecode('Membres+d%26%23x27%3Bhonneur'),jdecode(''), jdecode('%2F7101%2F50301.html'), 'true',[],'','']
	],'',''],
	['PAGE','7122',jdecode('Programme+annuel+'),jdecode(''), jdecode('%2F7122.html'), 'true',[],'',''],
	['PAGE','7185',jdecode('News'),jdecode(''), jdecode('%2F7185.html'), 'true',[],'',''],
	['PAGE','7206',jdecode('Photos'),jdecode(''), jdecode('%2F7206.html'), 'true',[],'',''],
	['PAGE','7227',jdecode('Historique'),jdecode(''), jdecode('%2F7227%2Findex.html'), 'true',[ 
		['PAGE','7269',jdecode('Le+centi%C3%A8me'),jdecode(''), jdecode('%2F7227%2F7269.html'), 'true',[],'',''],
		['PAGE','15101',jdecode('Une+chorale+en+Valais'),jdecode(''), jdecode('%2F7227%2F15101.html'), 'true',[],'',''],
		['PAGE','31901',jdecode('Marche+Ste-C%C3%A9cile'),jdecode(''), jdecode('%2F7227%2F31901.html'), 'true',[],'',''],
		['PAGE','50322',jdecode('Anciens+Pr%C3%A9s.+et+Dir.'),jdecode(''), jdecode('%2F7227%2F50322.html'), 'true',[],'','']
	],'',''],
	['PAGE','53801',jdecode('Costume+et+Drapeau'),jdecode(''), jdecode('%2F53801.html'), 'true',[],'',''],
	['PAGE','7290',jdecode('CD-DVD-Livre'),jdecode(''), jdecode('%2F7290.html'), 'true',[],'',''],
	['PAGE','7353',jdecode('Liens'),jdecode(''), jdecode('%2F7353.html'), 'true',[],'',''],
	['PAGE','38906',jdecode('Livre+d%26%23x27%3Bor'),jdecode(''), jdecode('%2F38906%2Findex.html'), 'true',[ 
		['PAGE','38901',jdecode('Entr%C3%A9es'),jdecode(''), jdecode('%2F38906%2F38901.html'), 'false',[],'','']
	],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Speed';
theSitetree.paletteFamily='920000';
theSitetree.keyvisualId='2314';
theSitetree.keyvisualName='architect.jpg';
theSitetree.fontsetId='373';
theSitetree.graphicsetId='424';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='920000';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Speed',
				paletteFamily: 	'920000',
				keyvisualId: 	'2314',
				keyvisualName: 	'architect.jpg',
				fontsetId: 		'373',
				graphicsetId: 	'424',
				contentColor: 	'FFFFFF',
				contentBGColor: '920000',
				a_color: 		'920000',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-15954913']={
webappId:    '1501',
documentId:  '401',
internalId:  '15954913',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-38906abw0x0in2osf']={
webappId:    '1002',
documentId:  '38906',
internalId:  '38906abw0x0in2osf',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20111026-183925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38201',
internalId:  '',
customField: '20070901-222512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38222',
internalId:  '',
customField: '20070901-222830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70901',
internalId:  '',
customField: '20120125-221644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7101',
internalId:  '',
customField: '20111026-184518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104301',
internalId:  '',
customField: '20111026-181910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76001',
internalId:  '',
customField: '20111026-214830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50301',
internalId:  '',
customField: '20120123-202715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7122',
internalId:  '',
customField: '20110921-222111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7185',
internalId:  '',
customField: '20110901-051002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7206',
internalId:  '',
customField: '20110614-052847'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7227',
internalId:  '',
customField: '20100818-053339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7269',
internalId:  '',
customField: '20070902-001817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15101',
internalId:  '',
customField: '20070816-054925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31901',
internalId:  '',
customField: '20070813-225254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50322',
internalId:  '',
customField: '20110901-050023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53801',
internalId:  '',
customField: '20081207-220356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7290',
internalId:  '',
customField: '20090916-062331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7353',
internalId:  '',
customField: '20091015-044936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38906',
internalId:  '',
customField: '20070811-214014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38901',
internalId:  '',
customField: '20070811-214014'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN2OSF';
var companyName   = '+++++++++Choeur+Ste-C%C3%A9cile+de+Bramois';
var htmlTitle	  = '++++++++++Choeur+Mixte+Ste+C%C3%A9cile+de+Bramois';
var metaKeywords  = '';
var metaContents  = '';
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();
};

