/* [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','4559',jdecode('Home'),jdecode(''), jdecode('%2F4559.html'), 'true',[],'',''],
	['PAGE','63156',jdecode('Aktuelles'),jdecode(''), jdecode('%2F63156.html'), 'false',[],'',''],
	['PAGE','4643',jdecode('Die+schwarze+Spinne+'),jdecode(''), jdecode('%2F4643.html'), 'true',[],'',''],
	['PAGE','161701',jdecode('Vorstellung+10.9.2011'),jdecode(''), jdecode('%2F161701.html'), 'false',[],'',''],
	['PAGE','152901',jdecode('Der+Spielort'),jdecode(''), jdecode('%2F152901.html'), 'true',[],'',''],
	['PAGE','159501',jdecode('Premi%C3%A8ren+Fotos'),jdecode(''), jdecode('%2F159501.html'), 'true',[],'',''],
	['PAGE','161101',jdecode('Video'),jdecode(''), jdecode('%2F161101.html'), 'true',[],'',''],
	['PAGE','155701',jdecode('Routenplaner'),jdecode(''), jdecode('%2F155701.html'), 'false',[],'',''],
	['PAGE','138601',jdecode('Menuplan+2009'),jdecode(''), jdecode('%2F138601.html'), 'false',[],'',''],
	['PAGE','53154',jdecode('Ticket-+Bestellung'),jdecode(''), jdecode('%2F53154.html'), 'false',[],'',''],
	['PAGE','85188',jdecode('Aktivmitglieder++Infos'),jdecode(''), jdecode('%2F85188.html'), 'false',[],'',''],
	['PAGE','147901',jdecode('Newsletter'),jdecode(''), jdecode('%2F147901.html'), 'true',[],'',''],
	['PAGE','5803',jdecode('Aktivmitglieder'),jdecode(''), jdecode('%2F5803.html'), 'true',[],'',''],
	['PAGE','5830',jdecode('Passivmitglieder'),jdecode(''), jdecode('%2F5830.html'), 'true',[],'',''],
	['PAGE','23303',jdecode('Jahresprogramm'),jdecode(''), jdecode('%2F23303.html'), 'true',[],'',''],
	['PAGE','5857',jdecode('Historie'),jdecode(''), jdecode('%2F5857.html'), 'true',[],'',''],
	['PAGE','32213',jdecode('Foto+Archiv'),jdecode(''), jdecode('%2F32213%2Findex.html'), 'true',[ 
		['PAGE','60256',jdecode('Schloss+2005'),jdecode(''), jdecode('%2F32213%2F60256.html'), 'true',[],'',''],
		['PAGE','60283',jdecode('Sams+2005'),jdecode(''), jdecode('%2F32213%2F60283.html'), 'true',[],'',''],
		['PAGE','69062',jdecode('Dr+Ma+wo+sich+nit+traut+'),jdecode(''), jdecode('%2F32213%2F69062.html'), 'true',[],'',''],
		['PAGE','84679',jdecode('Schlofzimmergescht+'),jdecode(''), jdecode('%2F32213%2F84679.html'), 'true',[],'',''],
		['PAGE','85401',jdecode('Schloss+2007'),jdecode(''), jdecode('%2F32213%2F85401.html'), 'true',[],'',''],
		['PAGE','115101',jdecode('Brand+in+Pratteln+2008'),jdecode(''), jdecode('%2F32213%2F115101.html'), 'true',[],'',''],
		['PAGE','128901',jdecode('Schloss+2009'),jdecode(''), jdecode('%2F32213%2F128901.html'), 'true',[],'',''],
		['PAGE','141601',jdecode('Magnolien+aus+Stahl'),jdecode(''), jdecode('%2F32213%2F141601.html'), 'true',[],'','']
	],'',''],
	['PAGE','52367',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F52367%2Findex.html'), 'true',[ 
		['PAGE','52368',jdecode('Eintr%C3%A4ge'),jdecode(''), jdecode('%2F52367%2F52368.html'), 'false',[],'','']
	],'',''],
	['PAGE','91001',jdecode('Links'),jdecode(''), jdecode('%2F91001.html'), 'true',[],'','']];
var siteelementCount=28;
theSitetree.topTemplateName='Neon';
theSitetree.paletteFamily='CC0000';
theSitetree.keyvisualId='854';
theSitetree.keyvisualName='kind_spielt.jpg';
theSitetree.fontsetId='163';
theSitetree.graphicsetId='189';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Neon',
				paletteFamily: 	'CC0000',
				keyvisualId: 	'854',
				keyvisualName: 	'kind_spielt.jpg',
				fontsetId: 		'163',
				graphicsetId: 	'189',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'000000',
				b_color: 		'666666',
				c_color: 		'000000',
				d_color: 		'6699CC',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4643',
internalId:  '',
customField: '20110911-075429'
};
webappMappings['1501']=webappMappings['1501-1501']={
webappId:    '1501',
documentId:  '4559',
internalId:  '1501',
customField: '1501'
};
webappMappings['1002']=webappMappings['1002-52367ABW0X0INXZTZ']={
webappId:    '1002',
documentId:  '52367',
internalId:  '52367ABW0X0INXZTZ',
customField: 'icq=false'
};
webappMappings['1009']=webappMappings['1009-6278901']={
webappId:    '1009',
documentId:  '53235',
internalId:  '6278901',
customField: 'isFollowupPage:true;documentId:53154;'
};
webappMappings['7008']=webappMappings['7008-789']={
webappId:    '7008',
documentId:  '53154',
internalId:  '789',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4559',
internalId:  '',
customField: '20090401-151430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63156',
internalId:  '',
customField: '20110329-114742'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4559',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '152901',
internalId:  '',
customField: '20110605-160716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53154',
internalId:  '',
customField: '20110618-172301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53235',
internalId:  '',
customField: '20060204-074325'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85188',
internalId:  '',
customField: '20100130-103129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5803',
internalId:  '',
customField: '20060906-083446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5830',
internalId:  '',
customField: '20060906-083511'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23303',
internalId:  '',
customField: '20110417-070529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5857',
internalId:  '',
customField: '20100825-161449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32213',
internalId:  '',
customField: '20060402-125525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60256',
internalId:  '',
customField: '20070211-081218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60283',
internalId:  '',
customField: '20060329-123439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69062',
internalId:  '',
customField: '20110823-121418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84679',
internalId:  '',
customField: '20070501-192616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85401',
internalId:  '',
customField: '20070814-133540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '115101',
internalId:  '',
customField: '20080813-161051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52367',
internalId:  '',
customField: '20060202-131234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52368',
internalId:  '',
customField: '20060202-131234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91001',
internalId:  '',
customField: '20110823-210337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '128901',
internalId:  '',
customField: '20090813-211059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '147901',
internalId:  '',
customField: '20110417-142255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '138601',
internalId:  '',
customField: '20091031-122733'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '155701',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '141601',
internalId:  '',
customField: '20100130-103741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '155701',
internalId:  '',
customField: '20110629-163419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '159501',
internalId:  '',
customField: '20110831-111800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '161101',
internalId:  '',
customField: '20110823-211436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '161701',
internalId:  '',
customField: '20110910-004948'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXZTZ';
var companyName   = 'Laienb%C3%BChne+Pratteln';
var htmlTitle	  = '+Laienb%C3%BChne+Pratteln';
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();
};

