/* [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','2001',jdecode('HOME'),jdecode(''),'/2001.html','true',[],'',''],
	['PAGE','2052',jdecode('FRANCAIS'),jdecode(''),'/2052/index.html','true',[ 
		['PAGE','2073',jdecode('Le+Prince+Canna'),jdecode(''),'/2052/2073.html','true',[],'',''],
		['PAGE','2094',jdecode('La+production'),jdecode(''),'/2052/2094.html','true',[],'',''],
		['PAGE','15401',jdecode('Le+chanvre'),jdecode(''),'/2052/15401.html','true',[],'',''],
		['PAGE','2115',jdecode('O%C3%B9+l%26%23x27%3Bacheter%3F'),jdecode(''),'/2052/2115.html','true',[],'',''],
		['PAGE','23001',jdecode('Achat+en+ligne'),jdecode(''),'/2052/23001.html','true',[],'',''],
		['PAGE','2136',jdecode('Ecoteaux'),jdecode(''),'/2052/2136.html','true',[],'',''],
		['PAGE','16401',jdecode('Fiche+technique'),jdecode(''),'/2052/16401.html','true',[],'',''],
		['PAGE','2178',jdecode('Contact'),jdecode(''),'/2052/2178.html','true',[],'','']
	],'',''],
	['PAGE','2199',jdecode('DEUTSCH'),jdecode(''),'/2199/index.html','true',[ 
		['PAGE','17001',jdecode('Der+Prince+Canna'),jdecode(''),'/2199/17001.html','true',[],'',''],
		['PAGE','17022',jdecode('Die+Herstellung'),jdecode(''),'/2199/17022.html','true',[],'',''],
		['PAGE','17043',jdecode('Der+Hanf'),jdecode(''),'/2199/17043.html','true',[],'',''],
		['PAGE','17064',jdecode('Wo+ihn+kaufen%3F'),jdecode(''),'/2199/17064.html','true',[],'',''],
		['PAGE','23601',jdecode('Bestellung+Online'),jdecode(''),'/2199/23601.html','true',[],'',''],
		['PAGE','17085',jdecode('Ecoteaux'),jdecode(''),'/2199/17085.html','true',[],'',''],
		['PAGE','17106',jdecode('Technische+Daten'),jdecode(''),'/2199/17106.html','true',[],'',''],
		['PAGE','17127',jdecode('Kontakt'),jdecode(''),'/2199/17127.html','true',[],'','']
	],'',''],
	['PAGE','2220',jdecode('ENGLISH'),jdecode(''),'/2220/index.html','true',[ 
		['PAGE','18801',jdecode('The+cheese+'),jdecode(''),'/2220/18801.html','true',[],'',''],
		['PAGE','18901',jdecode('The+production'),jdecode(''),'/2220/18901.html','true',[],'',''],
		['PAGE','18922',jdecode('The+hemp'),jdecode(''),'/2220/18922.html','true',[],'',''],
		['PAGE','18943',jdecode('Where+to+buy%3F'),jdecode(''),'/2220/18943.html','true',[],'',''],
		['PAGE','24401',jdecode('Order+Online'),jdecode(''),'/2220/24401.html','true',[],'',''],
		['PAGE','18964',jdecode('Ecoteaux'),jdecode(''),'/2220/18964.html','true',[],'',''],
		['PAGE','18985',jdecode('Data+Sheet'),jdecode(''),'/2220/18985.html','true',[],'',''],
		['PAGE','19006',jdecode('Contacts'),jdecode(''),'/2220/19006.html','true',[],'','']
	],'',''],
	['PAGE','25101',jdecode('SHOP+ONLINE'),jdecode(''),'/25101.html','true',[],'',''],
	['PAGE','2241',jdecode('CONTACT'),jdecode(''),'/2241.html','true',[],'','']];
var siteelementCount=30;
theSitetree.topTemplateName='Blast';
theSitetree.paletteFamily='FFF476';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='33267';
theSitetree.graphicsetId='14144';
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: 			'Blast',
				paletteFamily: 	'FFF476',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'33267',
				graphicsetId: 	'14144',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'D29D0D',
				b_color: 		'F5F36A',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20100107-173925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2052',
internalId:  '',
customField: '20100107-101004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2199',
internalId:  '',
customField: '20091004-210141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2220',
internalId:  '',
customField: '20091015-105110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2073',
internalId:  '',
customField: '20090828-191741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2094',
internalId:  '',
customField: '20090828-191834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16401',
internalId:  '',
customField: '20091015-151443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2115',
internalId:  '',
customField: '20100210-071917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2136',
internalId:  '',
customField: '20090828-191940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2241',
internalId:  '',
customField: '20100210-072147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2178',
internalId:  '',
customField: '20100210-072008'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2001',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15401',
internalId:  '',
customField: '20090916-082958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17001',
internalId:  '',
customField: '20091004-213550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17022',
internalId:  '',
customField: '20091004-214234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17043',
internalId:  '',
customField: '20091004-214710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17064',
internalId:  '',
customField: '20100210-072103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17085',
internalId:  '',
customField: '20091015-112547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17127',
internalId:  '',
customField: '20100210-072213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17106',
internalId:  '',
customField: '20091004-222906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18801',
internalId:  '',
customField: '20091015-105909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18901',
internalId:  '',
customField: '20091015-111024'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18922',
internalId:  '',
customField: '20091015-112503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18943',
internalId:  '',
customField: '20100210-072315'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19006',
internalId:  '',
customField: '20100210-072341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18964',
internalId:  '',
customField: '20091015-135234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18985',
internalId:  '',
customField: '20091015-143205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23001',
internalId:  '',
customField: '20100118-135919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23601',
internalId:  '',
customField: '20100118-140120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24401',
internalId:  '',
customField: '20100118-140235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25101',
internalId:  '',
customField: '20100107-110805'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW330INE8S3';
var companyName   = '++++++++++++++++++++++++++++++PRINCE+CANNA';
var htmlTitle	  = 'PRINCE+CANNA';
var metaKeywords  = 'fromage%2C+chanvre%2C+fromage+au+chanvre%2C+fromagerie%2C+prince%2C+canna%2C+prince+canna%2C+ecoteaux%2C+huile+essentielle%2C+huile+essentielle+de+chanvre%2CK%C3%A4se%2C+Hanf%2C+Hanfk%C3%A4se%2C+K%C3%A4serei%2C+%C3%A4therisches+Oil%2Ccheese%2C+hemp%2C+hemp+cheese%2C+hemp+essential+oil%2C+essential+oil%2CPascal+Morard%2C+Huguenin+SA%2C+Olivier+Sonnay%2C';
var metaContents  = 'PRINCE+CANNA%3A+d%C3%A9couvrez+les+secrets+du+Prince+Canna%2C+un+fromage+exceptionnel+au+chanvre%2C+produit+en+Suisse%2C+respectant+les+traditions+et+la+nature.';
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();
};
