/* [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','5701',jdecode('Le+3%C3%A8me+pilier'),jdecode(''),'/5701.html','true',[],'',''],
	['PAGE','10464',jdecode('Pourquoi+le+3%C3%A8me+pilier+%3F'),jdecode(''),'/10464/index.html','true',[ 
		['PAGE','10401',jdecode('Economiser+des+imp%C3%B4ts'),jdecode(''),'/10464/10401.html','true',[],'',''],
		['PAGE','10101',jdecode('Financer+sa+maison'),jdecode(''),'/10464/10101.html','true',[],'',''],
		['PAGE','10422',jdecode('Prot%C3%A9ger+sa+famille'),jdecode(''),'/10464/10422.html','true',[],'',''],
		['PAGE','10443',jdecode('Pr%C3%A9voir+sa+retraite'),jdecode(''),'/10464/10443.html','true',[],'','']
	],'',''],
	['PAGE','5901',jdecode('Qui+suis-je+%3F+Autres+ass.+%3F'),jdecode(''),'/5901.html','true',[],'',''],
	['PAGE','9001',jdecode('Me+contacter+%2F+Demande+RDV'),jdecode(''),'/9001.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='AC2323';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='356';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='AC2323';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'AC2323',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'356',
				contentColor: 	'FFFFFF',
				contentBGColor: 'AC2323',
				a_color: 		'AC2323',
				b_color: 		'480F0F',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20100828-163625'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20100828-160106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10101',
internalId:  '',
customField: '20100828-161738'
};
webappMappings['7008']=webappMappings['7008-9985']={
webappId:    '7008',
documentId:  '9001',
internalId:  '9985',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9001',
internalId:  '',
customField: '20100828-152232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10401',
internalId:  '',
customField: '20100830-084912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10422',
internalId:  '',
customField: '20100828-162110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10443',
internalId:  '',
customField: '20100828-155622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10464',
internalId:  '',
customField: '20100828-154959'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INEBFZ';
var companyName   = 'www.assurer.ch';
var htmlTitle	  = '';
var metaKeywords  = 'le+3%C3%A8me+pilier%3B+3%C3%A8me+pilier%3B+le+troisi%C3%A8me+pilier%3B+troisi%C3%A8me+pilier%3B+assurance+vie%3B+vie%3B+www.assurer.ch%3B+assurer.ch%3B+%C3%A9pargne+retraite%3B+%C3%A9pargne%3B+accession+%C3%A0+la+propri%C3%A9t%C3%A9%3B+achat+d%27un+bien+immobilier%3B+d%C3%A9duction+fiscale%3B+d%C3%A9ductions+fiscales%3B+%C3%A9conomie+d%27imp%C3%B4ts%3B+imp%C3%B4ts%3B+%C3%A9conomie%3B+protection+financi%C3%A8re%3B+prot%C3%A9ger+ses+proches%3B+prot%C3%A9ger+sa+famille%3B+constitution+d%27un+capital%2C+capital+retraite%3B+capital+garanti%3B+pr%C3%A9voyance%3B+pr%C3%A9voyance+retraite%3B+retraite.';
var metaContents  = 'Avez-vous+besoin+de+RENSEIGNEMENTS%2C+de+CONSEILS+en+mati%C3%A8re+de+pr%C3%A9voyance%2C+d%27une+OFFRE+ou+encore+d%27un+RENDEZ-VOUS+%3F+Alors+n%27h%C3%A9sitez+pas+%C3%A0+visiter+mon+site+d%C3%A9di%C3%A9+au+3%C3%A8me+pilier+%28assurance+vie%29.';
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();
};

