/* [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','5001',jdecode('Willkommen'),jdecode(''), jdecode('%2F5001.html'), 'true',[],'',''],
	['PAGE','5052',jdecode('Bienvenue'),jdecode(''), jdecode('%2F5052.html'), 'false',[],'',''],
	['PAGE','5073',jdecode('N%C3%A4chster+Anlass'),jdecode(''), jdecode('%2F5073.html'), 'false',[],'',''],
	['PAGE','5094',jdecode('Wo'),jdecode(''), jdecode('%2F5094.html'), 'false',[],'',''],
	['PAGE','5115',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F5115.html'), 'false',[],'',''],
	['PAGE','5136',jdecode('Newsletter'),jdecode(''), jdecode('%2F5136.html'), 'false',[],'',''],
	['PAGE','5157',jdecode('Kontakt'),jdecode(''), jdecode('%2F5157%2Findex.html'), 'false',[ 
		['PAGE','6201',jdecode('Kontaktformular'),jdecode(''), jdecode('%2F5157%2F6201.html'), 'true',[],'','']
	],'',''],
	['PAGE','5178',jdecode('Fotos'),jdecode(''), jdecode('%2F5178.html'), 'false',[],'',''],
	['PAGE','5199',jdecode('Links'),jdecode(''), jdecode('%2F5199%2Findex.html'), 'false',[ 
		['PAGE','6401',jdecode('Unsere+freunde'),jdecode(''), jdecode('%2F5199%2F6401.html'), 'true',[],'',''],
		['PAGE','6422',jdecode('Unser+Gayromeo+Club'),jdecode(''), jdecode('%2F5199%2F6422.html'), 'true',[],'',''],
		['PAGE','6443',jdecode('Unser+Pr%C3%A4ventions-Tipp'),jdecode(''), jdecode('%2F5199%2F6443.html'), 'true',[],'','']
	],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Speed';
theSitetree.paletteFamily='CC0000';
theSitetree.keyvisualId='2342';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='375';
theSitetree.graphicsetId='423';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='CC0000';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'hostpoint',
  product: 'WSCSYSSSSLYTC21Y'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Speed',
				paletteFamily: 	'CC0000',
				keyvisualId: 	'2342',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'375',
				graphicsetId: 	'423',
				contentColor: 	'FFFFFF',
				contentBGColor: 'CC0000',
				a_color: 		'CC0000',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-5115ahp340invga8']={
webappId:    '1002',
documentId:  '5115',
internalId:  '5115ahp340invga8',
customField: 'icq=false'
};
webappMappings['7060']=webappMappings['7060-e59e1f66f8ac40cc2335ceb4faa326f3']={
webappId:    '7060',
documentId:  '5178',
internalId:  'e59e1f66f8ac40cc2335ceb4faa326f3',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5001',
internalId:  '',
customField: '20120218-220115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5052',
internalId:  '',
customField: '20111130-121514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5073',
internalId:  '',
customField: '20111129-202106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5094',
internalId:  '',
customField: '20100630-161146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5115',
internalId:  '',
customField: '20100627-120640'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5136',
internalId:  '',
customField: '20100627-120902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5157',
internalId:  '',
customField: '20100630-162245'
};
webappMappings['7008']=webappMappings['7008-3313']={
webappId:    '7008',
documentId:  '6201',
internalId:  '3313',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5178',
internalId:  '',
customField: '20100627-114957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5199',
internalId:  '',
customField: '20100627-121844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6401',
internalId:  '',
customField: '20100628-121725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6422',
internalId:  '',
customField: '20100627-122309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6443',
internalId:  '',
customField: '20100628-121923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20100627-123435'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '5001',
internalId:  '1006',
customField: '1006'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'AHP340INVGA8';
var companyName   = '+++++++++++++++++P+O+S+i+B+A+R';
var htmlTitle	  = 'POSiBAR';
var metaKeywords  = 'AIDS+HIV+Toleranz+Z%C3%BCrich+Bar';
var metaContents  = 'Posibar+-+Ein+Treffpunkt+f%C3%BCr+HIV-Positive+und+HIV-Negative';
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();
};

