/* [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(''),'/501.html','true',[],'',''],
	['PAGE','552',jdecode('%C3%9Cber+uns'),jdecode(''),'/552.html','true',[],'',''],
	['PAGE','573',jdecode('Unser+Team'),jdecode(''),'/573.html','true',[],'',''],
	['PAGE','5548',jdecode('G%C3%A4stebuch'),jdecode(''),'/5548/index.html','true',[ 
		['PAGE','5543',jdecode('Eintr%C3%A4ge'),jdecode(''),'/5548/5543.html','false',[],'','']
	],'',''],
	['PAGE','171301',jdecode('Saison+2010'),jdecode(''),'/171301/index.html','true',[ 
		['PAGE','37801',jdecode('Renndaten'),jdecode(''),'/171301/37801.html','true',[],'',''],
		['PAGE','181101',jdecode('Freiburg+%28D%29'),jdecode(''),'/171301/181101.html','true',[],'',''],
		['PAGE','178201',jdecode('Bi%C3%A8re+22.05-23.05.'),jdecode(''),'/171301/178201.html','true',[],'',''],
		['PAGE','177301',jdecode('Saisonstart+Bure%2FB%C3%BCrglen'),jdecode(''),'/171301/177301.html','true',[],'',''],
		['PAGE','171322',jdecode('Bilder+Training+27.2.10'),jdecode(''),'/171301/171322.html','true',[],'',''],
		['PAGE','173901',jdecode('Turin+01.04-05.04'),jdecode(''),'/171301/173901.html','true',[],'',''],
		['PAGE','181601',jdecode('Eschenbach+26.06-27.06'),jdecode(''),'/171301/181601.html','true',[],'',''],
		['PAGE','181622',jdecode('Villars+s.+Ecot+03.07-04.07'),jdecode(''),'/171301/181622.html','true',[],'',''],
		['PAGE','185391',jdecode('Bettwil+07.-08.08'),jdecode(''),'/171301/185391.html','true',[],'','']
	],'',''],
	['PAGE','145001',jdecode('Bilder+2009'),jdecode(''),'/145001.html','true',[],'',''],
	['PAGE','125901',jdecode('Bilder+2008'),jdecode(''),'/125901.html','true',[],'',''],
	['PAGE','129601',jdecode('Bilder+2007'),jdecode(''),'/129601.html','true',[],'',''],
	['PAGE','17301',jdecode('Kontakt'),jdecode(''),'/17301/index.html','true',[ 
		['PAGE','17322',jdecode('Standort+Werkstatt'),jdecode(''),'/17301/17322.html','true',[],'','']
	],'',''],
	['PAGE','10701',jdecode('Links'),jdecode(''),'/10701.html','true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='003390';
theSitetree.keyvisualId='1819';
theSitetree.keyvisualName='kv_dummy.jpg';
theSitetree.fontsetId='291';
theSitetree.graphicsetId='353';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='003390';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'003390',
				keyvisualId: 	'1819',
				keyvisualName: 	'kv_dummy.jpg',
				fontsetId: 		'291',
				graphicsetId: 	'353',
				contentColor: 	'FFFFFF',
				contentBGColor: '003390',
				a_color: 		'003390',
				b_color: 		'000000',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1002']=webappMappings['1002-5548abw0x0inxp2s']={
webappId:    '1002',
documentId:  '5548',
internalId:  '5548abw0x0inxp2s',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20100607-192136'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20100227-203254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20100325-161400'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5548',
internalId:  '',
customField: '20090714-135259'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5543',
internalId:  '',
customField: '20060717-182158'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '171301',
internalId:  '',
customField: '20100227-225529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '171322',
internalId:  '',
customField: '20100302-205323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '125901',
internalId:  '',
customField: '20081129-155728'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129601',
internalId:  '',
customField: '20090714-135046'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37801',
internalId:  '',
customField: '20100525-092857'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17301',
internalId:  '',
customField: '20090716-104307'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17322',
internalId:  '',
customField: '20090714-143136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10701',
internalId:  '',
customField: '20100320-085938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '145001',
internalId:  '',
customField: '20100603-203308'
};
webappMappings['7008']=webappMappings['7008-6618']={
webappId:    '7008',
documentId:  '17301',
internalId:  '6618',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '173901',
internalId:  '',
customField: '20100406-090738'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '177301',
internalId:  '',
customField: '20100522-130647'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '178201',
internalId:  '',
customField: '20100522-132030'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '181101',
internalId:  '',
customField: '20100615-205220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '181601',
internalId:  '',
customField: '20100707-140008'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '181622',
internalId:  '',
customField: '20100707-133949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '185391',
internalId:  '',
customField: '20100824-085549'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXP2S';
var companyName   = 'Reni-Racing+Supermotard+Team';
var htmlTitle	  = 'RENI-RACING-SUPERMOTARD-TEAM';
var metaKeywords  = '+husaberg+husqvarna+ktm+supermoto+racing+schweizermeisterschaft+fms+sam+geili+sieche';
var metaContents  = 'reni-racing-supermotard+team+vorstellung+des+teams%2C+rennkalender+von+sam+und+fms+supermotard+bilder+vom+renngeschehen+und+freizeit';
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();
};
