/* [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','1801',jdecode('Home'),jdecode(''),'/1801.html','true',[],'',''],
	['PAGE','1822',jdecode('Schulleitung'),jdecode(''),'/1822.html','true',[],'',''],
	['PAGE','1873',jdecode('Schulrat'),jdecode(''),'/1873.html','true',[],'',''],
	['PAGE','13412',jdecode('Schule'),jdecode(''),'/13412/index.html','true',[ 
		['PAGE','1894',jdecode('Kindergarten'),jdecode(''),'/13412/1894.html','true',[],'',''],
		['PAGE','3901',jdecode('Primarschule'),jdecode(''),'/13412/3901.html','true',[],'',''],
		['PAGE','10401',jdecode('Oberstufe'),jdecode(''),'/13412/10401.html','true',[],'',''],
		['PAGE','4201',jdecode('IKK+%2F+ISS'),jdecode(''),'/13412/4201.html','true',[],'',''],
		['PAGE','4401',jdecode('Therapien'),jdecode(''),'/13412/4401.html','true',[],'','']
	],'',''],
	['PAGE','2101',jdecode('Schulspuren'),jdecode(''),'/2101.html','true',[],'',''],
	['PAGE','4701',jdecode('Leitbild'),jdecode(''),'/4701.html','true',[],'',''],
	['PAGE','12312',jdecode('Verordnungen+%2F+Regeln'),jdecode(''),'/12312/index.html','true',[ 
		['PAGE','5101',jdecode('Schulordnung'),jdecode(''),'/12312/5101.html','true',[],'',''],
		['PAGE','11901',jdecode('Disziplinarordnung'),jdecode(''),'/12312/11901.html','true',[],'',''],
		['PAGE','6001',jdecode('Hausordnung'),jdecode(''),'/12312/6001.html','true',[],'',''],
		['PAGE','6201',jdecode('Absenzregelung'),jdecode(''),'/12312/6201.html','true',[],'',''],
		['PAGE','12612',jdecode('Handy-+und+Pausenplatzregeln'),jdecode(''),'/12312/12612.html','true',[],'',''],
		['PAGE','12633',jdecode('Regeln+Schulweg+Taminser'),jdecode(''),'/12312/12633.html','true',[],'','']
	],'',''],
	['PAGE','6401',jdecode('Sch%C3%BClerzahlen'),jdecode(''),'/6401.html','true',[],'',''],
	['PAGE','6601',jdecode('Ferienplan'),jdecode(''),'/6601.html','true',[],'',''],
	['PAGE','6801',jdecode('Lehrerseiten'),jdecode(''),'/6801/index.html','true',[ 
		['PAGE','6822',jdecode('BSCW'),jdecode(''),'/6801/6822.html','true',[],'',''],
		['PAGE','7001',jdecode('iCampus'),jdecode(''),'/6801/7001.html','true',[],'','']
	],'',''],
	['PAGE','14712',jdecode('Sch%C3%BClerseiten'),jdecode(''),'/14712.html','true',[],'',''],
	['PAGE','7301',jdecode('G%C3%A4stebuch'),jdecode(''),'/7301.html','true',[],'',''],
	['PAGE','7401',jdecode('Kontakt'),jdecode(''),'/7401/index.html','true',[ 
		['PAGE','7601',jdecode('Kontaktformular'),jdecode(''),'/7401/7601.html','true',[],'',''],
		['PAGE','10601',jdecode('Hier+finden+Sie+uns'),jdecode(''),'/7401/10601.html','true',[],'','']
	],'','']];
var siteelementCount=28;
theSitetree.topTemplateName='Office';
theSitetree.paletteFamily='727D9C';
theSitetree.keyvisualId='11163';
theSitetree.keyvisualName='kv_11163.jpg';
theSitetree.fontsetId='32062';
theSitetree.graphicsetId='13879';
theSitetree.contentColor='4e5978';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Office',
				paletteFamily: 	'727D9C',
				keyvisualId: 	'11163',
				keyvisualName: 	'kv_11163.jpg',
				fontsetId: 		'32062',
				graphicsetId: 	'13879',
				contentColor: 	'4e5978',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1822',
internalId:  '',
customField: '20100610-103530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1873',
internalId:  '',
customField: '20100610-103742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20100725-130918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20100615-142017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1894',
internalId:  '',
customField: '20100812-073902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3901',
internalId:  '',
customField: '20100812-073846'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4201',
internalId:  '',
customField: '20100812-074009'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4401',
internalId:  '',
customField: '20100812-074042'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20100610-113749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20100610-142545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6001',
internalId:  '',
customField: '20100610-142839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20100610-145251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20100812-074650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6601',
internalId:  '',
customField: '20100812-074424'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6801',
internalId:  '',
customField: '20100610-184405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7001',
internalId:  '',
customField: '20100611-110446'
};
webappMappings['1002']=webappMappings['1002-7301awb010in280u']={
webappId:    '1002',
documentId:  '7301',
internalId:  '7301awb010in280u',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7401',
internalId:  '',
customField: '20100610-152555'
};
webappMappings['7008']=webappMappings['7008-8381']={
webappId:    '7008',
documentId:  '7601',
internalId:  '8381',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6822',
internalId:  '',
customField: '20100817-155102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7301',
internalId:  '',
customField: '20100610-175055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7601',
internalId:  '',
customField: '20100610-175006'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1801',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10401',
internalId:  '',
customField: '20100611-113943'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '10601',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10601',
internalId:  '',
customField: '20100611-114837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11901',
internalId:  '',
customField: '20100615-112515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12312',
internalId:  '',
customField: '20100615-134657'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12612',
internalId:  '',
customField: '20100615-134407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12633',
internalId:  '',
customField: '20100615-134347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13412',
internalId:  '',
customField: '20100615-135539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14712',
internalId:  '',
customField: '20100817-155042'
};
var canonHostname = 'wsc02.webland.ch';
var accountId     = 'AWB010IN280U';
var companyName   = 'Schule+Felsberg';
var htmlTitle	  = '';
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();
};
