/* [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','1201',jdecode('Home'),jdecode(''),'/1201.html','true',[],'',''],
	['PAGE','1252',jdecode('Prix'),jdecode(''),'/1252.html','true',[],'',''],
	['PAGE','1273',jdecode('Offres+actuelles'),jdecode(''),'/1273.html','true',[],'',''],
	['PAGE','1294',jdecode('Contact'),jdecode(''),'/1294.html','true',[],'',''],
	['PAGE','73806',jdecode('Livre+d%26%23x27%3Bor'),jdecode(''),'/73806/index.html','true',[ 
		['PAGE','73801',jdecode('Entr%C3%A9es'),jdecode(''),'/73806/73801.html','false',[],'','']
	],'','']];
var siteelementCount=6;
theSitetree.topTemplateName='Liveliness';
theSitetree.paletteFamily='BE9A5B';
theSitetree.keyvisualId='3265';
theSitetree.keyvisualName='kv_3265.jpg';
theSitetree.fontsetId='10693';
theSitetree.graphicsetId='10735';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Liveliness',
				paletteFamily: 	'BE9A5B',
				keyvisualId: 	'3265',
				keyvisualName: 	'kv_3265.jpg',
				fontsetId: 		'10693',
				graphicsetId: 	'10735',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'BE9A5B',
				e_color: 		'BCBCBC',
				f_color: 		'737373',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1252',
internalId:  '',
customField: '20070304-214946'
};
webappMappings['1002']=webappMappings['1002-73806abw0x0in2762']={
webappId:    '1002',
documentId:  '73806',
internalId:  '73806abw0x0in2762',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1201',
internalId:  '',
customField: '20090406-102001'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1201',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1273',
internalId:  '',
customField: '20070304-214005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1294',
internalId:  '',
customField: '20080304-224505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73806',
internalId:  '',
customField: '20070304-210514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73801',
internalId:  '',
customField: '20070105-220351'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN2762';
var companyName   = 'AVENTURA+Coiffure+MESSIEURS+';
var htmlTitle	  = 'www.aventuracoiffure.ch';
var metaKeywords  = 'salon+de+coiffure++coiffeuse+messieurs++aventura+coiffure++vinet++lausanne++centre+ville++aventura++';
var metaContents  = 'script+type%3Dtext%2Fjavascript%21--++google_ad_client+%3D+pub-2299351812594314%3B++google_ad_width+%3D+728%3B++google_ad_height+%3D+90%3B++google_ad_format+%3D+728x90_as%3B++google_ad_type+%3D+text_image%3B++google_ad_channel+%3D+%3B++google_color_border+%3D+FFFFFF%3B++google_color_bg+%3D+000000%3B++google_color_link+%3D+B3B3B3%3B++google_color_text+%3D+FFFFFF%3B++google_color_url+%3D+B3B3B3%3B++%2F%2F--%2Fscript++script+type%3Dtext%2Fjavascript++++src%3Dhttp%3A%2F%2Fpagead2.googlesyndication.com%2Fpagead%2Fshow_ads.js++%2FscriptLausanne%2C+avenue+Vinet+5+-+T%C3%A9l%C3%A9phone+021%2F3236476';
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();
};

