/* [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','401',jdecode('marchande+d%26%23x27%3B%C3%A9toiles'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','452',jdecode('la+galerie++des+f%C3%A9es'),jdecode(''),'/452.html','true',[],'',''],
	['PAGE','30901',jdecode('f%C3%A9es+miniatures+'),jdecode(''),'/30901.html','true',[],'',''],
	['PAGE','494',jdecode('au+clair+de+la+lune'),jdecode(''),'/494.html','true',[],'',''],
	['PAGE','31801',jdecode('au+pays+des+merveilles'),jdecode(''),'/31801.html','true',[],'',''],
	['PAGE','30922',jdecode('dans+le+sous-bois+'),jdecode(''),'/30922.html','true',[],'',''],
	['PAGE','67501',jdecode('nouveaut%C3%A9s'),jdecode(''),'/67501.html','true',[],'',''],
	['PAGE','71001',jdecode('lili+et+rose'),jdecode(''),'/71001.html','true',[],'',''],
	['PAGE','473',jdecode('pampilles+et+fil+de+fer++'),jdecode(''),'/473.html','true',[],'',''],
	['PAGE','103401',jdecode('en+vente'),jdecode(''),'/103401.html','true',[],'',''],
	['PAGE','21201',jdecode('boutique+en+ligne'),jdecode(''),'/21201.html','true',[],'',''],
	['PAGE','64101',jdecode('inspiration'),jdecode(''),'/64101.html','true',[],'',''],
	['PAGE','64122',jdecode('blog'),jdecode(''),'/64122.html','true',[],'',''],
	['PAGE','30943',jdecode('expositions'),jdecode(''),'/30943.html','true',[],'',''],
	['PAGE','515',jdecode('contact++'),jdecode(''),'/515.html','true',[],'',''],
	['PAGE','29101',jdecode('liens+'),jdecode(''),'/29101.html','true',[],'',''],
	['PAGE','111401',jdecode('un+enfant+par+la+main'),jdecode(''),'/111401.html','true',[],'',''],
	['PAGE','2506',jdecode('Livre+d%26%23x27%3Bor'),jdecode(''),'/2506.html','true',[],'',''],
	['PAGE','22001',jdecode('Acc%C3%A8s'),jdecode(''),'/22001.html','true',[],'',''],
	['PAGE','34801',jdecode('me+trouver'),jdecode(''),'/34801.html','true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Leaves';
theSitetree.paletteFamily='545454';
theSitetree.keyvisualId='11689';
theSitetree.keyvisualName='kv_11689.jpg';
theSitetree.fontsetId='32971';
theSitetree.graphicsetId='14002';
theSitetree.contentColor='545454';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Leaves',
				paletteFamily: 	'545454',
				keyvisualId: 	'11689',
				keyvisualName: 	'kv_11689.jpg',
				fontsetId: 		'32971',
				graphicsetId: 	'14002',
				contentColor: 	'545454',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-2506abw0x0ine00a']={
webappId:    '1002',
documentId:  '2506',
internalId:  '2506abw0x0ine00a',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20091106-180459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111401',
internalId:  '',
customField: '20100610-220713'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-26112136']={
webappId:    '1501',
documentId:  '401',
internalId:  '26112136',
customField: '1501'
};
webappMappings['4001']=webappMappings['4001-26112257']={
webappId:    '4001',
documentId:  '21201',
internalId:  '26112257',
customField: 'language:fr;country:FR;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '22001',
internalId:  'location',
customField: 'language:fr;country:FR;isIncluded:false;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '34801',
internalId:  'routing',
customField: 'fr_FR'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20091105-213024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30901',
internalId:  '',
customField: '20091105-212251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31801',
internalId:  '',
customField: '20091105-212827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20091106-180941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30922',
internalId:  '',
customField: '20090714-154352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20081103-001424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30943',
internalId:  '',
customField: '20100201-205524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20091106-182508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64122',
internalId:  '',
customField: '20100608-214750'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29101',
internalId:  '',
customField: '20100612-163826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2506',
internalId:  '',
customField: '20081025-150944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103401',
internalId:  '',
customField: '20100512-193452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64101',
internalId:  '',
customField: '20100513-160431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21201',
internalId:  '',
customField: '20100513-111707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22001',
internalId:  '',
customField: '20081023-120833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34801',
internalId:  '',
customField: '20081023-232237'
};
webappMappings['7008']=webappMappings['7008-3168']={
webappId:    '7008',
documentId:  '515',
internalId:  '3168',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67501',
internalId:  '',
customField: '20091106-181429'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71001',
internalId:  '',
customField: '20091106-182019'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INE00A';
var companyName   = 'La+marchande+d%27%C3%A9toiles';
var htmlTitle	  = 'au+pays+des+merveilles';
var metaKeywords  = 'sculptures+%2C+fees%2C++marchande+d+etoiles+%2C+papier+mache+%2C+decoratrice%2C++suisse+';
var metaContents  = 'sculptures++de+fees+de+papier+mach%C3%A9';
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();
};
