/* [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','4519',jdecode('Home'),jdecode(''),'/4519.html','true',[],'',''],
	['PAGE','8965',jdecode('Fiat+500'),jdecode(''),'/8965/index.html','true',[ 
		['PAGE','62401',jdecode('Nuova+500'),jdecode(''),'/8965/62401.html','true',[],'',''],
		['PAGE','62422',jdecode('Trepiuno'),jdecode(''),'/8965/62422.html','true',[],'','']
	],'',''],
	['PAGE','8992',jdecode('Club+FL'),jdecode(''),'/8992/index.html','true',[ 
		['PAGE','64301',jdecode('Vorstand'),jdecode(''),'/8992/64301.html','true',[],'',''],
		['PAGE','64322',jdecode('Mitglieder'),jdecode(''),'/8992/64322.html','true',[],'','']
	],'',''],
	['PAGE','9073',jdecode('Service'),jdecode(''),'/9073.html','true',[],'',''],
	['PAGE','9100',jdecode('Veranstaltungen'),jdecode(''),'/9100.html','true',[],'',''],
	['PAGE','9127',jdecode('Kontakt'),jdecode(''),'/9127/index.html','true',[ 
		['PAGE','25506',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''),'/9127/25506.html','false',[],'','']
	],'',''],
	['PAGE','47206',jdecode('G%C3%A4stebuch'),jdecode(''),'/47206/index.html','true',[ 
		['PAGE','47201',jdecode('Eintr%C3%A4ge'),jdecode(''),'/47206/47201.html','false',[],'','']
	],'',''],
	['PAGE','51401',jdecode('Fotoalbum'),jdecode(''),'/51401.html','true',[],'',''],
	['PAGE','61701',jdecode('Links'),jdecode(''),'/61701.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Fluent';
theSitetree.paletteFamily='9C2020';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10644';
theSitetree.graphicsetId='10522';
theSitetree.contentColor='757675';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Fluent',
				paletteFamily: 	'9C2020',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10644',
				graphicsetId: 	'10522',
				contentColor: 	'757675',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'A4A5A4',
				e_color: 		'8D1D1D',
				f_color: 		'DF0404',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4519',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51401',
internalId:  '',
customField: '20080617-100444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4519',
internalId:  '',
customField: '20100513-191653'
};
webappMappings['1002']=webappMappings['1002-47206ahp010in2wja']={
webappId:    '1002',
documentId:  '47206',
internalId:  '47206ahp010in2wja',
customField: 'icq=false'
};
webappMappings['7008']=webappMappings['7008-145']={
webappId:    '7008',
documentId:  '9127',
internalId:  '145',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8965',
internalId:  '',
customField: '20091028-215704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62401',
internalId:  '',
customField: '20080724-112414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62422',
internalId:  '',
customField: '20080724-112432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8992',
internalId:  '',
customField: '20090708-181526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64301',
internalId:  '',
customField: '20100227-183422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64322',
internalId:  '',
customField: '20100227-183606'
};
webappMappings['7060']=webappMappings['7060-febe52f4d24508189de0b5afb2a31c7c']={
webappId:    '7060',
documentId:  '51401',
internalId:  'febe52f4d24508189de0b5afb2a31c7c',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9073',
internalId:  '',
customField: '20080603-114440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9100',
internalId:  '',
customField: '20100513-191251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9127',
internalId:  '',
customField: '20100227-184529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25506',
internalId:  '',
customField: '20060711-185637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47206',
internalId:  '',
customField: '20080508-101120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47201',
internalId:  '',
customField: '20080508-100102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61701',
internalId:  '',
customField: '20090702-141531'
};
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'Ahp010IN2WJA';
var companyName   = 'C+I+N+Q+U+E+C+E+N+T+O+.+L+I';
var htmlTitle	  = 'C+I+N+Q+U+E+C+E+N+T+O+.+L+I';
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();
};
