/* [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','4521',jdecode('Page+d%26%23x27%3Baccueil'),jdecode(''),'/4521.html','true',[],'',''],
	['PAGE','4605',jdecode('1996-2005'),jdecode(''),'/4605.html','true',[],'',''],
	['PAGE','4632',jdecode('2006+'),jdecode(''),'/4632.html','true',[],'',''],
	['PAGE','4901',jdecode('2007-2010'),jdecode(''),'/4901.html','true',[],'',''],
	['PAGE','4928',jdecode('Les+mots+d%C3%A9peints'),jdecode(''),'/4928.html','true',[],'',''],
	['PAGE','15101',jdecode('L%26%23x27%3Bartiste+%2Fcontact+%2F+itin%C3%A9raire'),jdecode(''),'/15101.html','true',[],'',''],
	['PAGE','10402',jdecode('livre+d%26%23x27%3Bor'),jdecode(''),'/10402/index.html','true',[ 
		['PAGE','10403',jdecode('Entr%C3%A9es'),jdecode(''),'/10402/10403.html','false',[],'','']
	],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Holz';
theSitetree.paletteFamily='FF7112';
theSitetree.keyvisualId='8821';
theSitetree.keyvisualName='KV_07.swf';
theSitetree.fontsetId='-1';
theSitetree.graphicsetId='12654';
theSitetree.contentColor='FF7112';
theSitetree.contentBGColor='262626';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'true',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'true',
				hasCompanyname: 'false',
				name: 			'Holz',
				paletteFamily: 	'FF7112',
				keyvisualId: 	'8821',
				keyvisualName: 	'KV_07.swf',
				fontsetId: 		'-1',
				graphicsetId: 	'12654',
				contentColor: 	'FF7112',
				contentBGColor: '262626',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'FF6600',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'',
				contentFontSize:'-1',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4521',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4605',
internalId:  '',
customField: '20080401-080350'
};
webappMappings['1002']=webappMappings['1002-10402ABW0X0INXELL']={
webappId:    '1002',
documentId:  '10402',
internalId:  '10402ABW0X0INXELL',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4521',
internalId:  '',
customField: '20091025-102419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4632',
internalId:  '',
customField: '20080401-080517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4901',
internalId:  '',
customField: '20091025-103149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4928',
internalId:  '',
customField: '20071122-113722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15101',
internalId:  '',
customField: '20071122-114158'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10402',
internalId:  '',
customField: '20050628-172946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10403',
internalId:  '',
customField: '20050628-172946'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXELL';
var companyName   = 'BOURDET.CH';
var htmlTitle	  = 'http%3A%2F%2Fwww.bourdet.ch';
var metaKeywords  = 'art%2C+galerie%2C+bourdet%2C+st%C3%A9phane%2C+peintures%2C+exposition%2C+artiste-peintre%2C+st%C3%A9phane+bourdet%2C+Gen%C3%A8ve%2C+nus%2C+peinture+abstraite%2C+gay%2C+tableaux%2C+po%C3%A9sie%2C+bons+en+chablais%2C+haute+savoie';
var metaContents  = 'peintures%2C+po%C3%A9sie%2C+nus+artistiques';
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();
};
