/* [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','4520',jdecode('Home'),jdecode(''), jdecode('%2F4520.html'), 'true',[],'',''],
	['PAGE','4577',jdecode('Qui+sommes-nous%3F'),jdecode(''), jdecode('%2F4577.html'), 'true',[],'',''],
	['PAGE','31359',jdecode('Horaires'),jdecode(''), jdecode('%2F31359.html'), 'true',[],'',''],
	['PAGE','29495',jdecode('Photos+du+salon'),jdecode(''), jdecode('%2F29495.html'), 'true',[],'',''],
	['PAGE','4604',jdecode('Tarifs'),jdecode(''), jdecode('%2F4604%2Findex.html'), 'true',[ 
		['PAGE','4631',jdecode('Coiffure'),jdecode(''), jdecode('%2F4604%2F4631.html'), 'true',[],'',''],
		['PAGE','4658',jdecode('Esth%C3%A9tique'),jdecode(''), jdecode('%2F4604%2F4658.html'), 'true',[],'',''],
		['PAGE','4685',jdecode('Onglerie'),jdecode(''), jdecode('%2F4604%2F4685.html'), 'true',[],'',''],
		['PAGE','29518',jdecode('Epilation+d%C3%A9finitive'),jdecode(''), jdecode('%2F4604%2F29518.html'), 'true',[],'','']
	],'',''],
	['PAGE','29274',jdecode('Acc%C3%A8s+%26+Contact'),jdecode(''), jdecode('%2F29274.html'), 'true',[],'',''],
	['PAGE','25401',jdecode('Mes+liens+pr%C3%A9f%C3%A9r%C3%A9s'),jdecode(''), jdecode('%2F25401.html'), 'true',[],'',''],
	['PAGE','19361',jdecode('Livre+d%26%23x27%3Bor'),jdecode(''), jdecode('%2F19361%2Findex.html'), 'true',[ 
		['PAGE','19362',jdecode('Entr%C3%A9es'),jdecode(''), jdecode('%2F19361%2F19362.html'), 'false',[],'','']
	],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Architekt';
theSitetree.paletteFamily='FFCC66';
theSitetree.keyvisualId='1718';
theSitetree.keyvisualName='schminken.jpg';
theSitetree.fontsetId='281';
theSitetree.graphicsetId='343';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFCC66';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Architekt',
				paletteFamily: 	'FFCC66',
				keyvisualId: 	'1718',
				keyvisualName: 	'schminken.jpg',
				fontsetId: 		'281',
				graphicsetId: 	'343',
				contentColor: 	'000000',
				contentBGColor: 'FFCC66',
				a_color: 		'FFCC66',
				b_color: 		'CC6600',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4577',
internalId:  '',
customField: '20120118-143443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19361',
internalId:  '',
customField: '20050421-174836'
};
webappMappings['1002']=webappMappings['1002-19361ABW0X0INXZXM']={
webappId:    '1002',
documentId:  '19361',
internalId:  '19361ABW0X0INXZXM',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4520',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29274',
internalId:  '',
customField: '20120118-142010'
};
webappMappings['1009']=webappMappings['1009-6086380']={
webappId:    '1009',
documentId:  '26535',
internalId:  '6086380',
customField: 'isFollowupPage:true;documentId:26504;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4604',
internalId:  '',
customField: '20120118-144410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4520',
internalId:  '',
customField: '20120118-143149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4631',
internalId:  '',
customField: '20120118-151116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4658',
internalId:  '',
customField: '20120118-153309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4685',
internalId:  '',
customField: '20120118-145535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29518',
internalId:  '',
customField: '20091116-004653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26535',
internalId:  '',
customField: '20051208-120233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25401',
internalId:  '',
customField: '20060310-104646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19362',
internalId:  '',
customField: '20050421-174836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29495',
internalId:  '',
customField: '20111229-155130'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '31359',
internalId:  '-',
customField: '20120118-144217'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXZXM';
var companyName   = 'Charl%C3%A8ne+Beauty';
var htmlTitle	  = 'www.CharleneBeauty.com';
var metaKeywords  = '';
var metaContents  = '';
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();
};

