/* [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','4598',jdecode('home'),jdecode(''),'/4598.html','true',[],'',''],
	['PAGE','15547',jdecode('race+news'),jdecode(''),'/15547.html','true',[],'',''],
	['PAGE','31704',jdecode('div.+news'),jdecode(''),'/31704.html','true',[],'',''],
	['PAGE','77101',jdecode('fanclub'),jdecode(''),'/77101/index.html','true',[ 
		['PAGE','171001',jdecode('next+event'),jdecode(''),'/77101/171001.html','true',[],'',''],
		['PAGE','4736',jdecode('autogrammkarten'),jdecode(''),'/77101/4736.html','true',[],'','']
	],'',''],
	['PAGE','4655',jdecode('about+me%21'),jdecode(''),'/4655.html','true',[],'',''],
	['PAGE','134801',jdecode('races'),jdecode(''),'/134801/index.html','true',[ 
		['PAGE','174201',jdecode('mtb+races+09'),jdecode(''),'/134801/174201.html','true',[],'',''],
		['PAGE','134822',jdecode('mtb+races+08'),jdecode(''),'/134801/134822.html','true',[],'',''],
		['PAGE','12028',jdecode('mtb+races+07'),jdecode(''),'/134801/12028.html','true',[],'',''],
		['PAGE','167801',jdecode('cyclocross+08%2F09'),jdecode(''),'/134801/167801.html','true',[],'',''],
		['PAGE','85701',jdecode('cyclocross+07%2F08'),jdecode(''),'/134801/85701.html','true',[],'','']
	],'',''],
	['PAGE','4709',jdecode('palmares'),jdecode(''),'/4709.html','true',[],'',''],
	['PAGE','185701',jdecode('my+bikes+2009'),jdecode(''),'/185701.html','true',[],'',''],
	['PAGE','119701',jdecode('pics'),jdecode(''),'/119701/index.html','true',[ 
		['PAGE','187101',jdecode('Saison+2009'),jdecode(''),'/119701/187101.html','true',[],'',''],
		['PAGE','187301',jdecode('Saison+2008'),jdecode(''),'/119701/187301.html','true',[],'',''],
		['PAGE','4817',jdecode('mtb+races+07'),jdecode(''),'/119701/4817.html','true',[],'',''],
		['PAGE','119743',jdecode('cyclocross'),jdecode(''),'/119701/119743.html','true',[],'',''],
		['PAGE','119722',jdecode('oldies'),jdecode(''),'/119701/119722.html','true',[],'',''],
		['PAGE','187701',jdecode('Diverse'),jdecode(''),'/119701/187701.html','true',[],'','']
	],'',''],
	['PAGE','4844',jdecode('links'),jdecode(''),'/4844.html','true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Urban';
theSitetree.paletteFamily='F24529';
theSitetree.keyvisualId='12192';
theSitetree.keyvisualName='kv_12192.jpg';
theSitetree.fontsetId='33331';
theSitetree.graphicsetId='14201';
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: 			'Urban',
				paletteFamily: 	'F24529',
				keyvisualId: 	'12192',
				keyvisualName: 	'kv_12192.jpg',
				fontsetId: 		'33331',
				graphicsetId: 	'14201',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				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:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4598',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4598',
internalId:  '',
customField: '20091026-202848'
};
webappMappings['1501']=webappMappings['1501-728361']={
webappId:    '1501',
documentId:  '4598',
internalId:  '728361',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-1528']={
webappId:    '7008',
documentId:  '77101',
internalId:  '1528',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15547',
internalId:  '',
customField: '20090504-133937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31704',
internalId:  '',
customField: '20090510-082154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77101',
internalId:  '',
customField: '20090504-134903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '171001',
internalId:  '',
customField: '20081007-101136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4736',
internalId:  '',
customField: '20080514-105827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4655',
internalId:  '',
customField: '20090211-195453'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134801',
internalId:  '',
customField: '20081216-112251'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '174201',
internalId:  '',
customField: '20090429-114603'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '134822',
internalId:  '',
customField: '20080917-085116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12028',
internalId:  '',
customField: '20071207-102027'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '167801',
internalId:  '',
customField: '20081125-103129'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '85701',
internalId:  '',
customField: '20080108-091600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4709',
internalId:  '',
customField: '20071207-095707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '185701',
internalId:  '',
customField: '20090310-103610'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119701',
internalId:  '',
customField: '20090401-111837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '187301',
internalId:  '',
customField: '20090401-111350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4817',
internalId:  '',
customField: '20070925-152915'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119743',
internalId:  '',
customField: '20081028-095033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '187101',
internalId:  '',
customField: '20090401-110614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '119722',
internalId:  '',
customField: '20070925-153222'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4844',
internalId:  '',
customField: '20090505-191106'
};
webappMappings['7060']=webappMappings['7060-76cb200279ccda94dfce9c6c850efadb']={
webappId:    '7060',
documentId:  '187301',
internalId:  '76cb200279ccda94dfce9c6c850efadb',
customField: 'language:de;country:CH;'
};
webappMappings['7060']=webappMappings['7060-b8e385fd9d997c2110af950bc1b64226']={
webappId:    '7060',
documentId:  '187101',
internalId:  'b8e385fd9d997c2110af950bc1b64226',
customField: 'language:de;country:CH;'
};
webappMappings['7060']=webappMappings['7060-ee7aa79d84e6f17d661741e64d3f0354']={
webappId:    '7060',
documentId:  '187701',
internalId:  'ee7aa79d84e6f17d661741e64d3f0354',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '187701',
internalId:  '',
customField: '20090401-111707'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXXY4';
var companyName   = 'JUERGGRAF.CH';
var htmlTitle	  = 'JUERGGRAF.CH';
var metaKeywords  = 'J%EF%BF%BDrg+Graf+Mountainbiker+Mountainbike+Schweiz+Velo+MTB+Scott+Allianz+Suisse+Schweizermeister+Swiss+Champion+Elite+Profi+Swisspowercup+Radquer+Querfeldein+Felt+International+MTB+Team';
var metaContents  = 'J%EF%BF%BDrg+Graf+Mountainbiker+Mountainbike+Schweiz+Velo+MTB+Scott+Allianz+Suisse+Schweizermeister+Swiss+Champion+Elite+Profi+Swisspowercup+Radquer+Querfeldein+Felt+International+MTB+Team';
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();
};
