/* [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','26601',jdecode('Home'),jdecode(''),'/26601.html','true',[],'',''],
	['PAGE','26652',jdecode('Chi+siamo'),jdecode(''),'/26652/index.html','true',[ 
		['PAGE','26715',jdecode('Comitato+'),jdecode(''),'/26652/26715.html','true',[],'',''],
		['PAGE','53701',jdecode('Insegnanti'),jdecode(''),'/26652/53701.html','true',[],'',''],
		['PAGE','53301',jdecode('Monitrici'),jdecode(''),'/26652/53301.html','true',[],'',''],
		['PAGE','52222',jdecode('Statuto'),jdecode(''),'/26652/52222.html','true',[],'','']
	],'',''],
	['PAGE','205901',jdecode('I+nostri+Sponsor'),jdecode(''),'/205901.html','true',[],'',''],
	['PAGE','212501',jdecode('Risultati+TEST'),jdecode(''),'/212501/index.html','true',[ 
		['PAGE','307501',jdecode('stagione+2009+-+2010'),jdecode(''),'/212501/307501.html','true',[],'','']
	],'',''],
	['PAGE','59943',jdecode('Risultati+GARE'),jdecode(''),'/59943/index.html','true',[ 
		['PAGE','124101',jdecode('stagione+2009+-2010'),jdecode(''),'/59943/124101.html','true',[],'','']
	],'',''],
	['PAGE','311101',jdecode('Annuncio+gare'),jdecode(''),'/311101.html','true',[],'',''],
	['PAGE','311801',jdecode('Lugano+Cup'),jdecode(''),'/311801/index.html','true',[ 
		['PAGE','158601',jdecode('Stagione+2009+-2010'),jdecode(''),'/311801/158601.html','true',[],'',''],
		['PAGE','250901',jdecode('Stagione+2008+-+2009'),jdecode(''),'/311801/250901.html','true',[],'','']
	],'',''],
	['PAGE','311822',jdecode('Trofeo+del+Lago'),jdecode(''),'/311822/index.html','true',[ 
		['PAGE','60090',jdecode('Stagione+2009+-+2010'),jdecode(''),'/311822/60090.html','true',[],'',''],
		['PAGE','251401',jdecode('Stagione+2008+-+2009'),jdecode(''),'/311822/251401.html','true',[],'','']
	],'',''],
	['PAGE','312001',jdecode('Gara+Sociale'),jdecode(''),'/312001/index.html','true',[ 
		['PAGE','251422',jdecode('Stagione+2009+-+2010'),jdecode(''),'/312001/251422.html','true',[],'',''],
		['PAGE','251443',jdecode('Stagione+2008+-+2009'),jdecode(''),'/312001/251443.html','true',[],'','']
	],'',''],
	['PAGE','76601',jdecode('Orari+e+tariffe+Sezioni'),jdecode(''),'/76601/index.html','true',[ 
		['PAGE','59922',jdecode('Orari+Amministrazione'),jdecode(''),'/76601/59922.html','true',[],'',''],
		['PAGE','69101',jdecode('Pulcini'),jdecode(''),'/76601/69101.html','true',[],'',''],
		['PAGE','68122',jdecode('Amatori++'),jdecode(''),'/76601/68122.html','true',[],'',''],
		['PAGE','252401',jdecode('Goldies'),jdecode(''),'/76601/252401.html','true',[],'',''],
		['PAGE','68101',jdecode('Artistica'),jdecode(''),'/76601/68101.html','true',[],'',''],
		['PAGE','76622',jdecode('Danza'),jdecode(''),'/76601/76622.html','true',[],'','']
	],'',''],
	['PAGE','26862',jdecode('Sezioni'),jdecode(''),'/26862/index.html','true',[ 
		['PAGE','252443',jdecode('Pulcini'),jdecode(''),'/26862/252443.html','true',[],'',''],
		['PAGE','252422',jdecode('Amatori'),jdecode(''),'/26862/252422.html','true',[],'',''],
		['PAGE','252464',jdecode('Goldies'),jdecode(''),'/26862/252464.html','true',[],'',''],
		['PAGE','59985',jdecode('Artistica'),jdecode(''),'/26862/59985.html','true',[],'',''],
		['PAGE','317101',jdecode('Adulti'),jdecode(''),'/26862/317101.html','true',[],'','']
	],'',''],
	['PAGE','256101',jdecode('Cool+%26+Clean'),jdecode(''),'/256101.html','true',[],'',''],
	['PAGE','312401',jdecode('Comunicazioni'),jdecode(''),'/312401/index.html','true',[ 
		['PAGE','76643',jdecode('Stagione+2009+-+2010'),jdecode(''),'/312401/76643.html','true',[],'','']
	],'',''],
	['PAGE','97101',jdecode('Programma+Stagionale'),jdecode(''),'/97101.html','true',[],'',''],
	['PAGE','312701',jdecode('Photo+Gallery'),jdecode(''),'/312701/index.html','true',[ 
		['PAGE','258401',jdecode('Stagione+2009+-+2010'),jdecode(''),'/312701/258401.html','true',[],'',''],
		['PAGE','91101',jdecode('Stagione+2008+-+2009'),jdecode(''),'/312701/91101.html','true',[],'','']
	],'',''],
	['PAGE','128201',jdecode('Curiosit%C3%A0+'),jdecode(''),'/128201/index.html','true',[ 
		['PAGE','98606',jdecode('Libro+degli+ospiti'),jdecode(''),'/128201/98606.html','true',[],'',''],
		['PAGE','98601',jdecode('Registro'),jdecode(''),'/128201/98601.html','true',[],'','']
	],'',''],
	['PAGE','114701',jdecode('Links'),jdecode(''),'/114701.html','true',[],'',''],
	['PAGE','98701',jdecode('Mappa'),jdecode(''),'/98701.html','true',[],'',''],
	['PAGE','98801',jdecode('Calcolo+itinerario'),jdecode(''),'/98801.html','true',[],'','']];
var siteelementCount=47;
theSitetree.topTemplateName='Match';
theSitetree.paletteFamily='2354B7';
theSitetree.keyvisualId='2709';
theSitetree.keyvisualName='kv_2709.jpg';
theSitetree.fontsetId='10404';
theSitetree.graphicsetId='10633';
theSitetree.contentColor='2354B7';
theSitetree.contentBGColor='C6E2FE';
var localeDef={
  language: 'fr',
  country: 'FR'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Match',
				paletteFamily: 	'2354B7',
				keyvisualId: 	'2709',
				keyvisualName: 	'kv_2709.jpg',
				fontsetId: 		'10404',
				graphicsetId: 	'10633',
				contentColor: 	'2354B7',
				contentBGColor: 'C6E2FE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'2354B7',
				e_color: 		'707070',
				f_color: 		'707070',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-17178673']={
webappId:    '1501',
documentId:  '26601',
internalId:  '17178673',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26652',
internalId:  '',
customField: '20090728-160259'
};
webappMappings['1002']=webappMappings['1002-98606abw0x0in2une']={
webappId:    '1002',
documentId:  '98606',
internalId:  '98606abw0x0in2une',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26601',
internalId:  '',
customField: '20100902-170327'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '26601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '311101',
internalId:  '',
customField: '20100721-171208'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '98801',
internalId:  'routing',
customField: 'fr_FR'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '98701',
internalId:  'location',
customField: 'language:fr;country:FR;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26715',
internalId:  '',
customField: '20100719-140916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53701',
internalId:  '',
customField: '20100719-141132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53301',
internalId:  '',
customField: '20091006-230647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52222',
internalId:  '',
customField: '20091120-142949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '311822',
internalId:  '',
customField: '20100719-225132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '205901',
internalId:  '',
customField: '20090819-224431'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '212501',
internalId:  '',
customField: '20100514-152744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124101',
internalId:  '',
customField: '20100719-142305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59943',
internalId:  '',
customField: '20100719-224057'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '158601',
internalId:  '',
customField: '20091102-105350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60090',
internalId:  '',
customField: '20100320-191242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76601',
internalId:  '',
customField: '20071220-230648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59922',
internalId:  '',
customField: '20090728-161238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69101',
internalId:  '',
customField: '20090728-162746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68122',
internalId:  '',
customField: '20090728-170811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68101',
internalId:  '',
customField: '20080925-223201'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76622',
internalId:  '',
customField: '20071003-202246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76643',
internalId:  '',
customField: '20100514-145256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '317101',
internalId:  '',
customField: '20100827-120422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '252422',
internalId:  '',
customField: '20100812-220216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '252443',
internalId:  '',
customField: '20100812-222829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97101',
internalId:  '',
customField: '20100719-225808'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26862',
internalId:  '',
customField: '20100812-215702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59985',
internalId:  '',
customField: '20100812-220539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '252401',
internalId:  '',
customField: '20090727-203842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91101',
internalId:  '',
customField: '20090730-170833'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '128201',
internalId:  '',
customField: '20090727-183455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98606',
internalId:  '',
customField: '20071008-231007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98601',
internalId:  '',
customField: '20071008-231007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98701',
internalId:  '',
customField: '20090731-204245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '98801',
internalId:  '',
customField: '20090731-205918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '114701',
internalId:  '',
customField: '20100531-175850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '307501',
internalId:  '',
customField: '20100514-153323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '250901',
internalId:  '',
customField: '20090727-181521'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '251401',
internalId:  '',
customField: '20090727-182615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '251422',
internalId:  '',
customField: '20100320-191220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '251443',
internalId:  '',
customField: '20090727-182749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '252464',
internalId:  '',
customField: '20100812-224047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '256101',
internalId:  '',
customField: '20090729-232652'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '258401',
internalId:  '',
customField: '20100321-124850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '312001',
internalId:  '',
customField: '20100719-225050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '311801',
internalId:  '',
customField: '20100802-155041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '312401',
internalId:  '',
customField: '20100722-171425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '312701',
internalId:  '',
customField: '20100719-230055'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN2UNE';
var companyName   = 'CLUB+PATTINAGGIO+LUGANO';
var htmlTitle	  = 'Club+Pattinaggio+Lugano';
var metaKeywords  = 'skating%2C+pattinaggio';
var metaContents  = 'skating%2Cpattinaggio';
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();
};
