/* [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','301',jdecode('HOME'),jdecode(''),'/301.html','true',[],'',''],
	['PAGE','2501',jdecode('ANGEBOT'),jdecode(''),'/2501/index.html','true',[ 
		['PAGE','2522',jdecode('Spielgruppe'),jdecode(''),'/2501/2522.html','true',[],'',''],
		['PAGE','3101',jdecode('Kindergarten'),jdecode(''),'/2501/3101.html','true',[],'',''],
		['PAGE','14501',jdecode('Chinderhus+%C3%96pfelbaum'),jdecode(''),'/2501/14501.html','true',[],'',''],
		['PAGE','8501',jdecode('Tagesschule'),jdecode(''),'/2501/8501.html','true',[],'',''],
		['PAGE','8522',jdecode('Primarstufe'),jdecode(''),'/2501/8522.html','true',[],'',''],
		['PAGE','8543',jdecode('Sekundarstufe+I+und+II'),jdecode(''),'/2501/8543.html','true',[],'',''],
		['PAGE','8564',jdecode('Sekundarstufe+III'),jdecode(''),'/2501/8564.html','true',[],'',''],
		['PAGE','8585',jdecode('Matura-+oder+Abiturklassen'),jdecode(''),'/2501/8585.html','true',[],'',''],
		['PAGE','10801',jdecode('%C3%9Cbertritt+an+die+Staatsschulen'),jdecode(''),'/2501/10801.html','true',[],'',''],
		['PAGE','22101',jdecode('Antritt+einer+Lehrstelle'),jdecode(''),'/2501/22101.html','true',[],'','']
	],'',''],
	['PAGE','2543',jdecode('DAS+BESONDERE'),jdecode(''),'/2543/index.html','true',[ 
		['PAGE','25401',jdecode('Unser+Leitbild'),jdecode(''),'/2543/25401.html','true',[],'','']
	],'',''],
	['PAGE','2564',jdecode('ORGANISATION'),jdecode(''),'/2564.html','true',[],'',''],
	['PAGE','2585',jdecode('FINANZIELLES'),jdecode(''),'/2585.html','true',[],'',''],
	['PAGE','2606',jdecode('TERMINE+%2F+AGENDA'),jdecode(''),'/2606/index.html','true',[ 
		['PAGE','5201',jdecode('%C3%B6ffentliche+Veranstaltungen'),jdecode(''),'/2606/5201.html','true',[],'',''],
		['PAGE','5222',jdecode('interne+Veranstaltungen'),jdecode(''),'/2606/5222.html','true',[],'',''],
		['PAGE','6701',jdecode('Schulferien'),jdecode(''),'/2606/6701.html','true',[],'',''],
		['PAGE','14101',jdecode('Elternmitarbeit'),jdecode(''),'/2606/14101.html','true',[],'','']
	],'',''],
	['PAGE','2627',jdecode('ANMELDUNG'),jdecode(''),'/2627.html','true',[],'',''],
	['PAGE','2648',jdecode('KONTAKT'),jdecode(''),'/2648.html','true',[],'',''],
	['PAGE','2669',jdecode('LINKS'),jdecode(''),'/2669.html','true',[],'',''],
	['PAGE','30501',jdecode('KURSANGEBOTE'),jdecode(''),'/30501.html','true',[],'',''],
	['PAGE','19501',jdecode('FREIE+STELLEN'),jdecode(''),'/19501.html','true',[],'',''],
	['PAGE','2690',jdecode('DOWNLOADS'),jdecode(''),'/2690.html','true',[],'',''],
	['PAGE','4001',jdecode('ANFAHRT'),jdecode(''),'/4001.html','true',[],'','']];
var siteelementCount=28;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='D72B2B';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10893';
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: 			'Alpha',
				paletteFamily: 	'D72B2B',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10893',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'D72B2B',
				e_color: 		'D72B2B',
				f_color: 		'D72B2B',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '4001',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8501',
internalId:  '',
customField: '20090601-224409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20100306-224600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2501',
internalId:  '',
customField: '20090503-101409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2690',
internalId:  '',
customField: '20100405-220152'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2669',
internalId:  '',
customField: '20090623-213633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2627',
internalId:  '',
customField: '20100127-212427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2564',
internalId:  '',
customField: '20100118-213932'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2543',
internalId:  '',
customField: '20100221-120205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2585',
internalId:  '',
customField: '20100605-120816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2606',
internalId:  '',
customField: '20080324-093938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5201',
internalId:  '',
customField: '20100529-214538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5222',
internalId:  '',
customField: '20100718-205912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6701',
internalId:  '',
customField: '20100511-223905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2648',
internalId:  '',
customField: '20071118-211140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4001',
internalId:  '',
customField: '20071118-210420'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14101',
internalId:  '',
customField: '20100718-205942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3101',
internalId:  '',
customField: '20100605-120634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2522',
internalId:  '',
customField: '20100317-185340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14501',
internalId:  '',
customField: '20100524-170336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8522',
internalId:  '',
customField: '20080406-174945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8543',
internalId:  '',
customField: '20080406-175212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8564',
internalId:  '',
customField: '20080406-182603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8585',
internalId:  '',
customField: '20090623-213252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10801',
internalId:  '',
customField: '20080324-001618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19501',
internalId:  '',
customField: '20100610-002923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22101',
internalId:  '',
customField: '20091014-205850'
};
webappMappings['7008']=webappMappings['7008-1179']={
webappId:    '7008',
documentId:  '2648',
internalId:  '1179',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25401',
internalId:  '',
customField: '20080607-114944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30501',
internalId:  '',
customField: '20080619-210242'
};
var canonHostname = 'wsc.genotec.ch';
var accountId     = 'AGT010IN2KOG';
var companyName   = 'Rudolf+Steiner+Schule+Schaffhausen';
var htmlTitle	  = 'Die+besondere+Schule+in+Schaffhausen';
var metaKeywords  = 'Rudolf+Steiner+Schule%2C+Anthroposophie%2C+Tagesschule%2C+Kindergarten%2C+Privatschule%2C+Schaffhausen%2C+Waldorfschule%2C+Spielgruppe%2C+Schule%2C+Private+Schule%2C+rudolf+steiner+schule%2C+anthroposophie%2C+tagesschule%2C+kindergarten%2C+privatschule%2C+schaffhausen%2C+waldorfschule%2C+spielgruppe%2C+schule%2C+private+schule';
var metaContents  = 'Eine+umfassende+Schulbildung%2C+welche+die+ganzheitliche+Pers%C3%B6nlichkeitsentwicklung+ins+Zentrum+der+p%C3%A4dagogischen+Arbeit+stellt%2C+ist+die+beste+Voraussetzung+f%C3%BCr+eine+erfolgreiche+Ausbildung.';
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();
};
