/* [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','4599',jdecode('Home'),jdecode(''), jdecode('%2F4599.html'), 'true',[],'',''],
	['PAGE','64701',jdecode('News'),jdecode(''), jdecode('%2F64701.html'), 'true',[],'',''],
	['PAGE','12367',jdecode('Was+ist+der+Elternrat+%3F+'),jdecode(''), jdecode('%2F12367%2Findex.html'), 'true',[ 
		['PAGE','33401',jdecode('Geschichte+'),jdecode(''), jdecode('%2F12367%2F33401.html'), 'true',[],'',''],
		['PAGE','16452',jdecode('Organigram'),jdecode(''), jdecode('%2F12367%2F16452.html'), 'true',[],'',''],
		['PAGE','11403',jdecode('Vorstand'),jdecode(''), jdecode('%2F12367%2F11403.html'), 'true',[],'',''],
		['PAGE','12130',jdecode('Leitfaden'),jdecode(''), jdecode('%2F12367%2F12130.html'), 'true',[],'','']
	],'',''],
	['PAGE','9803',jdecode('Elternrats+Wahlen'),jdecode(''), jdecode('%2F9803%2Findex.html'), 'true',[ 
		['PAGE','10303',jdecode('Durchf%C3%BChrung'),jdecode(''), jdecode('%2F9803%2F10303.html'), 'true',[],'',''],
		['PAGE','10330',jdecode('R%C3%BCcktritt'),jdecode(''), jdecode('%2F9803%2F10330.html'), 'true',[],'',''],
		['PAGE','10357',jdecode('Ausnahmeregelung'),jdecode(''), jdecode('%2F9803%2F10357.html'), 'true',[],'','']
	],'',''],
	['PAGE','4710',jdecode('Termine+%26+Daten'),jdecode(''), jdecode('%2F4710.html'), 'true',[],'',''],
	['PAGE','4737',jdecode('Projekte+%26+Ideen'),jdecode(''), jdecode('%2F4737%2Findex.html'), 'true',[ 
		['PAGE','63401',jdecode('Sicher+mit+neuen+Medien'),jdecode(''), jdecode('%2F4737%2F63401.html'), 'true',[],'',''],
		['PAGE','56901',jdecode('Gewaltpr%C3%A4vention'),jdecode(''), jdecode('%2F4737%2F56901.html'), 'true',[],'',''],
		['PAGE','53601',jdecode('Midnight+Basketball'),jdecode(''), jdecode('%2F4737%2F53601.html'), 'true',[],'','']
	],'',''],
	['PAGE','26001',jdecode('Primar-Schulpflege+'),jdecode(''), jdecode('%2F26001%2Findex.html'), 'true',[ 
		['PAGE','30322',jdecode('Beh%C3%B6rdenprofil'),jdecode(''), jdecode('%2F26001%2F30322.html'), 'true',[],'',''],
		['PAGE','24001',jdecode('Bildungswege'),jdecode(''), jdecode('%2F26001%2F24001.html'), 'true',[],'','']
	],'',''],
	['PAGE','4818',jdecode('Archiv+%26+Doku'),jdecode(''), jdecode('%2F4818.html'), 'true',[],'',''],
	['PAGE','7403',jdecode('Links+Sammlung'),jdecode(''), jdecode('%2F7403.html'), 'true',[],'',''],
	['PAGE','4980',jdecode('Kontakt'),jdecode(''), jdecode('%2F4980.html'), 'true',[],'',''],
	['PAGE','4872',jdecode('Secured+Zone'),jdecode(''), jdecode('%2F4872%2Findex.html'), 'true',[ 
		['PAGE','15003',jdecode('Login'),jdecode(''), jdecode('%2F4872%2F15003.html'), 'true',[],'','']
	],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Amaze';
theSitetree.paletteFamily='0A2447';
theSitetree.keyvisualId='2410';
theSitetree.keyvisualName='bildung.jpg';
theSitetree.fontsetId='397';
theSitetree.graphicsetId='444';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='0A2447';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'hostpoint',
  product: 'WSCSYSSSSLYTC21F'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Amaze',
				paletteFamily: 	'0A2447',
				keyvisualId: 	'2410',
				keyvisualName: 	'bildung.jpg',
				fontsetId: 		'397',
				graphicsetId: 	'444',
				contentColor: 	'FFFFFF',
				contentBGColor: '0A2447',
				a_color: 		'0A2447',
				b_color: 		'081B35',
				c_color: 		'3268E2',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1501']=webappMappings['1501-4331600']={
webappId:    '1501',
documentId:  '4599',
internalId:  '4331600',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64701',
internalId:  '',
customField: '20110906-202040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4599',
internalId:  '',
customField: '20110906-201820'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4599',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12367',
internalId:  '',
customField: '20110301-181529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33401',
internalId:  '',
customField: '20060928-150806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9803',
internalId:  '',
customField: '20110301-182610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10303',
internalId:  '',
customField: '20110301-183305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10330',
internalId:  '',
customField: '20060628-120255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10357',
internalId:  '',
customField: '20060628-120357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16452',
internalId:  '',
customField: '20060929-075822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11403',
internalId:  '',
customField: '20110906-180939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12130',
internalId:  '',
customField: '20061010-082104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4710',
internalId:  '',
customField: '20110906-175749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4737',
internalId:  '',
customField: '20110301-184937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63401',
internalId:  '',
customField: '20091116-205020'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56901',
internalId:  '',
customField: '20071206-140811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53601',
internalId:  '',
customField: '20110301-185639'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26001',
internalId:  '',
customField: '20091116-203751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30322',
internalId:  '',
customField: '20060915-134904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4818',
internalId:  '',
customField: '20110821-091055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24001',
internalId:  '',
customField: '20060908-085810'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7403',
internalId:  '',
customField: '20110301-191638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4980',
internalId:  '',
customField: '20101006-185654'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4872',
internalId:  '',
customField: '20060917-105412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15003',
internalId:  '',
customField: '20060703-130635'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'Ahp010INEYQF';
var companyName   = 'Elternrat+Primarschule+Oberglatt';
var htmlTitle	  = 'Elternrat+Schule+Oberglatt+Online';
var metaKeywords  = 'elternrat+Oberglatt+schule+Oberglatt+primarschule+Oberglatt+Kinder+Mittagstisch+elternmithilfe+Oberglatt+elternmitwirkung+';
var metaContents  = 'Schulpflege+und+Elternrat+Oberglatt%2C+Primarschule+Oberglatt+Elternmithilfe%2C++egagierte+Eltern%2C+Schulprobleme+l%C3%B6sen%2C+Mittagstisch%2C+elternmitwirkung+';
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();
};

