/* [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','601',jdecode('Home'),jdecode(''),'/601.html','true',[],'',''],
	['PAGE','77401',jdecode('Description'),jdecode(''),'/77401.html','true',[],'',''],
	['PAGE','12601',jdecode('News+%2F+Agenda'),jdecode(''),'/12601.html','true',[],'',''],
	['PAGE','28701',jdecode('Nature'),jdecode(''),'/28701/index.html','true',[ 
		['PAGE','652',jdecode('Faune'),jdecode(''),'/28701/652.html','true',[],'',''],
		['PAGE','10901',jdecode('Paysages'),jdecode(''),'/28701/10901.html','true',[],'','']
	],'',''],
	['PAGE','95001',jdecode('Chevaux'),jdecode(''),'/95001/index.html','true',[ 
		['PAGE','85801',jdecode('Estivage'),jdecode(''),'/95001/85801.html','true',[],'',''],
		['PAGE','102101',jdecode('A+Vendre'),jdecode(''),'/95001/102101.html','true',[],'','']
	],'',''],
	['PAGE','28722',jdecode('Les+Alpages'),jdecode(''),'/28722/index.html','true',[ 
		['PAGE','715',jdecode('LaL%C3%A9'),jdecode(''),'/28722/715.html','true',[],'',''],
		['PAGE','29301',jdecode('Tsartsey'),jdecode(''),'/28722/29301.html','true',[],'',''],
		['PAGE','79101',jdecode('Bouzerou'),jdecode(''),'/28722/79101.html','true',[],'','']
	],'',''],
	['PAGE','694',jdecode('Buvette+de+LaL%C3%A9'),jdecode(''),'/694.html','true',[],'',''],
	['PAGE','63701',jdecode('Cabanes'),jdecode(''),'/63701.html','true',[],'',''],
	['PAGE','51801',jdecode('Webcam'),jdecode(''),'/51801.html','true',[],'',''],
	['PAGE','69601',jdecode('M%C3%A9t%C3%A9o'),jdecode(''),'/69601.html','true',[],'',''],
	['PAGE','57701',jdecode('Sondage'),jdecode(''),'/57701.html','true',[],'',''],
	['PAGE','49301',jdecode('Remerciements'),jdecode(''),'/49301.html','true',[],'',''],
	['PAGE','27806',jdecode('Livre+d%26%23x27%3Bor'),jdecode(''),'/27806/index.html','true',[ 
		['PAGE','27801',jdecode('Entr%C3%A9es'),jdecode(''),'/27806/27801.html','false',[],'','']
	],'',''],
	['PAGE','29801',jdecode('Liens'),jdecode(''),'/29801.html','true',[],'',''],
	['PAGE','76701',jdecode('Acc%C3%A8s'),jdecode(''),'/76701.html','true',[],'',''],
	['PAGE','77901',jdecode('Consignes'),jdecode(''),'/77901.html','true',[],'',''],
	['PAGE','6201',jdecode('Contact'),jdecode(''),'/6201.html','true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Holz';
theSitetree.paletteFamily='C239A1';
theSitetree.keyvisualId='8817';
theSitetree.keyvisualName='KV_03.swf';
theSitetree.fontsetId='17181';
theSitetree.graphicsetId='12652';
theSitetree.contentColor='CCCCCC';
theSitetree.contentBGColor='262626';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Holz',
				paletteFamily: 	'C239A1',
				keyvisualId: 	'8817',
				keyvisualName: 	'KV_03.swf',
				fontsetId: 		'17181',
				graphicsetId: 	'12652',
				contentColor: 	'CCCCCC',
				contentBGColor: '262626',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'C039A3',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '601',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-27806abw0x0in2suk']={
webappId:    '1002',
documentId:  '27806',
internalId:  '27806abw0x0in2suk',
customField: 'icq=false'
};
webappMappings['1501']=webappMappings['1501-14722881']={
webappId:    '1501',
documentId:  '601',
internalId:  '14722881',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-247']={
webappId:    '7008',
documentId:  '6201',
internalId:  '247',
customField: 'language:fr;country:FR;'
};
webappMappings['7005']=webappMappings['7005-37']={
webappId:    '7005',
documentId:  '12601',
internalId:  '37',
customField: 'language:fr;country:FR;'
};
webappMappings['7005']=webappMappings['7005-38']={
webappId:    '7005',
documentId:  '57701',
internalId:  '38',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '601',
internalId:  '',
customField: '20100816-225050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77401',
internalId:  '',
customField: '20081109-195927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12601',
internalId:  '',
customField: '20100706-062737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28701',
internalId:  '',
customField: '20081105-203145'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '652',
internalId:  '',
customField: '20090130-221131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20090130-221641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '694',
internalId:  '',
customField: '20100706-062812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63701',
internalId:  '',
customField: '20090310-213814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28722',
internalId:  '',
customField: '20090505-223038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '715',
internalId:  '',
customField: '20080217-162050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29301',
internalId:  '',
customField: '20090505-223219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79101',
internalId:  '',
customField: '20081109-202050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85801',
internalId:  '',
customField: '20100815-220742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51801',
internalId:  '',
customField: '20100816-181011'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69601',
internalId:  '',
customField: '20080605-231614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57701',
internalId:  '',
customField: '20080218-192236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49301',
internalId:  '',
customField: '20091117-211647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27806',
internalId:  '',
customField: '20070617-202408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27801',
internalId:  '',
customField: '20070617-202408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29801',
internalId:  '',
customField: '20090706-221521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76701',
internalId:  '',
customField: '20090505-225842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95001',
internalId:  '',
customField: '20100414-220538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102101',
internalId:  '',
customField: '20100418-192000'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77901',
internalId:  '',
customField: '20081109-201050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20081109-201233'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN2SUK';
var companyName   = 'Le+Vallon+de+R%C3%A9chy';
var htmlTitle	  = 'Site+internet+du+Vallon+de+R%C3%A9chy';
var metaKeywords  = 'vallon+de+r%3Fchy+vallon+de+rechy+vallon+bouzerou+lal%3F+LALE+vallon+de+rechy+vallon_de_r%3Fchy+biches+cerf+cerfs+biche+renards+f%3Fret+alpage+bouzerou+lal%3F+tsartsey+tzartzey+gille+favres+la+r%3Fche+g%3Fnisses+veau+vache+blaireau+chamois+cheuvreuil+broccard+neige+faune+flore+fleurs+edelweiss+fromage';
var metaContents  = 'Le+Vallon+de+R%3Fchy%2C+la+Faune%2C+la+Nature%2C+les+Paysages';
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();
};
