/* [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','12801',jdecode('Home'),jdecode(''), jdecode('%2F12801.html'), 'true',[],'',''],
	['PAGE','52301',jdecode('Contact'),jdecode(''), jdecode('%2F52301.html'), 'true',[],'',''],
	['PAGE','18222',jdecode('Notre+h%C3%B4tel'),jdecode(''), jdecode('%2F18222%2Findex.html'), 'true',[ 
		['PAGE','18243',jdecode('Les+chambres'),jdecode(''), jdecode('%2F18222%2F18243.html'), 'true',[],'',''],
		['PAGE','18901',jdecode('Les+prix'),jdecode(''), jdecode('%2F18222%2F18901.html'), 'true',[],'','']
	],'',''],
	['PAGE','44101',jdecode('Notre+restaurant'),jdecode(''), jdecode('%2F44101%2Findex.html'), 'true',[ 
		['PAGE','44164',jdecode('Caf%C3%A9'),jdecode(''), jdecode('%2F44101%2F44164.html'), 'true',[],'',''],
		['PAGE','42001',jdecode('Bistrot'),jdecode(''), jdecode('%2F44101%2F42001.html'), 'true',[],'',''],
		['PAGE','44122',jdecode('Salle+%C3%A0+manger'),jdecode(''), jdecode('%2F44101%2F44122.html'), 'true',[],'',''],
		['PAGE','44143',jdecode('Bar'),jdecode(''), jdecode('%2F44101%2F44143.html'), 'true',[],'',''],
		['PAGE','47801',jdecode('Les+Terrasses'),jdecode(''), jdecode('%2F44101%2F47801.html'), 'true',[],'',''],
		['PAGE','19090',jdecode('Carnotzet'),jdecode(''), jdecode('%2F44101%2F19090.html'), 'true',[],'',''],
		['PAGE','48101',jdecode('Grande+salle'),jdecode(''), jdecode('%2F44101%2F48101.html'), 'true',[],'','']
	],'',''],
	['PAGE','18964',jdecode('Salles+de+conf%C3%A9rences'),jdecode(''), jdecode('%2F18964%2Findex.html'), 'true',[ 
		['PAGE','18985',jdecode('Moraines'),jdecode(''), jdecode('%2F18964%2F18985.html'), 'true',[],'',''],
		['PAGE','19006',jdecode('Venoge'),jdecode(''), jdecode('%2F18964%2F19006.html'), 'true',[],'',''],
		['PAGE','19027',jdecode('Sorge'),jdecode(''), jdecode('%2F18964%2F19027.html'), 'true',[],'',''],
		['PAGE','19048',jdecode('Jura'),jdecode(''), jdecode('%2F18964%2F19048.html'), 'true',[],'','']
	],'',''],
	['PAGE','43601',jdecode('Service+traiteur'),jdecode(''), jdecode('%2F43601.html'), 'true',[],'',''],
	['PAGE','19501',jdecode('Galerie+de+photos'),jdecode(''), jdecode('%2F19501.html'), 'true',[],'',''],
	['PAGE','27001',jdecode('Plan+d%26%23x27%3Bacc%C3%A8s'),jdecode(''), jdecode('%2F27001.html'), 'true',[],'',''],
	['PAGE','49801',jdecode('Comment+nous+trouver'),jdecode(''), jdecode('%2F49801.html'), 'true',[],'',''],
	['PAGE','18264',jdecode('Liens'),jdecode(''), jdecode('%2F18264.html'), 'true',[],'',''],
	['PAGE','42706',jdecode('Livre+d%26%23x27%3Bor'),jdecode(''), jdecode('%2F42706%2Findex.html'), 'true',[ 
		['PAGE','42701',jdecode('Consulter+Livre+d%26%23x27%3Bor'),jdecode(''), jdecode('%2F42706%2F42701.html'), 'false',[],'','']
	],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='990000';
theSitetree.keyvisualId='1252';
theSitetree.keyvisualName='gedeck.jpg';
theSitetree.fontsetId='190';
theSitetree.graphicsetId='233';
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: 			'Profile',
				paletteFamily: 	'990000',
				keyvisualId: 	'1252',
				keyvisualName: 	'gedeck.jpg',
				fontsetId: 		'190',
				graphicsetId: 	'233',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'990000',
				b_color: 		'333333',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '12801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52301',
internalId:  '',
customField: '20070802-124309'
};
webappMappings['1002']=webappMappings['1002-42706abw0x0in2ea0']={
webappId:    '1002',
documentId:  '42706',
internalId:  '42706abw0x0in2ea0',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12801',
internalId:  '',
customField: '20071205-114410'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '49801',
internalId:  'routing',
customField: 'fr_FR'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18222',
internalId:  '',
customField: '20070806-173654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18243',
internalId:  '',
customField: '20070711-221016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18901',
internalId:  '',
customField: '20110101-130914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44101',
internalId:  '',
customField: '20070802-105105'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44164',
internalId:  '',
customField: '20070710-085751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42001',
internalId:  '',
customField: '20070806-114413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44122',
internalId:  '',
customField: '20070802-140704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44143',
internalId:  '',
customField: '20070806-113736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47801',
internalId:  '',
customField: '20070802-125449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19090',
internalId:  '',
customField: '20070806-173254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48101',
internalId:  '',
customField: '20070802-145837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18964',
internalId:  '',
customField: '20110101-205223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18985',
internalId:  '',
customField: '20070711-224604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19006',
internalId:  '',
customField: '20070802-104349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19027',
internalId:  '',
customField: '20070711-230444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19048',
internalId:  '',
customField: '20070802-104507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43601',
internalId:  '',
customField: '20070802-104136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19501',
internalId:  '',
customField: '20070806-173555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27001',
internalId:  '',
customField: '20070608-144318'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49801',
internalId:  '',
customField: '20070711-232805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18264',
internalId:  '',
customField: '20070607-225935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42706',
internalId:  '',
customField: '20070622-223739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42701',
internalId:  '',
customField: '20070622-223739'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN2EA0';
var companyName   = 'H%C3%B4tel+de+Ville+Bussigny';
var htmlTitle	  = 'Caf%C3%A9%3B+restaurant%3B+h%C3%B4tel+de+ville%3B+bussigny%3B+s%C3%A9minaire%3B+r%C3%A9union%3B+chambre';
var metaKeywords  = 'bussigny%3B++restaurant%3B++hotel%3B++h%C3%B4tel%3B+chambre%3B+salle+conf%C3%A9rence%3B+s%C3%A9minaire%3B+r%C3%A9union%3B+caf%C3%A9%3B+connection+internet+wifi';
var metaContents  = 'bussigny%3B+restaurant%3B++hotel%3B++h%C3%B4tel%3B++salle+conf%C3%A9rence%3B+chambre%3B+s%C3%A9minaire%3B+r%C3%A9union%3B+caf%C3%A9%3B+connection+internet+wifi';
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();
};

