/* [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','88582',jdecode('Home'),jdecode(''),'/88582.html','true',[],'',''],
	['PAGE','4589',jdecode('Aktuelles'),jdecode(''),'/4589/index.html','true',[ 
		['PAGE','82981',jdecode('Racing+4+Fun'),jdecode(''),'/4589/82981.html','true',[],'',''],
		['PAGE','4643',jdecode('Termine+racing'),jdecode(''),'/4589/4643.html','true',[],'','']
	],'',''],
	['PAGE','87774',jdecode('Honda+Moto'),jdecode(''),'/87774.html','true',[],'',''],
	['PAGE','87783',jdecode('Fahrr%C3%A4der'),jdecode(''),'/87783.html','true',[],'',''],
	['PAGE','87792',jdecode('Forst+und+Garten'),jdecode(''),'/87792.html','true',[],'',''],
	['PAGE','87801',jdecode('Mofa'),jdecode(''),'/87801.html','true',[],'',''],
	['PAGE','74523',jdecode('Vermietung'),jdecode(''),'/74523.html','true',[],'',''],
	['PAGE','74754',jdecode('Occasionen'),jdecode(''),'/74754.html','true',[],'',''],
	['PAGE','74050',jdecode('Infos'),jdecode(''),'/74050/index.html','true',[ 
		['PAGE','4670',jdecode('Email'),jdecode(''),'/74050/4670.html','true',[],'',''],
		['PAGE','39810',jdecode('Ihr+Weg+zu+uns'),jdecode(''),'/74050/39810.html','true',[],'',''],
		['PAGE','39840',jdecode('Anfahrt'),jdecode(''),'/74050/39840.html','true',[],'',''],
		['PAGE','4535',jdecode('Team'),jdecode(''),'/74050/4535.html','true',[],'',''],
		['PAGE','4478',jdecode('Willkommen'),jdecode(''),'/74050/4478.html','false',[],'','']
	],'',''],
	['PAGE','88867',jdecode('Stellenangebot'),jdecode(''),'/88867.html','true',[],'',''],
	['PAGE','39550',jdecode('G%C3%A4stebuch'),jdecode(''),'/39550.html','true',[],'',''],
	['PAGE','78923',jdecode('Links'),jdecode(''),'/78923.html','true',[],'','']];
var siteelementCount=19;
theSitetree.topTemplateName='Deepcolor';
theSitetree.paletteFamily='F9F6BC';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10349';
theSitetree.graphicsetId='10472';
theSitetree.contentColor='A00000';
theSitetree.contentBGColor='FDEE91';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Deepcolor',
				paletteFamily: 	'F9F6BC',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10349',
				graphicsetId: 	'10472',
				contentColor: 	'A00000',
				contentBGColor: 'FDEE91',
				a_color: 		'F9F6BC',
				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['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '88582',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-39550ABW0X0INXX0R']={
webappId:    '1002',
documentId:  '39550',
internalId:  '39550ABW0X0INXX0R',
customField: 'icq=false'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '39810',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '39840',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88582',
internalId:  '',
customField: '20100626-210337'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4589',
internalId:  '',
customField: '20100310-203954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4478',
internalId:  '',
customField: '20081203-215710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82981',
internalId:  '',
customField: '20090321-231255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4643',
internalId:  '',
customField: '20100310-205247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88867',
internalId:  '',
customField: '20091230-140047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87801',
internalId:  '',
customField: '20090311-214342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74523',
internalId:  '',
customField: '20090314-163111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74754',
internalId:  '',
customField: '20090314-162746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39810',
internalId:  '',
customField: '20060313-222428'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39840',
internalId:  '',
customField: '20060313-221247'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4535',
internalId:  '',
customField: '20091230-140903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4670',
internalId:  '',
customField: '20081110-155913'
};
webappMappings['7008']=webappMappings['7008-2433']={
webappId:    '7008',
documentId:  '4670',
internalId:  '2433',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74050',
internalId:  '',
customField: '20071009-100342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39550',
internalId:  '',
customField: '20060211-224419'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78923',
internalId:  '',
customField: '20090318-205854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87774',
internalId:  '',
customField: '20090310-225153'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87792',
internalId:  '',
customField: '20090311-214035'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '87783',
internalId:  '',
customField: '20090311-213634'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXX0R';
var companyName   = 'Mit+vollem+Einsatz+f%C3%BCr+Sie';
var htmlTitle	  = 'Meyer+Zweiradsport';
var metaKeywords  = '';
var metaContents  = 'Honda+Motorr%EF%BF%BDder+Motorrad+Roller+Rasenm%EF%BF%BDher+Motors%EF%BF%BDgen+Stihl+Velo+Mountainbikes+Fahrr%EF%BF%BDder+TDS+Tour+de+Suisse+Stevens+Power+Produkte';
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();
};
