/* [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','3001',jdecode('Bienvenue+chez+Winconseil+%21'),jdecode(''),'/3001.html','true',[],'',''],
	['PAGE','3052',jdecode('Assurance+Maladie'),jdecode(''),'/3052.html','true',[],'',''],
	['PAGE','3073',jdecode('+Pr%C3%A9voyance+-+Assurance+Vie'),jdecode(''),'/3073.html','true',[],'',''],
	['PAGE','3094',jdecode('Protection+juridique'),jdecode(''),'/3094.html','true',[],'',''],
	['PAGE','3115',jdecode('Assurance+pour+animaux'),jdecode(''),'/3115.html','true',[],'',''],
	['PAGE','3201',jdecode('Autres+assurances'),jdecode(''),'/3201/index.html','true',[ 
		['PAGE','3222',jdecode('Assurances+pour+v%C3%A9hicules'),jdecode(''),'/3201/3222.html','true',[],'',''],
		['PAGE','3243',jdecode('Assurance+m%C3%A9nage'),jdecode(''),'/3201/3243.html','true',[],'',''],
		['PAGE','3264',jdecode('Responsabilit%C3%A9+civile'),jdecode(''),'/3201/3264.html','true',[],'','']
	],'',''],
	['PAGE','16601',jdecode('Cr%C3%A9dit+priv%C3%A9'),jdecode(''),'/16601.html','true',[],'',''],
	['PAGE','3306',jdecode('Contactez-nous'),jdecode(''),'/3306.html','true',[],'',''],
	['PAGE','26101',jdecode('Qui+sommes-nous%3F'),jdecode(''),'/26101.html','true',[],'',''],
	['PAGE','3285',jdecode('Offres+d%26%23x27%3Bemploi'),jdecode(''),'/3285.html','true',[],'',''],
	['PAGE','3390',jdecode('Recherche+par+mot-cl%C3%A9'),jdecode(''),'/3390.html','true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Case';
theSitetree.paletteFamily='10224E';
theSitetree.keyvisualId='11330';
theSitetree.keyvisualName='kv_11330.jpg';
theSitetree.fontsetId='31939';
theSitetree.graphicsetId='13780';
theSitetree.contentColor='555555';
theSitetree.contentBGColor='F6FBFE';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Case',
				paletteFamily: 	'10224E',
				keyvisualId: 	'11330',
				keyvisualName: 	'kv_11330.jpg',
				fontsetId: 		'31939',
				graphicsetId: 	'13780',
				contentColor: 	'555555',
				contentBGColor: 'F6FBFE',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3001',
internalId:  '',
customField: '20100913-220610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3052',
internalId:  '',
customField: '20100630-213950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3073',
internalId:  '',
customField: '20100322-213409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3094',
internalId:  '',
customField: '20100322-213428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3115',
internalId:  '',
customField: '20100630-214038'
};
webappMappings['7008']=webappMappings['7008-9078']={
webappId:    '7008',
documentId:  '3306',
internalId:  '9078',
customField: 'language:fr;country:FR;'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '3390',
internalId:  'search',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3201',
internalId:  '',
customField: '20100329-222227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3306',
internalId:  '',
customField: '20100328-152410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26101',
internalId:  '',
customField: '20100403-153957'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '3001',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-31051215']={
webappId:    '1501',
documentId:  '3001',
internalId:  '31051215',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3222',
internalId:  '',
customField: '20100322-213508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3243',
internalId:  '',
customField: '20100328-150319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3264',
internalId:  '',
customField: '20100328-152228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3285',
internalId:  '',
customField: '20100403-160248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16601',
internalId:  '',
customField: '20100403-145914'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3390',
internalId:  '',
customField: '20100328-152522'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INEUM9';
var companyName   = 'Winconseil++-++Optimisez+votre+budget+%21';
var htmlTitle	  = '';
var metaKeywords  = 'assurance%2C+assurance+maladie%2C+caisse+maladie%2C+assurances%2C+assura%2C+caisse-maladie%2C+LAMal%2C+assurance+compl%C3%A9mentaire%2C+assurances+compl%C3%A9mentaires%2C+couverture+d%27assurance%2C+prime%2C+primes+avantageuses%2C+prime+pas+ch%C3%A8re%2C+assurance+vie%2C+assurance-vie%2C+assurance+v%C3%A9hicule%2C+assurance+vehicule%2C+assurance+voiture%2C+protection+juridique%2C+assurance+chien%2C+assurance+chat%2C+sant%C3%A9suisse%2C+animalia%2C+generali%2C+responsabilit%C3%A9+civile%2C+rc%2C+assurance+m%C3%A9nage.';
var metaContents  = 'Conseils+en+assurance+maladie%2C+assurance+vie%2C+assurances+v%C3%A9hicules+et+choses%2C+responsabilit%C3%A9+civile%2C+assurance+pour+animaux+de+compagnie%2C+protection+juridique.';
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();
};

