/* [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','4518',jdecode('Home'),jdecode(''),'/4518.html','true',[],'',''],
	['PAGE','96801',jdecode('News'),jdecode(''),'/96801.html','true',[],'',''],
	['PAGE','185801',jdecode('Berichte'),jdecode(''),'/185801.html','true',[],'',''],
	['PAGE','183601',jdecode('Renntermine'),jdecode(''),'/183601.html','true',[],'',''],
	['PAGE','9551',jdecode('Piloten'),jdecode(''),'/9551/index.html','true',[ 
		['PAGE','45803',jdecode('Levin'),jdecode(''),'/9551/45803.html','true',[],'',''],
		['PAGE','4602',jdecode('Severin'),jdecode(''),'/9551/4602.html','true',[],'',''],
		['PAGE','4629',jdecode('Jesina'),jdecode(''),'/9551/4629.html','true',[],'','']
	],'',''],
	['PAGE','9632',jdecode('Fotos'),jdecode(''),'/9632.html','true',[],'',''],
	['PAGE','42518',jdecode('Sponsoren'),jdecode(''),'/42518.html','true',[],'',''],
	['PAGE','156301',jdecode('Presse'),jdecode(''),'/156301.html','true',[],'',''],
	['PAGE','34352',jdecode('Links'),jdecode(''),'/34352/index.html','true',[ 
		['PAGE','4945',jdecode('Eintr%C3%A4ge'),jdecode(''),'/34352/4945.html','false',[],'','']
	],'',''],
	['PAGE','59764',jdecode('Archiv'),jdecode(''),'/59764/index.html','true',[ 
		['PAGE','189601',jdecode('News+2009'),jdecode(''),'/59764/189601.html','true',[],'',''],
		['PAGE','139001',jdecode('Berichte+2009'),jdecode(''),'/59764/139001.html','true',[],'',''],
		['PAGE','135401',jdecode('Dates+2009'),jdecode(''),'/59764/135401.html','true',[],'',''],
		['PAGE','139022',jdecode('Ranking+2009'),jdecode(''),'/59764/139022.html','true',[],'',''],
		['PAGE','135422',jdecode('News+2008'),jdecode(''),'/59764/135422.html','true',[],'',''],
		['PAGE','96201',jdecode('Rennberichte+2008'),jdecode(''),'/59764/96201.html','true',[],'',''],
		['PAGE','88801',jdecode('Termine+2008'),jdecode(''),'/59764/88801.html','true',[],'',''],
		['PAGE','96222',jdecode('Ranglisten+2008'),jdecode(''),'/59764/96222.html','true',[],'',''],
		['PAGE','9524',jdecode('News+2007'),jdecode(''),'/59764/9524.html','true',[],'',''],
		['PAGE','59755',jdecode('Rennberichte+2007'),jdecode(''),'/59764/59755.html','true',[],'',''],
		['PAGE','65377',jdecode('Ranglisten+2007'),jdecode(''),'/59764/65377.html','true',[],'',''],
		['PAGE','41043',jdecode('Rennberichte+2006'),jdecode(''),'/59764/41043.html','true',[],'',''],
		['PAGE','40418',jdecode('Rennberichte+2005'),jdecode(''),'/59764/40418.html','true',[],'','']
	],'',''],
	['PAGE','4656',jdecode('Kontakt'),jdecode(''),'/4656/index.html','true',[ 
		['PAGE','32488',jdecode('Kontakt+%28Form+followup+page%29'),jdecode(''),'/4656/32488.html','false',[],'','']
	],'',''],
	['PAGE','4944',jdecode('G%C3%A4stebuch'),jdecode(''),'/4944.html','true',[],'','']];
var siteelementCount=30;
theSitetree.topTemplateName='Startup';
theSitetree.paletteFamily='000066';
theSitetree.keyvisualId='1344';
theSitetree.keyvisualName='sektflasche.jpg';
theSitetree.fontsetId='235';
theSitetree.graphicsetId='292';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Startup',
				paletteFamily: 	'000066',
				keyvisualId: 	'1344',
				keyvisualName: 	'sektflasche.jpg',
				fontsetId: 		'235',
				graphicsetId: 	'292',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000066',
				b_color: 		'666666',
				c_color: 		'000000',
				d_color: 		'FF0000',
				e_color: 		'FF0000',
				f_color: 		'FF0000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4518',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '139001',
internalId:  '',
customField: '20091204-092459'
};
webappMappings['1002']=webappMappings['1002-4944ABW0X0INXXB0']={
webappId:    '1002',
documentId:  '4944',
internalId:  '4944ABW0X0INXXB0',
customField: 'icq=false'
};
webappMappings['1009']=webappMappings['1009-5929233']={
webappId:    '1009',
documentId:  '32488',
internalId:  '5929233',
customField: 'isFollowupPage:true;documentId:4656;'
};
webappMappings['1501']=webappMappings['1501-783204']={
webappId:    '1501',
documentId:  '4518',
internalId:  '783204',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-21']={
webappId:    '7008',
documentId:  '4656',
internalId:  '21',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4518',
internalId:  '',
customField: '20100902-180945'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96801',
internalId:  '',
customField: '20100906-105100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '139022',
internalId:  '',
customField: '20091204-092749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '135401',
internalId:  '',
customField: '20090701-202444'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9551',
internalId:  '',
customField: '20100425-181001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45803',
internalId:  '',
customField: '20100412-204927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4602',
internalId:  '',
customField: '20091218-202402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4629',
internalId:  '',
customField: '20091218-203002'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9632',
internalId:  '',
customField: '20100907-183758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42518',
internalId:  '',
customField: '20100425-180807'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34352',
internalId:  '',
customField: '20100902-180535'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59764',
internalId:  '',
customField: '20100902-180559'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '135422',
internalId:  '',
customField: '20081203-170918'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96222',
internalId:  '',
customField: '20081025-085135'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '96201',
internalId:  '',
customField: '20081126-191220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '88801',
internalId:  '',
customField: '20080414-114351'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9524',
internalId:  '',
customField: '20080102-145001'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '59755',
internalId:  '',
customField: '20071215-181843'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '65377',
internalId:  '',
customField: '20071119-101412'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41043',
internalId:  '',
customField: '20080107-142906'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40418',
internalId:  '',
customField: '20070612-171937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4656',
internalId:  '',
customField: '20100902-180855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32488',
internalId:  '',
customField: '20051024-225026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4944',
internalId:  '',
customField: '20051018-162911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4945',
internalId:  '',
customField: '20051018-162911'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156301',
internalId:  '',
customField: '20100907-182948'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '183601',
internalId:  '',
customField: '20100425-181028'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '185801',
internalId:  '',
customField: '20100907-182853'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '189601',
internalId:  '',
customField: '20100102-195741'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXXB0';
var companyName   = 'AMWEG+RACING';
var htmlTitle	  = '';
var metaKeywords  = 'Levin+Severin+Jesina+Amweg+Kart+ROK+Cup+ASS+Schweizermeisterschaft+Swiss+Kart++Resultate+Fahrer+lista+office+LO+Tony+Vortex+LKT+KF3+verkaufen+Material+Formel+Renault+2.0+Fredy+Lienhard+Nachwuchstalent+Talent+Motorsport';
var metaContents  = 'Levin+und+Severin+Amweg%2C+Kart+Racing+Team%2C+fahren+Tony+Chassis+und+Vortex++Motoren+und+bestreiten+die+Schweizermeisterschaft+%28SM%29+und+den+LO+lista+office+ROK+Cup.';
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();
};
