/* [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','4599',jdecode('Home'),jdecode(''), jdecode('%2F4599.html'), 'true',[],'',''],
	['PAGE','4656',jdecode('Page+d%26%23x27%3Baccueil'),jdecode(''), jdecode('%2F4656.html'), 'true',[],'',''],
	['PAGE','5292',jdecode('Pr%C3%A9sentation'),jdecode(''), jdecode('%2F5292.html'), 'true',[],'',''],
	['PAGE','4930',jdecode('La+page+du+mois+Janvier+2012'),jdecode(''), jdecode('%2F4930%2Findex.html'), 'true',[ 
		['PAGE','10655',jdecode('Livres+d%26%23x27%3Boccasion'),jdecode(''), jdecode('%2F4930%2F10655.html'), 'true',[],'','']
	],'',''],
	['PAGE','10118',jdecode('Informations+g%C3%A9n%C3%A9rales'),jdecode(''), jdecode('%2F10118%2Findex.html'), 'true',[ 
		['PAGE','10145',jdecode('Liste+des+Professeurs'),jdecode(''), jdecode('%2F10118%2F10145.html'), 'true',[],'',''],
		['PAGE','4984',jdecode('Contact'),jdecode(''), jdecode('%2F10118%2F4984.html'), 'true',[],'',''],
		['PAGE','8949',jdecode('Contact+%28Folgeseite%29'),jdecode(''), jdecode('%2F10118%2F8949.html'), 'false',[],'','']
	],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='003390';
theSitetree.keyvisualId='1747';
theSitetree.keyvisualName='fitness.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='353';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='003390';
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: 			'Movement',
				paletteFamily: 	'003390',
				keyvisualId: 	'1747',
				keyvisualName: 	'fitness.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'353',
				contentColor: 	'FFFFFF',
				contentBGColor: '003390',
				a_color: 		'003390',
				b_color: 		'000000',
				c_color: 		'FFFFFF',
				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:  '4599',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4599',
internalId:  '',
customField: '20120101-114135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4656',
internalId:  '',
customField: '20111231-111941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5292',
internalId:  '',
customField: '20120101-135431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4930',
internalId:  '',
customField: '20111230-114437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10655',
internalId:  '',
customField: '20061228-140414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10118',
internalId:  '',
customField: '20120101-134907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10145',
internalId:  '',
customField: '20100506-143321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4984',
internalId:  '',
customField: '20120101-131755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8949',
internalId:  '',
customField: '20060618-133810'
};
webappMappings['7008']=webappMappings['7008-5247']={
webappId:    '7008',
documentId:  '4984',
internalId:  '5247',
customField: 'language:fr;country:FR;'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXSXU';
var companyName   = 'Centre+de+Yoga';
var htmlTitle	  = 'Centre+de+Yoga+Lausanne+Berne+Sion';
var metaKeywords  = 'Yoga%2C+yoga%2C+yogaa%2C+yoga+bern%2C+yoga+centre%2C+yoga+lausanne%2C+yoga+suisse%2C+yoga+berne%2C+yoga%2C+a%2C+A%2C+Asana%2C+Pranayama%2C+Bandha%2C+Mudra%2C+Yoga+Lausanne%2C+Armand+Vitali%2C+Krishnamacharya%2C+Sribhashyam%2C+Desikachar%2C+Jean+Herbert%2C+Iyengar%2C+Nathamuni%2C+Krishnamurti%2C+Vitali%2C+Vitali+Armand%2C+Aubry+Serge%2C+Yoga+Berne%2C+Lausanne%2C+Centre+de+Yoga%2C+Yoga+traditionnel%2C+cours+de+yoga%2C+pranayama%2C+Yoga+Centre%2C+Madras%2C+points+vitaux%2C+Lausanne+Yoga%2C+Bern+Yoga%2C+Yoga+Bern%2C+yogaa%2C++sion%2C+asana%2C+bandha%2C+mudra%2C+yoga+berne%2C+physiopathologie%2C+origine+du+yoga%2C+recherche+spirituelle%2C+Bern%2C+Lausanne%2C+Yoga+Berne%2C+Yoga+Lausanne';
var metaContents  = 'Cours+de+Yoga%2C+enseignement+traditionnel+selon+Sri+T.+Krishnamacharya.+Quel+Yoga+et+pour+qui%3F+';
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();
};

