/* [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','501',jdecode('Bienvenue'),jdecode(''),'/501.html','true',[],'',''],
	['PAGE','97012',jdecode('Offre+de+No%C3%ABl+2009'),jdecode(''),'/97012.html','false',[],'',''],
	['PAGE','98012',jdecode('Portes+Ouvertes+12.12'),jdecode(''),'/98012.html','false',[],'',''],
	['PAGE','14101',jdecode('Nos+produits'),jdecode(''),'/14101/index.html','true',[ 
		['PAGE','14122',jdecode('Saumon+fum%C3%A9+%C3%A0+chaud'),jdecode(''),'/14101/14122.html','true',[],'',''],
		['PAGE','14143',jdecode('Saumon+fum%C3%A9+trad.'),jdecode(''),'/14101/14143.html','true',[],'',''],
		['PAGE','40601',jdecode('Saumon+marin%C3%A9'),jdecode(''),'/14101/40601.html','true',[],'',''],
		['PAGE','14164',jdecode('Anguille+fum%C3%A9e'),jdecode(''),'/14101/14164.html','true',[],'',''],
		['PAGE','40901',jdecode('%C5%92ufs+de+cor%C3%A9gone+'),jdecode(''),'/14101/40901.html','true',[],'',''],
		['PAGE','96412',jdecode('Les+Harengs+marin%C3%A9s'),jdecode(''),'/14101/96412.html','true',[],'',''],
		['PAGE','96433',jdecode('Renne+et+%C3%A9lan+fum%C3%A9'),jdecode(''),'/14101/96433.html','true',[],'',''],
		['PAGE','96454',jdecode('Pains+croustillants'),jdecode(''),'/14101/96454.html','true',[],'',''],
		['PAGE','96612',jdecode('Les+herbes'),jdecode(''),'/14101/96612.html','true',[],'','']
	],'',''],
	['PAGE','12922',jdecode('Commande'),jdecode(''),'/12922.html','true',[],'',''],
	['PAGE','61801',jdecode('Calendrier'),jdecode(''),'/61801.html','true',[],'',''],
	['PAGE','552',jdecode('O%C3%B9+nous+trouver'),jdecode(''),'/552/index.html','true',[ 
		['PAGE','103112',jdecode('Directions'),jdecode(''),'/552/103112.html','true',[],'','']
	],'',''],
	['PAGE','40922',jdecode('Distributeurs'),jdecode(''),'/40922.html','true',[],'',''],
	['PAGE','68701',jdecode('Partenaires'),jdecode(''),'/68701.html','true',[],'',''],
	['PAGE','28501',jdecode('Recettes'),jdecode(''),'/28501/index.html','true',[ 
		['PAGE','98033',jdecode('Comment+pr%C3%A9parer+le+saumon+fum%C3%A9+%C3%A0+chaud'),jdecode(''),'/28501/98033.html','true',[],'','']
	],'',''],
	['PAGE','89501',jdecode('Pal%C3%A9o+2009'),jdecode(''),'/89501.html','false',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='003399';
theSitetree.keyvisualId='1248';
theSitetree.keyvisualName='weinglaeser.jpg';
theSitetree.fontsetId='191';
theSitetree.graphicsetId='228';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Profile',
				paletteFamily: 	'003399',
				keyvisualId: 	'1248',
				keyvisualName: 	'weinglaeser.jpg',
				fontsetId: 		'191',
				graphicsetId: 	'228',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'003399',
				b_color: 		'000066',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96454',
internalId:  '',
customField: '20091121-120242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96612',
internalId:  '',
customField: '20091110-114520'
};
webappMappings['7008']=webappMappings['7008-2758']={
webappId:    '7008',
documentId:  '12922',
internalId:  '2758',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20091105-105450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97012',
internalId:  '',
customField: '20091105-115232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14101',
internalId:  '',
customField: '20071109-233049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14122',
internalId:  '',
customField: '20090626-215540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14143',
internalId:  '',
customField: '20090626-215556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40601',
internalId:  '',
customField: '20081104-111039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14164',
internalId:  '',
customField: '20081104-111134'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40901',
internalId:  '',
customField: '20090120-170541'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '103112',
internalId:  'routing',
customField: 'fr_FR'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89501',
internalId:  '',
customField: '20090730-104209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12922',
internalId:  '',
customField: '20080818-223209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61801',
internalId:  '',
customField: '20100226-173120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20091129-231119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40922',
internalId:  '',
customField: '20100226-172919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68701',
internalId:  '',
customField: '20091110-182307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28501',
internalId:  '',
customField: '20070903-165131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96412',
internalId:  '',
customField: '20091110-104021'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96433',
internalId:  '',
customField: '20091110-173547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98012',
internalId:  '',
customField: '20091129-230902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98033',
internalId:  '',
customField: '20091105-111653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '103112',
internalId:  '',
customField: '20100105-195624'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN27EK';
var companyName   = 'Saveurs+du+Nord+-+C.+Huguenin';
var htmlTitle	  = 'Saveurs+du+Nord';
var metaKeywords  = 'Les+meilleures+saveurs+du+nord%2C+saumon+fum%C3%A9+%C3%A0+chaud%2C+saumon+fum%C3%A9%2C+anguille+fum%C3%A9e%2C+oeufs+de+cor%C3%A9gone+blanc%2C+saumon+marin%C3%A9+%C3%A0+laneth%2C+service+traiteurs.+Hotsmoked+salmon%2C+cold+smoked+salmon%2C+smoked+eel%2C+bleak+roe%2C+dill+marinted+salmon%2C+traiteur.+';
var metaContents  = 'Les+meilleures+saveurs+du+nord%2C+saumon+fum%C3%A9+%C3%A0+chaud%2C+saumon+fum%C3%A9%2C+anguille+fum%C3%A9e%2C+saumon+marin%C3%A9+%C3%A0+laneth%2C+service+traiteur%2C+hot+smoked+salmon%2C+cold+smoked+salmon%2C+smoked+eel%2C+dill+marinated+salmon%2C+traiteur.';
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();
};
