/* [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','1601',jdecode('Start'),jdecode(''), jdecode('%2F1601.html'), 'true',[],'',''],
	['PAGE','94734',jdecode('Elektroauto+Occasionen'),jdecode(''), jdecode('%2F94734.html'), 'true',[],'',''],
	['PAGE','22064',jdecode('Twike'),jdecode(''), jdecode('%2F22064%2Findex.html'), 'true',[ 
		['PAGE','100534',jdecode('Sport+Edition'),jdecode(''), jdecode('%2F22064%2F100534.html'), 'true',[],'',''],
		['PAGE','57212',jdecode('Elektrischer+Antrieb'),jdecode(''), jdecode('%2F22064%2F57212.html'), 'true',[],'',''],
		['PAGE','58812',jdecode('Human+Power'),jdecode(''), jdecode('%2F22064%2F58812.html'), 'true',[],'',''],
		['PAGE','59112',jdecode('Spaceframe'),jdecode(''), jdecode('%2F22064%2F59112.html'), 'true',[],'',''],
		['PAGE','59412',jdecode('Technische+Daten'),jdecode(''), jdecode('%2F22064%2F59412.html'), 'true',[],'',''],
		['PAGE','44312',jdecode('Preise'),jdecode(''), jdecode('%2F22064%2F44312.html'), 'true',[],'',''],
		['PAGE','53112',jdecode('Akkus'),jdecode(''), jdecode('%2F22064%2F53112.html'), 'true',[],'',''],
		['PAGE','54412',jdecode('Zubeh%C3%B6r'),jdecode(''), jdecode('%2F22064%2F54412.html'), 'false',[],'','']
	],'',''],
	['PAGE','62312',jdecode('TWIKE-Occasionen'),jdecode(''), jdecode('%2F62312%2Findex.html'), 'true',[ 
		['PAGE','79023',jdecode('TWIKE+Updates'),jdecode(''), jdecode('%2F62312%2F79023.html'), 'false',[],'','']
	],'',''],
	['PAGE','93534',jdecode('Occasion-Akku'),jdecode(''), jdecode('%2F93534.html'), 'true',[],'',''],
	['PAGE','78823',jdecode('TWIKE+Beleuchtung'),jdecode(''), jdecode('%2F78823.html'), 'true',[],'',''],
	['PAGE','13122',jdecode('Kamoo'),jdecode(''), jdecode('%2F13122%2Findex.html'), 'true',[ 
		['PAGE','85023',jdecode('500-220i%2Fc'),jdecode(''), jdecode('%2F13122%2F85023.html'), 'true',[],'',''],
		['PAGE','22001',jdecode('Twingo'),jdecode(''), jdecode('%2F13122%2F22001.html'), 'true',[],'',''],
		['PAGE','22043',jdecode('500'),jdecode(''), jdecode('%2F13122%2F22043.html'), 'true',[],'',''],
		['PAGE','22022',jdecode('Panda'),jdecode(''), jdecode('%2F13122%2F22022.html'), 'false',[],'',''],
		['PAGE','22301',jdecode('Probefahrt'),jdecode(''), jdecode('%2F13122%2F22301.html'), 'true',[],'',''],
		['PAGE','60412',jdecode('Preise'),jdecode(''), jdecode('%2F13122%2F60412.html'), 'true',[],'',''],
		['PAGE','61312',jdecode('Mietpreise+eBattery'),jdecode(''), jdecode('%2F13122%2F61312.html'), 'true',[],'','']
	],'',''],
	['PAGE','64412',jdecode('Mega'),jdecode(''), jdecode('%2F64412.html'), 'false',[],'',''],
	['PAGE','64433',jdecode('MEGA+e-City'),jdecode(''), jdecode('%2F64433%2Findex.html'), 'false',[ 
		['PAGE','64454',jdecode('Multitruck'),jdecode(''), jdecode('%2F64433%2F64454.html'), 'true',[],'','']
	],'',''],
	['PAGE','62012',jdecode('Steck-Mobil'),jdecode(''), jdecode('%2F62012.html'), 'false',[],'',''],
	['PAGE','22085',jdecode('BionX'),jdecode(''), jdecode('%2F22085%2Findex.html'), 'true',[ 
		['PAGE','29401',jdecode('Die+Systeme'),jdecode(''), jdecode('%2F22085%2F29401.html'), 'false',[],'',''],
		['PAGE','83323',jdecode('Die+BionX+Systeme'),jdecode(''), jdecode('%2F22085%2F83323.html'), 'true',[],'',''],
		['PAGE','29422',jdecode('Die+Komponenten'),jdecode(''), jdecode('%2F22085%2F29422.html'), 'true',[],'',''],
		['PAGE','30801',jdecode('BionX+Fahrr%C3%A4der'),jdecode(''), jdecode('%2F22085%2F30801.html'), 'true',[],'','']
	],'',''],
	['PAGE','22106',jdecode('Gepida'),jdecode(''), jdecode('%2F22106%2Findex.html'), 'true',[ 
		['PAGE','32601',jdecode('Reptila+900'),jdecode(''), jdecode('%2F22106%2F32601.html'), 'true',[],'',''],
		['PAGE','32201',jdecode('Reptila+1000'),jdecode(''), jdecode('%2F22106%2F32201.html'), 'true',[],'','']
	],'',''],
	['PAGE','36101',jdecode('Occasionen'),jdecode(''), jdecode('%2F36101%2Findex.html'), 'false',[ 
		['PAGE','41412',jdecode('Akkus'),jdecode(''), jdecode('%2F36101%2F41412.html'), 'false',[],'','']
	],'',''],
	['PAGE','13269',jdecode('Werkstatt'),jdecode(''), jdecode('%2F13269.html'), 'true',[],'',''],
	['PAGE','13248',jdecode('Verkauf'),jdecode(''), jdecode('%2F13248.html'), 'true',[],'',''],
	['PAGE','34101',jdecode('Kontakt'),jdecode(''), jdecode('%2F34101.html'), 'true',[],'',''],
	['PAGE','34301',jdecode('Anfahrt'),jdecode(''), jdecode('%2F34301%2Findex.html'), 'true',[ 
		['PAGE','34601',jdecode('Routenplaner'),jdecode(''), jdecode('%2F34301%2F34601.html'), 'true',[],'','']
	],'',''],
	['PAGE','43012',jdecode('Wetter'),jdecode(''), jdecode('%2F43012.html'), 'false',[],'',''],
	['PAGE','39312',jdecode('Links'),jdecode(''), jdecode('%2F39312.html'), 'true',[],'','']];
var siteelementCount=44;
theSitetree.topTemplateName='Champagne';
theSitetree.paletteFamily='426388';
theSitetree.keyvisualId='11358';
theSitetree.keyvisualName='kv_11358.jpg';
theSitetree.fontsetId='31943';
theSitetree.graphicsetId='13786';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='426388';
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: 			'Champagne',
				paletteFamily: 	'426388',
				keyvisualId: 	'11358',
				keyvisualName: 	'kv_11358.jpg',
				fontsetId: 		'31943',
				graphicsetId: 	'13786',
				contentColor: 	'000000',
				contentBGColor: '426388',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1601',
internalId:  '',
customField: '20100127-081139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22064',
internalId:  '',
customField: '20100218-135954'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13122',
internalId:  '',
customField: '20110714-170746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22085',
internalId:  '',
customField: '20091124-150736'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22001',
internalId:  '',
customField: '20111221-151437'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22301',
internalId:  '',
customField: '20100211-152048'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85023',
internalId:  '',
customField: '20110509-094948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30801',
internalId:  '',
customField: '20110509-103036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13248',
internalId:  '',
customField: '20110712-092926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13269',
internalId:  '',
customField: '20091019-150037'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1601',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22022',
internalId:  '',
customField: '20101221-153554'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22043',
internalId:  '',
customField: '20110509-094539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29401',
internalId:  '',
customField: '20100611-151409'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29422',
internalId:  '',
customField: '20091116-115411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22106',
internalId:  '',
customField: '20091210-174844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32201',
internalId:  '',
customField: '20091117-145335'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32601',
internalId:  '',
customField: '20091117-145505'
};
webappMappings['7008']=webappMappings['7008-8095']={
webappId:    '7008',
documentId:  '34101',
internalId:  '8095',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34101',
internalId:  '',
customField: '20110712-092840'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '34301',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34301',
internalId:  '',
customField: '20091117-151438'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '34601',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34601',
internalId:  '',
customField: '20100118-090401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60412',
internalId:  '',
customField: '20110509-095513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36101',
internalId:  '',
customField: '20101008-103807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39312',
internalId:  '',
customField: '20110106-154528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41412',
internalId:  '',
customField: '20101012-145240'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43012',
internalId:  '',
customField: '20100118-083131'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '44312',
internalId:  '',
customField: '20111124-083217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '78823',
internalId:  '',
customField: '20110714-170602'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '53112',
internalId:  '',
customField: '20111123-145839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '54412',
internalId:  '',
customField: '20100126-164037'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57212',
internalId:  '',
customField: '20100218-134859'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58812',
internalId:  '',
customField: '20100218-140519'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59112',
internalId:  '',
customField: '20100218-141157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59412',
internalId:  '',
customField: '20100218-151216'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61312',
internalId:  '',
customField: '20110509-095812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62012',
internalId:  '',
customField: '20100405-135830'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62312',
internalId:  '',
customField: '20120213-100432'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '83323',
internalId:  '',
customField: '20110509-100953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64412',
internalId:  '',
customField: '20100617-205835'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64433',
internalId:  '',
customField: '20110301-225309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64454',
internalId:  '',
customField: '20100421-231839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '79023',
internalId:  '',
customField: '20110119-102146'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '93534',
internalId:  '-',
customField: '20111130-151241'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '94734',
internalId:  '-',
customField: '20120215-103042'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '100534',
internalId:  '-',
customField: '20120221-151555'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INEGMO';
var companyName   = 'M%C3%B6ckli+Elektrofahrzeuge';
var htmlTitle	  = 'M%C3%B6ckli+Elektrofahrzeuge+-+Verkauf%2C+Service+und+Unterhalt+von+Elektrofahrzeugen%2C+TWIKE%2C+Elektrofahrr%C3%A4der%2C+Zubeh%C3%B6r+usw.';
var metaKeywords  = 'Twike%2C+Twike+Occasion%2C+Occasion+Twike%2C+BionX%2C+Gepida%2C+Reptila%2C+Mes-Dea%2C+MES-D.E.A.%2C+Zebra%2C+Lithium%2C+LiFePO4%2C+Twingo%2C+Panda%2C+500%2C+Elektrofahrzeug%2C+Elektrofahrzeuge%2C+Elektroauto%2C+Elektrovelo%2C+Elektrofahrrad%2C+Flayer%2C+Akku%2C+Solar%2C+Energie%2C+Strom%2C+Volt%2C+Spannung%2C+Elektro%2C+Elektra%2C+PL-250%2C+PL-250HT%2C+PL-500HS%2C';
var metaContents  = 'M%C3%B6ckli+Elektrofahrzeuge+-+Verkauf%2C+Service+und+Unterhalt+von+Elektrofahrzeugen%2C+TWIKE+Elektrofahrr%C3%A4der%2C+Zubeh%C3%B6r+usw.';
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();
};

