/* [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','4501',jdecode('+Home'),jdecode(''), jdecode('%2F4501.html'), 'true',[],'',''],
	['PAGE','82401',jdecode('Partner'),jdecode(''), jdecode('%2F82401.html'), 'true',[],'',''],
	['PAGE','92401',jdecode('This+Priis'),jdecode(''), jdecode('%2F92401.html'), 'true',[],'',''],
	['PAGE','4585',jdecode('Betrieb'),jdecode(''), jdecode('%2F4585.html'), 'true',[],'',''],
	['PAGE','77301',jdecode('Erinnerungen'),jdecode(''), jdecode('%2F77301%2Findex.html'), 'true',[ 
		['PAGE','21422',jdecode('Anl%C3%A4sse'),jdecode(''), jdecode('%2F77301%2F21422.html'), 'true',[],'',''],
		['PAGE','301',jdecode('Arbeiten'),jdecode(''), jdecode('%2F77301%2F301.html'), 'true',[],'','']
	],'',''],
	['PAGE','4774',jdecode('Markt'),jdecode(''), jdecode('%2F4774%2Findex.html'), 'true',[ 
		['PAGE','29301',jdecode('Markt+%28Folgeseite%29'),jdecode(''), jdecode('%2F4774%2F29301.html'), 'false',[],'','']
	],'',''],
	['PAGE','100701',jdecode('Fahrzeuge'),jdecode(''), jdecode('%2F100701%2Findex.html'), 'true',[ 
		['PAGE','4543',jdecode('Ns2f+Heidi'),jdecode(''), jdecode('%2F100701%2F4543.html'), 'true',[],'',''],
		['PAGE','100801',jdecode('O%26K+MD2B'),jdecode(''), jdecode('%2F100701%2F100801.html'), 'true',[],'',''],
		['PAGE','100822',jdecode('EL+30+Tandem'),jdecode(''), jdecode('%2F100701%2F100822.html'), 'true',[],'',''],
		['PAGE','100843',jdecode('Diema+1549'),jdecode(''), jdecode('%2F100701%2F100843.html'), 'true',[],'',''],
		['PAGE','100864',jdecode('Sch%C3%B6ma+886'),jdecode(''), jdecode('%2F100701%2F100864.html'), 'true',[],'',''],
		['PAGE','106101',jdecode('O%26K+173'),jdecode(''), jdecode('%2F100701%2F106101.html'), 'true',[],'','']
	],'',''],
	['PAGE','4669',jdecode('Parkbahner'),jdecode(''), jdecode('%2F4669%2Findex.html'), 'true',[ 
		['PAGE','4690',jdecode('G%C3%B6nner'),jdecode(''), jdecode('%2F4669%2F4690.html'), 'true',[],'',''],
		['PAGE','29601',jdecode('G%C3%B6nner+%28Folgeseite%29'),jdecode(''), jdecode('%2F4669%2F29601.html'), 'false',[],'',''],
		['PAGE','14801',jdecode('Adressen'),jdecode(''), jdecode('%2F4669%2F14801.html'), 'true',[],'','']
	],'',''],
	['PAGE','4711',jdecode('Kontakt'),jdecode(''), jdecode('%2F4711%2Findex.html'), 'true',[ 
		['PAGE','20301',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''), jdecode('%2F4711%2F20301.html'), 'false',[],'','']
	],'',''],
	['PAGE','4753',jdecode('Umgebung+von+R%C3%BCmlang'),jdecode(''), jdecode('%2F4753.html'), 'true',[],'',''],
	['PAGE','75601',jdecode('Anfahrt+zur+Parkbahn'),jdecode(''), jdecode('%2F75601.html'), 'true',[],'',''],
	['PAGE','75801',jdecode('Lageplan'),jdecode(''), jdecode('%2F75801.html'), 'true',[],'','']];
var siteelementCount=25;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='AC2323';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='289';
theSitetree.graphicsetId='356';
theSitetree.contentColor='DDDDDD';
theSitetree.contentBGColor='AC2323';
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: 			'Movement',
				paletteFamily: 	'AC2323',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'289',
				graphicsetId: 	'356',
				contentColor: 	'DDDDDD',
				contentBGColor: 'AC2323',
				a_color: 		'AC2323',
				b_color: 		'480F0F',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82401',
internalId:  '',
customField: '20111122-104136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75801',
internalId:  '',
customField: '20090417-123254'
};
webappMappings['7008']=webappMappings['7008-4443']={
webappId:    '7008',
documentId:  '4690',
internalId:  '4443',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-4442']={
webappId:    '7008',
documentId:  '4711',
internalId:  '4442',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77301',
internalId:  '',
customField: '20090805-160908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100701',
internalId:  '',
customField: '20111122-103408'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '75601',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '75801',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4501',
internalId:  '',
customField: '20120107-203545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21422',
internalId:  '',
customField: '20110126-190825'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4585',
internalId:  '',
customField: '20111122-111547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4774',
internalId:  '',
customField: '20091220-191923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29301',
internalId:  '',
customField: '20070219-180317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20110402-154454'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4543',
internalId:  '',
customField: '20110126-214725'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4669',
internalId:  '',
customField: '20090830-161753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4690',
internalId:  '',
customField: '20090803-144716'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29601',
internalId:  '',
customField: '20070219-181302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14801',
internalId:  '',
customField: '20110111-084341'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4711',
internalId:  '',
customField: '20090803-145102'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20301',
internalId:  '',
customField: '20070130-121855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4753',
internalId:  '',
customField: '20090417-124748'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75601',
internalId:  '',
customField: '20090417-123053'
};
webappMappings['7008']=webappMappings['7008-4441']={
webappId:    '7008',
documentId:  '4774',
internalId:  '4441',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '92401',
internalId:  '',
customField: '20091220-201840'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100801',
internalId:  '',
customField: '20110126-204313'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100822',
internalId:  '',
customField: '20110126-214400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100843',
internalId:  '',
customField: '20110126-214334'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100864',
internalId:  '',
customField: '20110126-215319'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '106101',
internalId:  '-',
customField: '20111122-105317'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN2OO9';
var companyName   = 'Parkbahn+Letten%2C+8153+R%C3%BCmlang';
var htmlTitle	  = '';
var metaKeywords  = 'Feldbahn++Feldbahnlok++60cm++600mm++twofoot++Juchler++Szente++Galbier++Bienz++Parkbahn++Letten++R%EF%BF%BDmlang++8153++Ns2f++S%EF%BF%BDgewerksloren++Kipploren++Weichen++Schienen++Chlaus++Diesel+Festbahn+Bahn+Garten+Park+Geleise+Geleisebau+Weichen+Schaugarten+Advent';
var metaContents  = 'Feldbahnsammlung++Bahnanlage++Feldbahnlok++parkbahn++letten++aufbau++2006++Markt++bieten++suchen+Feldbahn+Ns2f+Parkbahntage+R%C3%BCmlang+Juchler+Garten+Gartenbau+Gartenbahn++';
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();
};

