/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','452',jdecode('News'),jdecode(''),'/452.html','true',[],'',''],
	['PAGE','473',jdecode('Unsere+B%C3%BCcher'),jdecode(''),'/473/index.html','true',[ 
		['PAGE','494',jdecode('Freizeitf%C3%BChrer'),jdecode(''),'/473/494.html','true',[],'',''],
		['PAGE','30701',jdecode('Wanderf%C3%BChrer'),jdecode(''),'/473/30701.html','true',[],'',''],
		['PAGE','66401',jdecode('ZVV-Wanderf%C3%BChrer'),jdecode(''),'/473/66401.html','true',[],'',''],
		['PAGE','64601',jdecode('Nachmittags-Ausfl%C3%BCge'),jdecode(''),'/473/64601.html','true',[],'',''],
		['PAGE','57901',jdecode('Velof%C3%BChrer'),jdecode(''),'/473/57901.html','true',[],'',''],
		['PAGE','536',jdecode('Abenteuer'),jdecode(''),'/473/536.html','true',[],'',''],
		['PAGE','34501',jdecode('Geschenkb%C3%BCcher'),jdecode(''),'/473/34501.html','true',[],'',''],
		['PAGE','515',jdecode('Bahn-Jahrbuch'),jdecode(''),'/473/515.html','true',[],'',''],
		['PAGE','46601',jdecode('Eisenbahnen'),jdecode(''),'/473/46601.html','true',[],'',''],
		['PAGE','54801',jdecode('Bauen+%26+Wohnen'),jdecode(''),'/473/54801.html','true',[],'',''],
		['PAGE','64622',jdecode('Kochb%C3%BCcher'),jdecode(''),'/473/64622.html','true',[],'',''],
		['PAGE','30722',jdecode('Kinderb%C3%BCcher'),jdecode(''),'/473/30722.html','true',[],'',''],
		['PAGE','43501',jdecode('Mihtuu'),jdecode(''),'/473/43501.html','true',[],'','']
	],'',''],
	['PAGE','54822',jdecode('Offene+Stellen'),jdecode(''),'/54822.html','true',[],'',''],
	['PAGE','557',jdecode('Wir+%C3%BCber+uns'),jdecode(''),'/557.html','true',[],'',''],
	['PAGE','599',jdecode('AGBs'),jdecode(''),'/599.html','true',[],'',''],
	['PAGE','36801',jdecode('Impressum%2C+Kontakt'),jdecode(''),'/36801.html','true',[],'',''],
	['PAGE','38001',jdecode('Online-Shop'),jdecode(''),'/38001.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Elegant';
theSitetree.paletteFamily='223892';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='32899';
theSitetree.graphicsetId='13974';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='223892';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Elegant',
				paletteFamily: 	'223892',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'32899',
				graphicsetId: 	'13974',
				contentColor: 	'FFFFFF',
				contentBGColor: '223892',
				a_color: 		'000000',
				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['7008']=webappMappings['7008-1743']={
webappId:    '7008',
documentId:  '452',
internalId:  '1743',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-1744']={
webappId:    '7008',
documentId:  '36801',
internalId:  '1744',
customField: 'language:de;country:CH;'
};
webappMappings['4001']=webappMappings['4001-11012704']={
webappId:    '4001',
documentId:  '38001',
internalId:  '11012704',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20090510-171705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '452',
internalId:  '',
customField: '20090217-150545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '473',
internalId:  '',
customField: '20070109-114248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '494',
internalId:  '',
customField: '20100105-074357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30701',
internalId:  '',
customField: '20100108-144516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57901',
internalId:  '',
customField: '20100105-074604'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '536',
internalId:  '',
customField: '20090313-091224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34501',
internalId:  '',
customField: '20080817-144344'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '515',
internalId:  '',
customField: '20100104-161703'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46601',
internalId:  '',
customField: '20100301-141346'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54801',
internalId:  '',
customField: '20100108-144925'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30722',
internalId:  '',
customField: '20081231-150631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43501',
internalId:  '',
customField: '20081231-150457'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54822',
internalId:  '',
customField: '20100119-143104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '557',
internalId:  '',
customField: '20090510-171807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '599',
internalId:  '',
customField: '20070114-183043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36801',
internalId:  '',
customField: '20090217-150613'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38001',
internalId:  '',
customField: '20070209-071927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64622',
internalId:  '',
customField: '20100214-114753'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64601',
internalId:  '',
customField: '20100108-144122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66401',
internalId:  '',
customField: '20100108-144355'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN2RDO';
var companyName   = 'Edition+Lan+AG';
var htmlTitle	  = 'Wander-+und+Freizeitf%C3%BChrer+sowie+Eisenbahnb%C3%BCcher+Schweiz';
var metaKeywords  = 'Edition+Lan+Wanderf%C3%BChrer+Wanderf%C3%BChrer+Schweiz+Wanderf%C3%BChrer+Z%C3%BCrich+Wandern+in+der+Schweiz+Ausflugsf%C3%BChrer+Schweiz+Bahnland+Schweiz+Schweizer+Bahnen+Bahn-Jahrbuch++Bahnjahrbuch++Cabrio++Cabriotouren++Regenwetter++Abenteuer+mit+Kindern+Handicap++Ausfl%C3%BCge+f%C3%BCr+Behinderte';
var metaContents  = 'Edition+Lan+AG+-+Ihr+Partner+f%C3%BCr+Medien+und+Marketing.+Wir+verlegen+und+produzieren+B%C3%BCcher+aus+den+Bereichen+Freizeit%2C+Tourismus+und+Verkehr.+Wir+erarbeiten+aber+auch+Konzepte%2C+insbesondere+in+den+Bereichen+Marketing+und+liefern+dazu+die+Umsetzung+im+Printbereich.';
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();
};
