/* [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','203',jdecode('Home'),jdecode(''),'/203.html','true',[],'',''],
	['PAGE','16901',jdecode('Club'),jdecode(''),'/16901/index.html','true',[ 
		['PAGE','49101',jdecode('Vorstand+%26+Trainer'),jdecode(''),'/16901/49101.html','true',[],'',''],
		['PAGE','49122',jdecode('Administratives'),jdecode(''),'/16901/49122.html','true',[],'',''],
		['PAGE','52601',jdecode('Kontakt'),jdecode(''),'/16901/52601.html','true',[],'','']
	],'',''],
	['PAGE','16922',jdecode('Training'),jdecode(''),'/16922.html','true',[],'',''],
	['PAGE','11401',jdecode('Terminplan'),jdecode(''),'/11401/index.html','true',[ 
		['PAGE','49143',jdecode('Vereinsanl%C3%A4sse'),jdecode(''),'/11401/49143.html','true',[],'',''],
		['PAGE','67401',jdecode('Ferienplan'),jdecode(''),'/11401/67401.html','true',[],'',''],
		['PAGE','49164',jdecode('Sonstiges'),jdecode(''),'/11401/49164.html','true',[],'','']
	],'',''],
	['PAGE','11422',jdecode('Interclub'),jdecode(''),'/11422/index.html','true',[ 
		['PAGE','49185',jdecode('1.Mannschaft'),jdecode(''),'/11422/49185.html','true',[],'',''],
		['PAGE','49206',jdecode('2.Mannschaft'),jdecode(''),'/11422/49206.html','true',[],'','']
	],'',''],
	['PAGE','11443',jdecode('Sch%C3%BClerturniere'),jdecode(''),'/11443.html','true',[],'',''],
	['PAGE','11464',jdecode('Impressionen'),jdecode(''),'/11464/index.html','true',[ 
		['PAGE','49248',jdecode('Sch%C3%BClerturniere'),jdecode(''),'/11464/49248.html','true',[],'',''],
		['PAGE','49269',jdecode('IC-Spiele+%26+Turniere'),jdecode(''),'/11464/49269.html','true',[],'',''],
		['PAGE','51501',jdecode('Vereinsanl%C3%A4sse'),jdecode(''),'/11464/51501.html','true',[],'','']
	],'',''],
	['PAGE','11485',jdecode('Sponsoren'),jdecode(''),'/11485.html','true',[],'',''],
	['PAGE','49290',jdecode('Links'),jdecode(''),'/49290.html','true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='003390';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='353';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='003390';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'003390',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'353',
				contentColor: 	'FFFFFF',
				contentBGColor: '003390',
				a_color: 		'003390',
				b_color: 		'000000',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '203',
internalId:  '',
customField: '20100513-113622'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16922',
internalId:  '',
customField: '20100513-150337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11401',
internalId:  '',
customField: '20100418-101907'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49143',
internalId:  '',
customField: '20100418-102033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '67401',
internalId:  '',
customField: '20100124-102933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49164',
internalId:  '',
customField: '20100418-102053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11422',
internalId:  '',
customField: '20100418-102248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49185',
internalId:  '',
customField: '20100418-102443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16901',
internalId:  '',
customField: '20090121-190416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49122',
internalId:  '',
customField: '20100513-150049'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '52601',
internalId:  '',
customField: '20100513-150238'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49206',
internalId:  '',
customField: '20100418-102330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49101',
internalId:  '',
customField: '20100418-102551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11443',
internalId:  '',
customField: '20090121-133425'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11464',
internalId:  '',
customField: '20090925-140916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49248',
internalId:  '',
customField: '20090121-133528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49269',
internalId:  '',
customField: '20100513-150353'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51501',
internalId:  '',
customField: '20090925-140123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11485',
internalId:  '',
customField: '20091016-200918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49290',
internalId:  '',
customField: '20090121-122915'
};
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'Ahp010INEYNV';
var companyName   = 'Badminton-Club+Obersee+%28BCO%29';
var htmlTitle	  = 'Badminton-Club+Obersee';
var metaKeywords  = 'Badminton%0D%0ABadmintonclub%0D%0ABadminton-Club%0D%0AObersee%0D%0ABadminton-Club+Obersee%0D%0ABadmintonclub+Obersee%0D%0ABCO%0D%0ABC+Obersee%0D%0ALachen%0D%0APf%C3%A4ffikon';
var metaContents  = 'Der+Badminton-Club+Obersee+%28BCO%29+ist+ein+gesellschaftlicher+Club.+Jedes+Jahr+veranstalten+wir+diverse+Plauschanl%C3%A4sse+%28Grillplausch%2C+Skiweekend%2C+Wanderung%2C+usw.%29+und+nat%C3%BCrlich+als+Highlight+ein+Trainingslager+in+einem+Sportzentrum.+Wir+freuen+uns+jederzeit+neue+Gesichter+in+unserem+Club+%21%21+Komm+doch+am+Donnerstag+auf+ein+Schnuppertraining+vorbei+-+egal+ob+Du+dich+zu+den+Plausch-%2C+Junioren-+oder+Elitespielern+z%C3%A4hlst.';
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();
};
