/* [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','4445',jdecode('Unsere+Schule'),jdecode(''), jdecode('%2F4445%2Findex.html'), 'true',[ 
		['PAGE','50785',jdecode('Leitbild'),jdecode(''), jdecode('%2F4445%2F50785.html'), 'true',[],'',''],
		['PAGE','91912',jdecode('News'),jdecode(''), jdecode('%2F4445%2F91912.html'), 'true',[],'',''],
		['PAGE','69401',jdecode('Organisation'),jdecode(''), jdecode('%2F4445%2F69401.html'), 'true',[],'',''],
		['PAGE','51216',jdecode('Schulhausordnung+'),jdecode(''), jdecode('%2F4445%2F51216.html'), 'true',[],'',''],
		['PAGE','51272',jdecode('Unsere+Regeln'),jdecode(''), jdecode('%2F4445%2F51272.html'), 'false',[],'',''],
		['PAGE','51281',jdecode('Anwendung+der+Regeln'),jdecode(''), jdecode('%2F4445%2F51281.html'), 'false',[],'','']
	],'',''],
	['PAGE','9286',jdecode('Kindergarten'),jdecode(''), jdecode('%2F9286%2Findex.html'), 'true',[ 
		['PAGE','143333',jdecode('Kindergarten+A'),jdecode(''), jdecode('%2F9286%2F143333.html'), 'true',[],'',''],
		['PAGE','143354',jdecode('Kindergarten+B'),jdecode(''), jdecode('%2F9286%2F143354.html'), 'true',[],'','']
	],'',''],
	['PAGE','9313',jdecode('Primarschule'),jdecode(''), jdecode('%2F9313%2Findex.html'), 'true',[ 
		['PAGE','143375',jdecode('1.+Klasse'),jdecode(''), jdecode('%2F9313%2F143375.html'), 'true',[],'',''],
		['PAGE','143396',jdecode('2.+Klasse'),jdecode(''), jdecode('%2F9313%2F143396.html'), 'true',[],'',''],
		['PAGE','143417',jdecode('1.+%2F+2.+Klasse+gemischt'),jdecode(''), jdecode('%2F9313%2F143417.html'), 'true',[],'',''],
		['PAGE','143438',jdecode('3.+Klasse'),jdecode(''), jdecode('%2F9313%2F143438.html'), 'true',[],'',''],
		['PAGE','143459',jdecode('4.+Klasse'),jdecode(''), jdecode('%2F9313%2F143459.html'), 'true',[],'',''],
		['PAGE','143480',jdecode('3.+%2F+4.+Klasse+gemischt'),jdecode(''), jdecode('%2F9313%2F143480.html'), 'true',[],'',''],
		['PAGE','143501',jdecode('5.+Klasse'),jdecode(''), jdecode('%2F9313%2F143501.html'), 'true',[],'',''],
		['PAGE','143522',jdecode('6.+Klasse'),jdecode(''), jdecode('%2F9313%2F143522.html'), 'true',[],'',''],
		['PAGE','143543',jdecode('5.+%2F+6.+Klasse+gemischt'),jdecode(''), jdecode('%2F9313%2F143543.html'), 'true',[],'','']
	],'',''],
	['PAGE','144312',jdecode('IF+%26+Fachpersonal'),jdecode(''), jdecode('%2F144312%2Findex.html'), 'true',[ 
		['PAGE','9622',jdecode('IF+'),jdecode(''), jdecode('%2F144312%2F9622.html'), 'true',[],'',''],
		['PAGE','40840',jdecode('+Fachpersonal'),jdecode(''), jdecode('%2F144312%2F40840.html'), 'true',[],'','']
	],'',''],
	['PAGE','9340',jdecode('Ferienplan'),jdecode(''), jdecode('%2F9340.html'), 'true',[],'',''],
	['PAGE','49038',jdecode('Musikschule'),jdecode(''), jdecode('%2F49038.html'), 'true',[],'',''],
	['PAGE','41665',jdecode('Anl%C3%A4sse%2C+Projekte'),jdecode(''), jdecode('%2F41665%2Findex.html'), 'true',[ 
		['PAGE','169312',jdecode('1.+Schultag'),jdecode(''), jdecode('%2F41665%2F169312.html'), 'true',[],'',''],
		['PAGE','172712',jdecode('Herbstwanderung'),jdecode(''), jdecode('%2F41665%2F172712.html'), 'true',[],'',''],
		['PAGE','173412',jdecode('Auf+dem+Bauernhof'),jdecode(''), jdecode('%2F41665%2F173412.html'), 'true',[],'',''],
		['PAGE','175712',jdecode('Diverses+3.+%2F+4.+Klasse'),jdecode(''), jdecode('%2F41665%2F175712.html'), 'true',[],'',''],
		['PAGE','175112',jdecode('Laternenumzug'),jdecode(''), jdecode('%2F41665%2F175112.html'), 'true',[],'',''],
		['PAGE','152212',jdecode('Klassenfotos+2011%2F12'),jdecode(''), jdecode('%2F41665%2F152212.html'), 'true',[],'','']
	],'',''],
	['PAGE','143812',jdecode('Links'),jdecode(''), jdecode('%2F143812%2Findex.html'), 'true',[ 
		['PAGE','49715',jdecode('Elternlinks'),jdecode(''), jdecode('%2F143812%2F49715.html'), 'true',[],'',''],
		['PAGE','42057',jdecode('Sch%C3%BClerlinks'),jdecode(''), jdecode('%2F143812%2F42057.html'), 'true',[],'','']
	],'',''],
	['PAGE','143833',jdecode('Lageplan'),jdecode(''), jdecode('%2F143833.html'), 'true',[],'','']];
var siteelementCount=36;
theSitetree.topTemplateName='Round';
theSitetree.paletteFamily='CC3333';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='439';
theSitetree.graphicsetId='495';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='e47272';
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: 			'Round',
				paletteFamily: 	'CC3333',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'439',
				graphicsetId: 	'495',
				contentColor: 	'FFFFFF',
				contentBGColor: 'e47272',
				a_color: 		'e47272',
				b_color: 		'CC3333',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '69401',
internalId:  '',
customField: '20110920-164715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143833',
internalId:  '',
customField: '20101012-134719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4445',
internalId:  '',
customField: '20110920-154307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143501',
internalId:  '',
customField: '20111120-131415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50785',
internalId:  '',
customField: '20110816-203513'
};
webappMappings['7060']=webappMappings['7060-3fe20b19ddb4077c59efaf5fa17d662d']={
webappId:    '7060',
documentId:  '152212',
internalId:  '3fe20b19ddb4077c59efaf5fa17d662d',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9286',
internalId:  '',
customField: '20110816-204457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9313',
internalId:  '',
customField: '20110816-203954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40840',
internalId:  '',
customField: '20110819-115751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9622',
internalId:  '',
customField: '20110819-115647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9340',
internalId:  '',
customField: '20110907-201627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51216',
internalId:  '',
customField: '20110816-200514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51272',
internalId:  '',
customField: '20101012-141608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51281',
internalId:  '',
customField: '20070909-202551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41665',
internalId:  '',
customField: '20120103-163506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143354',
internalId:  '',
customField: '20111120-131026'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '175712',
internalId:  '-',
customField: '20120103-163700'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42057',
internalId:  '',
customField: '20091206-012600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49715',
internalId:  '',
customField: '20101014-203854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143522',
internalId:  '',
customField: '20111120-131448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143459',
internalId:  '',
customField: '20111120-131300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143480',
internalId:  '',
customField: '20111120-131334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '144312',
internalId:  '',
customField: '20110920-164958'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143543',
internalId:  '',
customField: '20111120-131518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143812',
internalId:  '',
customField: '20101021-195937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143333',
internalId:  '',
customField: '20111120-130949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143375',
internalId:  '',
customField: '20111120-131108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143396',
internalId:  '',
customField: '20111120-131136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143417',
internalId:  '',
customField: '20111120-131208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143438',
internalId:  '',
customField: '20111120-131233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49038',
internalId:  '',
customField: '20090506-200510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '91912',
internalId:  '',
customField: '20111224-142514'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '173412',
internalId:  '-',
customField: '20111120-140526'
};
webappMappings['7060']=webappMappings['7060-a3116daf1e7725e0b977e8eb653b36b6']={
webappId:    '7060',
documentId:  '173412',
internalId:  'a3116daf1e7725e0b977e8eb653b36b6',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '152212',
internalId:  '',
customField: '20111120-130708'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '143833',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '172712',
internalId:  '-',
customField: '20111125-180423'
};
webappMappings['7060']=webappMappings['7060-165d42f96c505c630e75c8888506aadc']={
webappId:    '7060',
documentId:  '175112',
internalId:  '165d42f96c505c630e75c8888506aadc',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '175112',
internalId:  '-',
customField: '20111224-142403'
};
webappMappings['7060']=webappMappings['7060-a3f427ec6a783800422e22bd0bf07010']={
webappId:    '7060',
documentId:  '175712',
internalId:  'a3f427ec6a783800422e22bd0bf07010',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '169312',
internalId:  '',
customField: '20110907-202700'
};
webappMappings['7060']=webappMappings['7060-2e8310d5de587298541a48d480fb788b']={
webappId:    '7060',
documentId:  '172712',
internalId:  '2e8310d5de587298541a48d480fb788b',
customField: 'language:de;country:CH;'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXSYN';
var companyName   = 'Primarschule+Rothenthurm+2011%2F12';
var htmlTitle	  = 'Primarschule+Rothenthurm+2010%2F2011';
var metaKeywords  = 'Primarschule+Kindergarten+Schulsekretariat+Rothenthurm';
var metaContents  = 'Das+Schulangebot+in+der+Gemeinde+Rothenthurm.';
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();
};

