/* [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','1701',jdecode('Willkommen'),jdecode(''), jdecode('%2F1701.html'), 'true',[],'',''],
	['PAGE','10701',jdecode('Portrait'),jdecode(''), jdecode('%2F10701.html'), 'true',[],'',''],
	['PAGE','10722',jdecode('Team'),jdecode(''), jdecode('%2F10722.html'), 'true',[],'',''],
	['PAGE','1773',jdecode('%C3%96ffnungszeiten'),jdecode(''), jdecode('%2F1773.html'), 'true',[],'',''],
	['PAGE','1794',jdecode('Preise'),jdecode(''), jdecode('%2F1794%2Findex.html'), 'true',[ 
		['PAGE','31201',jdecode('Karteninfo'),jdecode(''), jdecode('%2F1794%2F31201.html'), 'true',[],'','']
	],'',''],
	['PAGE','1836',jdecode('Event'),jdecode(''), jdecode('%2F1836.html'), 'true',[],'',''],
	['PAGE','12301',jdecode('Kindergeburtstag'),jdecode(''), jdecode('%2F12301.html'), 'true',[],'',''],
	['PAGE','85501',jdecode('Snack%60s'),jdecode(''), jdecode('%2F85501.html'), 'true',[],'',''],
	['PAGE','32001',jdecode('Menuvorschl%C3%A4ge'),jdecode(''), jdecode('%2F32001%2Findex.html'), 'true',[ 
		['PAGE','32401',jdecode('Vorspeise'),jdecode(''), jdecode('%2F32001%2F32401.html'), 'true',[],'',''],
		['PAGE','32422',jdecode('kalte+Platten'),jdecode(''), jdecode('%2F32001%2F32422.html'), 'true',[],'',''],
		['PAGE','32443',jdecode('warme+Gerichte'),jdecode(''), jdecode('%2F32001%2F32443.html'), 'true',[],'',''],
		['PAGE','32464',jdecode('Buffet'),jdecode(''), jdecode('%2F32001%2F32464.html'), 'true',[],'',''],
		['PAGE','32485',jdecode('Dessert'),jdecode(''), jdecode('%2F32001%2F32485.html'), 'true',[],'','']
	],'',''],
	['PAGE','85522',jdecode('Billard'),jdecode(''), jdecode('%2F85522.html'), 'true',[],'',''],
	['PAGE','1815',jdecode('Kontakt'),jdecode(''), jdecode('%2F1815.html'), 'true',[],'',''],
	['PAGE','12801',jdecode('Spielanleitung'),jdecode(''), jdecode('%2F12801.html'), 'true',[],'',''],
	['PAGE','7501',jdecode('Links'),jdecode(''), jdecode('%2F7501.html'), 'true',[],'',''],
	['PAGE','14201',jdecode('Lageplan'),jdecode(''), jdecode('%2F14201.html'), 'true',[],'',''],
	['PAGE','25801',jdecode('Fotogallery'),jdecode(''), jdecode('%2F25801.html'), 'true',[],'',''],
	['PAGE','84501',jdecode('Sponsoring'),jdecode(''), jdecode('%2F84501.html'), 'true',[],'',''],
	['PAGE','86101',jdecode('Automaten'),jdecode(''), jdecode('%2F86101.html'), 'true',[],'',''],
	['PAGE','86122',jdecode('Fumoir'),jdecode(''), jdecode('%2F86122.html'), 'true',[],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Match';
theSitetree.paletteFamily='FF3333';
theSitetree.keyvisualId='2699';
theSitetree.keyvisualName='kv_2699.jpg';
theSitetree.fontsetId='10404';
theSitetree.graphicsetId='10635';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='CCCCCC';
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: 			'Match',
				paletteFamily: 	'FF3333',
				keyvisualId: 	'2699',
				keyvisualName: 	'kv_2699.jpg',
				fontsetId: 		'10404',
				graphicsetId: 	'10635',
				contentColor: 	'000000',
				contentBGColor: 'CCCCCC',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FF3333',
				e_color: 		'545353',
				f_color: 		'545353',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85501',
internalId:  '',
customField: '20110930-205558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85522',
internalId:  '',
customField: '20110930-210214'
};
webappMappings['7008']=webappMappings['7008-1091']={
webappId:    '7008',
documentId:  '1815',
internalId:  '1091',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1794',
internalId:  '',
customField: '20100330-074059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1701',
internalId:  '',
customField: '20111001-192039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10722',
internalId:  '',
customField: '20111001-192849'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10701',
internalId:  '',
customField: '20110930-190950'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1773',
internalId:  '',
customField: '20110930-191043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31201',
internalId:  '',
customField: '20081123-164007'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1836',
internalId:  '',
customField: '20110930-223812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32001',
internalId:  '',
customField: '20100427-161905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1815',
internalId:  '',
customField: '20111001-192218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '84501',
internalId:  '',
customField: '20110930-224525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7501',
internalId:  '',
customField: '20090903-123249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25801',
internalId:  '',
customField: '20110930-224625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86122',
internalId:  '',
customField: '20110930-223427'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32401',
internalId:  '',
customField: '20090903-111930'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32422',
internalId:  '',
customField: '20090903-112236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32443',
internalId:  '',
customField: '20110930-192146'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32464',
internalId:  '',
customField: '20090903-114204'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32485',
internalId:  '',
customField: '20090903-114734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12301',
internalId:  '',
customField: '20111001-185713'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12801',
internalId:  '',
customField: '20080130-193050'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14201',
internalId:  '',
customField: '20080119-070231'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '86101',
internalId:  '',
customField: '20110930-223004'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1701',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-14015619']={
webappId:    '1501',
documentId:  '1701',
internalId:  '14015619',
customField: '1501'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'AHOPT0IN3UUJ';
var companyName   = 'HIWIBOWLING';
var htmlTitle	  = 'Hiwibowling';
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();
};

