/* [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','4558',jdecode('Accueil'),jdecode(''),'/4558.html','true',[],'',''],
	['PAGE','10903',jdecode('Nouveaut%C3%A9s'),jdecode(''),'/10903.html','true',[],'',''],
	['PAGE','4615',jdecode('Tapissier-d%C3%A9corateur'),jdecode(''),'/4615.html','true',[],'',''],
	['PAGE','11203',jdecode('Courtepointi%C3%A8re'),jdecode(''),'/11203.html','true',[],'',''],
	['PAGE','9803',jdecode('Produits'),jdecode(''),'/9803.html','true',[],'',''],
	['PAGE','10930',jdecode('Offres+sp%C3%A9ciales'),jdecode(''),'/10930.html','true',[],'',''],
	['PAGE','4723',jdecode('Contact'),jdecode(''),'/4723/index.html','true',[ 
		['PAGE','40433',jdecode('Contact+%28Folgeseite%29'),jdecode(''),'/4723/40433.html','false',[],'','']
	],'',''],
	['PAGE','38616',jdecode('Liens+fournisseurs'),jdecode(''),'/38616.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='990000';
theSitetree.keyvisualId='1286';
theSitetree.keyvisualName='antikes.jpg';
theSitetree.fontsetId='190';
theSitetree.graphicsetId='232';
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: 	'990000',
				keyvisualId: 	'1286',
				keyvisualName: 	'antikes.jpg',
				fontsetId: 		'190',
				graphicsetId: 	'232',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'990000',
				b_color: 		'333333',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, 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:  '4558',
internalId:  '',
customField: '20091206-172904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4723',
internalId:  '',
customField: '20090211-204430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10903',
internalId:  '',
customField: '20090211-202734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4615',
internalId:  '',
customField: '20090211-210110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11203',
internalId:  '',
customField: '20041102-194200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9803',
internalId:  '',
customField: '20060917-151015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10930',
internalId:  '',
customField: '20090211-204233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38616',
internalId:  '',
customField: '20090211-205349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40433',
internalId:  '',
customField: '20050123-174558'
};
webappMappings['7008']=webappMappings['7008-7173']={
webappId:    '7008',
documentId:  '4723',
internalId:  '7173',
customField: 'language:fr;country:FR;'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXVIO';
var companyName   = 'Votre+artisan+tapissier-d%C3%A9corateur';
var htmlTitle	  = 'D%C3%A9coration+d%27int%C3%A9rieur+Paratte%2C+Tapissier-d%C3%A9corateur.';
var metaKeywords  = 'Tapissier-d%C3%A9corateur%2C+d%C3%A9coration+d%27int%C3%A9rieur%2C+d%C3%A9corateur+d%27int%C3%A9rieur%2C+meubles+rembourr%C3%A9s%2C+rembourrage%2C+rideaux%2C+voilages%2C+moquette%2C+tenture+murale%2C+literie%2C+luminaires%2C+courtepointi%C3%A8re%2C+tissus%2C+rev%C3%AAtement+de+sol%2C+duvet%2C+plume%2C+crin%2C+toile%2C+d%C3%A9coration%2C+devis+gratuit%2C+collections+tissus%2C+stores%2C+toile+de+tente%2C+moustiquaire%2C+tissu+grande+largeur%2C+m%C3%A9lamin%C3%A9%2C+PVC%2C+linol%C3%A9um%2C+t%C3%AAte+flamande%2C+confection%2C+rembourrage+%C3%A0+l%27ancienne%2C+toile+de+tente%2C+Alain+Paratte%2C+m%C3%A9lamin%C3%A9%2C+Saint-Sulpice%2C+Montricher%2C+devis+gratuit%2C+stores+bateau%2C+v%C3%A9nitien%2C+stores+%C3%A0+lamelles%2C+Braqueni%C3%A9%2C+Pierre+Frey%2C+Gaston+y+Daniela%2C+Boussac%2C+Romanex%2C+Veraseta%2C+Tassinari+et+Chatel%2C+Christian+Fischbacher%2C+Paratte%2C+Alain++Paratte%2C+Tissus+bio%2C+bio%2C+Pierre+Frey%2C+Nobilis%2C+Casamance%2C+Camengo%2C+';
var metaContents  = 'Site+de+d%EF%BF%BDcoration+dint%EF%BF%BDrieur+avec+la+pr%EF%BF%BDsentation+du+m%EF%BF%BDtier%2C+des+produits%2C+offres+sp%EF%BF%BDciales+et+nouveaut%EF%BF%BDs.';
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();
};
