/* [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','4818',jdecode('News'),jdecode(''), jdecode('%2F4818.html'), 'true',[],'',''],
	['PAGE','98601',jdecode('Fusion'),jdecode(''), jdecode('%2F98601%2Findex.html'), 'true',[ 
		['PAGE','98622',jdecode('Presse'),jdecode(''), jdecode('%2F98601%2F98622.html'), 'true',[],'',''],
		['PAGE','98643',jdecode('Vernehmlassung'),jdecode(''), jdecode('%2F98601%2F98643.html'), 'true',[],'','']
	],'',''],
	['PAGE','4656',jdecode('Partei'),jdecode(''), jdecode('%2F4656%2Findex.html'), 'true',[ 
		['PAGE','10119',jdecode('Unsere+Ziele'),jdecode(''), jdecode('%2F4656%2F10119.html'), 'true',[],'',''],
		['PAGE','4683',jdecode('Vorstand'),jdecode(''), jdecode('%2F4656%2F4683.html'), 'true',[],'',''],
		['PAGE','72801',jdecode('Parteileitung'),jdecode(''), jdecode('%2F4656%2F72801.html'), 'true',[],'',''],
		['PAGE','4710',jdecode('Gemeinderat'),jdecode(''), jdecode('%2F4656%2F4710.html'), 'true',[],'',''],
		['PAGE','4737',jdecode('Kantonsrat'),jdecode(''), jdecode('%2F4656%2F4737.html'), 'true',[],'',''],
		['PAGE','4764',jdecode('Kommissionen'),jdecode(''), jdecode('%2F4656%2F4764.html'), 'true',[],'',''],
		['PAGE','86101',jdecode('Statuten'),jdecode(''), jdecode('%2F4656%2F86101.html'), 'true',[],'','']
	],'',''],
	['PAGE','5034',jdecode('Abstimmungen'),jdecode(''), jdecode('%2F5034.html'), 'true',[],'',''],
	['PAGE','4926',jdecode('Termine'),jdecode(''), jdecode('%2F4926.html'), 'true',[],'',''],
	['PAGE','11216',jdecode('Mitglied+werden'),jdecode(''), jdecode('%2F11216%2Findex.html'), 'true',[ 
		['PAGE','11247',jdecode('Mitglied+werden+%28Form+followup+page%29'),jdecode(''), jdecode('%2F11216%2F11247.html'), 'false',[],'','']
	],'',''],
	['PAGE','55401',jdecode('Geld+spenden'),jdecode(''), jdecode('%2F55401.html'), 'true',[],'',''],
	['PAGE','7501',jdecode('Links'),jdecode(''), jdecode('%2F7501.html'), 'true',[],'',''],
	['PAGE','5484',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F5484%2Findex.html'), 'true',[ 
		['PAGE','5485',jdecode('Eintr%C3%A4ge'),jdecode(''), jdecode('%2F5484%2F5485.html'), 'false',[],'','']
	],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Seifenblase';
theSitetree.paletteFamily='69C151';
theSitetree.keyvisualId='2353';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='379';
theSitetree.graphicsetId='428';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
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: 			'Seifenblase',
				paletteFamily: 	'69C151',
				keyvisualId: 	'2353',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'379',
				graphicsetId: 	'428',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'339900',
				e_color: 		'33CC00',
				f_color: 		'66CC66',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-5484ABW0X0INXZMF']={
webappId:    '1002',
documentId:  '5484',
internalId:  '5484ABW0X0INXZMF',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4818',
internalId:  '',
customField: '20120126-130338'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4599',
internalId:  '1006',
customField: '1006'
};
webappMappings['1009']=webappMappings['1009-4991079']={
webappId:    '1009',
documentId:  '11247',
internalId:  '4991079',
customField: 'isFollowupPage:true;documentId:11216;'
};
webappMappings['7008']=webappMappings['7008-1739']={
webappId:    '7008',
documentId:  '11216',
internalId:  '1739',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4599',
internalId:  '',
customField: '20120128-151410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86101',
internalId:  '',
customField: '20100618-153215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4656',
internalId:  '',
customField: '20110408-175123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10119',
internalId:  '',
customField: '20090512-214839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4683',
internalId:  '',
customField: '20110626-221200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4710',
internalId:  '',
customField: '20111121-220031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4737',
internalId:  '',
customField: '20120128-150100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72801',
internalId:  '',
customField: '20110626-221524'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4764',
internalId:  '',
customField: '20120128-150352'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5034',
internalId:  '',
customField: '20111117-202945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4926',
internalId:  '',
customField: '20120126-225226'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '98643',
internalId:  '-',
customField: '20120126-124653'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '98622',
internalId:  '-',
customField: '20120128-151353'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '98601',
internalId:  '-',
customField: '20120128-151023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11216',
internalId:  '',
customField: '20090526-200454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11247',
internalId:  '',
customField: '20050224-185218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55401',
internalId:  '',
customField: '20110614-211236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20110824-142200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5484',
internalId:  '',
customField: '20060208-161601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5485',
internalId:  '',
customField: '20050220-140109'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXZMF';
var companyName   = 'SVP+Stadt+Olten';
var htmlTitle	  = 'SVP+Stadt+Olten';
var metaKeywords  = 'Politik++SVP+Olten++SVP+Stadt+Olten++B%EF%BF%BDrgerlich++Ausl%EF%BF%BDnder++Sparen++Islam++Nationalratswahlen++Schweiz';
var metaContents  = 'Politik++SVP+Olten++SVP+Stadt+Olten++B%EF%BF%BDrgerlich++Ausl%EF%BF%BDnder++Sparen++Islam++Nationalratswahlen++Schweiz';
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();
};

