/* [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','4595',jdecode('Page+d%26%23x27%3Baccueil'),jdecode(''),'/4595.html','true',[],'',''],
	['PAGE','49655',jdecode('Le+gardien'),jdecode(''),'/49655.html','true',[],'',''],
	['PAGE','34078',jdecode('Nos+activit%C3%A9s%2C+nos+animaux'),jdecode(''),'/34078.html','true',[],'',''],
	['PAGE','20149',jdecode('Nos+soir%C3%A9es+%C3%A0+th%C3%A8mes'),jdecode(''),'/20149.html','true',[],'',''],
	['PAGE','49370',jdecode('Couvert+et+sp%C3%A9cialit%C3%A9s'),jdecode(''),'/49370.html','true',[],'',''],
	['PAGE','49182',jdecode('Dortoir'),jdecode(''),'/49182.html','true',[],'',''],
	['PAGE','49258',jdecode('yourtes'),jdecode(''),'/49258.html','true',[],'',''],
	['PAGE','49173',jdecode('Paille'),jdecode(''),'/49173.html','true',[],'',''],
	['PAGE','47266',jdecode('Tarifs'),jdecode(''),'/47266.html','true',[],'',''],
	['PAGE','45918',jdecode('Contact+et+lien'),jdecode(''),'/45918.html','true',[],'',''],
	['PAGE','51354',jdecode('Plan+d%26%23x27%3Bacces'),jdecode(''),'/51354.html','true',[],'',''],
	['PAGE','49741',jdecode('Tour+des+Muverans'),jdecode(''),'/49741.html','true',[],'',''],
	['PAGE','50118',jdecode('Autres+randonn%C3%A9es+'),jdecode(''),'/50118.html','true',[],'',''],
	['PAGE','62801',jdecode('%22Entre+ciel+et+terre%22'),jdecode(''),'/62801.html','true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Icon';
theSitetree.paletteFamily='848ABC';
theSitetree.keyvisualId='3432';
theSitetree.keyvisualName='kv_3432.jpg';
theSitetree.fontsetId='10650';
theSitetree.graphicsetId='10743';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='A3A8CD';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Icon',
				paletteFamily: 	'848ABC',
				keyvisualId: 	'3432',
				keyvisualName: 	'kv_3432.jpg',
				fontsetId: 		'10650',
				graphicsetId: 	'10743',
				contentColor: 	'FFFFFF',
				contentBGColor: 'A3A8CD',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4595',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49655',
internalId:  '',
customField: '20100710-164327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4595',
internalId:  '',
customField: '20100713-210606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34078',
internalId:  '',
customField: '20100710-165104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20149',
internalId:  '',
customField: '20100713-211120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49370',
internalId:  '',
customField: '20100713-210628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49182',
internalId:  '',
customField: '20100710-165935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49258',
internalId:  '',
customField: '20100710-170006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49173',
internalId:  '',
customField: '20100710-170028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47266',
internalId:  '',
customField: '20090616-100516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45918',
internalId:  '',
customField: '20100711-185448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51354',
internalId:  '',
customField: '20100710-172337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49741',
internalId:  '',
customField: '20091113-110549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50118',
internalId:  '',
customField: '20091113-110809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62801',
internalId:  '',
customField: '20100706-141708'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INX3WT';
var companyName   = 'Alpage+de+la+Vare++++++++++++++++++++';
var htmlTitle	  = 'Bienvenue+%C3%A0+lAlpage+de+La+Vare';
var metaKeywords  = 'Pont+de+nant%2C+anzeinde%2C+plan+n%C3%A9v%C3%A9%2C+randonn%C3%A9e%2C+refuge%2C+restauration%2C+dortoir%2C+cabane%2C+gite+d%C3%A9tapes%2C+derborance%2C+yourte%2C+tente+c%C3%A9r%C3%A9monie+mongole%2C+Bex%2C+cr%C3%AApes+bretonnes%2C+cidre+breton.';
var metaContents  = 'Bienvenue+%C3%A0+l+alpage+de+La+Vare+%C3%A0+1h30+de+marche+de+Pont+de+Nant+ou+de+Anzeinde';
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();
};
