/* [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(''),'/4520.html','true',[],'',''],
	['PAGE','10921',jdecode('%C3%9Cber+uns'),jdecode(''),'/10921.html','true',[],'',''],
	['PAGE','9271',jdecode('Unsere+Fahrzeuge'),jdecode(''),'/9271.html','true',[],'',''],
	['PAGE','25226',jdecode('Reiseprogramm+%26%23x27%3B10'),jdecode(''),'/25226/index.html','true',[ 
		['PAGE','75154',jdecode('Salzkammergut'),jdecode(''),'/25226/75154.html','true',[],'',''],
		['PAGE','75163',jdecode('Abschlussfahrt'),jdecode(''),'/25226/75163.html','true',[],'','']
	],'',''],
	['PAGE','31750',jdecode('Anmeldung+'),jdecode(''),'/31750/index.html','true',[ 
		['PAGE','32004',jdecode('Anmeldung+Reiseprogramm+%28Form+followup+page%29'),jdecode(''),'/31750/32004.html','false',[],'','']
	],'',''],
	['PAGE','59743',jdecode('Reisebestimmungen'),jdecode(''),'/59743.html','true',[],'',''],
	['PAGE','9379',jdecode('Kontakt'),jdecode(''),'/9379.html','true',[],'',''],
	['PAGE','64497',jdecode('Anfahrt'),jdecode(''),'/64497.html','true',[],'',''],
	['PAGE','9352',jdecode('Anfrage+'),jdecode(''),'/9352/index.html','true',[ 
		['PAGE','37327',jdecode('Anfrage++%28Form+followup+page%29'),jdecode(''),'/9352/37327.html','false',[],'','']
	],'','']];
var siteelementCount=13;
theSitetree.topTemplateName='Galerie';
theSitetree.paletteFamily='EBEAEA';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='73';
theSitetree.graphicsetId='88';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='F5F5F5';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Galerie',
				paletteFamily: 	'EBEAEA',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'73',
				graphicsetId: 	'88',
				contentColor: 	'666666',
				contentBGColor: 'F5F5F5',
				a_color: 		'EBEAEA',
				b_color: 		'666666',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1009']=webappMappings['1009-5285242']={
webappId:    '1009',
documentId:  '37327',
internalId:  '5285242',
customField: 'isFollowupPage:true;documentId:9352;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25226',
internalId:  '',
customField: '20100510-112819'
};
webappMappings['1009']=webappMappings['1009-5195949']={
webappId:    '1009',
documentId:  '32004',
internalId:  '5195949',
customField: 'isFollowupPage:true;documentId:31750;'
};
webappMappings['7008']=webappMappings['7008-3923']={
webappId:    '7008',
documentId:  '9352',
internalId:  '3923',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4520',
internalId:  '',
customField: '20100718-212552'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '64497',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10921',
internalId:  '',
customField: '20100318-115437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9271',
internalId:  '',
customField: '20100320-133550'
};
webappMappings['1501']=webappMappings['1501-1637161']={
webappId:    '1501',
documentId:  '4520',
internalId:  '1637161',
customField: '1501'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4520',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-3922']={
webappId:    '7008',
documentId:  '31750',
internalId:  '3922',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75163',
internalId:  '',
customField: '20100320-122900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75154',
internalId:  '',
customField: '20100320-122555'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31750',
internalId:  '',
customField: '20081103-000359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32004',
internalId:  '',
customField: '20050325-092053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59743',
internalId:  '',
customField: '20100320-135027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9379',
internalId:  '',
customField: '20100320-134027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64497',
internalId:  '',
customField: '20100320-134045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9352',
internalId:  '',
customField: '20050410-180552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37327',
internalId:  '',
customField: '20050410-180504'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXETJ';
var companyName   = 'M%C3%84DER-REISEN';
var htmlTitle	  = '';
var metaKeywords  = 'Carreisen%2C+Busreisen%2C+Schulreisen%2C+Vereinsreisen%2C+Jahresprogramm%2C+Jasswochenende%2C+Jassfahrten%2C+Nordkapreise%2C+Nordkap%2C+Reisecar%2C+Salzkammergut%2C+Gardasee+Sommer%2C+Fr%C3%BChling%2C+Herbst%2C+Albert+M%C3%A4der%2C+Meiringen%2C+Bergsteigertaxi%2C+Grimsel%2C+Stauseen%2C+Susten%2C+Rosenlaui%2C+SCB';
var metaContents  = 'M%C3%A4der-Reisen+Reisen+Meiringen+Busreisen+Carreisen+Reiseprogramm+Auslandreisen+Vereinsreisen+Jahresprogramm+Reiseorganisation+Hochzeitsfahrten+Schlittelfahrten+Nordkap';
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();
};
