/* [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','701',jdecode('Home'),jdecode(''), jdecode('%2F701%2Findex.html'), 'true',[ 
		['PAGE','2222',jdecode('Geschichte'),jdecode(''), jdecode('%2F701%2F2222.html'), 'true',[],'',''],
		['PAGE','87501',jdecode('Pfadiheim'),jdecode(''), jdecode('%2F701%2F87501.html'), 'true',[],'','']
	],'',''],
	['PAGE','81001',jdecode('Biber'),jdecode(''), jdecode('%2F81001%2Findex.html'), 'true',[ 
		['PAGE','81022',jdecode('Anschlag'),jdecode(''), jdecode('%2F81001%2F81022.html'), 'true',[],'',''],
		['PAGE','87001',jdecode('Kontakt'),jdecode(''), jdecode('%2F81001%2F87001.html'), 'true',[],'',''],
		['PAGE','100312',jdecode('Semesterplan'),jdecode(''), jdecode('%2F81001%2F100312.html'), 'true',[],'','']
	],'',''],
	['PAGE','28922',jdecode('W%C3%B6lfe'),jdecode(''), jdecode('%2F28922%2Findex.html'), 'true',[ 
		['PAGE','30201',jdecode('Anschlag'),jdecode(''), jdecode('%2F28922%2F30201.html'), 'true',[],'',''],
		['PAGE','30222',jdecode('Semesterplan+-+W%C3%B6lfe'),jdecode(''), jdecode('%2F28922%2F30222.html'), 'true',[],'','']
	],'',''],
	['PAGE','28901',jdecode('Pfader'),jdecode(''), jdecode('%2F28901%2Findex.html'), 'true',[ 
		['PAGE','2201',jdecode('Anschlag'),jdecode(''), jdecode('%2F28901%2F2201.html'), 'true',[],'',''],
		['PAGE','2264',jdecode('Semesterplan+-+Pfadi'),jdecode(''), jdecode('%2F28901%2F2264.html'), 'true',[],'',''],
		['PAGE','2285',jdecode('Etat10'),jdecode(''), jdecode('%2F28901%2F2285.html'), 'true',[],'',''],
		['PAGE','82801',jdecode('%C3%9Cbung+04.09.10'),jdecode(''), jdecode('%2F28901%2F82801.html'), 'true',[],'',''],
		['PAGE','96012',jdecode('Schlittel-%C3%9Cbung'),jdecode(''), jdecode('%2F28901%2F96012.html'), 'true',[],'',''],
		['PAGE','77001',jdecode('So-La+2010'),jdecode(''), jdecode('%2F28901%2F77001.html'), 'true',[],'',''],
		['PAGE','78801',jdecode('So-La+2009'),jdecode(''), jdecode('%2F28901%2F78801.html'), 'true',[],'','']
	],'',''],
	['PAGE','101012',jdecode('Pios'),jdecode(''), jdecode('%2F101012%2Findex.html'), 'true',[ 
		['PAGE','101033',jdecode('Anschlag'),jdecode(''), jdecode('%2F101012%2F101033.html'), 'true',[],'','']
	],'',''],
	['PAGE','14306',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F14306%2Findex.html'), 'true',[ 
		['PAGE','14301',jdecode('Eintr%C3%A4ge'),jdecode(''), jdecode('%2F14306%2F14301.html'), 'false',[],'','']
	],'',''],
	['PAGE','65401',jdecode('Kontakt'),jdecode(''), jdecode('%2F65401.html'), 'true',[],'',''],
	['PAGE','36201',jdecode('Links'),jdecode(''), jdecode('%2F36201.html'), 'true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Amaze';
theSitetree.paletteFamily='0A2447';
theSitetree.keyvisualId='2411';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='396';
theSitetree.graphicsetId='444';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='0A2447';
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: 			'Amaze',
				paletteFamily: 	'0A2447',
				keyvisualId: 	'2411',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'396',
				graphicsetId: 	'444',
				contentColor: 	'FFFFFF',
				contentBGColor: '0A2447',
				a_color: 		'0A2447',
				b_color: 		'081B35',
				c_color: 		'3268E2',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-14306ahopt0invkfr']={
webappId:    '1002',
documentId:  '14306',
internalId:  '14306ahopt0invkfr',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78801',
internalId:  '',
customField: '20100905-190438'
};
webappMappings['7060']=webappMappings['7060-88cb3dacdce901f93f7b7afc3fb5bcbd']={
webappId:    '7060',
documentId:  '77001',
internalId:  '88cb3dacdce901f93f7b7afc3fb5bcbd',
customField: 'language:de;country:CH;'
};
webappMappings['7060']=webappMappings['7060-fbc4820c91abf7d886c4304e9756bb13']={
webappId:    '7060',
documentId:  '96012',
internalId:  'fbc4820c91abf7d886c4304e9756bb13',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81001',
internalId:  '',
customField: '20110316-182331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20101223-125017'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28901',
internalId:  '',
customField: '20100927-170142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2201',
internalId:  '',
customField: '20120121-113516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2222',
internalId:  '',
customField: '20101212-132915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2264',
internalId:  '',
customField: '20120121-113410'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2285',
internalId:  '',
customField: '20110825-084856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77001',
internalId:  '',
customField: '20100912-130043'
};
webappMappings['7060']=webappMappings['7060-fe9da6fd894402b542a1c4c568381c25']={
webappId:    '7060',
documentId:  '78801',
internalId:  'fe9da6fd894402b542a1c4c568381c25',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28922',
internalId:  '',
customField: '20100927-192512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30201',
internalId:  '',
customField: '20110825-084702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30222',
internalId:  '',
customField: '20100927-192637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100312',
internalId:  '',
customField: '20120113-211611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14306',
internalId:  '',
customField: '20090412-170052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14301',
internalId:  '',
customField: '20090412-170052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36201',
internalId:  '',
customField: '20091030-190016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65401',
internalId:  '',
customField: '20101204-123938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81022',
internalId:  '',
customField: '20120113-212021'
};
webappMappings['7060']=webappMappings['7060-be502906e335ac05816cf7442865a528']={
webappId:    '7060',
documentId:  '82801',
internalId:  'be502906e335ac05816cf7442865a528',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82801',
internalId:  '',
customField: '20101024-145355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87001',
internalId:  '',
customField: '20100927-162536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87501',
internalId:  '',
customField: '20101212-132322'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96012',
internalId:  '',
customField: '20110124-183740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101012',
internalId:  '',
customField: '20120126-202034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101033',
internalId:  '',
customField: '20120126-202034'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'AHOPT0INVKFR';
var companyName   = 'Pfadi+9.Stamm+Ebikon%2FBuchrain';
var htmlTitle	  = '';
var metaKeywords  = 'Pfadi++9.+Stamm++Ebikon++Buchrain++Meute+Chil+Luzern';
var metaContents  = 'Pfadi+9.+Stamm+Ebikon%2FBuchrain+W%C3%B6lfli+Meute+Chil+Ebikon%2FBuchrain';
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();
};

