/* [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','1246',jdecode('Home'),jdecode(''), jdecode('%2F1246.html'), 'true',[],'',''],
	['PAGE','19201',jdecode('Wohnungsreservationen'),jdecode(''), jdecode('%2F19201.html'), 'false',[],'',''],
	['PAGE','7501',jdecode('Freie+Wohnungen'),jdecode(''), jdecode('%2F7501%2Findex.html'), 'true',[ 
		['PAGE','52801',jdecode('A.02+%284.0-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F52801.html'), 'false',[],'',''],
		['PAGE','63201',jdecode('B.03+%283.0-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F63201.html'), 'true',[],'',''],
		['PAGE','32901',jdecode('C.05+%282.5-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F32901.html'), 'false',[],'',''],
		['PAGE','37701',jdecode('C.07+%284.0-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F37701.html'), 'false',[],'',''],
		['PAGE','36001',jdecode('C.11+%282.5-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F36001.html'), 'false',[],'',''],
		['PAGE','20001',jdecode('C.08+%282.0-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F20001.html'), 'false',[],'',''],
		['PAGE','57701',jdecode('D.01+%284.0-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F57701.html'), 'false',[],'',''],
		['PAGE','20022',jdecode('F.01+%284.5-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F20022.html'), 'false',[],'',''],
		['PAGE','17701',jdecode('F.02+%282.5-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F17701.html'), 'false',[],'',''],
		['PAGE','30001',jdecode('F.07+%284.5-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F30001.html'), 'false',[],'',''],
		['PAGE','41801',jdecode('G.01+%284.5-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F41801.html'), 'false',[],'',''],
		['PAGE','45701',jdecode('G.02+%282.5-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F45701.html'), 'false',[],'',''],
		['PAGE','45722',jdecode('G.03+%284.0-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F45722.html'), 'false',[],'',''],
		['PAGE','32922',jdecode('G.04+%284.5-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F32922.html'), 'false',[],'',''],
		['PAGE','51601',jdecode('G.07+%284.5-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F51601.html'), 'false',[],'',''],
		['PAGE','36801',jdecode('G.08+%282.5-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F36801.html'), 'false',[],'',''],
		['PAGE','39501',jdecode('G.09+%284.0-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F39501.html'), 'false',[],'',''],
		['PAGE','50501',jdecode('H.01+%284.5-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F50501.html'), 'false',[],'',''],
		['PAGE','16901',jdecode('H.02+%282.5-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F16901.html'), 'false',[],'',''],
		['PAGE','47601',jdecode('H.03+%283.5-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F47601.html'), 'false',[],'',''],
		['PAGE','34701',jdecode('H.04+%284.5-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F34701.html'), 'false',[],'',''],
		['PAGE','31601',jdecode('H.06+%283.5-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F31601.html'), 'false',[],'',''],
		['PAGE','55201',jdecode('H.08+%282.5-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F55201.html'), 'false',[],'',''],
		['PAGE','28701',jdecode('H.09+%283.5-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F28701.html'), 'false',[],'',''],
		['PAGE','61301',jdecode('H.11+%282.0-Zimmer%29'),jdecode(''), jdecode('%2F7501%2F61301.html'), 'false',[],'','']
	],'',''],
	['PAGE','7601',jdecode('Liegenschaften'),jdecode(''), jdecode('%2F7601%2Findex.html'), 'true',[ 
		['PAGE','9001',jdecode('Haus+A+%28Schulhausstr.+5%29'),jdecode(''), jdecode('%2F7601%2F9001.html'), 'true',[],'',''],
		['PAGE','13101',jdecode('Haus+B+%28Flurweg+1%29'),jdecode(''), jdecode('%2F7601%2F13101.html'), 'true',[],'',''],
		['PAGE','13122',jdecode('Haus+C+%28Schulhausstr.+9%29'),jdecode(''), jdecode('%2F7601%2F13122.html'), 'true',[],'',''],
		['PAGE','13143',jdecode('Haus+D+%28Schulhausstr.+7%29'),jdecode(''), jdecode('%2F7601%2F13143.html'), 'true',[],'',''],
		['PAGE','13164',jdecode('Haus+E+%28Schulhausstr.+12%29'),jdecode(''), jdecode('%2F7601%2F13164.html'), 'true',[],'',''],
		['PAGE','13185',jdecode('Haus+F+%28Schulhausstr.+10%29'),jdecode(''), jdecode('%2F7601%2F13185.html'), 'true',[],'',''],
		['PAGE','13206',jdecode('Haus+G+%28Schulhausstr.+8%29'),jdecode(''), jdecode('%2F7601%2F13206.html'), 'true',[],'',''],
		['PAGE','13227',jdecode('Haus+H+%28Ch%C3%A4ppelimatte+36%29'),jdecode(''), jdecode('%2F7601%2F13227.html'), 'true',[],'','']
	],'',''],
	['PAGE','7643',jdecode('Allgemeine+Infos'),jdecode(''), jdecode('%2F7643%2Findex.html'), 'true',[ 
		['PAGE','22601',jdecode('Aktuelles+Geschehen'),jdecode(''), jdecode('%2F7643%2F22601.html'), 'true',[],'',''],
		['PAGE','13501',jdecode('Wohnqualit%C3%A4t'),jdecode(''), jdecode('%2F7643%2F13501.html'), 'true',[],'',''],
		['PAGE','13701',jdecode('Fotogalerie'),jdecode(''), jdecode('%2F7643%2F13701.html'), 'true',[],'',''],
		['PAGE','22622',jdecode('Merkblatt+f%C3%BCr+Mieter'),jdecode(''), jdecode('%2F7643%2F22622.html'), 'true',[],'',''],
		['PAGE','7622',jdecode('Situationsplan'),jdecode(''), jdecode('%2F7643%2F7622.html'), 'true',[],'',''],
		['PAGE','22801',jdecode('Wegbeschreibung'),jdecode(''), jdecode('%2F7643%2F22801.html'), 'true',[],'','']
	],'',''],
	['PAGE','7664',jdecode('Genossenschaft'),jdecode(''), jdecode('%2F7664%2Findex.html'), 'true',[ 
		['PAGE','8201',jdecode('Adressen+Vorstand'),jdecode(''), jdecode('%2F7664%2F8201.html'), 'true',[],'',''],
		['PAGE','27901',jdecode('Verwaltung'),jdecode(''), jdecode('%2F7664%2F27901.html'), 'true',[],'','']
	],'','']];
var siteelementCount=47;
theSitetree.topTemplateName='Basic';
theSitetree.paletteFamily='36566E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10828';
theSitetree.graphicsetId='11283';
theSitetree.contentColor='36566E';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'webland',
  product: 'WSCSYSSSSLY0XFFS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Basic',
				paletteFamily: 	'36566E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10828',
				graphicsetId: 	'11283',
				contentColor: 	'36566E',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8201',
internalId:  '',
customField: '20100807-174323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7622',
internalId:  '',
customField: '20090808-155825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7643',
internalId:  '',
customField: '20090808-155702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7664',
internalId:  '',
customField: '20090808-160128'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1246',
internalId:  '',
customField: '20100622-232830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9001',
internalId:  '',
customField: '20110122-095515'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20111203-144232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7601',
internalId:  '',
customField: '20090808-153757'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13501',
internalId:  '',
customField: '20090808-154547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13701',
internalId:  '',
customField: '20110701-172656'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13101',
internalId:  '',
customField: '20111201-215622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13122',
internalId:  '',
customField: '20110122-095618'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13143',
internalId:  '',
customField: '20090808-154015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13164',
internalId:  '',
customField: '20090807-101854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13185',
internalId:  '',
customField: '20100729-100236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13206',
internalId:  '',
customField: '20090808-154110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13227',
internalId:  '',
customField: '20110122-095411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16901',
internalId:  '',
customField: '20100507-150508'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17701',
internalId:  '',
customField: '20111203-145444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19201',
internalId:  '',
customField: '20090806-204405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20001',
internalId:  '',
customField: '20090808-152526'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20022',
internalId:  '',
customField: '20090807-153140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22622',
internalId:  '',
customField: '20100807-173658'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22601',
internalId:  '',
customField: '20111201-222909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22801',
internalId:  '',
customField: '20090808-163233'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27901',
internalId:  '',
customField: '20090808-162604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28701',
internalId:  '',
customField: '20090813-214446'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30001',
internalId:  '',
customField: '20090920-193150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31601',
internalId:  '',
customField: '20100217-202339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32901',
internalId:  '',
customField: '20091204-135845'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32922',
internalId:  '',
customField: '20100501-203355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34701',
internalId:  '',
customField: '20091223-213851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36001',
internalId:  '',
customField: '20100105-221259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36801',
internalId:  '',
customField: '20100128-223455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37701',
internalId:  '',
customField: '20110205-194908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39501',
internalId:  '',
customField: '20110813-122152'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41801',
internalId:  '',
customField: '20100529-100210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45722',
internalId:  '',
customField: '20100828-163749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45701',
internalId:  '',
customField: '20100521-190550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47601',
internalId:  '',
customField: '20100804-212142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '50501',
internalId:  '',
customField: '20100913-214743'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51601',
internalId:  '',
customField: '20110205-195253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52801',
internalId:  '',
customField: '20110813-122241'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '55201',
internalId:  '',
customField: '20110205-195155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57701',
internalId:  '',
customField: '20110730-204935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61301',
internalId:  '',
customField: '20111201-215050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63201',
internalId:  '',
customField: '20120209-104629'
};
var webAppHostname = 'wsc-app.webland.ch:80';
var canonHostname = 'wsc02.webland.ch';
var accountId     = 'AWB010INXFVO';
var companyName   = 'Wohnbaugenossenschaft+Langnau';
var htmlTitle	  = 'Woba+ist+online%21';
var metaKeywords  = '';
var metaContents  = '';
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();
};

