/* [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','409001',jdecode('Page+d%26%23x27%3B+accueil'),jdecode(''),'/409001.html','true',[],'',''],
	['PAGE','517901',jdecode('Le+Pafuet'),jdecode(''),'/517901/index.html','true',[ 
		['PAGE','518001',jdecode('La+salle'),jdecode(''),'/517901/518001.html','true',[],'',''],
		['PAGE','518101',jdecode('Agenda'),jdecode(''),'/517901/518101.html','true',[],'','']
	],'',''],
	['PAGE','519201',jdecode('Porsel'),jdecode(''),'/519201/index.html','true',[ 
		['PAGE','519301',jdecode('Agenda'),jdecode(''),'/519201/519301.html','true',[],'','']
	],'',''],
	['PAGE','521001',jdecode('Bals++divers'),jdecode(''),'/521001.html','true',[],'',''],
	['PAGE','521022',jdecode('Innerberg'),jdecode(''),'/521022.html','true',[],'',''],
	['PAGE','413201',jdecode('Calimeros'),jdecode(''),'/413201.html','true',[],'',''],
	['PAGE','413601',jdecode('Alpinvagabunden'),jdecode(''),'/413601.html','true',[],'',''],
	['PAGE','417401',jdecode('Trio+Dimension'),jdecode(''),'/417401.html','true',[],'',''],
	['PAGE','417443',jdecode('Orchestre+Soleil'),jdecode(''),'/417443.html','true',[],'',''],
	['PAGE','498601',jdecode('Trio++Sunkings'),jdecode(''),'/498601.html','true',[],'',''],
	['PAGE','414501',jdecode('Alpentaler'),jdecode(''),'/414501.html','true',[],'',''],
	['PAGE','442501',jdecode('Swiiss-Walkers+'),jdecode(''),'/442501.html','true',[],'',''],
	['PAGE','487301',jdecode('Alain+Morisod'),jdecode(''),'/487301.html','true',[],'',''],
	['PAGE','420201',jdecode('Duo+fanatic'),jdecode(''),'/420201.html','true',[],'',''],
	['PAGE','420222',jdecode('R%C3%BCdis+Oberkrainer'),jdecode(''),'/420222.html','true',[],'',''],
	['PAGE','417464',jdecode('Duo+les+Gal%C3%A9riens'),jdecode(''),'/417464.html','true',[],'',''],
	['PAGE','443801',jdecode('Duo+Tropicana'),jdecode(''),'/443801.html','true',[],'',''],
	['PAGE','452301',jdecode('Duo++Sunshine'),jdecode(''),'/452301.html','true',[],'',''],
	['PAGE','421501',jdecode('Duo+Jo+P%C3%A9pino'),jdecode(''),'/421501.html','true',[],'',''],
	['PAGE','458801',jdecode('Pierre++Musique'),jdecode(''),'/458801.html','true',[],'',''],
	['PAGE','460401',jdecode('Jean+Pierre+Long'),jdecode(''),'/460401.html','true',[],'',''],
	['PAGE','462101',jdecode('Solo+Evasion'),jdecode(''),'/462101.html','true',[],'',''],
	['PAGE','506601',jdecode('Francis++Lachat'),jdecode(''),'/506601.html','true',[],'',''],
	['PAGE','462122',jdecode('Solo+M%C3%A9mory'),jdecode(''),'/462122.html','true',[],'',''],
	['PAGE','483201',jdecode('Gilbert++Kolly'),jdecode(''),'/483201.html','true',[],'',''],
	['PAGE','417485',jdecode('Divers+Solos'),jdecode(''),'/417485.html','true',[],'',''],
	['PAGE','468601',jdecode('Souvenir+du+Colorado'),jdecode(''),'/468601.html','true',[],'',''],
	['PAGE','410422',jdecode('Liens+Divers'),jdecode(''),'/410422.html','true',[],'',''],
	['PAGE','410601',jdecode('Sondage'),jdecode(''),'/410601.html','true',[],'',''],
	['PAGE','410701',jdecode('Forum'),jdecode(''),'/410701.html','true',[],'',''],
	['PAGE','410722',jdecode('Contact'),jdecode(''),'/410722.html','true',[],'',''],
	['PAGE','410743',jdecode('Livre+d%26%23x27%3Bor'),jdecode(''),'/410743.html','true',[],'','']];
var siteelementCount=35;
theSitetree.topTemplateName='Draft';
theSitetree.paletteFamily='2D50A1';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10399';
theSitetree.graphicsetId='10611';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='2D50A1';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Draft',
				paletteFamily: 	'2D50A1',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10399',
				graphicsetId: 	'10611',
				contentColor: 	'FFFFFF',
				contentBGColor: '2D50A1',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'D09868',
				e_color: 		'9E9E9F',
				f_color: 		'051E56',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '506601',
internalId:  '',
customField: '20100226-141436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '409001',
internalId:  '',
customField: '20100704-171005'
};
webappMappings['1501']=webappMappings['1501-21481296']={
webappId:    '1501',
documentId:  '409001',
internalId:  '21481296',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '409001',
internalId:  '1006',
customField: '1006'
};
webappMappings['7005']=webappMappings['7005-384']={
webappId:    '7005',
documentId:  '410601',
internalId:  '384',
customField: 'language:fr;country:FR;'
};
webappMappings['1003']=webappMappings['1003-abw1x0inewve122b261cc65']={
webappId:    '1003',
documentId:  '410701',
internalId:  'abw1x0inewve122b261cc65',
customField: 'fr:FR'
};
webappMappings['7008']=webappMappings['7008-6734']={
webappId:    '7008',
documentId:  '410722',
internalId:  '6734',
customField: 'language:fr;country:FR;'
};
webappMappings['1002']=webappMappings['1002-410743abw1x0inewve']={
webappId:    '1002',
documentId:  '410743',
internalId:  '410743abw1x0inewve',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '519301',
internalId:  '',
customField: '20100720-181853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '519201',
internalId:  '',
customField: '20100704-163629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '498601',
internalId:  '',
customField: '20100117-172055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '518001',
internalId:  '',
customField: '20100604-175840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '518101',
internalId:  '',
customField: '20100720-182848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452301',
internalId:  '',
customField: '20091024-150529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '413601',
internalId:  '',
customField: '20090726-215244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '413201',
internalId:  '',
customField: '20090727-005648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '414501',
internalId:  '',
customField: '20100604-174449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '420201',
internalId:  '',
customField: '20091116-195543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '417464',
internalId:  '',
customField: '20091024-143245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '417401',
internalId:  '',
customField: '20090726-231453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '483201',
internalId:  '',
customField: '20100402-125113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '417443',
internalId:  '',
customField: '20091207-101411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '417485',
internalId:  '',
customField: '20091116-200939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '420222',
internalId:  '',
customField: '20090727-013347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '442501',
internalId:  '',
customField: '20090928-111604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '421501',
internalId:  '',
customField: '20090729-154157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '410422',
internalId:  '',
customField: '20100704-181530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '410601',
internalId:  '',
customField: '20100425-195930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '410701',
internalId:  '',
customField: '20091123-204715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '410722',
internalId:  '',
customField: '20090818-151628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '410743',
internalId:  '',
customField: '20100331-230502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '443801',
internalId:  '',
customField: '20090927-130403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '458801',
internalId:  '',
customField: '20091030-150014'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '460401',
internalId:  '',
customField: '20091207-103535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '462101',
internalId:  '',
customField: '20100117-171417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '462122',
internalId:  '',
customField: '20100402-125019'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '468601',
internalId:  '',
customField: '20100604-174259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '487301',
internalId:  '',
customField: '20091112-215903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '521001',
internalId:  '',
customField: '20100720-192125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '521022',
internalId:  '',
customField: '20100704-174252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '517901',
internalId:  '',
customField: '20100605-161149'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW1X0INEWVE';
var companyName   = 'MUSIKDANCE';
var htmlTitle	  = 'http.%2F%2Fwww.musikdance.ch';
var metaKeywords  = 'Notre+vie+en+musique';
var metaContents  = 'http%3A%2F%2Fwww.musikdance.ch++Danse+pour+tous++dans+les+bals+et+dancings+de+suisse+romande++et+Canton+de+Berne';
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();
};
