/* [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','19601',jdecode('Page+d%26%23x27%3Baccueil'),jdecode(''),'/19601.html','true',[],'',''],
	['PAGE','27901',jdecode('Les+Bo%C3%AEtes+aux+lettres'),jdecode(''),'/27901.html','true',[],'',''],
	['PAGE','60801',jdecode('D%C3%A9corations+P%C3%A2ques'),jdecode(''),'/60801.html','true',[],'',''],
	['PAGE','56401',jdecode('Nouveaut%C3%A9'),jdecode(''),'/56401.html','true',[],'',''],
	['PAGE','27922',jdecode('Cadeaux%2C+D%C3%A9corations'),jdecode(''),'/27922.html','true',[],'',''],
	['PAGE','46001',jdecode('D%C3%A9corations+l%26%23x27%3Bhiver'),jdecode(''),'/46001.html','true',[],'',''],
	['PAGE','38301',jdecode('Mes+tricots+'),jdecode(''),'/38301.html','true',[],'',''],
	['PAGE','25401',jdecode('Services+'),jdecode(''),'/25401.html','true',[],'',''],
	['PAGE','36001',jdecode('Liste+de+Prix'),jdecode(''),'/36001.html','true',[],'',''],
	['PAGE','25422',jdecode('Information+%2F+contact'),jdecode(''),'/25422.html','true',[],'',''],
	['PAGE','40501',jdecode('Album+photo+'),jdecode(''),'/40501.html','true',[],'',''],
	['PAGE','36022',jdecode('Formulaire+d%26%23x27%3Be-mail'),jdecode(''),'/36022.html','true',[],'',''],
	['PAGE','23364',jdecode('Liens'),jdecode(''),'/23364.html','true',[],'',''],
	['PAGE','33901',jdecode('Livre+d%26%23x27%3Bor'),jdecode(''),'/33901.html','true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Blades';
theSitetree.paletteFamily='A13535';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='31704';
theSitetree.graphicsetId='13469';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='A23636';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Blades',
				paletteFamily: 	'A13535',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'31704',
				graphicsetId: 	'13469',
				contentColor: 	'FFFFFF',
				contentBGColor: 'A23636',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '19601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19601',
internalId:  '',
customField: '20100408-080508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27901',
internalId:  '',
customField: '20090920-152041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33901',
internalId:  '',
customField: '20090917-181310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25422',
internalId:  '',
customField: '20091231-103718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25401',
internalId:  '',
customField: '20091008-182734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56401',
internalId:  '',
customField: '20100125-134417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23364',
internalId:  '',
customField: '20100129-084915'
};
webappMappings['1002']=webappMappings['1002-33901abw0x0inxsr2']={
webappId:    '1002',
documentId:  '33901',
internalId:  '33901abw0x0inxsr2',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27922',
internalId:  '',
customField: '20100125-133812'
};
webappMappings['7008']=webappMappings['7008-7419']={
webappId:    '7008',
documentId:  '36022',
internalId:  '7419',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36001',
internalId:  '',
customField: '20091231-091356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36022',
internalId:  '',
customField: '20090920-171336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38301',
internalId:  '',
customField: '20100125-134637'
};
webappMappings['7060']=webappMappings['7060-d5dba629391c6fd38bd35956b60ff027']={
webappId:    '7060',
documentId:  '40501',
internalId:  'd5dba629391c6fd38bd35956b60ff027',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40501',
internalId:  '',
customField: '20091125-181356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46001',
internalId:  '',
customField: '20100125-131251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60801',
internalId:  '',
customField: '20100304-175346'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXSR2';
var companyName   = '';
var htmlTitle	  = 'www.boutiquecaroline.ch';
var metaKeywords  = 'Bo%C3%AEtes+aux+lettres%2C+bo%C3%AEte+aux+lettre%2Ccadeaux%2C+d%C3%A9corations%2C+d%C3%A9coration%2C+arisanal%2C+Boutique%2C+p%C3%A2te+%C3%A0+sel%2C+d%C3%A9corations+%C3%A0+partir+de+bois%2C+objets%2C+Goumoens-la-ville%2C+Caroline%2C+Echallens';
var metaContents  = 'Bo%C3%AEtes+aux+lettres%2C+bo%C3%AEte+aux+lettres%2Ccadeaux%2C+d%C3%A9corations%2C+d%C3%A9coration%2C+artisanal%2C+Boutique%2C+d%C3%A9corations+%C3%A0+partir+de+bois%2C+objets%2C+Goumoens-la-ville%2C+Caroline%2C+Echallens';
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();
};
