/* [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','4598',jdecode('Home'),jdecode(''),'/4598.html','true',[],'',''],
	['PAGE','4655',jdecode('RZSO-Aktuell'),jdecode(''),'/4655.html','true',[],'',''],
	['PAGE','4682',jdecode('RZSO-Organisation'),jdecode(''),'/4682/index.html','true',[ 
		['PAGE','4709',jdecode('Organigramm+Stab'),jdecode(''),'/4682/4709.html','true',[],'',''],
		['PAGE','29771',jdecode('Schutzbauten'),jdecode(''),'/4682/29771.html','true',[],'',''],
		['PAGE','4736',jdecode('Kontaktadresse'),jdecode(''),'/4682/4736.html','true',[],'',''],
		['PAGE','4763',jdecode('Plan'),jdecode(''),'/4682/4763.html','true',[],'',''],
		['PAGE','4790',jdecode('Vorstellung+Dienste'),jdecode(''),'/4682/4790.html','true',[],'','']
	],'',''],
	['PAGE','4817',jdecode('RZSO-Anl%C3%A4sse'),jdecode(''),'/4817/index.html','true',[ 
		['PAGE','33354',jdecode('Bilder+Kurs+07'),jdecode(''),'/4817/33354.html','false',[],'','']
	],'',''],
	['PAGE','4898',jdecode('RZSO-Unterlagen'),jdecode(''),'/4898/index.html','true',[ 
		['PAGE','10501',jdecode('Personal'),jdecode(''),'/4898/10501.html','true',[],'',''],
		['PAGE','16295',jdecode('Material'),jdecode(''),'/4898/16295.html','true',[],'',''],
		['PAGE','16322',jdecode('Fhr.-Unterst%C3%BCtzung'),jdecode(''),'/4898/16322.html','true',[],'',''],
		['PAGE','16349',jdecode('Schutz+%26+Betreuung'),jdecode(''),'/4898/16349.html','true',[],'',''],
		['PAGE','16376',jdecode('Kulturg%C3%BCterschutz'),jdecode(''),'/4898/16376.html','true',[],'',''],
		['PAGE','16403',jdecode('Unterst%C3%BCtzung'),jdecode(''),'/4898/16403.html','true',[],'',''],
		['PAGE','16430',jdecode('Logistik'),jdecode(''),'/4898/16430.html','true',[],'',''],
		['PAGE','16457',jdecode('Doku%26%23x27%3Bs+und+Behelfe'),jdecode(''),'/4898/16457.html','true',[],'',''],
		['PAGE','16484',jdecode('Vorlagen'),jdecode(''),'/4898/16484.html','true',[],'','']
	],'',''],
	['PAGE','32188',jdecode('RZSO-Downloads'),jdecode(''),'/32188.html','true',[],'',''],
	['PAGE','21955',jdecode('RFS-Aktuell'),jdecode(''),'/21955.html','true',[],'',''],
	['PAGE','31000',jdecode('RFS-Organisation'),jdecode(''),'/31000/index.html','true',[ 
		['PAGE','35613',jdecode('RFS+Stab'),jdecode(''),'/31000/35613.html','true',[],'',''],
		['PAGE','35701',jdecode('Kontaktadresse'),jdecode(''),'/31000/35701.html','true',[],'','']
	],'',''],
	['PAGE','30762',jdecode('RFS-Anl%C3%A4sse'),jdecode(''),'/30762.html','true',[],'',''],
	['PAGE','31027',jdecode('RFS-Unterlagen'),jdecode(''),'/31027/index.html','true',[ 
		['PAGE','35821',jdecode('EFD+Stab'),jdecode(''),'/31027/35821.html','true',[],'','']
	],'',''],
	['PAGE','4973',jdecode('G%C3%A4stebuch'),jdecode(''),'/4973/index.html','true',[ 
		['PAGE','4974',jdecode('Eintr%C3%A4ge'),jdecode(''),'/4973/4974.html','false',[],'','']
	],'',''],
	['PAGE','28748',jdecode('Ihr+Weg+zu+uns'),jdecode(''),'/28748.html','true',[],'',''],
	['PAGE','28979',jdecode('Anfahrt'),jdecode(''),'/28979.html','true',[],'','']];
var siteelementCount=32;
theSitetree.topTemplateName='Mosaic';
theSitetree.paletteFamily='F3F2BE';
theSitetree.keyvisualId='2600';
theSitetree.keyvisualName='verkehr.jpg';
theSitetree.fontsetId='10713';
theSitetree.graphicsetId='10518';
theSitetree.contentColor='234773';
theSitetree.contentBGColor='F3F2BE';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Mosaic',
				paletteFamily: 	'F3F2BE',
				keyvisualId: 	'2600',
				keyvisualName: 	'verkehr.jpg',
				fontsetId: 		'10713',
				graphicsetId: 	'10518',
				contentColor: 	'234773',
				contentBGColor: 'F3F2BE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'D85161',
				e_color: 		'A1A05C',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4655',
internalId:  '',
customField: '20110131-210952'
};
webappMappings['1002']=webappMappings['1002-4973ABW0X0INXP8O']={
webappId:    '1002',
documentId:  '4973',
internalId:  '4973ABW0X0INXP8O',
customField: 'icq=false'
};
webappMappings['1501']=webappMappings['1501-2883815']={
webappId:    '1501',
documentId:  '4598',
internalId:  '2883815',
customField: '1501'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '28748',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '28979',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4598',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4598',
internalId:  '',
customField: '20110131-214349'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4682',
internalId:  '',
customField: '20051202-111012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4709',
internalId:  '',
customField: '20110301-161755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29771',
internalId:  '',
customField: '20080412-121432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4736',
internalId:  '',
customField: '20061127-111328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4763',
internalId:  '',
customField: '20051202-105405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4790',
internalId:  '',
customField: '20051028-131809'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4817',
internalId:  '',
customField: '20101219-103953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '33354',
internalId:  '',
customField: '20071228-073023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4898',
internalId:  '',
customField: '20051202-115715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20091222-191826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16295',
internalId:  '',
customField: '20080412-122500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16322',
internalId:  '',
customField: '20051028-132055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16349',
internalId:  '',
customField: '20051028-132113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16376',
internalId:  '',
customField: '20051028-132132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16403',
internalId:  '',
customField: '20051028-132147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16430',
internalId:  '',
customField: '20051028-132159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16457',
internalId:  '',
customField: '20091222-195637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16484',
internalId:  '',
customField: '20091222-200035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32188',
internalId:  '',
customField: '20080413-134107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21955',
internalId:  '',
customField: '20110131-210514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31000',
internalId:  '',
customField: '20110131-220244'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35613',
internalId:  '',
customField: '20110131-220153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35701',
internalId:  '',
customField: '20110131-210612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30762',
internalId:  '',
customField: '20110131-214626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31027',
internalId:  '',
customField: '20110131-214656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35821',
internalId:  '',
customField: '20070226-155538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4973',
internalId:  '',
customField: '20051202-100929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4974',
internalId:  '',
customField: '20050902-115457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28748',
internalId:  '',
customField: '20051028-160832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28979',
internalId:  '',
customField: '20061127-115415'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXP8O';
var companyName   = 'RZSO+-+GFS+-+MR';
var htmlTitle	  = 'RZSO+-+GFS+-+MR';
var metaKeywords  = 'Zivilschutz%2C+Mittelrheintal%2C+RZSO%2C+GFS%2C+rzso%2C+gfs%2C+Au%2C+Berneck%2C+Balgach%2C+Widnau%2C+Diepoldsau';
var metaContents  = 'Vorstellung+der+Regionalen+Zivilschutzorganisation+sowie+des+Gememeindef%C3%BChrungsstabs+des+Mittelrheintals';
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();
};

