/* [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','151579',jdecode('News+2010'),jdecode(''),'/151579/index.html','true',[ 
		['PAGE','151630',jdecode('R%C3%A9sum%C3%A9s+2010'),jdecode(''),'/151579/151630.html','true',[],'',''],
		['PAGE','151651',jdecode('Calendrier+2010'),jdecode(''),'/151579/151651.html','true',[],'','']
	],'',''],
	['PAGE','18555',jdecode('Pilote'),jdecode(''),'/18555.html','true',[],'',''],
	['PAGE','18663',jdecode('Partenaires'),jdecode(''),'/18663.html','true',[],'',''],
	['PAGE','39299',jdecode('Liens'),jdecode(''),'/39299.html','true',[],'',''],
	['PAGE','116901',jdecode('Albums+photos'),jdecode(''),'/116901/index.html','true',[ 
		['PAGE','171079',jdecode('2010+Soir%C3%A9e+15+Avril'),jdecode(''),'/116901/171079.html','true',[],'',''],
		['PAGE','155879',jdecode('2010+Saison'),jdecode(''),'/116901/155879.html','true',[],'',''],
		['PAGE','134201',jdecode('2009+Soir%C3%A9e+1er+Avril'),jdecode(''),'/116901/134201.html','true',[],'',''],
		['PAGE','125122',jdecode('2009+Saison+'),jdecode(''),'/116901/125122.html','true',[],'',''],
		['PAGE','125101',jdecode('2008+Saison'),jdecode(''),'/116901/125101.html','true',[],'',''],
		['PAGE','18636',jdecode('2007+Saison'),jdecode(''),'/116901/18636.html','true',[],'',''],
		['PAGE','49243',jdecode('2006+Saison'),jdecode(''),'/116901/49243.html','true',[],'',''],
		['PAGE','49222',jdecode('Karting'),jdecode(''),'/116901/49222.html','true',[],'','']
	],'',''],
	['PAGE','39281',jdecode('Contact'),jdecode(''),'/39281.html','true',[],'',''],
	['PAGE','102301',jdecode('Archives+2009'),jdecode(''),'/102301/index.html','true',[ 
		['PAGE','102352',jdecode('R%C3%A9sum%C3%A9s+2009'),jdecode(''),'/102301/102352.html','true',[],'','']
	],'',''],
	['PAGE','18501',jdecode('Archives+2008'),jdecode(''),'/18501/index.html','true',[ 
		['PAGE','62801',jdecode('R%C3%A9sum%C3%A9s+2008'),jdecode(''),'/18501/62801.html','true',[],'','']
	],'',''],
	['PAGE','39236',jdecode('Archives+2006'),jdecode(''),'/39236.html','true',[],'',''],
	['PAGE','111401',jdecode('Archives+2007'),jdecode(''),'/111401/index.html','true',[ 
		['PAGE','18609',jdecode('R%C3%A9sum%C3%A9s+2007'),jdecode(''),'/111401/18609.html','true',[],'','']
	],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Match';
theSitetree.paletteFamily='FF3333';
theSitetree.keyvisualId='2694';
theSitetree.keyvisualName='kv_2694.jpg';
theSitetree.fontsetId='10404';
theSitetree.graphicsetId='10635';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='CCCCCC';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Match',
				paletteFamily: 	'FF3333',
				keyvisualId: 	'2694',
				keyvisualName: 	'kv_2694.jpg',
				fontsetId: 		'10404',
				graphicsetId: 	'10635',
				contentColor: 	'000000',
				contentBGColor: 'CCCCCC',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FF3333',
				e_color: 		'545353',
				f_color: 		'545353',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '151579',
internalId:  '1501',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102301',
internalId:  '',
customField: '20100407-213238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18501',
internalId:  '',
customField: '20090119-104626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '111401',
internalId:  '',
customField: '20090119-201250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39236',
internalId:  '',
customField: '20070916-123654'
};
webappMappings['7060']=webappMappings['7060-4e8dda0393273d95f6d079247ab08e36']={
webappId:    '7060',
documentId:  '155879',
internalId:  '4e8dda0393273d95f6d079247ab08e36',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18663',
internalId:  '',
customField: '20100216-211130'
};
webappMappings['7060']=webappMappings['7060-cc8317bbe23846591ac64f75371c124b']={
webappId:    '7060',
documentId:  '125101',
internalId:  'cc8317bbe23846591ac64f75371c124b',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18636',
internalId:  '',
customField: '20090225-215027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '151579',
internalId:  '',
customField: '20100705-161511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39281',
internalId:  '',
customField: '20100216-211846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102352',
internalId:  '',
customField: '20100407-213256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '155879',
internalId:  '',
customField: '20100417-134708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62801',
internalId:  '',
customField: '20080928-211223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18609',
internalId:  '',
customField: '20080408-181640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18555',
internalId:  '',
customField: '20100419-161838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39299',
internalId:  '',
customField: '20100419-155520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49243',
internalId:  '',
customField: '20090225-215247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49222',
internalId:  '',
customField: '20090225-215402'
};
webappMappings['7060']=webappMappings['7060-dfd55b66ba33c2a4e5a5f9b46bb29dde']={
webappId:    '7060',
documentId:  '134201',
internalId:  'dfd55b66ba33c2a4e5a5f9b46bb29dde',
customField: 'language:fr;country:FR;'
};
webappMappings['7060']=webappMappings['7060-f340360723853b3f52e8d20c7db40055']={
webappId:    '7060',
documentId:  '18636',
internalId:  'f340360723853b3f52e8d20c7db40055',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116901',
internalId:  '',
customField: '20090226-215759'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '116901',
internalId:  'search',
customField: 'language:fr;country:FR;'
};
webappMappings['7060']=webappMappings['7060-2ab404fd54ae24fd41bbb122bc902db0']={
webappId:    '7060',
documentId:  '49243',
internalId:  '2ab404fd54ae24fd41bbb122bc902db0',
customField: 'language:fr;country:FR;'
};
webappMappings['7060']=webappMappings['7060-578cf3e8db958d3b87feb65189ac52d9']={
webappId:    '7060',
documentId:  '49222',
internalId:  '578cf3e8db958d3b87feb65189ac52d9',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134201',
internalId:  '',
customField: '20090403-091644'
};
webappMappings['7060']=webappMappings['7060-b61b2a6fc8b727da11fe0a1f57f4b034']={
webappId:    '7060',
documentId:  '125122',
internalId:  'b61b2a6fc8b727da11fe0a1f57f4b034',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125101',
internalId:  '',
customField: '20090225-214820'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125122',
internalId:  '',
customField: '20090225-214753'
};
webappMappings['1501']=webappMappings['1501-1211292']={
webappId:    '1501',
documentId:  '151579',
internalId:  '1211292',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '151579',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '151630',
internalId:  '',
customField: '20100705-192727'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '151651',
internalId:  '',
customField: '20100216-203440'
};
webappMappings['7060']=webappMappings['7060-bafbd48e5f7845ac7ba54947daf827c2']={
webappId:    '7060',
documentId:  '171079',
internalId:  'bafbd48e5f7845ac7ba54947daf827c2',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '171079',
internalId:  '',
customField: '20100417-134613'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INX2GI';
var companyName   = 'Fabien+Thuner';
var htmlTitle	  = '';
var metaKeywords  = 'Renault+Megane+Trophy+Eurocup+World+Series+Formule+Renault+2.0++Fabien+Thuner++Championnat+Suisse++Karting+Kart++Formula+Renault++JD+Racing+team++Founex++Pilote+automobile+Suisse++Racing+driver++swiss+++switzerland+++schweiz++Team+Jenzer+Autobritt+Bousten+Energy+Racing';
var metaContents  = 'Le+site+officiel+du+pilote+Suisse+Fabien+Thuner.';
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();
};
