/* [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','4597',jdecode('Bienvenue+%21'),jdecode(''), jdecode('%2F4597.html'), 'true',[],'',''],
	['PAGE','317101',jdecode('Actualit%C3%A9s'),jdecode(''), jdecode('%2F317101.html'), 'true',[],'',''],
	['PAGE','436701',jdecode('Palmar%C3%A8s'),jdecode(''), jdecode('%2F436701.html'), 'false',[],'',''],
	['PAGE','4843',jdecode('%C3%89quipe+de+comp%C3%A9titions'),jdecode(''), jdecode('%2F4843.html'), 'true',[],'',''],
	['PAGE','462712',jdecode('Saison+2011-12'),jdecode(''), jdecode('%2F462712%2Findex.html'), 'true',[ 
		['PAGE','397201',jdecode('R%C3%A9sultats+-+Saison+2010-11'),jdecode(''), jdecode('%2F462712%2F397201.html'), 'true',[],'',''],
		['PAGE','316701',jdecode('R%C3%A9sultats+-+Saison+2009-10'),jdecode(''), jdecode('%2F462712%2F316701.html'), 'true',[],'','']
	],'',''],
	['PAGE','317001',jdecode('Camps+d%26%23x27%3Bentra%C3%AEnement'),jdecode(''), jdecode('%2F317001.html'), 'false',[],'',''],
	['PAGE','477212',jdecode('ECK'),jdecode(''), jdecode('%2F477212.html'), 'false',[],'',''],
	['PAGE','341101',jdecode('GOLD-COAST-CUP'),jdecode(''), jdecode('%2F341101%2Findex.html'), 'false',[ 
		['PAGE','327901',jdecode('Informations'),jdecode(''), jdecode('%2F341101%2F327901.html'), 'false',[],'',''],
		['PAGE','341143',jdecode('Horaires+de+la+comp%C3%A9tition'),jdecode(''), jdecode('%2F341101%2F341143.html'), 'false',[],'',''],
		['PAGE','341122',jdecode('R%C3%A9sultats+GCC+2009'),jdecode(''), jdecode('%2F341101%2F341122.html'), 'false',[],'','']
	],'',''],
	['PAGE','17218',jdecode('Contacts'),jdecode(''), jdecode('%2F17218.html'), 'true',[],'',''],
	['PAGE','4789',jdecode('Tarifs'),jdecode(''), jdecode('%2F4789.html'), 'false',[],'',''],
	['PAGE','4951',jdecode('Liens'),jdecode(''), jdecode('%2F4951.html'), 'true',[],'',''],
	['PAGE','341801',jdecode('Mentions+l%C3%A9gales'),jdecode(''), jdecode('%2F341801.html'), 'false',[],'',''],
	['PAGE','488612',jdecode('Stages+d%26%23x27%3B%C3%A9t%C3%A9+2012'),jdecode(''), jdecode('%2F488612.html'), 'false',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Push';
theSitetree.paletteFamily='B99BC7';
theSitetree.keyvisualId='11441';
theSitetree.keyvisualName='kv_11441.jpg';
theSitetree.fontsetId='32013';
theSitetree.graphicsetId='13840';
theSitetree.contentColor='2C4E8B';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Push',
				paletteFamily: 	'B99BC7',
				keyvisualId: 	'11441',
				keyvisualName: 	'kv_11441.jpg',
				fontsetId: 		'32013',
				graphicsetId: 	'13840',
				contentColor: 	'2C4E8B',
				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['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '436701',
internalId:  '',
customField: '20120131-221402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4843',
internalId:  '',
customField: '20120122-194459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '462712',
internalId:  '',
customField: '20120131-221103'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4597',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-455971']={
webappId:    '1501',
documentId:  '4597',
internalId:  '455971',
customField: '1501'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '17218',
internalId:  'location',
customField: 'language:fr;country:FR;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '317001',
internalId:  '',
customField: '20120101-135344'
};
webappMappings['1009']=webappMappings['1009-5722153']={
webappId:    '1009',
documentId:  '20159',
internalId:  '5722153',
customField: 'isFollowupPage:true;documentId:4597;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20159',
internalId:  '',
customField: '20050820-164248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4597',
internalId:  '',
customField: '20120130-105917'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '327901',
internalId:  '',
customField: '20110620-163744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '316701',
internalId:  '',
customField: '20110521-190521'
};
webappMappings['7050']=webappMappings['7050-735']={
webappId:    '7050',
documentId:  '317101',
internalId:  '735',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4789',
internalId:  '',
customField: '20100726-112245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '317101',
internalId:  '',
customField: '20110911-142411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17218',
internalId:  '',
customField: '20120109-112301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4951',
internalId:  '',
customField: '20120109-123040'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '488612',
internalId:  '-',
customField: '20120106-171231'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '477212',
internalId:  '-',
customField: '20120106-170249'
};
webappMappings['7008']=webappMappings['7008-13384']={
webappId:    '7008',
documentId:  '317001',
internalId:  '13384',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '397201',
internalId:  '',
customField: '20110715-095935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '341101',
internalId:  '',
customField: '20110620-161054'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '341122',
internalId:  '',
customField: '20110620-161358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '341143',
internalId:  '',
customField: '20091021-114104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '341801',
internalId:  '',
customField: '20120106-155705'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXX9M';
var companyName   = 'WWW.RICHARDLEROY.CH';
var htmlTitle	  = '';
var metaKeywords  = 'richard+leroy+timothy+leemann+mikael+redin+virginie+clerc+sergey+balashov+choregraphie+patinage+artistique+suisse+cornelia+diener+tomi+pulkkinen+carmen+oliveras+vanessa+rossi+bettina+heim+ramona+elsener+florian+roost+luna+meyer+beltrami+aurelia+buchs+eck+kessnacht+tamim+kandil+danse+sur+glace';
var metaContents  = 'Entraineur+de+patinage+en+Suisse+dans+le+canton+de+Zurich+%3A+pr%C3%A9sentation+de+l%27%C3%A9cole+de+patinage%2C+du+travail+de+chor%C3%A9graphies%2C+des+stages+et+de+toutes+les+informations+du+club+de+K%C3%BCsnacht.';
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();
};

