/* [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(''),'/4599.html','true',[],'',''],
	['PAGE','4818',jdecode('News'),jdecode(''),'/4818.html','true',[],'',''],
	['PAGE','4656',jdecode('Partei'),jdecode(''),'/4656/index.html','true',[ 
		['PAGE','10119',jdecode('Unsere+Ziele'),jdecode(''),'/4656/10119.html','true',[],'',''],
		['PAGE','4683',jdecode('Vorstand'),jdecode(''),'/4656/4683.html','true',[],'',''],
		['PAGE','72801',jdecode('Parteileitung'),jdecode(''),'/4656/72801.html','true',[],'',''],
		['PAGE','4710',jdecode('Gemeinderat'),jdecode(''),'/4656/4710.html','true',[],'',''],
		['PAGE','4737',jdecode('Kantonsrat'),jdecode(''),'/4656/4737.html','true',[],'',''],
		['PAGE','4764',jdecode('Kommissionen'),jdecode(''),'/4656/4764.html','true',[],'',''],
		['PAGE','86101',jdecode('Statuten'),jdecode(''),'/4656/86101.html','true',[],'','']
	],'',''],
	['PAGE','5034',jdecode('Abstimmungen'),jdecode(''),'/5034.html','true',[],'',''],
	['PAGE','4926',jdecode('Termine'),jdecode(''),'/4926.html','true',[],'',''],
	['PAGE','19298',jdecode('Vorst%C3%B6sse'),jdecode(''),'/19298.html','true',[],'',''],
	['PAGE','11216',jdecode('Mitglied+werden'),jdecode(''),'/11216/index.html','true',[ 
		['PAGE','11247',jdecode('Mitglied+werden+%28Form+followup+page%29'),jdecode(''),'/11216/11247.html','false',[],'','']
	],'',''],
	['PAGE','55401',jdecode('Geld+spenden'),jdecode(''),'/55401.html','true',[],'',''],
	['PAGE','7501',jdecode('Links'),jdecode(''),'/7501.html','true',[],'',''],
	['PAGE','5484',jdecode('G%C3%A4stebuch'),jdecode(''),'/5484/index.html','true',[ 
		['PAGE','5485',jdecode('Eintr%C3%A4ge'),jdecode(''),'/5484/5485.html','false',[],'','']
	],'','']];
var siteelementCount=19;
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 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: '20100816-165401'
};
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: '20100816-165029'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86101',
internalId:  '',
customField: '20100618-153215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4656',
internalId:  '',
customField: '20090523-162421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10119',
internalId:  '',
customField: '20090512-214839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4683',
internalId:  '',
customField: '20100326-180430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4710',
internalId:  '',
customField: '20091127-201827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4737',
internalId:  '',
customField: '20090512-213112'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '72801',
internalId:  '',
customField: '20091029-001217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4764',
internalId:  '',
customField: '20091127-202457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5034',
internalId:  '',
customField: '20100618-153405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4926',
internalId:  '',
customField: '20100526-214853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19298',
internalId:  '',
customField: '20091127-203539'
};
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: '20080822-153423'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20100414-221040'
};
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 canonHostname = 'hptworkerdb01a.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();
};
