/* [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','401',jdecode('Startseite'),jdecode(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','2601',jdecode('deutsch'),jdecode(''), jdecode('%2F2601%2Findex.html'), 'true',[ 
		['PAGE','46633',jdecode('Aktuell'),jdecode(''), jdecode('%2F2601%2F46633.html'), 'true',[],'',''],
		['PAGE','494',jdecode('Aktivit%C3%A4ten'),jdecode(''), jdecode('%2F2601%2F494.html'), 'true',[],'',''],
		['PAGE','473',jdecode('Tr%C3%A4gerschaft'),jdecode(''), jdecode('%2F2601%2F473.html'), 'true',[],'',''],
		['PAGE','7001',jdecode('Kontakt'),jdecode(''), jdecode('%2F2601%2F7001.html'), 'true',[],'',''],
		['PAGE','30143',jdecode('Archiv'),jdecode(''), jdecode('%2F2601%2F30143.html'), 'true',[],'',''],
		['PAGE','30122',jdecode('Archiv_Er%C3%B6ffnveranst_29_01_2010'),jdecode(''), jdecode('%2F2601%2F30122.html'), 'false',[],'','']
	],'',''],
	['PAGE','2622',jdecode('fran%C3%A7ais'),jdecode(''), jdecode('%2F2622%2Findex.html'), 'true',[ 
		['PAGE','46654',jdecode('Actualit%C3%A9'),jdecode(''), jdecode('%2F2622%2F46654.html'), 'true',[],'',''],
		['PAGE','8732',jdecode('Activit%C3%A9s'),jdecode(''), jdecode('%2F2622%2F8732.html'), 'true',[],'',''],
		['PAGE','8711',jdecode('Soutien'),jdecode(''), jdecode('%2F2622%2F8711.html'), 'true',[],'',''],
		['PAGE','8753',jdecode('Contact'),jdecode(''), jdecode('%2F2622%2F8753.html'), 'true',[],'',''],
		['PAGE','30185',jdecode('Archives'),jdecode(''), jdecode('%2F2622%2F30185.html'), 'true',[],'',''],
		['PAGE','30164',jdecode('Archives_coll_inaug_29_01_2010'),jdecode(''), jdecode('%2F2622%2F30164.html'), 'false',[],'','']
	],'',''],
	['PAGE','2643',jdecode('italiano'),jdecode(''), jdecode('%2F2643%2Findex.html'), 'true',[ 
		['PAGE','46675',jdecode('Attualit%C3%A0'),jdecode(''), jdecode('%2F2643%2F46675.html'), 'true',[],'',''],
		['PAGE','13832',jdecode('Attivit%C3%A0'),jdecode(''), jdecode('%2F2643%2F13832.html'), 'true',[],'',''],
		['PAGE','13811',jdecode('Sostenitori'),jdecode(''), jdecode('%2F2643%2F13811.html'), 'true',[],'',''],
		['PAGE','13853',jdecode('Contatto'),jdecode(''), jdecode('%2F2643%2F13853.html'), 'true',[],'',''],
		['PAGE','30227',jdecode('Archivio'),jdecode(''), jdecode('%2F2643%2F30227.html'), 'true',[],'',''],
		['PAGE','30206',jdecode('Archivio_Manif_apertura_29_01_2010'),jdecode(''), jdecode('%2F2643%2F30206.html'), 'false',[],'','']
	],'',''],
	['PAGE','5806',jdecode('Forum'),jdecode(''), jdecode('%2F5806%2Findex.html'), 'true',[ 
		['PAGE','5801',jdecode('Beitr%C3%A4ge%2Fcontributions%2Fcontribuzioni'),jdecode(''), jdecode('%2F5806%2F5801.html'), 'false',[],'','']
	],'',''],
	['PAGE','15511',jdecode('Anmeldung+29.1.2010'),jdecode(''), jdecode('%2F15511.html'), 'false',[],'',''],
	['PAGE','53344',jdecode('Forum+Ideenwettbewerbe'),jdecode(''), jdecode('%2F53344.html'), 'true',[],'','']];
var siteelementCount=26;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10892';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'hostpoint',
  product: 'WSCSYSSSSLYTC21F'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10892',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2601',
internalId:  '',
customField: '20100223-170201'
};
webappMappings['1002']=webappMappings['1002-5806ahopt0inv0pa']={
webappId:    '1002',
documentId:  '5806',
internalId:  '5806ahopt0inv0pa',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100226-155707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20100227-154604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20110921-185731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20091103-143208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2622',
internalId:  '',
customField: '20090908-101124'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2643',
internalId:  '',
customField: '20090908-105555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5806',
internalId:  '',
customField: '20090915-065434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5801',
internalId:  '',
customField: '20090629-152846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8711',
internalId:  '',
customField: '20100227-154539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8732',
internalId:  '',
customField: '20110921-192010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8753',
internalId:  '',
customField: '20091103-144703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13811',
internalId:  '',
customField: '20100227-154643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13832',
internalId:  '',
customField: '20110815-041817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13853',
internalId:  '',
customField: '20091110-071107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15511',
internalId:  '',
customField: '20090921-073340'
};
webappMappings['7008']=webappMappings['7008-1262']={
webappId:    '7008',
documentId:  '15511',
internalId:  '1262',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30122',
internalId:  '',
customField: '20100910-120901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30143',
internalId:  '',
customField: '20110921-185658'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46633',
internalId:  '',
customField: '20110921-191329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30164',
internalId:  '',
customField: '20100910-120918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30185',
internalId:  '',
customField: '20110921-192639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30206',
internalId:  '',
customField: '20100910-120953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30227',
internalId:  '',
customField: '20110502-150543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46654',
internalId:  '',
customField: '20110815-041803'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46675',
internalId:  '',
customField: '20110815-041844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53344',
internalId:  '',
customField: '20101220-195415'
};
webappMappings['1003']=webappMappings['1003-ahopt0inv0pa12d0539b172']={
webappId:    '1003',
documentId:  '53344',
internalId:  'ahopt0inv0pa12d0539b172',
customField: 'de:CH'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'AHOPT0INV0PA';
var companyName   = 'HORIZONT+HORIZONS+ORIZZONTE+2015';
var htmlTitle	  = 'Horizont+Horizon+Orizzonte+2015';
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();
};

