/* [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 theSitetree=[ 
	['PAGE','4520',jdecode('Bienvenu+%C3%A0+l%26%23x27%3BEscapade'),jdecode(''),'/4520.html','true',[],''],
	['PAGE','14339',jdecode('Notre+table+d%26%23x27%3Bh%C3%B4tes'),jdecode(''),'/14339.html','true',[],''],
	['PAGE','9201',jdecode('Isa+et+Jean-Mi'),jdecode(''),'/9201.html','true',[],''],
	['PAGE','28565',jdecode('Niouzes'),jdecode(''),'/28565.html','true',[],''],
	['PAGE','9255',jdecode('Menus%2C+Agenda+et+Prix'),jdecode(''),'/9255.html','true',[],''],
	['PAGE','52506',jdecode('Livre+d%26%23x27%3Bor'),jdecode(''),'/52506/index.html','true',[ 
		['PAGE','52501',jdecode('Entr%C3%A9es'),jdecode(''),'/52506/52501.html','false',[],'']
	],'']];
var siteelementCount=7;
theSitetree.topTemplateName='Sonnemond';
theSitetree.paletteFamily='F9FBBF';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10759';
theSitetree.graphicsetId='10816';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F9FBBF';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				name: 			'Sonnemond',
				paletteFamily: 	'F9FBBF',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10759',
				graphicsetId: 	'10816',
				contentColor: 	'000000',
				contentBGColor: 'F9FBBF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'5C5898',
				e_color: 		'ED4747',
				f_color: 		'437D3B',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4520',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14339',
internalId:  '',
customField: '20071101-185710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4520',
internalId:  '',
customField: '20081227-100146'
};
webappMappings['1002']=webappMappings['1002-52506abw0x0inxshx']={
webappId:    '1002',
documentId:  '52506',
internalId:  '52506abw0x0inxshx',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9201',
internalId:  '',
customField: '20070905-205202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28565',
internalId:  '',
customField: '20081227-100241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9255',
internalId:  '',
customField: '20081227-100524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52506',
internalId:  '',
customField: '20080619-174205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52501',
internalId:  '',
customField: '20080619-174205'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXSHX';
var companyName   = 'L%27Escapade%2C+table+d%27h%C3%B4te';
var htmlTitle	  = 'Escapade+table+d+h%C3%B4te';
var metaKeywords  = 'escapade+suisse++valais+table+chambres+chambre+hote+h%C3%B4te+cuisine+valais+val+h%C3%A9rens+herens+chasse+reiki+magnifique+vue+authentique+soign%C3%A9+repas+r%C3%A9servation+alpes+gastronomie+vacances+week-end+ferme+montagne';
var metaContents  = 'Situ%C3%A9+au+Coeur+des+Alpes+valaisannes%2C+%C3%A0+20+minutes+de+Sion.+Entre+Vex+et+Les+Collons%2C+tel+un+joyaux+dans+un+%C3%A9crin+aplestre+magnifique%2C+notre+table+dh%C3%B4te+vous+accueille+tous+les+soirs+de+l+ann%C3%A9e+pour+un+bon+repas+entre+amis+ou+en+famille.+Nous+vous+proposons+aussi+2+chambres+dh%C3%B4tes.';
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();
};
