/* [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','4519',jdecode('Accueil'),jdecode(''), jdecode('%2F4519.html'), 'true',[],'',''],
	['PAGE','64101',jdecode('Qui+sommes-nous%3F'),jdecode(''), jdecode('%2F64101%2Findex.html'), 'true',[ 
		['PAGE','64122',jdecode('Interlocuteurs'),jdecode(''), jdecode('%2F64101%2F64122.html'), 'true',[],'',''],
		['PAGE','28824',jdecode('Historique'),jdecode(''), jdecode('%2F64101%2F28824.html'), 'true',[],'','']
	],'',''],
	['PAGE','16375',jdecode('Infrastructure'),jdecode(''), jdecode('%2F16375.html'), 'true',[],'',''],
	['PAGE','10291',jdecode('Services+et+livraisons'),jdecode(''), jdecode('%2F10291.html'), 'true',[],'',''],
	['PAGE','79401',jdecode('Info+et+nouveaut%C3%A9'),jdecode(''), jdecode('%2F79401.html'), 'false',[],'',''],
	['PAGE','16456',jdecode('Nos+produits'),jdecode(''), jdecode('%2F16456%2Findex.html'), 'true',[ 
		['PAGE','16483',jdecode('L%C3%A9gumes+et+salades'),jdecode(''), jdecode('%2F16456%2F16483.html'), 'true',[],'',''],
		['PAGE','16510',jdecode('Fruits+%2F+fruits+exotiques'),jdecode(''), jdecode('%2F16456%2F16510.html'), 'true',[],'',''],
		['PAGE','41954',jdecode('Pommes+de+terre'),jdecode(''), jdecode('%2F16456%2F41954.html'), 'true',[],'',''],
		['PAGE','16537',jdecode('Surgel%C3%A9s'),jdecode(''), jdecode('%2F16456%2F16537.html'), 'false',[],'','']
	],'',''],
	['PAGE','101601',jdecode('Contact'),jdecode(''), jdecode('%2F101601.html'), 'true',[],'',''],
	['PAGE','27302',jdecode('Acc%C3%A8s'),jdecode(''), jdecode('%2F27302.html'), 'true',[],'',''],
	['PAGE','27464',jdecode('Comment+nous+trouver'),jdecode(''), jdecode('%2F27464.html'), 'true',[],'',''],
	['PAGE','28509',jdecode('Liens'),jdecode(''), jdecode('%2F28509.html'), 'true',[],'',''],
	['PAGE','97901',jdecode('Notre+Boutique'),jdecode(''), jdecode('%2F97901.html'), 'true',[],'',''],
	['PAGE','101201',jdecode('offre+d%26%23x27%3Bemploi'),jdecode(''), jdecode('%2F101201.html'), 'false',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Retail';
theSitetree.paletteFamily='F0C266';
theSitetree.keyvisualId='11782';
theSitetree.keyvisualName='kv_11782.jpg';
theSitetree.fontsetId='33055';
theSitetree.graphicsetId='14047';
theSitetree.contentColor='67490d';
theSitetree.contentBGColor='F0C266';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Retail',
				paletteFamily: 	'F0C266',
				keyvisualId: 	'11782',
				keyvisualName: 	'kv_11782.jpg',
				fontsetId: 		'33055',
				graphicsetId: 	'14047',
				contentColor: 	'67490d',
				contentBGColor: 'F0C266',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4519',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16375',
internalId:  '',
customField: '20100531-075111'
};
webappMappings['4001']=webappMappings['4001-32394941']={
webappId:    '4001',
documentId:  '97901',
internalId:  '32394941',
customField: 'language:fr;country:FR;'
};
webappMappings['1501']=webappMappings['1501-1211710']={
webappId:    '1501',
documentId:  '4519',
internalId:  '1211710',
customField: '1501'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '27302',
internalId:  'location',
customField: 'language:fr;country:FR;isIncluded:false;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '27464',
internalId:  'routing',
customField: 'fr_FR'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4519',
internalId:  '',
customField: '20110909-094137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64101',
internalId:  '',
customField: '20120119-062957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64122',
internalId:  '',
customField: '20120119-070728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16456',
internalId:  '',
customField: '20101106-165121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16510',
internalId:  '',
customField: '20101011-184448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41954',
internalId:  '',
customField: '20101014-165651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16483',
internalId:  '',
customField: '20101010-175555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16537',
internalId:  '',
customField: '20100215-160123'
};
webappMappings['7008']=webappMappings['7008-11618']={
webappId:    '7008',
documentId:  '101601',
internalId:  '11618',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10291',
internalId:  '',
customField: '20101012-175246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28824',
internalId:  '',
customField: '20120119-063940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97901',
internalId:  '',
customField: '20101210-093832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27302',
internalId:  '',
customField: '20051112-174705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27464',
internalId:  '',
customField: '20051112-174858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28509',
internalId:  '',
customField: '20110323-082835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101601',
internalId:  '',
customField: '20110209-103834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101201',
internalId:  '',
customField: '20110208-100606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79401',
internalId:  '',
customField: '20110627-104157'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INX2G2';
var companyName   = 'La+signature+du+vrai+go%C3%BBt';
var htmlTitle	  = '';
var metaKeywords  = 'fruits+++%0D%0Al%C3%A9gumes%0D%0Asurgel%C3%A9%0D%0A4e+gamme%0D%0Apommes+de+terre%0D%0Apatates%0D%0Amuller%0D%0Amuller+fruits%0D%0Amuller+fruits+et+l%C3%A9gumes%0D%0Amuller+goumoens%0D%0Agoumoens%0D%0A1376%0D%0Amullerfruitsetlegumes%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A';
var metaContents  = 'Vente+de+fruits+et+l%C3%A9gumes+%0D%0Afruits%0D%0Al%C3%A9gumes%0D%0A4e+gamme%0D%0Asurgel%C3%A9%0D%0A';
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();
};

