/* [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','6501',jdecode('Home'),jdecode(''), jdecode('%2F6501.html'), 'true',[],'',''],
	['PAGE','6552',jdecode('Portrait'),jdecode(''), jdecode('%2F6552%2Findex.html'), 'true',[ 
		['PAGE','16801',jdecode('Verwaltung'),jdecode(''), jdecode('%2F6552%2F16801.html'), 'true',[],'',''],
		['PAGE','16822',jdecode('Krankenpflege'),jdecode(''), jdecode('%2F6552%2F16822.html'), 'true',[],'',''],
		['PAGE','16843',jdecode('Psychiatrische+Pflege'),jdecode(''), jdecode('%2F6552%2F16843.html'), 'true',[],'',''],
		['PAGE','16864',jdecode('Hauswirtschaft'),jdecode(''), jdecode('%2F6552%2F16864.html'), 'true',[],'','']
	],'',''],
	['PAGE','6657',jdecode('Unser+Angebot'),jdecode(''), jdecode('%2F6657%2Findex.html'), 'true',[ 
		['PAGE','6678',jdecode('Krankenpflege'),jdecode(''), jdecode('%2F6657%2F6678.html'), 'true',[],'',''],
		['PAGE','6699',jdecode('Hauswirtschaft'),jdecode(''), jdecode('%2F6657%2F6699.html'), 'true',[],'',''],
		['PAGE','6720',jdecode('Mahlzeitendienst'),jdecode(''), jdecode('%2F6657%2F6720.html'), 'true',[],'',''],
		['PAGE','6741',jdecode('%C3%9Cbrige+Dienste'),jdecode(''), jdecode('%2F6657%2F6741.html'), 'true',[],'','']
	],'',''],
	['PAGE','14422',jdecode('Freunde+Spitex+Aare-Nord-SO'),jdecode(''), jdecode('%2F14422%2Findex.html'), 'true',[ 
		['PAGE','7743',jdecode('Mitglied+werden'),jdecode(''), jdecode('%2F14422%2F7743.html'), 'true',[],'',''],
		['PAGE','14443',jdecode('Anl%C3%A4sse'),jdecode(''), jdecode('%2F14422%2F14443.html'), 'true',[],'','']
	],'',''],
	['PAGE','16701',jdecode('Spenden+'),jdecode(''), jdecode('%2F16701%2Findex.html'), 'true',[ 
		['PAGE','7701',jdecode('Was+unterst%C3%BCtzen%3F'),jdecode(''), jdecode('%2F16701%2F7701.html'), 'true',[],'',''],
		['PAGE','7722',jdecode('Wie+spenden%3F'),jdecode(''), jdecode('%2F16701%2F7722.html'), 'true',[],'','']
	],'',''],
	['PAGE','23501',jdecode('Unsere+Sponsoren'),jdecode(''), jdecode('%2F23501.html'), 'true',[],'',''],
	['PAGE','22801',jdecode('Berichte+und+Infos'),jdecode(''), jdecode('%2F22801.html'), 'true',[],'',''],
	['PAGE','6825',jdecode('Kontakt'),jdecode(''), jdecode('%2F6825.html'), 'true',[],'',''],
	['PAGE','20301',jdecode('Stellenangebote'),jdecode(''), jdecode('%2F20301.html'), 'true',[],'',''],
	['PAGE','14485',jdecode('Gallerie'),jdecode(''), jdecode('%2F14485.html'), 'true',[],'','']];
var siteelementCount=22;
theSitetree.topTemplateName='Office';
theSitetree.paletteFamily='727D9C';
theSitetree.keyvisualId='11153';
theSitetree.keyvisualName='kv_11153.jpg';
theSitetree.fontsetId='32063';
theSitetree.graphicsetId='13879';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'webland',
  product: 'WSCSYSSSSLY0XFY2'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Office',
				paletteFamily: 	'727D9C',
				keyvisualId: 	'11153',
				keyvisualName: 	'kv_11153.jpg',
				fontsetId: 		'32063',
				graphicsetId: 	'13879',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6501',
internalId:  '',
customField: '20110811-104038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6825',
internalId:  '',
customField: '20100922-095349'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '6501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6552',
internalId:  '',
customField: '20100922-103925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16822',
internalId:  '',
customField: '20110811-112022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16843',
internalId:  '',
customField: '20110811-111924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16801',
internalId:  '',
customField: '20110811-112149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6657',
internalId:  '',
customField: '20110811-104535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6678',
internalId:  '',
customField: '20110106-163300'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6699',
internalId:  '',
customField: '20100323-090212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6720',
internalId:  '',
customField: '20100204-155035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6741',
internalId:  '',
customField: '20110106-165434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22801',
internalId:  '',
customField: '20110822-094643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16864',
internalId:  '',
customField: '20110811-111910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20100304-165950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7722',
internalId:  '',
customField: '20110106-162715'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7743',
internalId:  '',
customField: '20110621-103628'
};
webappMappings['7008']=webappMappings['7008-6398']={
webappId:    '7008',
documentId:  '6825',
internalId:  '6398',
customField: 'language:de;country:CH;'
};
webappMappings['7060']=webappMappings['7060-10a7bc880f51493803291e7ba6fcfe12']={
webappId:    '7060',
documentId:  '14485',
internalId:  '10a7bc880f51493803291e7ba6fcfe12',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14485',
internalId:  '',
customField: '20110621-135422'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14422',
internalId:  '',
customField: '20110811-112505'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14443',
internalId:  '',
customField: '20110822-094516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16701',
internalId:  '',
customField: '20110822-095226'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20301',
internalId:  '',
customField: '20111110-163527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23501',
internalId:  '',
customField: '20100525-101724'
};
var webAppHostname = 'wsc-app.webland.ch:80';
var canonHostname = 'wsc02.webland.ch';
var accountId     = 'AWB010IN2DCC';
var companyName   = 'Spitex+Aare-Nord-SO';
var htmlTitle	  = 'Spitex+Aare-Nord-SO';
var metaKeywords  = 'Spitex%2C+R%C3%BCttenen%2C+Galmis%2C+Pflege%2C+Aare-Nord%2C+Solothurn';
var metaContents  = 'Spitex%2C+R%C3%BCttenen%2C+Galmis%2C+Pflege%2C+Aare-Nord%2C+Solothurn%2C+Feldbrunnen%2C+Balm%2C+G%C3%BCnsberg%2C+Niederwil%2C+Kammersrohr%2C+Selzach%2C+Balm+bei+G%C3%BCnsberg';
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();
};

