/* [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(''), jdecode('%2F4519.html'), 'true',[],'',''],
	['PAGE','8965',jdecode('Fiat+500'),jdecode(''), jdecode('%2F8965%2Findex.html'), 'true',[ 
		['PAGE','62401',jdecode('Nuova+500'),jdecode(''), jdecode('%2F8965%2F62401.html'), 'true',[],'',''],
		['PAGE','62422',jdecode('Trepiuno'),jdecode(''), jdecode('%2F8965%2F62422.html'), 'true',[],'','']
	],'',''],
	['PAGE','8992',jdecode('Club+FL'),jdecode(''), jdecode('%2F8992%2Findex.html'), 'true',[ 
		['PAGE','64301',jdecode('Vorstand'),jdecode(''), jdecode('%2F8992%2F64301.html'), 'true',[],'',''],
		['PAGE','64322',jdecode('Mitglieder'),jdecode(''), jdecode('%2F8992%2F64322.html'), 'true',[],'','']
	],'',''],
	['PAGE','9073',jdecode('Service'),jdecode(''), jdecode('%2F9073.html'), 'true',[],'',''],
	['PAGE','9100',jdecode('Veranstaltungen'),jdecode(''), jdecode('%2F9100.html'), 'true',[],'',''],
	['PAGE','9127',jdecode('Kontakt'),jdecode(''), jdecode('%2F9127%2Findex.html'), 'true',[ 
		['PAGE','25506',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''), jdecode('%2F9127%2F25506.html'), 'false',[],'','']
	],'',''],
	['PAGE','85501',jdecode('Fotoalbum'),jdecode(''), jdecode('%2F85501.html'), 'true',[],'',''],
	['PAGE','47206',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F47206%2Findex.html'), 'true',[ 
		['PAGE','47201',jdecode('Eintr%C3%A4ge'),jdecode(''), jdecode('%2F47206%2F47201.html'), 'false',[],'','']
	],'',''],
	['PAGE','61701',jdecode('Links'),jdecode(''), jdecode('%2F61701.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 prodDef={
  wl_name: 'hostpoint',
  product: 'WSCSYSSSSLYTC21F'
};
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:  '4519',
internalId:  '',
customField: '20110831-081605'
};
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: '20110525-202511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62401',
internalId:  '',
customField: '20080724-092414'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62422',
internalId:  '',
customField: '20080724-092432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8992',
internalId:  '',
customField: '20110525-202548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64301',
internalId:  '',
customField: '20110226-060058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64322',
internalId:  '',
customField: '20110226-060326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85501',
internalId:  '',
customField: '20110525-202156'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9073',
internalId:  '',
customField: '20110525-202619'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9100',
internalId:  '',
customField: '20110831-081501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9127',
internalId:  '',
customField: '20110525-202737'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25506',
internalId:  '',
customField: '20060711-165637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47206',
internalId:  '',
customField: '20110525-202806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47201',
internalId:  '',
customField: '20080508-080102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61701',
internalId:  '',
customField: '20110525-202827'
};
var webAppHostname = 'cgi.webomat.ch:80';
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();
};

