/* [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 theSitetree=[ 
	['PAGE','2101',jdecode('Home'),jdecode(''),'/2101.html','true',[],''],
	['PAGE','2236',jdecode('Schiesszentrum'),jdecode(''),'/2236/index.html','true',[ 
		['PAGE','2257',jdecode('Anlagenbeschrieb'),jdecode(''),'/2236/2257.html','true',[],''],
		['PAGE','2278',jdecode('Infrastruktur'),jdecode(''),'/2236/2278.html','true',[],''],
		['PAGE','2383',jdecode('Referenzen'),jdecode(''),'/2236/2383.html','true',[],''],
		['PAGE','2404',jdecode('Preise'),jdecode(''),'/2236/2404.html','true',[],''],
		['PAGE','3701',jdecode('Events'),jdecode(''),'/2236/3701.html','true',[],''],
		['PAGE','8601',jdecode('J%C3%A4ger'),jdecode(''),'/2236/8601.html','true',[],''],
		['PAGE','9501',jdecode('Security'),jdecode(''),'/2236/9501.html','true',[],'']
	],''],
	['PAGE','6301',jdecode('Schiesskino'),jdecode(''),'/6301.html','true',[],''],
	['PAGE','2425',jdecode('Ausbildung'),jdecode(''),'/2425.html','true',[],''],
	['PAGE','5601',jdecode('Training'),jdecode(''),'/5601.html','true',[],''],
	['PAGE','2446',jdecode('Verkauf'),jdecode(''),'/2446/index.html','true',[ 
		['PAGE','2530',jdecode('Online-Shop'),jdecode(''),'/2446/2530.html','true',[],'']
	],''],
	['PAGE','3501',jdecode('Service'),jdecode(''),'/3501.html','true',[],''],
	['PAGE','2194',jdecode('Kontakt'),jdecode(''),'/2194/index.html','true',[ 
		['PAGE','7601',jdecode('Kontaktformular'),jdecode(''),'/2194/7601.html','true',[],'']
	],''],
	['PAGE','2656',jdecode('So+finden+Sie+uns'),jdecode(''),'/2656.html','true',[],''],
	['PAGE','2551',jdecode('Links'),jdecode(''),'/2551.html','true',[],''],
	['PAGE','17701',jdecode('Fotogalerie'),jdecode(''),'/17701.html','true',[],''],
	['PAGE','20201',jdecode('Bestimmungen'),jdecode(''),'/20201.html','true',[],''],
	['PAGE','20601',jdecode('Downloads'),jdecode(''),'/20601.html','true',[],'']];
var siteelementCount=22;
theSitetree.topTemplateName='Triangle';
theSitetree.paletteFamily='004165';
theSitetree.keyvisualId='12004';
theSitetree.keyvisualName='kv_12004.jpg';
theSitetree.fontsetId='33262';
theSitetree.graphicsetId='14140';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='004165';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				name: 			'Triangle',
				paletteFamily: 	'004165',
				keyvisualId: 	'12004',
				keyvisualName: 	'kv_12004.jpg',
				fontsetId: 		'33262',
				graphicsetId: 	'14140',
				contentColor: 	'FFFFFF',
				contentBGColor: '004165',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'004165',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20601',
internalId:  '',
customField: '20090626-093211'
};
webappMappings['4001']=webappMappings['4001-29526724']={
webappId:    '4001',
documentId:  '2530',
internalId:  '29526724',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2101',
internalId:  '',
customField: '20090720-093536'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2194',
internalId:  '',
customField: '20090626-091550'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20201',
internalId:  '',
customField: '20090626-092829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2236',
internalId:  '',
customField: '20090626-100154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2257',
internalId:  '',
customField: '20090626-113546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2278',
internalId:  '',
customField: '20090626-111712'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7601',
internalId:  '',
customField: '20090626-091838'
};
webappMappings['7008']=webappMappings['7008-5997']={
webappId:    '7008',
documentId:  '7601',
internalId:  '5997',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8601',
internalId:  '',
customField: '20090626-102045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2383',
internalId:  '',
customField: '20090626-085202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2404',
internalId:  '',
customField: '20090626-085358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2425',
internalId:  '',
customField: '20090619-085924'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2446',
internalId:  '',
customField: '20090619-095357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9501',
internalId:  '',
customField: '20090626-102503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2530',
internalId:  '',
customField: '20090609-073417'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2551',
internalId:  '',
customField: '20090626-092519'
};
webappMappings['7060']=webappMappings['7060-c746d1395a956c59e601992c6f0679d1']={
webappId:    '7060',
documentId:  '17701',
internalId:  'c746d1395a956c59e601992c6f0679d1',
customField: 'language:de;country:CH;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '2656',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17701',
internalId:  '',
customField: '20090626-091221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2656',
internalId:  '',
customField: '20090626-092137'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3501',
internalId:  '',
customField: '20090626-111218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '3701',
internalId:  '',
customField: '20090626-090640'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2101',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-29527213']={
webappId:    '1501',
documentId:  '2101',
internalId:  '29527213',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20090619-090058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6301',
internalId:  '',
customField: '20090626-095608'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW1X0INEMQZ';
var companyName   = 'f%C3%BCr+J%C3%A4ger+-+Sch%C3%BCtzen+-+Beh%C3%B6rden+-+Sicherheitspersonal';
var htmlTitle	  = '';
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();
};

