/* [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','85533',jdecode('Aktuelles+Projekt'),jdecode(''),'/85533/index.html','true',[ 
		['PAGE','133612',jdecode('Skulpturenausstellung'),jdecode(''),'/85533/133612.html','true',[],'',''],
		['PAGE','1810',jdecode('Chor+KAMER'),jdecode(''),'/85533/1810.html','true',[],'',''],
		['PAGE','125012',jdecode('MISSA'),jdecode(''),'/85533/125012.html','true',[],'','']
	],'',''],
	['PAGE','3901',jdecode('Veranstaltungen+2010'),jdecode(''),'/3901.html','true',[],'',''],
	['PAGE','64512',jdecode('Kleiner+Kunstf%C3%BChrer'),jdecode(''),'/64512.html','true',[],'',''],
	['PAGE','1831',jdecode('Verein'),jdecode(''),'/1831/index.html','true',[ 
		['PAGE','13501',jdecode('Logo+%2F+Statuten'),jdecode(''),'/1831/13501.html','true',[],'',''],
		['PAGE','22801',jdecode('Medien'),jdecode(''),'/1831/22801.html','true',[],'',''],
		['PAGE','26301',jdecode('Unser+Zuhause'),jdecode(''),'/1831/26301.html','true',[],'',''],
		['PAGE','48612',jdecode('Kirchenbezirk'),jdecode(''),'/1831/48612.html','true',[],'',''],
		['PAGE','17501',jdecode('Bremgarten+AG'),jdecode(''),'/1831/17501.html','true',[],'',''],
		['PAGE','17601',jdecode('Anfahrt'),jdecode(''),'/1831/17601.html','true',[],'','']
	],'',''],
	['PAGE','3922',jdecode('Vorstand'),jdecode(''),'/3922/index.html','true',[ 
		['PAGE','16743',jdecode('Pr%C3%A4sident'),jdecode(''),'/3922/16743.html','true',[],'',''],
		['PAGE','16785',jdecode('Aktuarin'),jdecode(''),'/3922/16785.html','true',[],'',''],
		['PAGE','16806',jdecode('Kassier+%2F+IT'),jdecode(''),'/3922/16806.html','true',[],'','']
	],'',''],
	['PAGE','69412',jdecode('Gallerie'),jdecode(''),'/69412/index.html','false',[ 
		['PAGE','105512',jdecode('Skulpturen'),jdecode(''),'/69412/105512.html','false',[],'',''],
		['PAGE','105412',jdecode('MISSA'),jdecode(''),'/69412/105412.html','true',[],'',''],
		['PAGE','127612',jdecode('Chor+KAMER'),jdecode(''),'/69412/127612.html','false',[],'','']
	],'',''],
	['PAGE','1884',jdecode('G%C3%A4stebuch'),jdecode(''),'/1884.html','true',[],'',''],
	['PAGE','1905',jdecode('Kontakt'),jdecode(''),'/1905/index.html','true',[ 
		['PAGE','16848',jdecode('Pr%C3%A4sident'),jdecode(''),'/1905/16848.html','true',[],'',''],
		['PAGE','16869',jdecode('Aktuarin'),jdecode(''),'/1905/16869.html','true',[],'',''],
		['PAGE','16890',jdecode('Kassier+%2F+IT'),jdecode(''),'/1905/16890.html','true',[],'','']
	],'',''],
	['PAGE','9701',jdecode('Links'),jdecode(''),'/9701.html','true',[],'',''],
	['PAGE','17201',jdecode('Umfrage'),jdecode(''),'/17201.html','true',[],'',''],
	['PAGE','95033',jdecode('Archiv+2010'),jdecode(''),'/95033.html','false',[],'',''],
	['PAGE','69112',jdecode('KIB-Blog'),jdecode(''),'/69112.html','false',[],'','']];
var siteelementCount=30;
theSitetree.topTemplateName='Verve';
theSitetree.paletteFamily='4FA9F4';
theSitetree.keyvisualId='8391';
theSitetree.keyvisualName='kv_8391.jpg';
theSitetree.fontsetId='17071';
theSitetree.graphicsetId='12442';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Verve',
				paletteFamily: 	'4FA9F4',
				keyvisualId: 	'8391',
				keyvisualName: 	'kv_8391.jpg',
				fontsetId: 		'17071',
				graphicsetId: 	'12442',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9701',
internalId:  '',
customField: '20100629-233651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3922',
internalId:  '',
customField: '20101021-023620'
};
webappMappings['7002']=webappMappings['7002-1567']={
webappId:    '7002',
documentId:  '1884',
internalId:  '1567',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-1788']={
webappId:    '7008',
documentId:  '1905',
internalId:  '1788',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1810',
internalId:  '',
customField: '20100629-233325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1831',
internalId:  '',
customField: '20100628-003050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20100628-033001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64512',
internalId:  '',
customField: '20110211-153228'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1884',
internalId:  '',
customField: '20100619-005300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1905',
internalId:  '',
customField: '20100518-233100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3901',
internalId:  '',
customField: '20100628-030435'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '85533',
internalId:  '1006',
customField: '1006'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '17601',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17201',
internalId:  '',
customField: '20100514-153013'
};
webappMappings['7005']=webappMappings['7005-45']={
webappId:    '7005',
documentId:  '17201',
internalId:  '45',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17501',
internalId:  '',
customField: '20100628-033051'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '17501',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17601',
internalId:  '',
customField: '20100603-233718'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16743',
internalId:  '',
customField: '20101103-175934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '133612',
internalId:  '',
customField: '20101122-130934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16785',
internalId:  '',
customField: '20101103-175930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16806',
internalId:  '',
customField: '20101103-175926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16848',
internalId:  '',
customField: '20100619-024747'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16869',
internalId:  '',
customField: '20100619-025041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16890',
internalId:  '',
customField: '20100619-025253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22801',
internalId:  '',
customField: '20100701-181249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125012',
internalId:  '',
customField: '20101103-175852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26301',
internalId:  '',
customField: '20100604-003530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48612',
internalId:  '',
customField: '20100624-191029'
};
webappMappings['7050']=webappMappings['7050-1493']={
webappId:    '7050',
documentId:  '69112',
internalId:  '1493',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69112',
internalId:  '',
customField: '20091205-150246'
};
webappMappings['7060']=webappMappings['7060-76656104f827b8abad7b40e493005a45']={
webappId:    '7060',
documentId:  '105412',
internalId:  '76656104f827b8abad7b40e493005a45',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69412',
internalId:  '',
customField: '20100627-133949'
};
webappMappings['7060']=webappMappings['7060-2d7525816cd56414f0ca8c805f519cc8']={
webappId:    '7060',
documentId:  '127612',
internalId:  '2d7525816cd56414f0ca8c805f519cc8',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85533',
internalId:  '',
customField: '20101122-130952'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95033',
internalId:  '',
customField: '20101103-175852'
};
webappMappings['7060']=webappMappings['7060-f2e743179772752b4fa3c8b0ea853406']={
webappId:    '7060',
documentId:  '105512',
internalId:  'f2e743179772752b4fa3c8b0ea853406',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105412',
internalId:  '',
customField: '20100619-012022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105512',
internalId:  '',
customField: '20100619-012038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '127612',
internalId:  '',
customField: '20100628-033311'
};
var canonHostname = 'wsc02.webland.ch';
var accountId     = 'AWB010INXLWL';
var companyName   = 'Kunst%2C+Kultur+und+Musik+im+Kirchenbezirk';
var htmlTitle	  = 'Kultur-Insel+Bremgarten';
var metaKeywords  = 'Bremgarten%2CKultur%2CKunst%2CMusik%2CKirchenbezirk%2CAargau%2CFreiamt%2CReuss%2CLukaszewszi';
var metaContents  = 'Kultur-Insel+Bremgarten+Der+Verein+zur+F%C3%B6rderung+von+Kunst%2C+Kultur+und+Musik+im+Kirchenbezirk+Bremgarten';
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();
};

