/* [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','4520',jdecode('Home'),jdecode(''), jdecode('%2F4520%2Findex.html'), 'true',[ 
		['PAGE','47675',jdecode('Webmaster'),jdecode(''), jdecode('%2F4520%2F47675.html'), 'true',[],'','']
	],'',''],
	['PAGE','4786',jdecode('Vorstand'),jdecode(''), jdecode('%2F4786.html'), 'true',[],'',''],
	['PAGE','4867',jdecode('GV%2FProgramm'),jdecode(''), jdecode('%2F4867%2Findex.html'), 'true',[ 
		['PAGE','36707',jdecode('Jahresprogramm+2012'),jdecode(''), jdecode('%2F4867%2F36707.html'), 'true',[],'','']
	],'',''],
	['PAGE','5002',jdecode('Statuten'),jdecode(''), jdecode('%2F5002.html'), 'true',[],'',''],
	['PAGE','40400',jdecode('Vereinssitz'),jdecode(''), jdecode('%2F40400%2Findex.html'), 'true',[ 
		['PAGE','83392',jdecode('Ihr+Weg+zu+uns'),jdecode(''), jdecode('%2F40400%2F83392.html'), 'true',[],'','']
	],'',''],
	['PAGE','36680',jdecode('Anl%C3%A4sse'),jdecode(''), jdecode('%2F36680%2Findex.html'), 'true',[ 
		['PAGE','43856',jdecode('Archiviert'),jdecode(''), jdecode('%2F36680%2F43856.html'), 'true',[],'','']
	],'',''],
	['PAGE','122482',jdecode('Sport%2FFahrtraining'),jdecode(''), jdecode('%2F122482%2Findex.html'), 'true',[ 
		['PAGE','156923',jdecode('Kartplausch+2010'),jdecode(''), jdecode('%2F122482%2F156923.html'), 'true',[],'','']
	],'',''],
	['PAGE','4813',jdecode('Kontakt%2FAnmeldung%2Fetc'),jdecode(''), jdecode('%2F4813.html'), 'true',[],'',''],
	['PAGE','125950',jdecode('Aufnahmegesuch'),jdecode(''), jdecode('%2F125950.html'), 'true',[],'',''],
	['PAGE','160274',jdecode('Versicherungen'),jdecode(''), jdecode('%2F160274.html'), 'true',[],'',''],
	['PAGE','41456',jdecode('Forum'),jdecode(''), jdecode('%2F41456.html'), 'true',[],'',''],
	['PAGE','4921',jdecode('Sternfahrten'),jdecode(''), jdecode('%2F4921%2Findex.html'), 'true',[ 
		['PAGE','4894',jdecode('Alle+St.-Fahrten'),jdecode(''), jdecode('%2F4921%2F4894.html'), 'true',[],'',''],
		['PAGE','133528',jdecode('Archiviert'),jdecode(''), jdecode('%2F4921%2F133528.html'), 'true',[],'','']
	],'',''],
	['PAGE','5029',jdecode('Souvenirs'),jdecode(''), jdecode('%2F5029.html'), 'true',[],'',''],
	['PAGE','5185',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F5185.html'), 'true',[],'',''],
	['PAGE','121422',jdecode('Login+Vorstand'),jdecode(''), jdecode('%2F121422.html'), 'true',[],'',''],
	['PAGE','5056',jdecode('Links'),jdecode(''), jdecode('%2F5056%2Findex.html'), 'true',[ 
		['PAGE','158747',jdecode('Testseite'),jdecode(''), jdecode('%2F5056%2F158747.html'), 'false',[],'','']
	],'','']];
var siteelementCount=24;
theSitetree.topTemplateName='Commander';
theSitetree.paletteFamily='2B25A2';
theSitetree.keyvisualId='2383';
theSitetree.keyvisualName='highway.jpg';
theSitetree.fontsetId='393';
theSitetree.graphicsetId='439';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='E0E0E0';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Commander',
				paletteFamily: 	'2B25A2',
				keyvisualId: 	'2383',
				keyvisualName: 	'highway.jpg',
				fontsetId: 		'393',
				graphicsetId: 	'439',
				contentColor: 	'000000',
				contentBGColor: 'E0E0E0',
				a_color: 		'E0E0E0',
				b_color: 		'5762CA',
				c_color: 		'A1A4D2',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4520',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-5185ABW0X0INXEEJ']={
webappId:    '1002',
documentId:  '5185',
internalId:  '5185ABW0X0INXEEJ',
customField: 'icq=false'
};
webappMappings['7008']=webappMappings['7008-2055']={
webappId:    '7008',
documentId:  '4813',
internalId:  '2055',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47675',
internalId:  '',
customField: '20120205-133641'
};
webappMappings['1501']=webappMappings['1501-1687147']={
webappId:    '1501',
documentId:  '4520',
internalId:  '1687147',
customField: '1501'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '40400',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['1003']=webappMappings['1003-abw0x0inxeej10c62653de5']={
webappId:    '1003',
documentId:  '41456',
internalId:  'abw0x0inxeej10c62653de5',
customField: 'de:CH:'
};
webappMappings['7005']=webappMappings['7005-221']={
webappId:    '7005',
documentId:  '47675',
internalId:  '221',
customField: 'language:de;country:CH;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '83392',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['7050']=webappMappings['7050-488']={
webappId:    '7050',
documentId:  '121422',
internalId:  '488',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4520',
internalId:  '',
customField: '20120205-204045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4786',
internalId:  '',
customField: '20110626-200612'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4867',
internalId:  '',
customField: '20120205-140941'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36707',
internalId:  '',
customField: '20120205-155003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5002',
internalId:  '',
customField: '20100503-202841'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40400',
internalId:  '',
customField: '20110626-200905'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83392',
internalId:  '',
customField: '20040509-133219'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36680',
internalId:  '',
customField: '20110925-113236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '160274',
internalId:  '',
customField: '20111219-172549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43856',
internalId:  '',
customField: '20060413-004010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '122482',
internalId:  '',
customField: '20111219-192540'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156923',
internalId:  '',
customField: '20110108-192531'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4813',
internalId:  '',
customField: '20110126-051255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125950',
internalId:  '',
customField: '20100502-122006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41456',
internalId:  '',
customField: '20060320-223736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121422',
internalId:  '',
customField: '20100308-135205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4921',
internalId:  '',
customField: '20070901-144224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4894',
internalId:  '',
customField: '20070901-144237'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '133528',
internalId:  '',
customField: '20070901-142039'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5029',
internalId:  '',
customField: '20090521-224909'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5185',
internalId:  '',
customField: '20070320-213544'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5056',
internalId:  '',
customField: '20100307-125804'
};
webappMappings['7060']=webappMappings['7060-0e800db9231ec93f64f1223a0ad14dea']={
webappId:    '7060',
documentId:  '158747',
internalId:  '0e800db9231ec93f64f1223a0ad14dea',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '158747',
internalId:  '',
customField: '20100221-212558'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXEEJ';
var companyName   = 'Polizei-Motorsport-Club+Luzern';
var htmlTitle	  = 'Polizei-Motorsport-Club+Luzern';
var metaKeywords  = '';
var metaContents  = 'Polizei-Motorsport-Club+Luzern';
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();
};

