/* [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','4597',jdecode('Startseite'),jdecode(''), jdecode('%2F4597.html'), 'true',[],'',''],
	['PAGE','33864',jdecode('Veranstaltungen+%2F+Kurse'),jdecode(''), jdecode('%2F33864.html'), 'true',[],'',''],
	['PAGE','104364',jdecode('Hoppli'),jdecode(''), jdecode('%2F104364.html'), 'true',[],'',''],
	['PAGE','104301',jdecode('Schule+%26+Kindergarten'),jdecode(''), jdecode('%2F104301.html'), 'true',[],'',''],
	['PAGE','104322',jdecode('Waldanl%C3%A4sse'),jdecode(''), jdecode('%2F104322.html'), 'true',[],'',''],
	['PAGE','104406',jdecode('Gruppen'),jdecode(''), jdecode('%2F104406.html'), 'true',[],'',''],
	['PAGE','34157',jdecode('Geburtstag+im+Wald'),jdecode(''), jdecode('%2F34157.html'), 'true',[],'',''],
	['PAGE','104343',jdecode('Termine'),jdecode(''), jdecode('%2F104343.html'), 'true',[],'',''],
	['PAGE','181201',jdecode('Hinweise+%26+Gesundheit'),jdecode(''), jdecode('%2F181201.html'), 'true',[],'',''],
	['PAGE','4654',jdecode('Fotos+%2F+%C3%BCber+uns'),jdecode(''), jdecode('%2F4654.html'), 'true',[],'',''],
	['PAGE','34082',jdecode('Waldp%C3%A4dagogik%3F'),jdecode(''), jdecode('%2F34082.html'), 'true',[],'',''],
	['PAGE','4681',jdecode('Adressen+%26+Links'),jdecode(''), jdecode('%2F4681.html'), 'true',[],'',''],
	['PAGE','137401',jdecode('Kontakt'),jdecode(''), jdecode('%2F137401.html'), 'true',[],'',''],
	['PAGE','104385',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F104385.html'), 'false',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Intense';
theSitetree.paletteFamily='66956C';
theSitetree.keyvisualId='3497';
theSitetree.keyvisualName='kv_3497.jpg';
theSitetree.fontsetId='10654';
theSitetree.graphicsetId='10800';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='B3D0B7';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Intense',
				paletteFamily: 	'66956C',
				keyvisualId: 	'3497',
				keyvisualName: 	'kv_3497.jpg',
				fontsetId: 		'10654',
				graphicsetId: 	'10800',
				contentColor: 	'000000',
				contentBGColor: 'B3D0B7',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'AD401A',
				e_color: 		'727171',
				f_color: 		'3F3F3F',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4597',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4597',
internalId:  '',
customField: '20120220-105215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33864',
internalId:  '',
customField: '20120203-180023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34157',
internalId:  '',
customField: '20101227-143719'
};
webappMappings['7008']=webappMappings['7008-5536']={
webappId:    '7008',
documentId:  '137401',
internalId:  '5536',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4654',
internalId:  '',
customField: '20120204-114125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34082',
internalId:  '',
customField: '20091004-114250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '181201',
internalId:  '',
customField: '20120221-074242'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4681',
internalId:  '',
customField: '20111122-102853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104364',
internalId:  '',
customField: '20120220-164821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104385',
internalId:  '',
customField: '20100319-081906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104301',
internalId:  '',
customField: '20110630-170600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104322',
internalId:  '',
customField: '20110216-144732'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104343',
internalId:  '',
customField: '20120203-164735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '104406',
internalId:  '',
customField: '20110603-190607'
};
webappMappings['1002']=webappMappings['1002-104385abw0x0inx20y']={
webappId:    '1002',
documentId:  '104385',
internalId:  '104385abw0x0inx20y',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '137401',
internalId:  '',
customField: '20120220-163006'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INX20Y';
var companyName   = 'Aussergew%C3%B6hnliche+Naturerlebnisse%21';
var htmlTitle	  = 'natur-erlebnis-wald.ch+-+waldp%C3%A4dagogik%2C+kurse+und+erlebnistage+in+natur+und+wald';
var metaKeywords  = 'Natur%2C+Erlebnis%2C+Wald%2C+Wald%2C+P%C3%A4dagogik%2C+naturbezogene%2C+Umwelt%2C+Bildung%2C+Hoppli%2C+Veranstaltungen%2C+Kurse%2C+Exkursionen%2C+Walderlebnistage%2C+Kinder%2C+Erwachsene%2C+Silviva%2C+erlebnisreich%2C+Familien%2C+Ursula%2C+Fluri-Baumgartner%2C+Kinder%2C+Waldmobil%2C+Waldschule%2C+Solothurn%2C+Wasseramt%2C+Obergerlafingen%2C+Waldspielgruppe%2C+Biberist%2C+Bucheggberg';
var metaContents  = 'Natur%2C+Erlebnis%2C+Wald+stehen+im+Zentrum+meiner+Waldp%C3%A4dagogik.+Ich+biete+erlebnisreiche+Veranstaltungen%2C+Kurse%2C+Exkursionen+und+Walderlebnistage+fuer+Kinder%2C+Erwachsene+und+Familien+an.+';
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();
};

