/* [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','4480',jdecode('Home'),jdecode(''),'/4480.html','true',[],'',''],
	['PAGE','4537',jdecode('T%C3%B6fflibuebe'),jdecode(''),'/4537/index.html','true',[ 
		['PAGE','6701',jdecode('Wer+sind+wir+eigentlich'),jdecode(''),'/4537/6701.html','true',[],'',''],
		['PAGE','9335',jdecode('Lange+ist+es+her'),jdecode(''),'/4537/9335.html','true',[],'','']
	],'',''],
	['PAGE','4591',jdecode('Aktuelles'),jdecode(''),'/4591/index.html','true',[ 
		['PAGE','4618',jdecode('T%C3%B6ffli'),jdecode(''),'/4591/4618.html','true',[],'',''],
		['PAGE','121801',jdecode('T%C3%B6ffli+Restauration'),jdecode(''),'/4591/121801.html','true',[],'',''],
		['PAGE','21769',jdecode('Alte+Prospekte'),jdecode(''),'/4591/21769.html','true',[],'',''],
		['PAGE','4645',jdecode('Termine'),jdecode(''),'/4591/4645.html','true',[],'',''],
		['PAGE','16169',jdecode('Zu+Verkaufen'),jdecode(''),'/4591/16169.html','true',[],'','']
	],'',''],
	['PAGE','51001',jdecode('Alte+Polizeifotos'),jdecode(''),'/51001.html','true',[],'',''],
	['PAGE','14549',jdecode('T%C3%B6fflitouren'),jdecode(''),'/14549/index.html','true',[ 
		['PAGE','10235',jdecode('Tessin%2C+Pfingsten+2004'),jdecode(''),'/14549/10235.html','true',[],'',''],
		['PAGE','13040',jdecode('Avenches%2C+3.-5.9.2004'),jdecode(''),'/14549/13040.html','true',[],'',''],
		['PAGE','13687',jdecode('Sisikon%2C+Pfingsten+2005'),jdecode(''),'/14549/13687.html','true',[],'',''],
		['PAGE','13918',jdecode('T%C3%B6fflimuseum+Kriens'),jdecode(''),'/14549/13918.html','true',[],'',''],
		['PAGE','17569',jdecode('Avenches%2C+23.-25.9.2005'),jdecode(''),'/14549/17569.html','true',[],'',''],
		['PAGE','25369',jdecode('Tessin%2C+Pfingsten+2006'),jdecode(''),'/14549/25369.html','true',[],'',''],
		['PAGE','30692',jdecode('Brienz%2C+22.9.-25.9.2006'),jdecode(''),'/14549/30692.html','true',[],'',''],
		['PAGE','49401',jdecode('Tessin%2C+Pfingsten+2007'),jdecode(''),'/14549/49401.html','true',[],'',''],
		['PAGE','70501',jdecode('Brienz%2C+14.9.-16.9.2007'),jdecode(''),'/14549/70501.html','true',[],'',''],
		['PAGE','94701',jdecode('Avenches%2C+Pfingsten+2008'),jdecode(''),'/14549/94701.html','true',[],'',''],
		['PAGE','96901',jdecode('Schweizerreise+2008'),jdecode(''),'/14549/96901.html','true',[],'',''],
		['PAGE','123901',jdecode('Tessin+Pfingsten+2009'),jdecode(''),'/14549/123901.html','true',[],'',''],
		['PAGE','130101',jdecode('Herbst+2009'),jdecode(''),'/14549/130101.html','true',[],'',''],
		['PAGE','138101',jdecode('Pfingsten+2010'),jdecode(''),'/14549/138101.html','true',[],'',''],
		['PAGE','141501',jdecode('B%C3%BCndnertour+2010'),jdecode(''),'/14549/141501.html','true',[],'',''],
		['PAGE','146401',jdecode('Redbull+Alpenbrevet+2010'),jdecode(''),'/14549/146401.html','true',[],'','']
	],'',''],
	['PAGE','4672',jdecode('Kontakt'),jdecode(''),'/4672.html','true',[],'',''],
	['PAGE','23700',jdecode('Link'),jdecode(''),'/23700.html','true',[],'',''],
	['PAGE','29912',jdecode('G%C3%A4stebuch'),jdecode(''),'/29912/index.html','true',[ 
		['PAGE','29911',jdecode('Eintr%C3%A4ge'),jdecode(''),'/29912/29911.html','false',[],'','']
	],'',''],
	['PAGE','31033',jdecode('Ihr+Weg+zu+uns'),jdecode(''),'/31033.html','true',[],'',''],
	['PAGE','72001',jdecode('Unsere+neue+Werkstatt'),jdecode(''),'/72001.html','true',[],'',''],
	['PAGE','76401',jdecode('Sonstige+Anl%C3%A4sse'),jdecode(''),'/76401/index.html','true',[ 
		['PAGE','76422',jdecode('Sylvester+07%2F08'),jdecode(''),'/76401/76422.html','true',[],'','']
	],'','']];
var siteelementCount=36;
theSitetree.topTemplateName='Architekt';
theSitetree.paletteFamily='FFCC66';
theSitetree.keyvisualId='1687';
theSitetree.keyvisualName='antiquites.jpg';
theSitetree.fontsetId='281';
theSitetree.graphicsetId='343';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFCC66';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Architekt',
				paletteFamily: 	'FFCC66',
				keyvisualId: 	'1687',
				keyvisualName: 	'antiquites.jpg',
				fontsetId: 		'281',
				graphicsetId: 	'343',
				contentColor: 	'000000',
				contentBGColor: 'FFCC66',
				a_color: 		'FFCC66',
				b_color: 		'CC6600',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Times New Roman, Times, serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4480',
internalId:  '',
customField: '20090107-235334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4537',
internalId:  '',
customField: '20090922-110931'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4480',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-71711']={
webappId:    '1501',
documentId:  '4480',
internalId:  '71711',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-29912abw0x0inxs8f']={
webappId:    '1002',
documentId:  '29912',
internalId:  '29912abw0x0inxs8f',
customField: 'icq=false'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '31033',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20060210-142214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9335',
internalId:  '',
customField: '20060713-162425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4591',
internalId:  '',
customField: '20071112-112611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4618',
internalId:  '',
customField: '20060116-162339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21769',
internalId:  '',
customField: '20060705-210020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4645',
internalId:  '',
customField: '20090325-112656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16169',
internalId:  '',
customField: '20070426-144211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51001',
internalId:  '',
customField: '20070514-151941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14549',
internalId:  '',
customField: '20060901-204929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10235',
internalId:  '',
customField: '20091223-162930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13040',
internalId:  '',
customField: '20060119-231926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13687',
internalId:  '',
customField: '20060107-180904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13918',
internalId:  '',
customField: '20060127-234812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17569',
internalId:  '',
customField: '20060127-235016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25369',
internalId:  '',
customField: '20070201-190819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30692',
internalId:  '',
customField: '20070627-125538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49401',
internalId:  '',
customField: '20080116-102252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70501',
internalId:  '',
customField: '20080315-175444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94701',
internalId:  '',
customField: '20080526-085235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96901',
internalId:  '',
customField: '20090821-102954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4672',
internalId:  '',
customField: '20070509-115045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23700',
internalId:  '',
customField: '20100811-235523'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29912',
internalId:  '',
customField: '20060628-183710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29911',
internalId:  '',
customField: '20060628-183710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31033',
internalId:  '',
customField: '20061019-150425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72001',
internalId:  '',
customField: '20080204-161531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76401',
internalId:  '',
customField: '20080107-210534'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76422',
internalId:  '',
customField: '20080107-204032'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121801',
internalId:  '',
customField: '20100329-160137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123901',
internalId:  '',
customField: '20090922-104036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '130101',
internalId:  '',
customField: '20100116-201458'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138101',
internalId:  '',
customField: '20100116-195517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '141501',
internalId:  '',
customField: '20100822-132229'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '146401',
internalId:  '',
customField: '20100905-204723'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXS8F';
var companyName   = 'T%C3%B6fflibuebe';
var htmlTitle	  = 'T%C3%B6fflibuebe';
var metaKeywords  = 'mofas%2C+t%C3%B6ffli%2C+t%C3%B6fflibuebe%2C+toeffli%2C+toefflibuebe%2C+moped%2C';
var metaContents  = 'mofas%2Ct%C3%B6ffli%2C+t%C3%B6fflibuebe%2C+toeffli%2C+toefflibuebe%2C+moped%2C+';
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();
};
