/* [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','85815',jdecode('RISULTATI+GARE'),jdecode(''),'/85815/index.html','true',[ 
		['PAGE','536',jdecode('Risultati+'),jdecode(''),'/85815/536.html','true',[],'','']
	],'',''],
	['PAGE','85915',jdecode('Programma'),jdecode(''),'/85915/index.html','true',[ 
		['PAGE','557',jdecode('Gioved%C3%AC+10.12.'),jdecode(''),'/85915/557.html','true',[],'',''],
		['PAGE','23106',jdecode('Venerd%C3%AC+11.12.'),jdecode(''),'/85915/23106.html','true',[],'',''],
		['PAGE','23127',jdecode('Sabato+12.12'),jdecode(''),'/85915/23127.html','true',[],'','']
	],'',''],
	['PAGE','38701',jdecode('Messaggi+di+benvenuto+'),jdecode(''),'/38701/index.html','true',[ 
		['PAGE','52715',jdecode('Sig.a+Yva+Giudici'),jdecode(''),'/38701/52715.html','true',[],'',''],
		['PAGE','38752',jdecode('On.+Sindaco+di+Lugano'),jdecode(''),'/38701/38752.html','true',[],'',''],
		['PAGE','38773',jdecode('Presidente+CPL'),jdecode(''),'/38701/38773.html','true',[],'',''],
		['PAGE','42901',jdecode('Presidente+FTP'),jdecode(''),'/38701/42901.html','true',[],'',''],
		['PAGE','44201',jdecode('Comitato+Campionati'),jdecode(''),'/38701/44201.html','true',[],'','']
	],'',''],
	['PAGE','401',jdecode('Presentazioni'),jdecode(''),'/401/index.html','true',[ 
		['PAGE','452',jdecode('Il+Comitato+d%26%23x27%3Bonore'),jdecode(''),'/401/452.html','true',[],'',''],
		['PAGE','6701',jdecode('Comitato+'),jdecode(''),'/401/6701.html','true',[],'',''],
		['PAGE','6722',jdecode('La+Citt%C3%A0+di+Lugano'),jdecode(''),'/401/6722.html','true',[],'',''],
		['PAGE','494',jdecode('La+Resega'),jdecode(''),'/401/494.html','true',[],'',''],
		['PAGE','6743',jdecode('Il+progetto'),jdecode(''),'/401/6743.html','true',[],'',''],
		['PAGE','23043',jdecode('Gala'),jdecode(''),'/401/23043.html','true',[],'','']
	],'',''],
	['PAGE','599',jdecode('Iscriviti+alla+Newsletter'),jdecode(''),'/599/index.html','true',[ 
		['PAGE','6785',jdecode('News+letter'),jdecode(''),'/599/6785.html','true',[],'','']
	],'',''],
	['PAGE','20701',jdecode('Last+News+%2F+Help+point'),jdecode(''),'/20701/index.html','true',[ 
		['PAGE','47301',jdecode('News+Letters'),jdecode(''),'/20701/47301.html','true',[],'',''],
		['PAGE','50201',jdecode('Presentazione+USP'),jdecode(''),'/20701/50201.html','true',[],'',''],
		['PAGE','51315',jdecode('Articoli+Giornali+'),jdecode(''),'/20701/51315.html','true',[],'','']
	],'',''],
	['PAGE','45801',jdecode('Hotel'),jdecode(''),'/45801.html','true',[],'',''],
	['PAGE','515',jdecode('Il+programma+ufficiale'),jdecode(''),'/515.html','true',[],'',''],
	['PAGE','23148',jdecode('I+partecipanti'),jdecode(''),'/23148.html','true',[],'',''],
	['PAGE','82615',jdecode('Orario+competizioni'),jdecode(''),'/82615.html','true',[],'',''],
	['PAGE','18701',jdecode('Giudici+e+pannello+tech'),jdecode(''),'/18701.html','true',[],'',''],
	['PAGE','6764',jdecode('Galleria+Foto+e+video++'),jdecode(''),'/6764.html','true',[],'',''],
	['PAGE','18743',jdecode('Curiosit%C3%A0'),jdecode(''),'/18743.html','true',[],'',''],
	['PAGE','7201',jdecode('Come+trovarci'),jdecode(''),'/7201.html','true',[],'',''],
	['PAGE','23337',jdecode('Contact'),jdecode(''),'/23337.html','true',[],'',''],
	['PAGE','24101',jdecode('Sondaggio'),jdecode(''),'/24101.html','true',[],'',''],
	['PAGE','24006',jdecode('Livre+d%26%23x27%3Bor'),jdecode(''),'/24006/index.html','true',[ 
		['PAGE','24001',jdecode('Entr%C3%A9es'),jdecode(''),'/24006/24001.html','false',[],'','']
	],'','']];
var siteelementCount=37;
theSitetree.topTemplateName='Rectangle';
theSitetree.paletteFamily='FFFFFF';
theSitetree.keyvisualId='2505';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='451';
theSitetree.graphicsetId='506';
theSitetree.contentColor='033568';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Rectangle',
				paletteFamily: 	'FFFFFF',
				keyvisualId: 	'2505',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'451',
				graphicsetId: 	'506',
				contentColor: 	'033568',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '38701',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '38701',
internalId:  '1501',
customField: '1501'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '7201',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['7008']=webappMappings['7008-658']={
webappId:    '7008',
documentId:  '6785',
internalId:  '658',
customField: 'language:fr;country:FR;'
};
webappMappings['1002']=webappMappings['1002-24006abw1x0ineqll']={
webappId:    '1002',
documentId:  '24006',
internalId:  '24006abw1x0ineqll',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38701',
internalId:  '',
customField: '20091212-185401'
};
webappMappings['7005']=webappMappings['7005-80']={
webappId:    '7005',
documentId:  '24101',
internalId:  '80',
customField: 'language:fr;country:FR;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38752',
internalId:  '',
customField: '20090210-221708'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20090215-210753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20090131-222943'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6722',
internalId:  '',
customField: '20090106-180326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20090103-171426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6743',
internalId:  '',
customField: '20090426-104913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20090509-172247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23043',
internalId:  '',
customField: '20090106-165051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20701',
internalId:  '',
customField: '20091213-201425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20091211-192826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51315',
internalId:  '',
customField: '20091009-220046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20091102-225603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23106',
internalId:  '',
customField: '20091102-225619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23127',
internalId:  '',
customField: '20091102-223929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20091211-191737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23148',
internalId:  '',
customField: '20091120-191303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18701',
internalId:  '',
customField: '20091018-164325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85915',
internalId:  '',
customField: '20091211-204556'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82615',
internalId:  '',
customField: '20091202-001745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85815',
internalId:  '',
customField: '20091212-185439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6764',
internalId:  '',
customField: '20090920-160101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18743',
internalId:  '',
customField: '20090106-221537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '599',
internalId:  '',
customField: '20090106-222440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6785',
internalId:  '',
customField: '20081130-195444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7201',
internalId:  '',
customField: '20081130-183139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23337',
internalId:  '',
customField: '20090103-175110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24101',
internalId:  '',
customField: '20090106-131154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24006',
internalId:  '',
customField: '20090103-175807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24001',
internalId:  '',
customField: '20090103-175807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38773',
internalId:  '',
customField: '20090210-223005'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42901',
internalId:  '',
customField: '20090215-200930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44201',
internalId:  '',
customField: '20090227-201008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45801',
internalId:  '',
customField: '20090815-083510'
};
webappMappings['1501']=webappMappings['1501-26777654']={
webappId:    '1501',
documentId:  '38701',
internalId:  '26777654',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47301',
internalId:  '',
customField: '20091107-093251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50201',
internalId:  '',
customField: '20090420-111437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52715',
internalId:  '',
customField: '20090712-113923'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW1X0INEQLL';
var companyName   = 'CAMPIONATI+SVIZZERI+ELITE+2010';
var htmlTitle	  = 'CAMPIONATI+SVIZZERI+ELITE+2010';
var metaKeywords  = '';
var metaContents  = '';
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();
};
