/* [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','401',jdecode('Home+%2F+News'),jdecode(''), jdecode('%2F401%2Findex.html'), 'true',[ 
		['PAGE','81512',jdecode('Events+%2F+Agenda'),jdecode(''), jdecode('%2F401%2F81512.html'), 'true',[],'','']
	],'',''],
	['PAGE','161934',jdecode('Resultate'),jdecode(''), jdecode('%2F161934%2Findex.html'), 'true',[ 
		['PAGE','473',jdecode('2010'),jdecode(''), jdecode('%2F161934%2F473.html'), 'true',[],'',''],
		['PAGE','105512',jdecode('2009'),jdecode(''), jdecode('%2F161934%2F105512.html'), 'true',[],'',''],
		['PAGE','105533',jdecode('2008'),jdecode(''), jdecode('%2F161934%2F105533.html'), 'true',[],'','']
	],'',''],
	['PAGE','494',jdecode('Fotos'),jdecode(''), jdecode('%2F494%2Findex.html'), 'true',[ 
		['PAGE','160534',jdecode('2010'),jdecode(''), jdecode('%2F494%2F160534.html'), 'true',[],'',''],
		['PAGE','105596',jdecode('Archiv'),jdecode(''), jdecode('%2F494%2F105596.html'), 'true',[],'','']
	],'',''],
	['PAGE','162234',jdecode('Reports'),jdecode(''), jdecode('%2F162234%2Findex.html'), 'true',[ 
		['PAGE','117012',jdecode('2010'),jdecode(''), jdecode('%2F162234%2F117012.html'), 'true',[],'',''],
		['PAGE','76812',jdecode('2009'),jdecode(''), jdecode('%2F162234%2F76812.html'), 'true',[],'','']
	],'',''],
	['PAGE','557',jdecode('Portrait'),jdecode(''), jdecode('%2F557%2Findex.html'), 'true',[ 
		['PAGE','6201',jdecode('Vorstand'),jdecode(''), jdecode('%2F557%2F6201.html'), 'true',[],'',''],
		['PAGE','82612',jdecode('Geschichte'),jdecode(''), jdecode('%2F557%2F82612.html'), 'true',[],'',''],
		['PAGE','82633',jdecode('Jugendriege'),jdecode(''), jdecode('%2F557%2F82633.html'), 'true',[],'','']
	],'',''],
	['PAGE','82412',jdecode('Turnerfamilie'),jdecode(''), jdecode('%2F82412%2Findex.html'), 'true',[ 
		['PAGE','82433',jdecode('M%C3%A4nnerriege'),jdecode(''), jdecode('%2F82412%2F82433.html'), 'false',[],'',''],
		['PAGE','82454',jdecode('Damenriege'),jdecode(''), jdecode('%2F82412%2F82454.html'), 'true',[],'',''],
		['PAGE','100512',jdecode('Frauenriege'),jdecode(''), jdecode('%2F82412%2F100512.html'), 'true',[],'',''],
		['PAGE','82475',jdecode('M%C3%A4dchenriege'),jdecode(''), jdecode('%2F82412%2F82475.html'), 'false',[],'',''],
		['PAGE','82496',jdecode('KITU'),jdecode(''), jdecode('%2F82412%2F82496.html'), 'true',[],'',''],
		['PAGE','100533',jdecode('MUKI'),jdecode(''), jdecode('%2F82412%2F100533.html'), 'true',[],'','']
	],'',''],
	['PAGE','83612',jdecode('Maskenball'),jdecode(''), jdecode('%2F83612%2Findex.html'), 'true',[ 
		['PAGE','183334',jdecode('2011'),jdecode(''), jdecode('%2F83612%2F183334.html'), 'true',[],'',''],
		['PAGE','156034',jdecode('2010'),jdecode(''), jdecode('%2F83612%2F156034.html'), 'true',[],'',''],
		['PAGE','515',jdecode('2009'),jdecode(''), jdecode('%2F83612%2F515.html'), 'true',[],'',''],
		['PAGE','83675',jdecode('Archiv'),jdecode(''), jdecode('%2F83612%2F83675.html'), 'true',[],'','']
	],'',''],
	['PAGE','77512',jdecode('Links'),jdecode(''), jdecode('%2F77512.html'), 'true',[],'',''],
	['PAGE','77812',jdecode('Impressum'),jdecode(''), jdecode('%2F77812%2Findex.html'), 'true',[ 
		['PAGE','82912',jdecode('Sitemap'),jdecode(''), jdecode('%2F77812%2F82912.html'), 'true',[],'','']
	],'',''],
	['PAGE','79412',jdecode('TVK+intern'),jdecode(''), jdecode('%2F79412%2Findex.html'), 'true',[ 
		['PAGE','79612',jdecode('Fotos%2FVideos'),jdecode(''), jdecode('%2F79412%2F79612.html'), 'true',[],'','']
	],'','']];
var siteelementCount=33;
theSitetree.topTemplateName='Stylus';
theSitetree.paletteFamily='B0CBD6';
theSitetree.keyvisualId='2054';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='330';
theSitetree.graphicsetId='383';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
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: 			'Stylus',
				paletteFamily: 	'B0CBD6',
				keyvisualId: 	'2054',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'330',
				graphicsetId: 	'383',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'B0CBD6',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20120117-192151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20091012-105724'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20100128-063552'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '401',
internalId:  'search',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20110112-121447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20111128-191628'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20091027-171903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '117012',
internalId:  '',
customField: '20110112-121911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77512',
internalId:  '',
customField: '20100705-165558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76812',
internalId:  '',
customField: '20100119-085710'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '77812',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77812',
internalId:  '',
customField: '20110713-103134'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '160534',
internalId:  '',
customField: '20110112-121946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156034',
internalId:  '',
customField: '20101024-193601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79412',
internalId:  '',
customField: '20111028-181456'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79612',
internalId:  '',
customField: '20110713-103822'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '81512',
internalId:  '',
customField: '20100705-165733'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82612',
internalId:  '',
customField: '20100410-082135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82633',
internalId:  '',
customField: '20110713-103342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82412',
internalId:  '',
customField: '20100705-164347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82433',
internalId:  '',
customField: '20091002-145459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82454',
internalId:  '',
customField: '20100615-172210'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82475',
internalId:  '',
customField: '20091002-145459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82496',
internalId:  '',
customField: '20101203-182445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82912',
internalId:  '',
customField: '20110824-050620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83612',
internalId:  '',
customField: '20120117-192901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100512',
internalId:  '',
customField: '20101116-172643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100533',
internalId:  '',
customField: '20101203-182607'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83675',
internalId:  '',
customField: '20110308-133744'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105512',
internalId:  '',
customField: '20100111-203811'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105533',
internalId:  '',
customField: '20100111-203910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '183334',
internalId:  '',
customField: '20111130-194541'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '105596',
internalId:  '',
customField: '20110824-054752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '161934',
internalId:  '',
customField: '20111128-184425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '162234',
internalId:  '',
customField: '20110914-114419'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'AHOPT0INV9I3';
var companyName   = 'Turnverein+Kleinl%C3%BCtzel+1904';
var htmlTitle	  = 'T+V+K+++++1+9+0+4';
var metaKeywords  = '';
var metaContents  = 'Turnverein%2C+Kleinl%C3%BCtzel%2C+1904%2C+Maskenball%2C+Jugendriege%2C+Leichtathletik%2C+TVK%2C+tvk+1904%2C+sotv%2C+dr+schn%C3%A4llst+l%C3%BCtzler%2C+jugi%2C+fasnacht%2C+dorneck+thierstein%2C+schwarzbubenland%2C+';
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();
};

