/* [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','1301',jdecode('Home'),jdecode(''),'/1301.html','true',[],'',''],
	['PAGE','1457',jdecode('OFFRES+-+ACTUALITE+'),jdecode(''),'/1457.html','true',[],'',''],
	['PAGE','6501',jdecode('Contact+%26+Adresse'),jdecode(''),'/6501.html','true',[],'',''],
	['PAGE','1415',jdecode('Pr%C3%A9sentation+-+SOINS+%26+TARIFS'),jdecode(''),'/1415.html','true',[],'',''],
	['PAGE','6522',jdecode('R%C3%A9flexologie+%26+Points+M%C3%A9xicains'),jdecode(''),'/6522.html','true',[],'',''],
	['PAGE','1352',jdecode('Massages'),jdecode(''),'/1352.html','true',[],'',''],
	['PAGE','1394',jdecode('Aromath%C3%A9rapie+%26+Hydrolath%C3%A9rapie'),jdecode(''),'/1394.html','true',[],'',''],
	['PAGE','5901',jdecode('Liens'),jdecode(''),'/5901.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Stylus';
theSitetree.paletteFamily='B5D3B5';
theSitetree.keyvisualId='1990';
theSitetree.keyvisualName='strand.jpg';
theSitetree.fontsetId='330';
theSitetree.graphicsetId='384';
theSitetree.contentColor='000066';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Stylus',
				paletteFamily: 	'B5D3B5',
				keyvisualId: 	'1990',
				keyvisualName: 	'strand.jpg',
				fontsetId: 		'330',
				graphicsetId: 	'384',
				contentColor: 	'000066',
				contentBGColor: 'FFFFFF',
				a_color: 		'B5D3B5',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1301',
internalId:  '',
customField: '20090421-145637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1457',
internalId:  '',
customField: '20100104-023657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20090827-170938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1415',
internalId:  '',
customField: '20100104-032358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6522',
internalId:  '',
customField: '20080210-024312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1352',
internalId:  '',
customField: '20080209-180711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1394',
internalId:  '',
customField: '20080208-010422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20080209-173120'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN2M35';
var companyName   = 'Institut+O%27Sources';
var htmlTitle	  = 'IOS+-+INSTITUT+OSOURCES+-+Lausanne';
var metaKeywords  = 'R%C3%A9flexologie+-+Massages+-+Points+Mexicains+-+Tension+art%C3%A9rielle+-+Ayur-v%C3%A9da+-+Aromath%C3%A9rapie+-+Huiles+essentielles+-+Hydrolath%C3%A9rapie+-+Eaux+florales+-+Muscles+-+Relaxation+-+Relax+-+M%C3%A9decines+douces+-+Sant%C3%A9+-+Pieds+-+Mains+-+Dos+-+Oreilles+-+Ossature+-+Articulations+-+jambes+-+Langue+-+C%C3%B4lon+-+Th%C3%A9rapies+naturelles+-+Migraines+-+T%C3%AAte+-+Mariage+-+Cadeau+-+Stress+-+Lymphatique+-+Fatigue+-+Source+-+Sources+-+Institut';
var metaContents  = 'R%C3%A9flexologie+-+Massages+-+Points+Mexicains+-+Tension+art%C3%A9rielle+-+Ayur-v%C3%A9da+-+Aromath%C3%A9rapie+-+Huiles+essentielles+-+Hydrolath%C3%A9rapie+-+Eaux+florales+-+Muscles+-+Relaxation+-+Relax+-+M%C3%A9decines+douces+-+Sant%C3%A9+-+Pieds+-+Mains+-+Dos+-+Oreilles+-+Ossature+-+Articulations+-+jambes+-+Langue+-+C%C3%B4lon+-+Th%C3%A9rapies+naturelles+-+Migraines+-+T%C3%AAte+-+Mariage+-+Cadeau+-+Stress+-+Lymphatique+-+Fatigue+-+Source+-+Sources+-+Institut';
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();
};

