/* [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','501',jdecode('Home'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','131401',jdecode('Gemeindewahlen+2012'),jdecode(''), jdecode('%2F131401%2Findex.html'), 'true',[ 
		['PAGE','134401',jdecode('allgemeine+Infos'),jdecode(''), jdecode('%2F131401%2F134401.html'), 'true',[],'',''],
		['PAGE','134422',jdecode('Gemeinderat'),jdecode(''), jdecode('%2F131401%2F134422.html'), 'true',[],'',''],
		['PAGE','134443',jdecode('Einwohnerrat'),jdecode(''), jdecode('%2F131401%2F134443.html'), 'true',[],'',''],
		['PAGE','134464',jdecode('Gemeindepr%C3%A4sidium'),jdecode(''), jdecode('%2F131401%2F134464.html'), 'true',[],'',''],
		['PAGE','134485',jdecode('Schulrat'),jdecode(''), jdecode('%2F131401%2F134485.html'), 'true',[],'',''],
		['PAGE','134506',jdecode('Sozialhilfebeh%C3%B6rde'),jdecode(''), jdecode('%2F131401%2F134506.html'), 'true',[],'',''],
		['PAGE','63801',jdecode('Wie+w%C3%A4hle+ich+richtig+%3F'),jdecode(''), jdecode('%2F131401%2F63801.html'), 'true',[],'',''],
		['PAGE','139301',jdecode('Leserbriefe'),jdecode(''), jdecode('%2F131401%2F139301.html'), 'true',[],'','']
	],'',''],
	['PAGE','102901',jdecode('Abstimmungen'),jdecode(''), jdecode('%2F102901.html'), 'true',[],'',''],
	['PAGE','573',jdecode('Agenda'),jdecode(''), jdecode('%2F573.html'), 'true',[],'',''],
	['PAGE','113001',jdecode('Initiativen%2C+Referenden'),jdecode(''), jdecode('%2F113001.html'), 'true',[],'',''],
	['PAGE','95801',jdecode('ABC+der+SP+Reinach'),jdecode(''), jdecode('%2F95801.html'), 'true',[],'',''],
	['PAGE','636',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F636%2Findex.html'), 'true',[ 
		['PAGE','678',jdecode('Der+Vorstand'),jdecode(''), jdecode('%2F636%2F678.html'), 'true',[],'',''],
		['PAGE','720',jdecode('Statuten'),jdecode(''), jdecode('%2F636%2F720.html'), 'true',[],'','']
	],'',''],
	['PAGE','741',jdecode('Mitglied+werden'),jdecode(''), jdecode('%2F741.html'), 'true',[],'',''],
	['PAGE','100801',jdecode('Kontakt'),jdecode(''), jdecode('%2F100801.html'), 'true',[],'',''],
	['PAGE','762',jdecode('Unsere+Mandatstr%C3%A4ger'),jdecode(''), jdecode('%2F762%2Findex.html'), 'true',[ 
		['PAGE','783',jdecode('Gemeinderat'),jdecode(''), jdecode('%2F762%2F783.html'), 'true',[],'',''],
		['PAGE','804',jdecode('Einwohnerrat'),jdecode(''), jdecode('%2F762%2F804.html'), 'true',[],'',''],
		['PAGE','825',jdecode('Schulrat'),jdecode(''), jdecode('%2F762%2F825.html'), 'true',[],'',''],
		['PAGE','846',jdecode('Sozialhilfebeh%C3%B6rde'),jdecode(''), jdecode('%2F762%2F846.html'), 'true',[],'',''],
		['PAGE','867',jdecode('Vormundschaftsbeh%C3%B6rde'),jdecode(''), jdecode('%2F762%2F867.html'), 'true',[],'',''],
		['PAGE','888',jdecode('Friedensrichter'),jdecode(''), jdecode('%2F762%2F888.html'), 'true',[],'',''],
		['PAGE','909',jdecode('Landrat'),jdecode(''), jdecode('%2F762%2F909.html'), 'true',[],'',''],
		['PAGE','20001',jdecode('Wahlb%C3%BCro'),jdecode(''), jdecode('%2F762%2F20001.html'), 'true',[],'','']
	],'',''],
	['PAGE','58901',jdecode('National-+und+St%C3%A4nderat'),jdecode(''), jdecode('%2F58901.html'), 'true',[],'',''],
	['PAGE','993',jdecode('Interessante+Links'),jdecode(''), jdecode('%2F993.html'), 'true',[],'',''],
	['PAGE','128601',jdecode('Archiv+2011'),jdecode(''), jdecode('%2F128601%2Findex.html'), 'true',[ 
		['PAGE','106901',jdecode('Resultate+LR+Wahlen'),jdecode(''), jdecode('%2F128601%2F106901.html'), 'true',[],'',''],
		['PAGE','123401',jdecode('Statements+LR+Wahlen'),jdecode(''), jdecode('%2F128601%2F123401.html'), 'true',[],'',''],
		['PAGE','124801',jdecode('Regierungsratswahlen+2011'),jdecode(''), jdecode('%2F128601%2F124801.html'), 'true',[],'','']
	],'',''],
	['PAGE','119601',jdecode('Archiv+2010'),jdecode(''), jdecode('%2F119601.html'), 'true',[],'',''],
	['PAGE','97943',jdecode('Archiv+2009'),jdecode(''), jdecode('%2F97943%2Findex.html'), 'true',[ 
		['PAGE','92901',jdecode('Boule+Abend+22.7.09'),jdecode(''), jdecode('%2F97943%2F92901.html'), 'true',[],'',''],
		['PAGE','594',jdecode('Abstimmungsresultate+29.11.09'),jdecode(''), jdecode('%2F97943%2F594.html'), 'true',[],'',''],
		['PAGE','951',jdecode('Leserbriefe'),jdecode(''), jdecode('%2F97943%2F951.html'), 'true',[],'','']
	],'',''],
	['PAGE','94101',jdecode('Archiv+2008'),jdecode(''), jdecode('%2F94101%2Findex.html'), 'true',[ 
		['PAGE','50501',jdecode('Wahlkampf'),jdecode(''), jdecode('%2F94101%2F50501.html'), 'true',[],'',''],
		['PAGE','35401',jdecode('Fotos+Wahlkampf'),jdecode(''), jdecode('%2F94101%2F35401.html'), 'true',[],'',''],
		['PAGE','50522',jdecode('Gemeinderats+Wahlen'),jdecode(''), jdecode('%2F94101%2F50522.html'), 'true',[],'',''],
		['PAGE','50543',jdecode('Einwohnerrats+Wahlen'),jdecode(''), jdecode('%2F94101%2F50543.html'), 'true',[],'',''],
		['PAGE','66801',jdecode('Aus+dem+Einwohnerrat'),jdecode(''), jdecode('%2F94101%2F66801.html'), 'true',[],'',''],
		['PAGE','74101',jdecode('Schulrats+Wahlen'),jdecode(''), jdecode('%2F94101%2F74101.html'), 'true',[],'',''],
		['PAGE','76801',jdecode('Statements+Schulrat'),jdecode(''), jdecode('%2F94101%2F76801.html'), 'true',[],'',''],
		['PAGE','97922',jdecode('Leserbriefe+2008'),jdecode(''), jdecode('%2F94101%2F97922.html'), 'true',[],'','']
	],'',''],
	['PAGE','39401',jdecode('Archiv+2007'),jdecode(''), jdecode('%2F39401%2Findex.html'), 'true',[ 
		['PAGE','51601',jdecode('Fotos+Fraktionssitzung'),jdecode(''), jdecode('%2F39401%2F51601.html'), 'true',[],'',''],
		['PAGE','35722',jdecode('Fotos+Beh%C3%B6rdenessen'),jdecode(''), jdecode('%2F39401%2F35722.html'), 'true',[],'',''],
		['PAGE','31122',jdecode('Fotos+Wahlkampf'),jdecode(''), jdecode('%2F39401%2F31122.html'), 'true',[],'',''],
		['PAGE','97901',jdecode('Leserbriefe+2007'),jdecode(''), jdecode('%2F39401%2F97901.html'), 'true',[],'','']
	],'','']];
var siteelementCount=53;
theSitetree.topTemplateName='Clearline';
theSitetree.paletteFamily='B71602';
theSitetree.keyvisualId='3288';
theSitetree.keyvisualName='kv_3288.jpg';
theSitetree.fontsetId='10421';
theSitetree.graphicsetId='10715';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
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: 			'Clearline',
				paletteFamily: 	'B71602',
				keyvisualId: 	'3288',
				keyvisualName: 	'kv_3288.jpg',
				fontsetId: 		'10421',
				graphicsetId: 	'10715',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'B71602',
				e_color: 		'989696',
				f_color: 		'989696',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20120205-141712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100801',
internalId:  '',
customField: '20120104-191436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20120205-141248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '594',
internalId:  '',
customField: '20091215-225400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '113001',
internalId:  '',
customField: '20111128-222412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39401',
internalId:  '',
customField: '20100521-072503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '94101',
internalId:  '',
customField: '20100521-072238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92901',
internalId:  '',
customField: '20090812-071938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63801',
internalId:  '',
customField: '20120104-191949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119601',
internalId:  '',
customField: '20101205-214934'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '951',
internalId:  '',
customField: '20100118-230026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '636',
internalId:  '',
customField: '20111209-172626'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '678',
internalId:  '',
customField: '20120104-191558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '720',
internalId:  '',
customField: '20091030-163741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '741',
internalId:  '',
customField: '20111209-173945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '762',
internalId:  '',
customField: '20111209-174520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '783',
internalId:  '',
customField: '20100428-170259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '804',
internalId:  '',
customField: '20120205-145703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '825',
internalId:  '',
customField: '20120205-153722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '846',
internalId:  '',
customField: '20120205-154129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '867',
internalId:  '',
customField: '20120205-154252'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '888',
internalId:  '',
customField: '20091030-163818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '909',
internalId:  '',
customField: '20111206-180248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20001',
internalId:  '',
customField: '20100428-164214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134401',
internalId:  '',
customField: '20120104-191322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58901',
internalId:  '',
customField: '20120104-192101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51601',
internalId:  '',
customField: '20070628-091159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35722',
internalId:  '',
customField: '20070205-101439'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31122',
internalId:  '',
customField: '20070627-144646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50501',
internalId:  '',
customField: '20090715-165647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35401',
internalId:  '',
customField: '20090715-171936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50522',
internalId:  '',
customField: '20090715-170616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50543',
internalId:  '',
customField: '20090715-170123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66801',
internalId:  '',
customField: '20091215-230409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74101',
internalId:  '',
customField: '20080422-120940'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76801',
internalId:  '',
customField: '20090714-220152'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '993',
internalId:  '',
customField: '20120104-192139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95801',
internalId:  '',
customField: '20120103-194300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97922',
internalId:  '',
customField: '20091024-200307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97943',
internalId:  '',
customField: '20100521-071849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '97901',
internalId:  '',
customField: '20091215-231256'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102901',
internalId:  '',
customField: '20120205-142029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106901',
internalId:  '',
customField: '20111206-174539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123401',
internalId:  '',
customField: '20110129-225557'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124801',
internalId:  '',
customField: '20110221-065826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '128601',
internalId:  '',
customField: '20110403-202616'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '131401',
internalId:  '',
customField: '20120205-142440'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134422',
internalId:  '',
customField: '20120110-071108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134443',
internalId:  '',
customField: '20120104-073101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134464',
internalId:  '',
customField: '20120110-071735'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134485',
internalId:  '',
customField: '20120104-071608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134506',
internalId:  '',
customField: '20120104-071825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '139301',
internalId:  '',
customField: '20120205-141509'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'AHOPT0INEEC5';
var companyName   = 'Willkommen+bei+der+SP+Reinach+BL';
var htmlTitle	  = 'SP+Reinach+BL';
var metaKeywords  = 'sozial%2C+landrat%2C+gemeinderat%2C+sp%2C+reinach%2C+beh%C3%B6rde%2C+mir+bringes+uf+e+punkt%2C+hintermann%2C+chappuis%2C+maag%2C+david+meier';
var metaContents  = 'Mir+bringe+es+uf+e+Punkt%2C+Aktuelles%2C+Veranstaltungen%2C+Beh%C3%B6rdenvertreter+der+SP+Reinach+BL%2C+Gemeindewahlen%2C+Landrat%2C+Gemeinderat%2C+Einwohnerrat';
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();
};

