/* [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','773',jdecode('Home'),jdecode(''), jdecode('%2F773.html'), 'true',[],'',''],
	['PAGE','156701',jdecode('Actualit%C3%A9s+-+vid%C3%A9os'),jdecode(''), jdecode('%2F156701.html'), 'true',[],'',''],
	['PAGE','26401',jdecode('Photos'),jdecode(''), jdecode('%2F26401.html'), 'true',[],'',''],
	['PAGE','815',jdecode('CV+presse+pub+TV+clip'),jdecode(''), jdecode('%2F815%2Findex.html'), 'true',[ 
		['PAGE','157401',jdecode('Presse'),jdecode(''), jdecode('%2F815%2F157401.html'), 'true',[],'',''],
		['PAGE','157422',jdecode('Publicit%C3%A9'),jdecode(''), jdecode('%2F815%2F157422.html'), 'true',[],'',''],
		['PAGE','157443',jdecode('TV+-+clip'),jdecode(''), jdecode('%2F815%2F157443.html'), 'true',[],'','']
	],'',''],
	['PAGE','159901',jdecode('Parcours+Cirque'),jdecode(''), jdecode('%2F159901.html'), 'true',[],'',''],
	['PAGE','159922',jdecode('Parcours+Danse'),jdecode(''), jdecode('%2F159922.html'), 'true',[],'',''],
	['PAGE','857',jdecode('Contact+et+lien'),jdecode(''), jdecode('%2F857.html'), 'true',[],'',''],
	['PAGE','3406',jdecode('Livre+d%26%23x27%3Bor'),jdecode(''), jdecode('%2F3406%2Findex.html'), 'true',[ 
		['PAGE','3401',jdecode('Entr%C3%A9es'),jdecode(''), jdecode('%2F3406%2F3401.html'), 'false',[],'','']
	],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Verve';
theSitetree.paletteFamily='CC76EB';
theSitetree.keyvisualId='8400';
theSitetree.keyvisualName='kv_8400.jpg';
theSitetree.fontsetId='17072';
theSitetree.graphicsetId='12445';
theSitetree.contentColor='929191';
theSitetree.contentBGColor='FFFFFF';
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: 			'Verve',
				paletteFamily: 	'CC76EB',
				keyvisualId: 	'8400',
				keyvisualName: 	'kv_8400.jpg',
				fontsetId: 		'17072',
				graphicsetId: 	'12445',
				contentColor: 	'929191',
				contentBGColor: 'FFFFFF',
				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['1002']=webappMappings['1002-3406abw0x0in2547']={
webappId:    '1002',
documentId:  '3406',
internalId:  '3406abw0x0in2547',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '773',
internalId:  '',
customField: '20111231-163547'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '773',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26401',
internalId:  '',
customField: '20111113-123919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '815',
internalId:  '',
customField: '20111231-164025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '857',
internalId:  '',
customField: '20111019-224829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3406',
internalId:  '',
customField: '20111022-175345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3401',
internalId:  '',
customField: '20061022-141605'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156701',
internalId:  '',
customField: '20120108-220422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '157401',
internalId:  '',
customField: '20111231-172944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '157443',
internalId:  '',
customField: '20120108-220637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '157422',
internalId:  '',
customField: '20111101-124513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '159901',
internalId:  '',
customField: '20111113-123648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '159922',
internalId:  '',
customField: '20111113-125612'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN2547';
var companyName   = 'Emi+Vauthey';
var htmlTitle	  = 'EMI+VAUTHEY';
var metaKeywords  = 'Emi+Vauthey+Rudra+Bejart+B%C3%A9jart+Cirque+Eloize++contorsion+danse+m6+incroyable+talent%2C+';
var metaContents  = 'Emi+contorsionniste+danseuse.';
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();
};

