/* [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','301',jdecode('Home'),jdecode(''),'/301.html','true',[],'',''],
	['PAGE','127390',jdecode('Unser+Gesch%C3%A4ft'),jdecode(''),'/127390.html','true',[],'',''],
	['PAGE','90190',jdecode('NEWS'),jdecode(''),'/90190.html','true',[],'',''],
	['PAGE','1501',jdecode('MOTONICA'),jdecode(''),'/1501/index.html','true',[ 
		['PAGE','1522',jdecode('1%2F8'),jdecode(''),'/1501/1522.html','true',[],'',''],
		['PAGE','128290',jdecode('Electron'),jdecode(''),'/1501/128290.html','true',[],'',''],
		['PAGE','1564',jdecode('classic'),jdecode(''),'/1501/1564.html','true',[],'','']
	],'',''],
	['PAGE','159701',jdecode('Test+Motonica+P8F'),jdecode(''),'/159701.html','true',[],'',''],
	['PAGE','12485',jdecode('Team+MOTONICA'),jdecode(''),'/12485.html','true',[],'',''],
	['PAGE','89090',jdecode('TEAM+TITAN'),jdecode(''),'/89090.html','true',[],'',''],
	['PAGE','1711',jdecode('Produkte'),jdecode(''),'/1711.html','true',[],'',''],
	['PAGE','6064',jdecode('Motoren%2CTreibstoff'),jdecode(''),'/6064/index.html','true',[ 
		['PAGE','114890',jdecode('ORION'),jdecode(''),'/6064/114890.html','true',[],'',''],
		['PAGE','6106',jdecode('Novarossi'),jdecode(''),'/6064/6106.html','true',[],'',''],
		['PAGE','36301',jdecode('MAX+Power'),jdecode(''),'/6064/36301.html','true',[],'',''],
		['PAGE','6127',jdecode('Jet%26%23x27%3Bs+'),jdecode(''),'/6064/6127.html','true',[],'','']
	],'',''],
	['PAGE','121690',jdecode('Rennkalender+1%2F8'),jdecode(''),'/121690.html','true',[],'',''],
	['PAGE','139890',jdecode('1.V8+Lostallo'),jdecode(''),'/139890.html','true',[],'',''],
	['PAGE','148090',jdecode('2.V8+Aigle'),jdecode(''),'/148090.html','true',[],'',''],
	['PAGE','152501',jdecode('3.V8+Schaffhausen'),jdecode(''),'/152501.html','true',[],'',''],
	['PAGE','161001',jdecode('4.V8+Sitterdorf'),jdecode(''),'/161001.html','true',[],'',''],
	['PAGE','163801',jdecode('5.V8+Oey-Diemtigen'),jdecode(''),'/163801.html','true',[],'',''],
	['PAGE','156801',jdecode('A-EM+Locorotondo'),jdecode(''),'/156801.html','true',[],'',''],
	['PAGE','160901',jdecode('4.+SM+E10+TC'),jdecode(''),'/160901.html','true',[],'',''],
	['PAGE','6843',jdecode('Kontakt'),jdecode(''),'/6843/index.html','true',[ 
		['PAGE','12401',jdecode('Oeffnungszeiten'),jdecode(''),'/6843/12401.html','true',[],'','']
	],'',''],
	['PAGE','35601',jdecode('Info'),jdecode(''),'/35601.html','true',[],'',''],
	['PAGE','65590',jdecode('Aktionen'),jdecode(''),'/65590.html','true',[],'',''],
	['PAGE','135790',jdecode('LACHPARADE'),jdecode(''),'/135790.html','true',[],'','']];
var siteelementCount=29;
theSitetree.topTemplateName='Orbit';
theSitetree.paletteFamily='003366';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='172';
theSitetree.graphicsetId='202';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='003366';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Orbit',
				paletteFamily: 	'003366',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'172',
				graphicsetId: 	'202',
				contentColor: 	'FFFFFF',
				contentBGColor: '003366',
				a_color: 		'003366',
				b_color: 		'336699',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20100808-193236'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1501',
internalId:  '',
customField: '20100226-143812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1522',
internalId:  '',
customField: '20100831-102824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '128290',
internalId:  '',
customField: '20100831-102620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1564',
internalId:  '',
customField: '20100226-152022'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12485',
internalId:  '',
customField: '20100831-151411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '163801',
internalId:  '',
customField: '20100830-174413'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1711',
internalId:  '',
customField: '20100831-151629'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156801',
internalId:  '',
customField: '20100707-175842'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '139890',
internalId:  '',
customField: '20100422-073213'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6064',
internalId:  '',
customField: '20100226-152852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6106',
internalId:  '',
customField: '20090521-123935'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36301',
internalId:  '',
customField: '20090424-130248'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6127',
internalId:  '',
customField: '20100831-151710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '121690',
internalId:  '',
customField: '20100601-095217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '114890',
internalId:  '',
customField: '20091222-115138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6843',
internalId:  '',
customField: '20100427-113648'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12401',
internalId:  '',
customField: '20100427-113621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '152501',
internalId:  '',
customField: '20100622-183851'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35601',
internalId:  '',
customField: '20100413-112611'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65590',
internalId:  '',
customField: '20100808-193634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '159701',
internalId:  '',
customField: '20100804-160133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '160901',
internalId:  '',
customField: '20100825-091929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '161001',
internalId:  '',
customField: '20100824-103945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '148090',
internalId:  '',
customField: '20100510-175936'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '89090',
internalId:  '',
customField: '20100831-151323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90190',
internalId:  '',
customField: '20100804-160734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '127390',
internalId:  '',
customField: '20100831-102332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '135790',
internalId:  '',
customField: '20100824-102300'
};
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'AHOPT0IN3FY4';
var companyName   = 'modellbau+lackner';
var htmlTitle	  = '';
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();
};
