/* [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','110008',jdecode('Aktuell+%28Blog%29'),jdecode(''), jdecode('%2F110008.html'), 'true',[],'',''],
	['PAGE','401',jdecode('%C3%84ltere+Blogeintr%C3%A4ge'),jdecode(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','89386',jdecode('M%C3%A4nnerTelefon'),jdecode(''), jdecode('%2F89386.html'), 'true',[],'',''],
	['PAGE','23122',jdecode('Projekte'),jdecode(''), jdecode('%2F23122.html'), 'true',[],'',''],
	['PAGE','29201',jdecode('Veranstaltungen'),jdecode(''), jdecode('%2F29201.html'), 'true',[],'',''],
	['PAGE','43101',jdecode('Ver%C3%B6ffentlichungen'),jdecode(''), jdecode('%2F43101%2Findex.html'), 'true',[ 
		['PAGE','9001',jdecode('Bericht+2007'),jdecode(''), jdecode('%2F43101%2F9001.html'), 'true',[],'',''],
		['PAGE','41201',jdecode('Galerie'),jdecode(''), jdecode('%2F43101%2F41201.html'), 'true',[],'','']
	],'',''],
	['PAGE','74375',jdecode('Kooperationen'),jdecode(''), jdecode('%2F74375.html'), 'true',[],'',''],
	['PAGE','1843',jdecode('Verein+M%C3%A4nnerZug'),jdecode(''), jdecode('%2F1843%2Findex.html'), 'true',[ 
		['PAGE','1801',jdecode('Historie'),jdecode(''), jdecode('%2F1843%2F1801.html'), 'true',[],'',''],
		['PAGE','9022',jdecode('Beitreten...'),jdecode(''), jdecode('%2F1843%2F9022.html'), 'true',[],'',''],
		['PAGE','10501',jdecode('Unterst%C3%BCtzung'),jdecode(''), jdecode('%2F1843%2F10501.html'), 'true',[],'',''],
		['PAGE','106208',jdecode('Statuten'),jdecode(''), jdecode('%2F1843%2F106208.html'), 'true',[],'','']
	],'',''],
	['PAGE','86186',jdecode('Charta'),jdecode(''), jdecode('%2F86186.html'), 'true',[],'',''],
	['PAGE','1864',jdecode('Zu+M%C3%A4nner'),jdecode(''), jdecode('%2F1864%2Findex.html'), 'true',[ 
		['PAGE','8301',jdecode('Dies+und+Das'),jdecode(''), jdecode('%2F1864%2F8301.html'), 'true',[],'','']
	],'',''],
	['PAGE','1885',jdecode('Kontakt+%2F+Anmeldung'),jdecode(''), jdecode('%2F1885.html'), 'true',[],'',''],
	['PAGE','59964',jdecode('Meinungen'),jdecode(''), jdecode('%2F59964.html'), 'true',[],'',''],
	['PAGE','23164',jdecode('Links'),jdecode(''), jdecode('%2F23164.html'), 'true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Powering';
theSitetree.paletteFamily='154186';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10735';
theSitetree.graphicsetId='10566';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='808080';
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: 			'Powering',
				paletteFamily: 	'154186',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10735',
				graphicsetId: 	'10566',
				contentColor: 	'FFFFFF',
				contentBGColor: '808080',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '110008',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-940']={
webappId:    '7008',
documentId:  '9022',
internalId:  '940',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20110929-152006'
};
webappMappings['7008']=webappMappings['7008-939']={
webappId:    '7008',
documentId:  '1885',
internalId:  '939',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74375',
internalId:  '',
customField: '20110926-150329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23122',
internalId:  '',
customField: '20110926-145437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86186',
internalId:  '',
customField: '20100825-132120'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29201',
internalId:  '',
customField: '20111206-131955'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41201',
internalId:  '',
customField: '20110620-120519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43101',
internalId:  '',
customField: '20110620-121122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1801',
internalId:  '',
customField: '20110523-113753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9001',
internalId:  '',
customField: '20101025-110912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9022',
internalId:  '',
customField: '20110523-114059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1843',
internalId:  '',
customField: '20120206-115236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20110929-152319'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1864',
internalId:  '',
customField: '20090825-090147'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1885',
internalId:  '',
customField: '20091031-071113'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8301',
internalId:  '',
customField: '20091029-200636'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23164',
internalId:  '',
customField: '20110711-110728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89386',
internalId:  '',
customField: '20101018-114530'
};
webappMappings['1002']=webappMappings['1002-59964ahopt0invkf3']={
webappId:    '1002',
documentId:  '59964',
internalId:  '59964ahopt0invkf3',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59964',
internalId:  '',
customField: '20091030-082232'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '110008',
internalId:  '',
customField: '20120206-113929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '106208',
internalId:  '',
customField: '20110620-121805'
};
webappMappings['7050']=webappMappings['7050-104']={
webappId:    '7050',
documentId:  '110008',
internalId:  '104',
customField: 'language:de;country:CH;'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'AHOPT0INVKF3';
var companyName   = 'M%C3%A4nner+am+Zug';
var htmlTitle	  = 'M%C3%A4nnerZug';
var metaKeywords  = 'M%C3%A4nner+Mann+Ressourcen+wild+Kraft+Neue+Gesch%C3%A4ft+Business+Sport+Bier+Most+Bar+Notfall+Gewalt+Sex+Rollen+Geschlechter+Beziehung+Ratgeber+Frauen+Beratung+Therapie+Vater+Liebhaber+Chef+depressiv+gewaltt%C3%A4tig+fein+einf%C3%BChlsam+Tafelrunde+Arthus+Gespr%C3%A4che+streiten+Gleichstellung';
var metaContents  = 'M%C3%A4nner+Mann+Ressourcen+wild+Kraft+Neue+Gesch%C3%A4ft+Business+Sport+Bier+Most+Bar+Notfall+Gewalt+Sex+Rollen+Geschlechter+Beziehung+Ratgeber+Frauen+Beratung+Therapie+Vater+Liebhaber+Chef+depressiv+gewaltt%C3%A4tig+fein+einf%C3%BChlsam+Tafelrunde+Arthus+Gespr%C3%A4che+streiten+Gleichstellung';
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();
};

