/* [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','71665',jdecode('Accueil'),jdecode(''), jdecode('%2F71665.html'), 'true',[],'',''],
	['PAGE','4596',jdecode('Pr%C3%A9sentation+du+Club'),jdecode(''), jdecode('%2F4596.html'), 'true',[],'',''],
	['PAGE','4680',jdecode('Derni%C3%A8res+Infos+'),jdecode(''), jdecode('%2F4680.html'), 'true',[],'',''],
	['PAGE','5401',jdecode('La+Cabane+du+Cunay'),jdecode(''), jdecode('%2F5401.html'), 'true',[],'',''],
	['PAGE','29805',jdecode('Agenda'),jdecode(''), jdecode('%2F29805.html'), 'true',[],'',''],
	['PAGE','23564',jdecode('Troph%C3%A9e+Vall%C3%A9e+Joux'),jdecode(''), jdecode('%2F23564%2Findex.html'), 'true',[ 
		['PAGE','23806',jdecode('R%C3%A9sultats'),jdecode(''), jdecode('%2F23564%2F23806.html'), 'true',[],'','']
	],'',''],
	['PAGE','4734',jdecode('Programme+Alpin'),jdecode(''), jdecode('%2F4734%2Findex.html'), 'true',[ 
		['PAGE','30063',jdecode('R%C3%A9sultats+Alpin'),jdecode(''), jdecode('%2F4734%2F30063.html'), 'true',[],'','']
	],'',''],
	['PAGE','4707',jdecode('Programme+Saut'),jdecode(''), jdecode('%2F4707%2Findex.html'), 'true',[ 
		['PAGE','30036',jdecode('R%C3%A9sultats+Saut'),jdecode(''), jdecode('%2F4707%2F30036.html'), 'true',[],'','']
	],'',''],
	['PAGE','4761',jdecode('Galerie+Photos'),jdecode(''), jdecode('%2F4761.html'), 'true',[],'',''],
	['PAGE','23328',jdecode('Liens'),jdecode(''), jdecode('%2F23328.html'), 'true',[],'',''],
	['PAGE','4788',jdecode('Comit%C3%A9'),jdecode(''), jdecode('%2F4788.html'), 'true',[],'',''],
	['PAGE','4815',jdecode('Contacts'),jdecode(''), jdecode('%2F4815.html'), 'true',[],'',''],
	['PAGE','27799',jdecode('Livre+d%26%23x27%3Bor'),jdecode(''), jdecode('%2F27799%2Findex.html'), 'true',[ 
		['PAGE','27800',jdecode('Entr%C3%A9es'),jdecode(''), jdecode('%2F27799%2F27800.html'), 'false',[],'','']
	],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Mosaic';
theSitetree.paletteFamily='9EB9E9';
theSitetree.keyvisualId='2595';
theSitetree.keyvisualName='ski.jpg';
theSitetree.fontsetId='10362';
theSitetree.graphicsetId='10517';
theSitetree.contentColor='234773';
theSitetree.contentBGColor='9EB9E9';
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: 			'Mosaic',
				paletteFamily: 	'9EB9E9',
				keyvisualId: 	'2595',
				keyvisualName: 	'ski.jpg',
				fontsetId: 		'10362',
				graphicsetId: 	'10517',
				contentColor: 	'234773',
				contentBGColor: '9EB9E9',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'D85161',
				e_color: 		'DAE4F0',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4596',
internalId:  '',
customField: '20101211-114535'
};
webappMappings['1002']=webappMappings['1002-27799ABW0X0INXSTX']={
webappId:    '1002',
documentId:  '27799',
internalId:  '27799ABW0X0INXSTX',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4680',
internalId:  '',
customField: '20110829-194049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71665',
internalId:  '',
customField: '20120126-185140'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '71665',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5401',
internalId:  '',
customField: '20120108-214031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29805',
internalId:  '',
customField: '20111222-192742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23564',
internalId:  '',
customField: '20111220-193043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23806',
internalId:  '',
customField: '20100220-192231'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4734',
internalId:  '',
customField: '20100303-073636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30063',
internalId:  '',
customField: '20100308-162856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4707',
internalId:  '',
customField: '20120123-232703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30036',
internalId:  '',
customField: '20120123-231805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4761',
internalId:  '',
customField: '20111203-120340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23328',
internalId:  '',
customField: '20081223-135053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4788',
internalId:  '',
customField: '20100610-180351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4815',
internalId:  '',
customField: '20110813-105940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27799',
internalId:  '',
customField: '20080222-214049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27800',
internalId:  '',
customField: '20051120-200323'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXSTX';
var companyName   = 'Ski-Club+Le+Brassus';
var htmlTitle	  = 'Ski-Club+Le+Brassus';
var metaKeywords  = 'Ski+club%3B+Ski+club+le+brassus%3B+SCB%3B+SC+Le+Brassus%3B+La+Vall%C3%A9e+de+Joux%3B+sport%3B+alpin%3B+saut%3B+dormir+en+cabane%3B++%C3%A9tape%3B+Refuge%3B+Grand+Cunay%3B+Cabane+du+grand+cunay%3B+Marchairuz%3B+Mont+tendre%3B+cr%C3%AAtes+du+jura%3B+Mont+de+Bierre%3B+Randonn%C3%A9e%3B+VTT%3B+%C3%A0+voir';
var metaContents  = 'Ski-Club%3B+Le+Brassus%3B+La+Vall%C3%A9e+de+Joux%3B+Sport%3B+ski+alpin%3B+Saut+%C3%A0+skis%3B+dormir+en+cabane%3B%C3%A9tape%3B';
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();
};

