/* [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','4480',jdecode('Accueil'),jdecode(''), jdecode('%2F4480.html'), 'true',[],'',''],
	['PAGE','4973',jdecode('Sophrologie+'),jdecode(''), jdecode('%2F4973.html'), 'true',[],'',''],
	['PAGE','5329',jdecode('Acouph%C3%A8nes'),jdecode(''), jdecode('%2F5329.html'), 'true',[],'',''],
	['PAGE','5302',jdecode('M%C3%A9ditation+'),jdecode(''), jdecode('%2F5302.html'), 'true',[],'',''],
	['PAGE','5356',jdecode('Angoisse%2FAnxi%C3%A9t%C3%A9%2FStress'),jdecode(''), jdecode('%2F5356.html'), 'true',[],'',''],
	['PAGE','5437',jdecode('Programme%2FTarifs%2FInfos'),jdecode(''), jdecode('%2F5437.html'), 'true',[],'',''],
	['PAGE','5383',jdecode('CD+audio+par+poste'),jdecode(''), jdecode('%2F5383.html'), 'false',[],'',''],
	['PAGE','5410',jdecode('Salle+%C3%A0+louer+p.+activit%C3%A9s'),jdecode(''), jdecode('%2F5410.html'), 'true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Reflectance';
theSitetree.paletteFamily='7E8CE4';
theSitetree.keyvisualId='3604';
theSitetree.keyvisualName='kv_3604.jpg';
theSitetree.fontsetId='10740';
theSitetree.graphicsetId='10854';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2QE'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Reflectance',
				paletteFamily: 	'7E8CE4',
				keyvisualId: 	'3604',
				keyvisualName: 	'kv_3604.jpg',
				fontsetId: 		'10740',
				graphicsetId: 	'10854',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'7E8CE4',
				e_color: 		'424978',
				f_color: 		'A09D9D',
				hasCustomLogo: 	'false',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4480',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4480',
internalId:  '',
customField: '20111130-162413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5383',
internalId:  '',
customField: '20110718-093734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4973',
internalId:  '',
customField: '20101102-100720'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5329',
internalId:  '',
customField: '20110601-101219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5302',
internalId:  '',
customField: '20111118-195033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5356',
internalId:  '',
customField: '20110126-094537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5410',
internalId:  '',
customField: '20111230-130502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5437',
internalId:  '',
customField: '20120123-153259'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INX2N2';
var companyName   = 'Sophrologie-Gen%C3%A8ve';
var htmlTitle	  = 'http%3A%2F%2Fwww.sophrologie-geneve.ch';
var metaKeywords  = 'sophrologie%2C+relaxation%2C+memoire%2C+angoisses%2C+anxiete%2C+stress%2C+fatigue+chronique%2C+insomnies%2C+tensions+physiques+et+psychiques%2Cacouphenes%2C+%C2%AB+troubles+de+la+memoire+%C2%BB%2C++Geneve%2C+psychosomatique%2C+m%C3%A9moire%2C+%C2%AB+troubles+de+la+m%C3%A9moire+%C2%BB%2C+sophrologie%2C+relaxation%2C+%C2%AB+trous+de+memoire+%C2%BB%2C+%C2%AB+probl%C3%A8mes+de+memoire+%C2%BB%2C+Gen%C3%A8ve%2C+Suisse%2C+phobies%2C+troubles+de+la+memoire%2C+trac%2C+timidite%2C+douleurs+psychosomatiques%2C+acouphenes';
var metaContents  = 'Sophrologie+caycedienne+%C3%A0+Gen%C3%A8ve.+Tr%C3%A8s+bons+resultats+lors+de+prevention+ou+traitement+de+%3A+angoisses%2C+anxiete%2C+stress%2C+phobies%2C+tensions+physiques+et+psychiques%2C+troubles+de+la+memoire%2C+trac%2C+timidite%2C+fatigue+chronique%2C+insomnies%2C+douleurs+psychosomatiques%2C+acouphenes.++Seances+individuelles%2C+petits+groupes%2C+ateliers';
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();
};

