/* [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(''),'/4599.html','true',[],'',''],
	['PAGE','4656',jdecode('Biography'),jdecode(''),'/4656.html','true',[],'',''],
	['PAGE','99701',jdecode('Discography'),jdecode(''),'/99701.html','true',[],'',''],
	['PAGE','38784',jdecode('On+Stage'),jdecode(''),'/38784.html','true',[],'',''],
	['PAGE','4710',jdecode('News+%26+Agenda'),jdecode(''),'/4710.html','true',[],'',''],
	['PAGE','61101',jdecode('Press'),jdecode(''),'/61101.html','true',[],'',''],
	['PAGE','67801',jdecode('Medias'),jdecode(''),'/67801.html','true',[],'',''],
	['PAGE','52101',jdecode('Shop'),jdecode(''),'/52101.html','true',[],'',''],
	['PAGE','4791',jdecode('Contact'),jdecode(''),'/4791.html','true',[],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Logg';
theSitetree.paletteFamily='1D6C89';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='421';
theSitetree.graphicsetId='469';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='1D6C89';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Logg',
				paletteFamily: 	'1D6C89',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'421',
				graphicsetId: 	'469',
				contentColor: 	'FFFFFF',
				contentBGColor: '1D6C89',
				a_color: 		'1D6C89',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				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['4001']=webappMappings['4001-16528476']={
webappId:    '4001',
documentId:  '52101',
internalId:  '16528476',
customField: 'language:fr;country:FR;'
};
webappMappings['1501']=webappMappings['1501-1113419']={
webappId:    '1501',
documentId:  '4599',
internalId:  '1113419',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-1173']={
webappId:    '7008',
documentId:  '4791',
internalId:  '1173',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4599',
internalId:  '',
customField: '20100124-172506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4656',
internalId:  '',
customField: '20091015-234058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '99701',
internalId:  '',
customField: '20091015-234727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38784',
internalId:  '',
customField: '20080804-184829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4710',
internalId:  '',
customField: '20100503-194317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61101',
internalId:  '',
customField: '20100118-114838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67801',
internalId:  '',
customField: '20100106-205006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52101',
internalId:  '',
customField: '20091021-183620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4791',
internalId:  '',
customField: '20091015-235114'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INX2J2';
var companyName   = 'Official+Web+Site';
var htmlTitle	  = 'Lynn...+Official+Web+Site';
var metaKeywords  = 'Lynn%2C+lisset%2C+musique%2C+eurovision%2C+alain+morisod%2C+tsr%2C+piano%2C+chant%2C+cubaine%2C+cuba%2C+Gen%C3%A8ve%2C+suisse%2C+concerts%2C+latino%2C+jazz%2C+blues%2C+pop%2C+swiss+world+music%2C+festival%2C+beaulieu%2C+fetes+de+geneve%2C+20+minutes%2C+radio+paradiso%2C+tribune%2C+eaux+vives%2C+one+fm%2C+rouge+fm%2C+tvrl%2C+leman+bleu%2C+myspace%2C+sensuel+sexy+voice%2C+rsr%2C+option+musique%2C+buena+vista+social+club%2C+euro+foot%2C+option+musique%2C+sweet+people%2C+';
var metaContents  = 'Lynn+.++eurovision%2C+alain+morisod%2C+tsr%2C+Lisset+%2C+compositrice%2C+chanteuse%2C+pianiste%2C+Cubaine%2C+Biographie%2C+discographie%2C+news%2C+contact%2C+concerts%2C+havana%2C+raiz+latina%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();
};
