/* [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','4599',jdecode('Home'),jdecode(''), jdecode('%2F4599.html'), 'true',[],'',''],
	['PAGE','5203',jdecode('R%C3%A9flexologie+MTC'),jdecode(''), jdecode('%2F5203.html'), 'true',[],'',''],
	['PAGE','13863',jdecode('Soins+th%C3%A9rapeutiques+et+%C3%A9nerg%C3%A9tiques'),jdecode(''), jdecode('%2F13863.html'), 'true',[],'',''],
	['PAGE','53201',jdecode('Cure+intensive+%22perte+de+poids%22'),jdecode(''), jdecode('%2F53201.html'), 'true',[],'',''],
	['PAGE','13836',jdecode('Endermologie'),jdecode(''), jdecode('%2F13836%2Findex.html'), 'true',[ 
		['PAGE','5230',jdecode('Cellu+M6+KMS+-+Lipomassage'),jdecode(''), jdecode('%2F13836%2F5230.html'), 'true',[],'',''],
		['PAGE','5257',jdecode('Lift+6+-+Liftmassage'),jdecode(''), jdecode('%2F13836%2F5257.html'), 'true',[],'','']
	],'',''],
	['PAGE','13845',jdecode('Plateforme+Sismo+Fitness'),jdecode(''), jdecode('%2F13845.html'), 'true',[],'',''],
	['PAGE','13881',jdecode('Ultrasons'),jdecode(''), jdecode('%2F13881.html'), 'true',[],'',''],
	['PAGE','13854',jdecode('Soins+visage'),jdecode(''), jdecode('%2F13854.html'), 'true',[],'',''],
	['PAGE','5284',jdecode('Soins+corps'),jdecode(''), jdecode('%2F5284.html'), 'true',[],'',''],
	['PAGE','13872',jdecode('Soins+%C3%A9nerg%C3%A9tiques+Phyto5'),jdecode(''), jdecode('%2F13872.html'), 'true',[],'',''],
	['PAGE','5311',jdecode('Prix+%26+bons+cadeaux'),jdecode(''), jdecode('%2F5311.html'), 'true',[],'',''],
	['PAGE','5338',jdecode('Adresse%2C+Horaires%2C+Liens'),jdecode(''), jdecode('%2F5338.html'), 'true',[],'',''],
	['PAGE','5365',jdecode('Comment+nous+trouver'),jdecode(''), jdecode('%2F5365.html'), 'true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Stylus';
theSitetree.paletteFamily='B0CBD6';
theSitetree.keyvisualId='2054';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='330';
theSitetree.graphicsetId='383';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Stylus',
				paletteFamily: 	'B0CBD6',
				keyvisualId: 	'2054',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'330',
				graphicsetId: 	'383',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'B0CBD6',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4599',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4599',
internalId:  '',
customField: '20120201-212625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13854',
internalId:  '',
customField: '20111122-000156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13863',
internalId:  '',
customField: '20120201-211128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5203',
internalId:  '',
customField: '20110310-135140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13836',
internalId:  '',
customField: '20111118-173440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5230',
internalId:  '',
customField: '20100211-180225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5257',
internalId:  '',
customField: '20111118-173531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13845',
internalId:  '',
customField: '20111118-173933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13881',
internalId:  '',
customField: '20111118-174022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5284',
internalId:  '',
customField: '20120201-213216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13872',
internalId:  '',
customField: '20111122-002954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5311',
internalId:  '',
customField: '20120201-215034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53201',
internalId:  '',
customField: '20120201-214707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5338',
internalId:  '',
customField: '20110703-184716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5365',
internalId:  '',
customField: '20080321-173806'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXX6K';
var companyName   = 'Celless+Institut';
var htmlTitle	  = 'Celless+Institut+dEndermologie';
var metaKeywords  = '';
var metaContents  = '';
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();
};

