/* [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','4506',jdecode('Home'),jdecode(''),'/4506.html','true',[],'',''],
	['PAGE','4617',jdecode('%C3%9Cber+uns'),jdecode(''),'/4617.html','true',[],'',''],
	['PAGE','22148',jdecode('Aktuell'),jdecode(''),'/22148.html','true',[],'',''],
	['PAGE','14304',jdecode('Ranglisten'),jdecode(''),'/14304.html','true',[],'',''],
	['PAGE','4644',jdecode('Jahresprogramm'),jdecode(''),'/4644.html','true',[],'',''],
	['PAGE','10763',jdecode('Jungsch%C3%BCtzen'),jdecode(''),'/10763/index.html','true',[ 
		['PAGE','129514',jdecode('Fotos'),jdecode(''),'/10763/129514.html','true',[],'',''],
		['PAGE','132985',jdecode('Ranglisten+'),jdecode(''),'/10763/132985.html','true',[],'',''],
		['PAGE','135054',jdecode('Leiter+Team'),jdecode(''),'/10763/135054.html','true',[],'','']
	],'',''],
	['PAGE','4987',jdecode('Bundesprogramm'),jdecode(''),'/4987.html','true',[],'',''],
	['PAGE','5014',jdecode('Feldschiessen'),jdecode(''),'/5014.html','true',[],'',''],
	['PAGE','53560',jdecode('Flintentag'),jdecode(''),'/53560/index.html','true',[ 
		['PAGE','123842',jdecode('Kat+A'),jdecode(''),'/53560/123842.html','true',[],'',''],
		['PAGE','123897',jdecode('Kat+B'),jdecode(''),'/53560/123897.html','true',[],'',''],
		['PAGE','123906',jdecode('Kat+C'),jdecode(''),'/53560/123906.html','true',[],'',''],
		['PAGE','123915',jdecode('Kat+D'),jdecode(''),'/53560/123915.html','true',[],'',''],
		['PAGE','124183',jdecode('Gruppen'),jdecode(''),'/53560/124183.html','true',[],'','']
	],'',''],
	['PAGE','101505',jdecode('Anfahrt'),jdecode(''),'/101505.html','true',[],'',''],
	['PAGE','100467',jdecode('Routenplan'),jdecode(''),'/100467.html','true',[],'',''],
	['PAGE','4698',jdecode('Fotos'),jdecode(''),'/4698.html','true',[],'',''],
	['PAGE','4590',jdecode('Geschichte'),jdecode(''),'/4590.html','true',[],'',''],
	['PAGE','4725',jdecode('Links'),jdecode(''),'/4725.html','true',[],'',''],
	['PAGE','5250',jdecode('G%C3%A4stebuch'),jdecode(''),'/5250/index.html','true',[ 
		['PAGE','5251',jdecode('Eintr%C3%A4ge'),jdecode(''),'/5250/5251.html','false',[],'',''],
		['PAGE','117513',jdecode('neu'),jdecode(''),'/5250/117513.html','true',[],'','']
	],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Icon';
theSitetree.paletteFamily='9FAF91';
theSitetree.keyvisualId='3421';
theSitetree.keyvisualName='kv_3421.jpg';
theSitetree.fontsetId='10650';
theSitetree.graphicsetId='10742';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='B8C3AE';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Icon',
				paletteFamily: 	'9FAF91',
				keyvisualId: 	'3421',
				keyvisualName: 	'kv_3421.jpg',
				fontsetId: 		'10650',
				graphicsetId: 	'10742',
				contentColor: 	'000000',
				contentBGColor: 'B8C3AE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4506',
internalId:  '',
customField: '20100719-152754'
};
webappMappings['1002']=webappMappings['1002-5250ABW0X0INXXTH']={
webappId:    '1002',
documentId:  '5250',
internalId:  '5250ABW0X0INXXTH',
customField: 'icq=false'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4506',
internalId:  '1006',
customField: '1006'
};
webappMappings['1010']=webappMappings['1010-_Ea_Rangliste_Winterschiessen_20']={
webappId:    '1010',
documentId:  '14304',
internalId:  '_Ea_Rangliste_Winterschiessen_20',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['1501']=webappMappings['1501-757845']={
webappId:    '1501',
documentId:  '4506',
internalId:  '757845',
customField: '1501'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '100467',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '101505',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['7008']=webappMappings['7008-1323']={
webappId:    '7008',
documentId:  '10763',
internalId:  '1323',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10763',
internalId:  '',
customField: '20100712-120946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4617',
internalId:  '',
customField: '20100319-101139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22148',
internalId:  '',
customField: '20100715-203945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14304',
internalId:  '',
customField: '20100719-152905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4644',
internalId:  '',
customField: '20100319-094015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129514',
internalId:  '',
customField: '20100712-125033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4987',
internalId:  '',
customField: '20100319-094248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5014',
internalId:  '',
customField: '20100714-101235'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53560',
internalId:  '',
customField: '20090908-160831'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '132985',
internalId:  '',
customField: '20100117-143434'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123842',
internalId:  '',
customField: '20090908-131203'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123897',
internalId:  '',
customField: '20090908-131304'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123906',
internalId:  '',
customField: '20090908-131403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '123915',
internalId:  '',
customField: '20090908-131459'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '124183',
internalId:  '',
customField: '20090908-131722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '101505',
internalId:  '',
customField: '20050923-143525'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100467',
internalId:  '',
customField: '20050923-143407'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4698',
internalId:  '',
customField: '20100715-210838'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4590',
internalId:  '',
customField: '20060309-104346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4725',
internalId:  '',
customField: '20080224-212129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5250',
internalId:  '',
customField: '20040303-213448'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5251',
internalId:  '',
customField: '20040303-212412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '117513',
internalId:  '',
customField: '20060704-065450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '135054',
internalId:  '',
customField: '20100712-124933'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXXTH';
var companyName   = 'Sch%C3%BCtzengesellschaft+9555+Tobel';
var htmlTitle	  = 'Sch%C3%BCtzengesellschaft++Tobel';
var metaKeywords  = 'Bundesprogramm%2FFeldschiessen%2FSchiessen%2FJungsch%C3%BCtzenkurs';
var metaContents  = 'Bundesprogramm%2F+Feldschiessen%2F+Schiessen%2FJungsch%C3%BCtzenkurs';
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();
};
