/* [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','4879',jdecode('Home'),jdecode(''),'/4879.html','true',[],'',''],
	['PAGE','4555',jdecode('Kirchner+Museum'),jdecode(''),'/4555.html','true',[],'',''],
	['PAGE','4663',jdecode('Ausstellungen'),jdecode(''),'/4663/index.html','true',[ 
		['PAGE','62270',jdecode('Vorschau'),jdecode(''),'/4663/62270.html','true',[],'',''],
		['PAGE','6210',jdecode('R%C3%BCckschau'),jdecode(''),'/4663/6210.html','true',[],'','']
	],'',''],
	['PAGE','4636',jdecode('Sammlung'),jdecode(''),'/4636/index.html','true',[ 
		['PAGE','38630',jdecode('Ausgew%C3%A4hlte+Werke'),jdecode(''),'/4636/38630.html','true',[],'',''],
		['PAGE','108901',jdecode('Leihgaben'),jdecode(''),'/4636/108901.html','true',[],'',''],
		['PAGE','7956',jdecode('Werke+auf+Reisen'),jdecode(''),'/4636/7956.html','true',[],'','']
	],'',''],
	['PAGE','182501',jdecode('Forschung'),jdecode(''),'/182501/index.html','true',[ 
		['PAGE','182522',jdecode('Text+zu+Forschung'),jdecode(''),'/182501/182522.html','false',[],'','']
	],'',''],
	['PAGE','6129',jdecode('Archiv+und+Bibliothek'),jdecode(''),'/6129.html','true',[],'',''],
	['PAGE','4582',jdecode('Besucherinformation'),jdecode(''),'/4582.html','true',[],'',''],
	['PAGE','6102',jdecode('Kunstvermittlung'),jdecode(''),'/6102/index.html','true',[ 
		['PAGE','157101',jdecode('Wanderungen'),jdecode(''),'/6102/157101.html','false',[],'',''],
		['PAGE','7902',jdecode('Kinder+Workshop'),jdecode(''),'/6102/7902.html','true',[],'',''],
		['PAGE','132301',jdecode('Kinder+Geburtstag'),jdecode(''),'/6102/132301.html','true',[],'',''],
		['PAGE','64955',jdecode('Schulklassen'),jdecode(''),'/6102/64955.html','true',[],'','']
	],'',''],
	['PAGE','28930',jdecode('Termine+2010'),jdecode(''),'/28930.html','true',[],'',''],
	['PAGE','48776',jdecode('Museumsshop'),jdecode(''),'/48776/index.html','true',[ 
		['PAGE','49820',jdecode('Museumsshop+%28Form+followup+page%29'),jdecode(''),'/48776/49820.html','false',[],'',''],
		['PAGE','4717',jdecode('Kataloge+%2F+B%C3%BCcher'),jdecode(''),'/48776/4717.html','true',[],'',''],
		['PAGE','48803',jdecode('Poster'),jdecode(''),'/48776/48803.html','true',[],'',''],
		['PAGE','133101',jdecode('Kunstkarten'),jdecode(''),'/48776/133101.html','true',[],'',''],
		['PAGE','48830',jdecode('Souvenirs'),jdecode(''),'/48776/48830.html','true',[],'','']
	],'',''],
	['PAGE','7356',jdecode('Kirchner+Verein'),jdecode(''),'/7356/index.html','true',[ 
		['PAGE','184701',jdecode('%C3%9Cber+den+Verein'),jdecode(''),'/7356/184701.html','true',[],'',''],
		['PAGE','180801',jdecode('Statuten'),jdecode(''),'/7356/180801.html','true',[],'',''],
		['PAGE','180822',jdecode('Vorstand'),jdecode(''),'/7356/180822.html','true',[],'',''],
		['PAGE','180843',jdecode('Veranstaltungen'),jdecode(''),'/7356/180843.html','true',[],'',''],
		['PAGE','182001',jdecode('F%C3%B6rderung'),jdecode(''),'/7356/182001.html','true',[],'',''],
		['PAGE','180864',jdecode('Mitgliedschaft'),jdecode(''),'/7356/180864.html','true',[],'',''],
		['PAGE','182201',jdecode('Kontakt'),jdecode(''),'/7356/182201.html','true',[],'','']
	],'',''],
	['PAGE','25402',jdecode('Ernst+Ludwig+Kirchner'),jdecode(''),'/25402/index.html','true',[ 
		['PAGE','4744',jdecode('Biographie'),jdecode(''),'/25402/4744.html','true',[],'',''],
		['PAGE','25429',jdecode('Bibliographie'),jdecode(''),'/25402/25429.html','true',[],'','']
	],'',''],
	['PAGE','4771',jdecode('Architektur'),jdecode(''),'/4771.html','true',[],'',''],
	['PAGE','97501',jdecode('Partner'),jdecode(''),'/97501.html','true',[],'',''],
	['PAGE','4798',jdecode('Presse+%2F+Medien'),jdecode(''),'/4798.html','true',[],'',''],
	['PAGE','45803',jdecode('English'),jdecode(''),'/45803.html','true',[],'',''],
	['PAGE','4825',jdecode('Kontakt'),jdecode(''),'/4825/index.html','true',[ 
		['PAGE','43330',jdecode('Impressum'),jdecode(''),'/4825/43330.html','true',[],'',''],
		['PAGE','45776',jdecode('Disclaimer'),jdecode(''),'/4825/45776.html','true',[],'','']
	],'',''],
	['PAGE','7983',jdecode('Links'),jdecode(''),'/7983/index.html','true',[ 
		['PAGE','47435',jdecode('Interaktiv+%28Form+followup+page%29'),jdecode(''),'/7983/47435.html','false',[],'','']
	],'','']];
var siteelementCount=45;
theSitetree.topTemplateName='Galerie';
theSitetree.paletteFamily='EBEAEA';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='75';
theSitetree.graphicsetId='88';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F5F5F5';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Galerie',
				paletteFamily: 	'EBEAEA',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'75',
				graphicsetId: 	'88',
				contentColor: 	'000000',
				contentBGColor: 'F5F5F5',
				a_color: 		'EBEAEA',
				b_color: 		'666666',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '182001',
internalId:  '',
customField: '20100319-151927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '182201',
internalId:  '',
customField: '20100318-084204'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4879',
internalId:  '1006',
customField: '1006'
};
webappMappings['1009']=webappMappings['1009-4579501']={
webappId:    '1009',
documentId:  '49820',
internalId:  '4579501',
customField: 'isFollowupPage:true;documentId:48776;'
};
webappMappings['7008']=webappMappings['7008-1268']={
webappId:    '7008',
documentId:  '48776',
internalId:  '1268',
customField: 'language:de;country:CH;'
};
webappMappings['1009']=webappMappings['1009-4142761']={
webappId:    '1009',
documentId:  '47435',
internalId:  '4142761',
customField: 'isFollowupPage:true;documentId:7983;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4879',
internalId:  '',
customField: '20100618-165007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4555',
internalId:  '',
customField: '20080908-220921'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4663',
internalId:  '',
customField: '20100628-094120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62270',
internalId:  '',
customField: '20100618-171908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6210',
internalId:  '',
customField: '20100215-171631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4636',
internalId:  '',
customField: '20091125-083825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38630',
internalId:  '',
customField: '20100324-135931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '108901',
internalId:  '',
customField: '20091228-145333'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7956',
internalId:  '',
customField: '20100623-220850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6129',
internalId:  '',
customField: '20081218-202029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4582',
internalId:  '',
customField: '20100628-094214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6102',
internalId:  '',
customField: '20091125-084849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7902',
internalId:  '',
customField: '20100618-214612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '132301',
internalId:  '',
customField: '20091125-085303'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64955',
internalId:  '',
customField: '20091125-085428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28930',
internalId:  '',
customField: '20100628-094931'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48776',
internalId:  '',
customField: '20100716-133327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49820',
internalId:  '',
customField: '20050107-112456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4717',
internalId:  '',
customField: '20100716-134908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48803',
internalId:  '',
customField: '20081220-093639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '133101',
internalId:  '',
customField: '20081220-093326'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48830',
internalId:  '',
customField: '20081220-093825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7356',
internalId:  '',
customField: '20100429-160255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25402',
internalId:  '',
customField: '20080209-183235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4744',
internalId:  '',
customField: '20081204-161711'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25429',
internalId:  '',
customField: '20081204-160843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4771',
internalId:  '',
customField: '20081218-095103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97501',
internalId:  '',
customField: '20091125-101215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4798',
internalId:  '',
customField: '20080209-194205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45803',
internalId:  '',
customField: '20090930-095713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4825',
internalId:  '',
customField: '20100429-155729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43330',
internalId:  '',
customField: '20090207-070425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45776',
internalId:  '',
customField: '20081218-095542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7983',
internalId:  '',
customField: '20100310-134501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47435',
internalId:  '',
customField: '20041210-155026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '157101',
internalId:  '',
customField: '20090806-100109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '180801',
internalId:  '',
customField: '20100301-142334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '180822',
internalId:  '',
customField: '20100429-160444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '180843',
internalId:  '',
customField: '20100321-063730'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '180864',
internalId:  '',
customField: '20100315-155735'
};
webappMappings['7008']=webappMappings['7008-9103']={
webappId:    '7008',
documentId:  '180864',
internalId:  '9103',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '182501',
internalId:  '',
customField: '20100310-111658'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '182522',
internalId:  '',
customField: '20100330-085435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '184701',
internalId:  '',
customField: '20100301-151447'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXXYC';
var companyName   = 'Kirchner+Museum+Davos';
var htmlTitle	  = 'Kirchner+Museum+Davos';
var metaKeywords  = 'Kirchner+Museum+Ernst+Ludwig+Davos+Graubuenden+Expressionismus+deutscher+Maler+Kunst+Kultur+';
var metaContents  = 'Website+des+Kirchner+Museums+Davos+mit+der+gr%C3%B6ssten+Sammlung+an+Werken+des+deutschen+Expressionisten+Ernst+Ludwig+Kirchner.';
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();
};
