/* [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 theSitetree=[ 
	['PAGE','4558',jdecode('Home'),jdecode(''),'/4558.html','true',[],''],
	['PAGE','12502',jdecode('Qui+sommes-nous%3F'),jdecode(''),'/12502.html','true',[],''],
	['PAGE','16030',jdecode('Notre+projet'),jdecode(''),'/16030.html','true',[],''],
	['PAGE','30065',jdecode('Notre+proposition'),jdecode(''),'/30065.html','true',[],''],
	['PAGE','29721',jdecode('Formation+-+CDA'),jdecode(''),'/29721.html','true',[],''],
	['PAGE','12529',jdecode('Nos+Produits'),jdecode(''),'/12529.html','true',[],''],
	['PAGE','12556',jdecode('Shop+On-Line'),jdecode(''),'/12556.html','true',[],''],
	['PAGE','14402',jdecode('Sponsoring+%2F+Liens'),jdecode(''),'/14402/index.html','true',[ 
		['PAGE','27951',jdecode('Nutrilite'),jdecode(''),'/14402/27951.html','true',[],''],
		['PAGE','27960',jdecode('UNICEF'),jdecode(''),'/14402/27960.html','true',[],''],
		['PAGE','27969',jdecode('E.+Funkhouser'),jdecode(''),'/14402/27969.html','true',[],''],
		['PAGE','27978',jdecode('Artistry'),jdecode(''),'/14402/27978.html','true',[],'']
	],''],
	['PAGE','5083',jdecode('Contact'),jdecode(''),'/5083/index.html','true',[ 
		['PAGE','6502',jdecode('Contact+%28Folgeseite%29'),jdecode(''),'/5083/6502.html','false',[],'']
	],'']];
var siteelementCount=14;
theSitetree.topTemplateName='Seifenblase';
theSitetree.paletteFamily='C8E2FF';
theSitetree.keyvisualId='2358';
theSitetree.keyvisualName='event-agentur5.jpg';
theSitetree.fontsetId='381';
theSitetree.graphicsetId='427';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				name: 			'Seifenblase',
				paletteFamily: 	'C8E2FF',
				keyvisualId: 	'2358',
				keyvisualName: 	'event-agentur5.jpg',
				fontsetId: 		'381',
				graphicsetId: 	'427',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'6666CC',
				e_color: 		'3333CC',
				f_color: 		'9999CC',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4558',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12502',
internalId:  '',
customField: '20070412-201706'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4558',
internalId:  '',
customField: '20070412-201234'
};
webappMappings['7008']=webappMappings['7008-4947']={
webappId:    '7008',
documentId:  '5083',
internalId:  '4947',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16030',
internalId:  '',
customField: '20070412-201809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30065',
internalId:  '',
customField: '20070412-203954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29721',
internalId:  '',
customField: '20070123-192945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12529',
internalId:  '',
customField: '20070123-195416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12556',
internalId:  '',
customField: '20060801-084444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14402',
internalId:  '',
customField: '20070123-192955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27951',
internalId:  '',
customField: '20060801-085236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27960',
internalId:  '',
customField: '20060801-095221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27969',
internalId:  '',
customField: '20060801-094603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27978',
internalId:  '',
customField: '20070123-193037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5083',
internalId:  '',
customField: '20050209-195319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6502',
internalId:  '',
customField: '20060802-070545'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXL19';
var companyName   = 'PK+Distribution';
var htmlTitle	  = 'PK+Distribution';
var metaKeywords  = 'AmwayEmploiOpportunit%C3%A9+daffaireLOCSA8Nutrilite';
var metaContents  = 'AmwayEmploiOpportunit%C3%A9+daffaireLOCSA8Nutrilite';
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();
};
