/* [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','37407',jdecode('Programme+des+spectacles'),jdecode(''), jdecode('%2F37407.html'), 'true',[],'',''],
	['PAGE','401',jdecode('Qui+sommes-nous+%3F'),jdecode(''), jdecode('%2F401%2Findex.html'), 'true',[ 
		['PAGE','14201',jdecode('Califrenzies+%26+Comit%C3%A9'),jdecode(''), jdecode('%2F401%2F14201.html'), 'true',[],'',''],
		['PAGE','6701',jdecode('Les+Choristes'),jdecode(''), jdecode('%2F401%2F6701.html'), 'true',[],'','']
	],'',''],
	['PAGE','473',jdecode('Notre+r%C3%A9pertoire'),jdecode(''), jdecode('%2F473%2Findex.html'), 'true',[ 
		['PAGE','494',jdecode('Historique+'),jdecode(''), jdecode('%2F473%2F494.html'), 'true',[],'','']
	],'',''],
	['PAGE','32201',jdecode('Galerie+photos'),jdecode(''), jdecode('%2F32201.html'), 'true',[],'',''],
	['PAGE','32222',jdecode('Livre+d%26%23x27%3Bor'),jdecode(''), jdecode('%2F32222.html'), 'true',[],'',''],
	['PAGE','536',jdecode('O%C3%B9+nous+trouver+%3F'),jdecode(''), jdecode('%2F536.html'), 'true',[],'',''],
	['PAGE','515',jdecode('Contact'),jdecode(''), jdecode('%2F515.html'), 'true',[],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Blog';
theSitetree.paletteFamily='536BD3';
theSitetree.keyvisualId='11524';
theSitetree.keyvisualName='kv_11524.jpg';
theSitetree.fontsetId='32865';
theSitetree.graphicsetId='13950';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='989696';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Blog',
				paletteFamily: 	'536BD3',
				keyvisualId: 	'11524',
				keyvisualName: 	'kv_11524.jpg',
				fontsetId: 		'32865',
				graphicsetId: 	'13950',
				contentColor: 	'FFFFFF',
				contentBGColor: '989696',
				a_color: 		'FFE933',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '37407',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20110409-120823'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20110409-124001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14201',
internalId:  '',
customField: '20110409-122556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20110419-211333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20091126-211427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20110409-122306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20091126-205947'
};
webappMappings['7060']=webappMappings['7060-e3a3f5cdcc73c8d6b13393176e94fbfb']={
webappId:    '7060',
documentId:  '32201',
internalId:  'e3a3f5cdcc73c8d6b13393176e94fbfb',
customField: 'language:fr;country:FR;'
};
webappMappings['1002']=webappMappings['1002-32222abw0x0inejfe']={
webappId:    '1002',
documentId:  '32222',
internalId:  '32222abw0x0inejfe',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32201',
internalId:  '',
customField: '20090428-135509'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32222',
internalId:  '',
customField: '20090428-143829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37407',
internalId:  '',
customField: '20110419-210335'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INEJFE';
var companyName   = 'Chorale+des+Califrenzies';
var htmlTitle	  = '';
var metaKeywords  = 'califrenzies%2C+chorale+collonge-bellerive%2C+concert%2C+collonge-Bellerives%2C+chorale+Gen%EF%BF%BDve%2C+choeur+Gen%EF%BF%BDve%2C+starmania%2C+dalida%2C+carmina+burana%2C+victoria+hall';
var metaContents  = 'La+Chorale+des+Califrenzies+est+un+ensemble+mixte+bas%EF%BF%BD+en+Suisse+dans+le+Canton+de+Gen%EF%BF%BDve+%28Rive+Gauche%29+et+compos%EF%BF%BD+actuellement+dune+quarantaine+de+membres.+Notre+objectif+est+de+pratiquer+le+chant+en+g%EF%BF%BDn%EF%BF%BDral+pour+le+plaisir+et+dans+la+bonne+humeur.+Notre+prochain+spectacle+sera+consacr%EF%BF%BD+aux+Carmina+Burana.';
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();
};

