/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','452',jdecode('Sommerfest'),jdecode(''),'/452/index.html','true',[ 
		['PAGE','494',jdecode('Das+Programm'),jdecode(''),'/452/494.html','true',[],'',''],
		['PAGE','23001',jdecode('Prominente'),jdecode(''),'/452/23001.html','true',[],'',''],
		['PAGE','473',jdecode('Die+Band'),jdecode(''),'/452/473.html','true',[],'',''],
		['PAGE','16301',jdecode('Bilder+2006'),jdecode(''),'/452/16301.html','true',[],'',''],
		['PAGE','41201',jdecode('Bilder+2007'),jdecode(''),'/452/41201.html','true',[],'',''],
		['PAGE','47201',jdecode('Bilder+2008'),jdecode(''),'/452/47201.html','true',[],'',''],
		['PAGE','55612',jdecode('Bilder+2010'),jdecode(''),'/452/55612.html','true',[],'','']
	],'',''],
	['PAGE','515',jdecode('Junge+Aeschiner'),jdecode(''),'/515/index.html','true',[ 
		['PAGE','536',jdecode('Komitee'),jdecode(''),'/515/536.html','true',[],'',''],
		['PAGE','557',jdecode('Philosophie'),jdecode(''),'/515/557.html','true',[],'',''],
		['PAGE','578',jdecode('Zweck+'),jdecode(''),'/515/578.html','true',[],'','']
	],'',''],
	['PAGE','31901',jdecode('Ausflug'),jdecode(''),'/31901/index.html','true',[ 
		['PAGE','43801',jdecode('2004'),jdecode(''),'/31901/43801.html','true',[],'',''],
		['PAGE','43822',jdecode('2005'),jdecode(''),'/31901/43822.html','true',[],'',''],
		['PAGE','43843',jdecode('2006'),jdecode(''),'/31901/43843.html','true',[],'',''],
		['PAGE','43864',jdecode('2007'),jdecode(''),'/31901/43864.html','true',[],'',''],
		['PAGE','48801',jdecode('2008'),jdecode(''),'/31901/48801.html','true',[],'',''],
		['PAGE','52812',jdecode('2009'),jdecode(''),'/31901/52812.html','true',[],'','']
	],'',''],
	['PAGE','599',jdecode('Fond+'),jdecode(''),'/599/index.html','true',[ 
		['PAGE','620',jdecode('Kommission'),jdecode(''),'/599/620.html','true',[],'','']
	],'',''],
	['PAGE','641',jdecode('Institutionen'),jdecode(''),'/641.html','true',[],'',''],
	['PAGE','10901',jdecode('Sponsoren'),jdecode(''),'/10901.html','true',[],'',''],
	['PAGE','25101',jdecode('Bilder'),jdecode(''),'/25101.html','true',[],'',''],
	['PAGE','10922',jdecode('Links'),jdecode(''),'/10922.html','true',[],'',''],
	['PAGE','19206',jdecode('G%C3%A4stebuch'),jdecode(''),'/19206/index.html','true',[ 
		['PAGE','19201',jdecode('Eintr%C3%A4ge'),jdecode(''),'/19206/19201.html','false',[],'','']
	],'',''],
	['PAGE','35101',jdecode('Ihr+Weg+zu+uns'),jdecode(''),'/35101.html','true',[],'','']];
var siteelementCount=29;
theSitetree.topTemplateName='Enjoy';
theSitetree.paletteFamily='93A6CC';
theSitetree.keyvisualId='2228';
theSitetree.keyvisualName='hochzeit4.jpg';
theSitetree.fontsetId='366';
theSitetree.graphicsetId='415';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='93A6CC';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Enjoy',
				paletteFamily: 	'93A6CC',
				keyvisualId: 	'2228',
				keyvisualName: 	'hochzeit4.jpg',
				fontsetId: 		'366',
				graphicsetId: 	'415',
				contentColor: 	'000000',
				contentBGColor: '93A6CC',
				a_color: 		'93A6CC',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-7028898']={
webappId:    '1501',
documentId:  '401',
internalId:  '7028898',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-19206abw0x0in2wxv']={
webappId:    '1002',
documentId:  '19206',
internalId:  '19206abw0x0in2wxv',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100410-104425'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '35101',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20090422-113527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20100328-210025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '641',
internalId:  '',
customField: '20100718-110008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10901',
internalId:  '',
customField: '20081015-123834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20061006-142630'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20100328-204552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23001',
internalId:  '',
customField: '20061017-191837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20061003-224719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16301',
internalId:  '',
customField: '20070722-233031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41201',
internalId:  '',
customField: '20070722-232948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47201',
internalId:  '',
customField: '20080721-132220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20061013-125306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '578',
internalId:  '',
customField: '20061017-192116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31901',
internalId:  '',
customField: '20071020-122910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43801',
internalId:  '',
customField: '20071020-122247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43822',
internalId:  '',
customField: '20071020-122311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43843',
internalId:  '',
customField: '20071020-122345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43864',
internalId:  '',
customField: '20071020-121635'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '48801',
internalId:  '',
customField: '20081025-125836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '599',
internalId:  '',
customField: '20061023-191412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '620',
internalId:  '',
customField: '20100328-210126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25101',
internalId:  '',
customField: '20061018-205016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10922',
internalId:  '',
customField: '20061018-205417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19206',
internalId:  '',
customField: '20061003-230536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19201',
internalId:  '',
customField: '20061003-230536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35101',
internalId:  '',
customField: '20061018-230602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52812',
internalId:  '',
customField: '20100718-104840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55612',
internalId:  '',
customField: '20100819-130440'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN2WXV';
var companyName   = 'Sommerfest+Aeschi';
var htmlTitle	  = 'sommerfest-aeschi.ch';
var metaKeywords  = 'sommerfest+aeschi++die+jungen+aeschiner++aeschi+sommer';
var metaContents  = 'sommerfest+aeschi+die+jungen+aeschiner';
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();
};

