/* [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','186824',jdecode('Nouveau+site'),jdecode(''), jdecode('%2F186824.html'), 'true',[],'',''],
	['PAGE','5601',jdecode('Bienvenue'),jdecode(''), jdecode('%2F5601.html'), 'true',[],'',''],
	['PAGE','9301',jdecode('Livre+d%26%23x27%3Bor+'),jdecode(''), jdecode('%2F9301.html'), 'true',[],'',''],
	['PAGE','99913',jdecode('Presse+et+liens'),jdecode(''), jdecode('%2F99913.html'), 'true',[],'',''],
	['PAGE','183313',jdecode('Contact%3A+06+16+23+55+38'),jdecode(''), jdecode('%2F183313.html'), 'true',[],'','']];
var siteelementCount=5;
theSitetree.topTemplateName='Charm';
theSitetree.paletteFamily='E1D5F2';
theSitetree.keyvisualId='11066';
theSitetree.keyvisualName='kv_11066.jpg';
theSitetree.fontsetId='31948';
theSitetree.graphicsetId='13791';
theSitetree.contentColor='797979';
theSitetree.contentBGColor='E1D5F2';
var localeDef={
  language: 'en',
  country: 'GB'
};
var prodDef={
  wl_name: 'easily_co_uk',
  product: 'WSCSYSSSSLY0XVDH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Charm',
				paletteFamily: 	'E1D5F2',
				keyvisualId: 	'11066',
				keyvisualName: 	'kv_11066.jpg',
				fontsetId: 		'31948',
				graphicsetId: 	'13791',
				contentColor: 	'797979',
				contentBGColor: 'E1D5F2',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20111014-220748'
};
webappMappings['1002']=webappMappings['1002-9301anbt20inept0']={
webappId:    '1002',
documentId:  '9301',
internalId:  '9301anbt20inept0',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9301',
internalId:  '',
customField: '20110928-173106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '186824',
internalId:  '',
customField: '20120219-231023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99913',
internalId:  '',
customField: '20111007-090504'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '183313',
internalId:  '',
customField: '20110928-180053'
};
var webAppHostname = 'cgi.easily.co.uk:80';
var canonHostname = 'coucm4all01.netbenefit.co.uk';
var accountId     = 'ANBT20INEPT0';
var companyName   = '';
var htmlTitle	  = 'The+Cake+Toulouse%2C+Helen+Shlosberg%2C+Wedding+Cake%2C+G%C3%A2teaux+de+mariage%2C+wedding+cakes+americains+et+pi%C3%A9ces+mont%C3%A8es+style+anglais+et+americain+%C3%A0+Toulouse%21';
var metaKeywords  = 'pi%C3%A8ces+mont%C3%A9es+%2C+g%C3%A2teaux+de+mariage%2C+wedding+cake%2C+cake%2C+g%C3%A2teau+d%27anniversaire%2C+toulouse%2C%2C+Gateaux+en+3D%2C+G%C3%A2teaux+Rigolos%2C+Les+mari%C3%A9s+de+2011%2C+Patisserie+addict%2C+Plaisir+des+Cupcakes%2C+Pour+nous+les+filles%2C+Toulouse%2C+D%C3%A9co+mariage%2C+Environs+de+Toulouse%2C+G%C3%A2teaux+d%C3%A9cor%C3%A9s%2C+Restaurants+toulouse%2C+Cupcakes%2C+Cookies%2C+P%C3%A2te+%C3%A0+sucre%2C+G%C3%A2teau+3d%2C+Wedding+cake%2C+D%C3%A9coration+de+g%C3%A2teau%2C+G%C3%A2teaux+d%C3%A9co%2C+Gateau+de+mariage%2C+G%C3%A2teau+bapt%C3%AAme%2C+';
var metaContents  = 'pi%C3%A8ces+mont%C3%A9es+%2C+g%C3%A2teaux+de+mariage%2C+wedding+cake%2C+cake%2C+g%C3%A2teau+d%27anniversaire%2C+toulouse%2C%2C+Gateaux+en+3D%2C+G%C3%A2teaux+Rigolos%2C+Les+mari%C3%A9s+de+2011%2C+Patisserie+addict%2C+Plaisir+des+Cupcakes%2C+Pour+nous+les+filles%2C+Toulouse%2C+D%C3%A9co+mariage%2C+Environs+de+Toulouse%2C+G%C3%A2teaux+d%C3%A9cor%C3%A9s%2C+Restaurants+toulouse%2C+Cupcakes%2C+Cookies%2C+P%C3%A2te+%C3%A0+sucre%2C+G%C3%A2teau+3d%2C+Wedding+cake%2C+D%C3%A9coration+de+g%C3%A2teau%2C+G%C3%A2teaux+d%C3%A9co%2C+Gateau+de+mariage%2C+G%C3%A2teau+bapt%C3%AAme%2C+';
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();
};

