/* [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','4455',jdecode('Accueil'),jdecode(''), jdecode('%2F4455.html'), 'true',[],'',''],
	['PAGE','9503',jdecode('Pr%C3%A9sentation+%26+Situation'),jdecode(''), jdecode('%2F9503.html'), 'true',[],'',''],
	['PAGE','8974',jdecode('Menus+pour+banquets'),jdecode(''), jdecode('%2F8974.html'), 'true',[],'',''],
	['PAGE','23647',jdecode('Visitez+notre+r%C3%A9gion+%21'),jdecode(''), jdecode('%2F23647.html'), 'true',[],'',''],
	['PAGE','27719',jdecode('Clins+d%26%23x27%3Boeil'),jdecode(''), jdecode('%2F27719.html'), 'true',[],'',''],
	['PAGE','69367',jdecode('Clins+d%26%23x27%3Boeil+2'),jdecode(''), jdecode('%2F69367.html'), 'true',[],'',''],
	['PAGE','47318',jdecode('USA+2005'),jdecode(''), jdecode('%2F47318.html'), 'true',[],'',''],
	['PAGE','9001',jdecode('American+Cars'),jdecode(''), jdecode('%2F9001.html'), 'true',[],'',''],
	['PAGE','66972',jdecode('Close+to+the+Sky'),jdecode(''), jdecode('%2F66972.html'), 'true',[],'',''],
	['PAGE','48448',jdecode('La+voiture+des+potes'),jdecode(''), jdecode('%2F48448.html'), 'true',[],'',''],
	['PAGE','67560',jdecode('Dallas+2008'),jdecode(''), jdecode('%2F67560.html'), 'true',[],'',''],
	['PAGE','67817',jdecode('Indy+2008'),jdecode(''), jdecode('%2F67817.html'), 'true',[],'',''],
	['PAGE','68580',jdecode('Indy+2009'),jdecode(''), jdecode('%2F68580.html'), 'true',[],'',''],
	['PAGE','69861',jdecode('Indy+2010'),jdecode(''), jdecode('%2F69861.html'), 'true',[],'',''],
	['PAGE','74901',jdecode('Indy+2011'),jdecode(''), jdecode('%2F74901.html'), 'true',[],'',''],
	['PAGE','69765',jdecode('Doussard+2010'),jdecode(''), jdecode('%2F69765.html'), 'true',[],'',''],
	['PAGE','69212',jdecode('Sorties+Fun+2010'),jdecode(''), jdecode('%2F69212.html'), 'true',[],'',''],
	['PAGE','69525',jdecode('Pigne+d%26%23x27%3BArolla'),jdecode(''), jdecode('%2F69525.html'), 'true',[],'',''],
	['PAGE','74922',jdecode('Mont+Blanc+de+Cheilon'),jdecode(''), jdecode('%2F74922.html'), 'true',[],'',''],
	['PAGE','70101',jdecode('Bob+McDorman+Collection'),jdecode(''), jdecode('%2F70101.html'), 'true',[],'',''],
	['PAGE','73401',jdecode('Detroit+2011'),jdecode(''), jdecode('%2F73401.html'), 'true',[],'',''],
	['PAGE','78201',jdecode('We+love+Bowling+Green+%21'),jdecode(''), jdecode('%2F78201.html'), 'true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Logg';
theSitetree.paletteFamily='1D6C89';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='422';
theSitetree.graphicsetId='469';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='1D6C89';
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: 			'Logg',
				paletteFamily: 	'1D6C89',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'422',
				graphicsetId: 	'469',
				contentColor: 	'FFFFFF',
				contentBGColor: '1D6C89',
				a_color: 		'1D6C89',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4455',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4455',
internalId:  '',
customField: '20111210-124059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48448',
internalId:  '',
customField: '20101206-160417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9503',
internalId:  '',
customField: '20110604-192748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8974',
internalId:  '',
customField: '20110217-211417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23647',
internalId:  '',
customField: '20100327-111442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27719',
internalId:  '',
customField: '20101005-213644'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68580',
internalId:  '',
customField: '20100422-155817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69367',
internalId:  '',
customField: '20100422-143009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47318',
internalId:  '',
customField: '20060129-103206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9001',
internalId:  '',
customField: '20110604-192615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69212',
internalId:  '',
customField: '20100504-155635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66972',
internalId:  '',
customField: '20100308-125418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67560',
internalId:  '',
customField: '20080614-113924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67817',
internalId:  '',
customField: '20100310-072213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69525',
internalId:  '',
customField: '20100511-124951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69765',
internalId:  '',
customField: '20100505-121450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69861',
internalId:  '',
customField: '20100626-204547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70101',
internalId:  '',
customField: '20101206-155747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73401',
internalId:  '',
customField: '20110913-110224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74901',
internalId:  '',
customField: '20110607-221722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74922',
internalId:  '',
customField: '20111210-151934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78201',
internalId:  '',
customField: '20110912-183338'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INX2Q5';
var companyName   = 'Caf%C3%A9-Restaurant+RELAIS+DES+MAYENS+DE+SION';
var htmlTitle	  = 'mayensdesion.ch';
var metaKeywords  = 'Mayens+de+Sion++Restaurant+H%EF%BF%BDtel+Chambres+Bisse+Filet+de+boeuf+Fondue+Vex+H%EF%BF%BDr%EF%BF%BDmence+Thyon++Les+Collons++Les+MassesVoitures++Am%EF%BF%BDricaines+Chevrolet+Corvette+Rudaz+Bernard+Lily+Sara+Nancy+Indy+500+Le+Relais+Auburn+Corvette+Classics';
var metaContents  = 'Caf%EF%BF%BD-Restaurant+Chambres+H%EF%BF%BDtel+Collection+voitures+am%EF%BF%BDricaines';
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();
};

