/* [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','4529',jdecode('Bienvenue'),jdecode(''), jdecode('%2F4529.html'), 'true',[],'',''],
	['PAGE','4667',jdecode('Communiqu%C3%A9s'),jdecode(''), jdecode('%2F4667.html'), 'true',[],'',''],
	['PAGE','57501',jdecode('Ch%C3%A2telat+Media'),jdecode(''), jdecode('%2F57501.html'), 'true',[],'',''],
	['PAGE','4586',jdecode('Pr%C3%A9sentation'),jdecode(''), jdecode('%2F4586%2Findex.html'), 'true',[ 
		['PAGE','11223',jdecode('Situation'),jdecode(''), jdecode('%2F4586%2F11223.html'), 'true',[],'',''],
		['PAGE','11250',jdecode('Population'),jdecode(''), jdecode('%2F4586%2F11250.html'), 'true',[],'',''],
		['PAGE','11277',jdecode('Armoiries'),jdecode(''), jdecode('%2F4586%2F11277.html'), 'true',[],'',''],
		['PAGE','11304',jdecode('Histoire'),jdecode(''), jdecode('%2F4586%2F11304.html'), 'true',[],'',''],
		['PAGE','27764',jdecode('Com.+mennonite'),jdecode(''), jdecode('%2F4586%2F27764.html'), 'true',[],'',''],
		['PAGE','46801',jdecode('La+course+en+famille'),jdecode(''), jdecode('%2F4586%2F46801.html'), 'true',[],'','']
	],'',''],
	['PAGE','4613',jdecode('Autorit%C3%A9s'),jdecode(''), jdecode('%2F4613.html'), 'true',[],'',''],
	['PAGE','4640',jdecode('Administration'),jdecode(''), jdecode('%2F4640%2Findex.html'), 'true',[ 
		['PAGE','6525',jdecode('Secr%C3%A9tariat'),jdecode(''), jdecode('%2F4640%2F6525.html'), 'true',[],'',''],
		['PAGE','6552',jdecode('Finances'),jdecode(''), jdecode('%2F4640%2F6552.html'), 'true',[],'',''],
		['PAGE','6579',jdecode('Office+AVS'),jdecode(''), jdecode('%2F4640%2F6579.html'), 'true',[],'',''],
		['PAGE','12382',jdecode('Autres+services'),jdecode(''), jdecode('%2F4640%2F12382.html'), 'true',[],'','']
	],'',''],
	['PAGE','48901',jdecode('R%C3%A8glements'),jdecode(''), jdecode('%2F48901.html'), 'true',[],'',''],
	['PAGE','4694',jdecode('Ecoles'),jdecode(''), jdecode('%2F4694.html'), 'true',[],'',''],
	['PAGE','23650',jdecode('Zone+%C3%A0+b%C3%A2tir'),jdecode(''), jdecode('%2F23650.html'), 'true',[],'',''],
	['PAGE','15834',jdecode('Bonnes+adresses'),jdecode(''), jdecode('%2F15834.html'), 'true',[],'',''],
	['PAGE','4721',jdecode('Liens'),jdecode(''), jdecode('%2F4721.html'), 'true',[],'',''],
	['PAGE','6619',jdecode('Livre+d%26%23x27%3Bor'),jdecode(''), jdecode('%2F6619%2Findex.html'), 'true',[ 
		['PAGE','6620',jdecode('Entr%C3%A9es'),jdecode(''), jdecode('%2F6619%2F6620.html'), 'false',[],'','']
	],'',''],
	['PAGE','31012',jdecode('Nous+trouver+%3F'),jdecode(''), jdecode('%2F31012.html'), 'true',[],'',''],
	['PAGE','15915',jdecode('Plan+du+site'),jdecode(''), jdecode('%2F15915.html'), 'true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='cutout';
theSitetree.paletteFamily='F0F1D8';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10611';
theSitetree.graphicsetId='10473';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
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: 			'cutout',
				paletteFamily: 	'F0F1D8',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10611',
				graphicsetId: 	'10473',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4640',
internalId:  '',
customField: '20110913-191630'
};
webappMappings['1002']=webappMappings['1002-6619ABW0X0INXZIY']={
webappId:    '1002',
documentId:  '6619',
internalId:  '6619ABW0X0INXZIY',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4529',
internalId:  '',
customField: '20120122-162957'
};
webappMappings['1501']=webappMappings['1501-2603475']={
webappId:    '1501',
documentId:  '4529',
internalId:  '2603475',
customField: '1501'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '31012',
internalId:  'routing',
customField: 'fr_FR'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4667',
internalId:  '',
customField: '20120122-165937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4586',
internalId:  '',
customField: '20101209-233455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11223',
internalId:  '',
customField: '20050531-151153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11250',
internalId:  '',
customField: '20110215-142100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11277',
internalId:  '',
customField: '20110215-142343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11304',
internalId:  '',
customField: '20100125-160724'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27764',
internalId:  '',
customField: '20101206-150417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4613',
internalId:  '',
customField: '20110210-101438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6525',
internalId:  '',
customField: '20090125-203953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6552',
internalId:  '',
customField: '20110829-142117'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6579',
internalId:  '',
customField: '20110202-092303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12382',
internalId:  '',
customField: '20120122-165327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4694',
internalId:  '',
customField: '20110829-142020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23650',
internalId:  '',
customField: '20080430-113207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15834',
internalId:  '',
customField: '20101228-130805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4721',
internalId:  '',
customField: '20110829-141941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6619',
internalId:  '',
customField: '20050815-140314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6620',
internalId:  '',
customField: '20050410-115833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31012',
internalId:  '',
customField: '20070420-154632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15915',
internalId:  '',
customField: '20051203-115623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57501',
internalId:  '',
customField: '20110717-120422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46801',
internalId:  '',
customField: '20091004-120157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48901',
internalId:  '',
customField: '20110316-171956'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXZIY';
var companyName   = '';
var htmlTitle	  = 'SITE+OFFICIEL+DE+LA+COMMUNE+MIXTE+DE+CHATELAT';
var metaKeywords  = 'chatelat%2C+ch%EF%BF%BDtelat%2C+commune%2C+moron%2C+fornet-dessous%2C+jura+bernois%2C+berne%2C+suisse%2C+conseil+communal%2C+assembl%EF%BF%BDe+communale%2C+administration%2C+armoiries%2C+fontaine%2C+home%2C+amstutz%2C+loosli%2C+juillerat%2C+bernard%2C+t%EF%BF%BDte-de-moine%2C+lerch%2C+jura+bernois+tourisme%2C+secr%EF%BF%BDtariat+communal%2C+office+AVS%2C+caisse+de+compensation%2C+news%2C+mas+du+sapin%2C+restaurant%2C+fromagerie%2C+bio%2C+vin+de+fraise+bois+de+ch%C3%A2telat%2C+vital+bandelier%2C+pu%C3%A9riculture%2C+%C3%A9coute%2C+courtine%2C+petit-val%2C+agence+AVS';
var metaContents  = 'chatelat%2C+chatelat%2C+commune%2C+moron%2C+fornet-dessous%2C+jura+bernois%2C+berne%2C+suisse%2C+conseil+communal%2C+assemblee+communale%2C+administration%2C+armoiries%2C+fontaine%2C+home%2C+amstutz%2C+loosli%2C+juillerat%2C+bernard%2C+tete-de-moine%2C+lerch%2C+jura+bernois+tourisme%2C+secretariat+communal%2Coffice+AVS%2C+caisse+de+compensation%2C+news%2C+mas+du+sapin%2C+restaurant%2C+hofer%2C+allemand%2C+caisse%2C+fromagerie%2C+bio%2C+vin+de+fraise%2C+hebergement%2C+zone+a+batir%2C+loosli%2C+auberge+ours%2C+souboz%2C+sornetan%2C+saicourt%0D%0Abois+de+ch%C3%A2telat%2C+vital+bandelier%2C+pu%C3%A9riculture%2C+%C3%A9coute%2C+courtine%2C+petit-val%2C+agence+AVS';
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();
};

