/* [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','3201',jdecode('Accueil'),jdecode(''), jdecode('%2F3201%2Findex.html'), 'true',[ 
		['PAGE','3252',jdecode('La+cuisine'),jdecode(''), jdecode('%2F3201%2F3252.html'), 'true',[],'',''],
		['PAGE','17101',jdecode('A+l%26%23x27%3Bemporter'),jdecode(''), jdecode('%2F3201%2F17101.html'), 'true',[],'',''],
		['PAGE','29801',jdecode('Les+vins'),jdecode(''), jdecode('%2F3201%2F29801.html'), 'true',[],'','']
	],'',''],
	['PAGE','3273',jdecode('Prix+de+la+plus+belle+terrasse'),jdecode(''), jdecode('%2F3273.html'), 'true',[],'',''],
	['ITEM','26601',jdecode('Vid%C3%A9os'),jdecode(''), jdecode('http%3A%2F%2Fwww.youtube.com%2Fuser%2FTilleulsGE%2Ffeed%3Ffilter%3D2'), 'true',[],'','_blank'],
	['PAGE','3294',jdecode('Contact+et+liens'),jdecode(''), jdecode('%2F3294%2Findex.html'), 'true',[ 
		['PAGE','3401',jdecode('Plan+de+situation'),jdecode(''), jdecode('%2F3294%2F3401.html'), 'true',[],'',''],
		['PAGE','12901',jdecode('Formulaire+de+contact'),jdecode(''), jdecode('%2F3294%2F12901.html'), 'true',[],'',''],
		['ITEM','26301',jdecode('Nous+sommes+sur+facebook'),jdecode(''), jdecode('http%3A%2F%2Fwww.facebook.com%2FTilleuls.GE'), 'true',[],'','_blank'],
		['ITEM','28201',jdecode('Nous+sommes+sur+restorang.ch'),jdecode(''), jdecode('http%3A%2F%2Fwww.restorang.ch%2Finfo.cfm%3Fcanton%3Dge%26restono%3D232'), 'true',[],'','_blank'],
		['ITEM','28202',jdecode('Nous+sommes+sur+Itaste'),jdecode(''), jdecode('http%3A%2F%2Fwww.itaste.com%2Fapplication%2FrestaurantWholeDtail.php%3Fid_rest%3D6702'), 'true',[],'','_blank']
	],'',''],
	['PAGE','25001',jdecode('Presse'),jdecode(''), jdecode('%2F25001.html'), 'true',[],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='479949';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10461';
theSitetree.graphicsetId='10895';
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: 			'Alpha',
				paletteFamily: 	'479949',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10461',
				graphicsetId: 	'10895',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'479949',
				e_color: 		'479949',
				f_color: 		'479949',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3201',
internalId:  '',
customField: '20120209-021948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3294',
internalId:  '',
customField: '20111223-211217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3252',
internalId:  '',
customField: '20111223-194210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3273',
internalId:  '',
customField: '20111223-170550'
};
webappMappings['1501']=webappMappings['1501-32031641']={
webappId:    '1501',
documentId:  '3201',
internalId:  '32031641',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3401',
internalId:  '',
customField: '20101011-155055'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3201',
internalId:  '1006',
customField: '1006'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '3401',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['7008']=webappMappings['7008-10801']={
webappId:    '7008',
documentId:  '12901',
internalId:  '10801',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12901',
internalId:  '',
customField: '20110114-022856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17101',
internalId:  '',
customField: '20120209-021547'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '29801',
internalId:  '-',
customField: '20120209-005834'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '25001',
internalId:  '-',
customField: '20111223-211149'
};
webappMappings['7060']=webappMappings['7060-bef1d720fdd43a4fef57e9c04b703205']={
webappId:    '7060',
documentId:  '25001',
internalId:  'bef1d720fdd43a4fef57e9c04b703205',
customField: 'language:fr;country:FR;'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INESCQ';
var companyName   = 'Restaurant+les+Tilleuls';
var htmlTitle	  = 'www.les-tilleuls.ch';
var metaKeywords  = 'St%C3%A9phane%2C+Orasianu%2C+St%C3%A9phane+Orasianu%2C+Tilleuls%2C+restaurant%2C+pizzeria%2C+pizzeria+des+tilleuls%2C+restaurant+les+tilleuls%2C+terrasse%2C+la+plus+belle+terrasse%2C+le+meilleur+restraurant+iltalien%2C+italien%2C+suggestions%2C+restaurant+Gen%C3%A8ve%2C+Gen%C3%A8ve%2C+restaurant+italien+Gen%C3%A8ve%2C+terrasse+Gen%C3%A8ve%2C+plus+belle+terrasse+Gen%C3%A8ve%2C+italien+restaurant%2C+sea+food%2C+italian+restaurant%2C+sp%C3%A9cialit%C3%A9s+de+p%C3%A2tes+fra%C3%AEches%2C+p%C3%A2tes%2C+entrec%C3%B4te%2C+pizza%2C+pizzas%2C+plats+italiens%2C+plats+fran%C3%A7ais%2C+terrasse%2C+non+fumeurs%2C+salle+banquets';
var metaContents  = 'Dirig%C3%A9+par+St%C3%A9phane+Orasianu%2C+le+restaurant+des+Tilleuls+dans+le+quartier+de+Saint-Jean+%C3%A0+Gen%C3%A8ve+est+devenu+un+lieu+culte+de+la+restauration+genevoise.+Sp%C3%A9cialit%C3%A9s+italiennes+et+fran%C3%A7aises+se+c%C3%B4toient+et+se+compl%C3%A9mente+afin+de+satisfaire+vos+papilles.+R%C3%A9put%C3%A9+pour+ses+portions+g%C3%A9n%C3%A9reuses%2C+ses+plats+savoureux+et+son+excellent+rapport+qualit%C3%A9-prix%2C+le+restaurant+des+Tilleuls+a+%C3%A9t%C3%A9+%C3%A9lu+en+2010+la+plus+belle+terrasse+de+la+ville+de+Gen%C3%A8ve+par+le+public+lors+d%27un+prestigieux+concours+parmi+900+autre+terrasses+participantes.';
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();
};

