/* [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('%C3%9Cber+uns'),jdecode(''), jdecode('%2F552.html'), 'true',[],'',''],
	['PAGE','573',jdecode('Unser+Team'),jdecode(''), jdecode('%2F573%2Findex.html'), 'true',[ 
		['PAGE','199791',jdecode('Alessandro+Tanner'),jdecode(''), jdecode('%2F573%2F199791.html'), 'true',[],'',''],
		['PAGE','199812',jdecode('Gino+Tanner'),jdecode(''), jdecode('%2F573%2F199812.html'), 'true',[],'','']
	],'',''],
	['PAGE','5548',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F5548%2Findex.html'), 'true',[ 
		['PAGE','5543',jdecode('Eintr%C3%A4ge'),jdecode(''), jdecode('%2F5548%2F5543.html'), 'false',[],'','']
	],'',''],
	['PAGE','191091',jdecode('Saison+2011'),jdecode(''), jdecode('%2F191091%2Findex.html'), 'true',[ 
		['PAGE','191112',jdecode('Renndaten'),jdecode(''), jdecode('%2F191091%2F191112.html'), 'true',[],'',''],
		['PAGE','196091',jdecode('B%C3%BCrgeln'),jdecode(''), jdecode('%2F191091%2F196091.html'), 'true',[],'',''],
		['PAGE','197291',jdecode('Sundgau++%28+F+%29'),jdecode(''), jdecode('%2F191091%2F197291.html'), 'true',[],'',''],
		['PAGE','201691',jdecode('Hoch-Ybrig'),jdecode(''), jdecode('%2F191091%2F201691.html'), 'true',[],'',''],
		['PAGE','203491',jdecode('B%C3%A4retswil'),jdecode(''), jdecode('%2F191091%2F203491.html'), 'true',[],'',''],
		['PAGE','195291',jdecode('News+Renato+Meier'),jdecode(''), jdecode('%2F191091%2F195291.html'), 'true',[],'','']
	],'',''],
	['PAGE','171301',jdecode('Saison+2010'),jdecode(''), jdecode('%2F171301%2Findex.html'), 'true',[ 
		['PAGE','177301',jdecode('Bure'),jdecode(''), jdecode('%2F171301%2F177301.html'), 'true',[],'',''],
		['PAGE','181101',jdecode('Freiburg+%28D%29'),jdecode(''), jdecode('%2F171301%2F181101.html'), 'true',[],'',''],
		['PAGE','178201',jdecode('Bi%C3%A8re'),jdecode(''), jdecode('%2F171301%2F178201.html'), 'true',[],'',''],
		['PAGE','181601',jdecode('Eschenbach+'),jdecode(''), jdecode('%2F171301%2F181601.html'), 'true',[],'',''],
		['PAGE','181622',jdecode('Villars+s.+Ecot+'),jdecode(''), jdecode('%2F171301%2F181622.html'), 'true',[],'',''],
		['PAGE','185391',jdecode('Bettwil+'),jdecode(''), jdecode('%2F171301%2F185391.html'), 'true',[],'',''],
		['PAGE','189791',jdecode('Ramsen+'),jdecode(''), jdecode('%2F171301%2F189791.html'), 'true',[],'',''],
		['PAGE','173901',jdecode('Turin+'),jdecode(''), jdecode('%2F171301%2F173901.html'), 'true',[],'',''],
		['PAGE','171322',jdecode('Training++Villingen+%28+D+%29'),jdecode(''), jdecode('%2F171301%2F171322.html'), 'true',[],'','']
	],'',''],
	['PAGE','145001',jdecode('Bilder+2009'),jdecode(''), jdecode('%2F145001.html'), 'true',[],'',''],
	['PAGE','125901',jdecode('Bilder+2008'),jdecode(''), jdecode('%2F125901.html'), 'true',[],'',''],
	['PAGE','129601',jdecode('Bilder+2007'),jdecode(''), jdecode('%2F129601.html'), 'true',[],'',''],
	['PAGE','17301',jdecode('Kontakt'),jdecode(''), jdecode('%2F17301%2Findex.html'), 'true',[ 
		['PAGE','17322',jdecode('Standort+Werkstatt'),jdecode(''), jdecode('%2F17301%2F17322.html'), 'true',[],'','']
	],'',''],
	['PAGE','10701',jdecode('Links'),jdecode(''), jdecode('%2F10701.html'), 'true',[],'','']];
var siteelementCount=30;
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 prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MH'
};
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: '20110718-170229'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '552',
internalId:  '',
customField: '20110518-160451'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '573',
internalId:  '',
customField: '20110516-183422'
};
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: '20110518-180121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '129601',
internalId:  '',
customField: '20110518-175749'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '191091',
internalId:  '',
customField: '20110204-132353'
};
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: '20110620-151740'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '145001',
internalId:  '',
customField: '20110518-175627'
};
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: '20110518-161642'
};
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-102806'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '189791',
internalId:  '',
customField: '20100930-142643'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '191112',
internalId:  '',
customField: '20110607-012053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '195291',
internalId:  '',
customField: '20110327-122548'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '196091',
internalId:  '',
customField: '20110427-142141'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '197291',
internalId:  '',
customField: '20110516-183209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '199791',
internalId:  '',
customField: '20110524-033946'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '199812',
internalId:  '',
customField: '20110524-040220'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '201691',
internalId:  '',
customField: '20110606-210537'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '203491',
internalId:  '',
customField: '20110718-165857'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.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();
};

