/* [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','501',jdecode('Home'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','552',jdecode('Wer+bin+Ich'),jdecode(''), jdecode('%2F552.html'), 'true',[],'',''],
	['PAGE','30301',jdecode('Verkauf+Elektroroller'),jdecode(''), jdecode('%2F30301%2Findex.html'), 'true',[ 
		['PAGE','45701',jdecode('Alpha+1500+W'),jdecode(''), jdecode('%2F30301%2F45701.html'), 'true',[],'',''],
		['PAGE','45722',jdecode('Bravo+1500+W'),jdecode(''), jdecode('%2F30301%2F45722.html'), 'true',[],'',''],
		['PAGE','73201',jdecode('Delta+1500W'),jdecode(''), jdecode('%2F30301%2F73201.html'), 'true',[],'',''],
		['PAGE','45601',jdecode('Cemoto+Sprinter+'),jdecode(''), jdecode('%2F30301%2F45601.html'), 'true',[],'','']
	],'',''],
	['PAGE','76301',jdecode('Verkauf+E-Bikes'),jdecode(''), jdecode('%2F76301.html'), 'true',[],'',''],
	['PAGE','75601',jdecode('WATT%26%23x27%3BS'),jdecode(''), jdecode('%2F75601%2Findex.html'), 'true',[ 
		['PAGE','82601',jdecode('Swing'),jdecode(''), jdecode('%2F75601%2F82601.html'), 'true',[],'',''],
		['PAGE','82622',jdecode('Swing+LDT'),jdecode(''), jdecode('%2F75601%2F82622.html'), 'true',[],'',''],
		['PAGE','82643',jdecode('Tango'),jdecode(''), jdecode('%2F75601%2F82643.html'), 'true',[],'',''],
		['PAGE','82664',jdecode('Swisspulse'),jdecode(''), jdecode('%2F75601%2F82664.html'), 'true',[],'',''],
		['PAGE','82685',jdecode('Mamba'),jdecode(''), jdecode('%2F75601%2F82685.html'), 'true',[],'',''],
		['PAGE','82706',jdecode('Eco'),jdecode(''), jdecode('%2F75601%2F82706.html'), 'true',[],'',''],
		['PAGE','82727',jdecode('Mini-Move'),jdecode(''), jdecode('%2F75601%2F82727.html'), 'true',[],'','']
	],'',''],
	['PAGE','40201',jdecode('Unser+Service'),jdecode(''), jdecode('%2F40201%2Findex.html'), 'true',[ 
		['PAGE','40222',jdecode('Reparatur'),jdecode(''), jdecode('%2F40201%2F40222.html'), 'true',[],'',''],
		['PAGE','40243',jdecode('Probefahrt'),jdecode(''), jdecode('%2F40201%2F40243.html'), 'true',[],'','']
	],'',''],
	['PAGE','28401',jdecode('Zu+verkaufen'),jdecode(''), jdecode('%2F28401.html'), 'true',[],'',''],
	['PAGE','5706',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F5706%2Findex.html'), 'true',[ 
		['PAGE','5701',jdecode('Eintr%C3%A4ge'),jdecode(''), jdecode('%2F5706%2F5701.html'), 'false',[],'','']
	],'',''],
	['PAGE','678',jdecode('Kontakt'),jdecode(''), jdecode('%2F678.html'), 'true',[],'',''],
	['PAGE','71801',jdecode('So+finden+Sie+uns'),jdecode(''), jdecode('%2F71801.html'), 'true',[],'',''],
	['PAGE','71601',jdecode('Lustiges'),jdecode(''), jdecode('%2F71601.html'), 'true',[],'',''],
	['PAGE','10301',jdecode('Interessante+Links'),jdecode(''), jdecode('%2F10301.html'), 'true',[],'','']];
var siteelementCount=26;
theSitetree.topTemplateName='Enjoy';
theSitetree.paletteFamily='93A6CC';
theSitetree.keyvisualId='2224';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='366';
theSitetree.graphicsetId='415';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='93A6CC';
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: 			'Enjoy',
				paletteFamily: 	'93A6CC',
				keyvisualId: 	'2224',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'366',
				graphicsetId: 	'415',
				contentColor: 	'000000',
				contentBGColor: '93A6CC',
				a_color: 		'93A6CC',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-5706abw1x0ine5lh']={
webappId:    '1002',
documentId:  '5706',
internalId:  '5706abw1x0ine5lh',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20110429-113031'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20091215-224119'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30301',
internalId:  '',
customField: '20100926-004946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40201',
internalId:  '',
customField: '20091216-020516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82622',
internalId:  '',
customField: '20110429-112452'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45601',
internalId:  '',
customField: '20091215-225340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40243',
internalId:  '',
customField: '20091216-020646'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40222',
internalId:  '',
customField: '20091120-231453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5706',
internalId:  '',
customField: '20091120-232245'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5701',
internalId:  '',
customField: '20080414-112158'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '678',
internalId:  '',
customField: '20091215-225741'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28401',
internalId:  '',
customField: '20110320-155310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10301',
internalId:  '',
customField: '20101210-173012'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45701',
internalId:  '',
customField: '20091215-224301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45722',
internalId:  '',
customField: '20091215-224527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82601',
internalId:  '',
customField: '20110429-112608'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71601',
internalId:  '',
customField: '20091216-010002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '71801',
internalId:  '',
customField: '20091216-223751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '73201',
internalId:  '',
customField: '20091216-014027'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '71801',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '75601',
internalId:  '',
customField: '20110405-221959'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '76301',
internalId:  '',
customField: '20100329-231055'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82643',
internalId:  '',
customField: '20110429-112421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82664',
internalId:  '',
customField: '20110429-112336'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82685',
internalId:  '',
customField: '20110429-112307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82706',
internalId:  '',
customField: '20110429-112218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '82727',
internalId:  '',
customField: '20110429-112143'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW1X0INE5LH';
var companyName   = 'Strupi%27s+Schrauberecke';
var htmlTitle	  = 'Strupis+Schrauberecke';
var metaKeywords  = '';
var metaContents  = '';
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();
};

