/* [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','1401',jdecode('News'),jdecode(''),'/1401/index.html','true',[ 
		['PAGE','26623',jdecode('Infos+f%C3%BCr+Spieler'),jdecode(''),'/1401/26623.html','false',[],'','']
	],'',''],
	['PAGE','1620',jdecode('Angebot'),jdecode(''),'/1620.html','true',[],'',''],
	['PAGE','1557',jdecode('Snakes'),jdecode(''),'/1557/index.html','true',[ 
		['PAGE','1578',jdecode('Fotos'),jdecode(''),'/1557/1578.html','true',[],'',''],
		['PAGE','5501',jdecode('Online+Einradfilme'),jdecode(''),'/1557/5501.html','true',[],'',''],
		['PAGE','1599',jdecode('Termine'),jdecode(''),'/1557/1599.html','true',[],'','']
	],'',''],
	['PAGE','1452',jdecode('Verein'),jdecode(''),'/1452/index.html','true',[ 
		['PAGE','1494',jdecode('Der+Vorstand'),jdecode(''),'/1452/1494.html','true',[],'',''],
		['PAGE','1515',jdecode('Statuten'),jdecode(''),'/1452/1515.html','true',[],'',''],
		['PAGE','1473',jdecode('Geschichte'),jdecode(''),'/1452/1473.html','true',[],'',''],
		['PAGE','43223',jdecode('Links'),jdecode(''),'/1452/43223.html','true',[],'','']
	],'',''],
	['PAGE','17412',jdecode('G%C3%A4stebuch'),jdecode(''),'/17412.html','true',[],'',''],
	['PAGE','1641',jdecode('Kontakt'),jdecode(''),'/1641.html','true',[],'',''],
	['PAGE','1662',jdecode('Impressum'),jdecode(''),'/1662.html','true',[],'','']];
var siteelementCount=15;
theSitetree.topTemplateName='Match';
theSitetree.paletteFamily='2354B7';
theSitetree.keyvisualId='2698';
theSitetree.keyvisualName='kv_2698.jpg';
theSitetree.fontsetId='10701';
theSitetree.graphicsetId='10633';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='C6E2FE';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Match',
				paletteFamily: 	'2354B7',
				keyvisualId: 	'2698',
				keyvisualName: 	'kv_2698.jpg',
				fontsetId: 		'10701',
				graphicsetId: 	'10633',
				contentColor: 	'000000',
				contentBGColor: 'C6E2FE',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'2354B7',
				e_color: 		'707070',
				f_color: 		'707070',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '17412',
internalId:  '',
customField: '20090227-161641'
};
webappMappings['7060']=webappMappings['7060-d181f2696696c4e4150e7a5005d23c18']={
webappId:    '7060',
documentId:  '1578',
internalId:  'd181f2696696c4e4150e7a5005d23c18',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-594']={
webappId:    '7008',
documentId:  '1641',
internalId:  '594',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1401',
internalId:  '',
customField: '20100527-083316'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1578',
internalId:  '',
customField: '20090523-142709'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '1401',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-2612095']={
webappId:    '1501',
documentId:  '1401',
internalId:  '2612095',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1473',
internalId:  '',
customField: '20100207-160547'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1452',
internalId:  '',
customField: '20090322-132107'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1494',
internalId:  '',
customField: '20100207-154206'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1557',
internalId:  '',
customField: '20090427-105104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1662',
internalId:  '',
customField: '20100207-155631'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1641',
internalId:  '',
customField: '20090412-173957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1620',
internalId:  '',
customField: '20100521-070826'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1599',
internalId:  '',
customField: '20090227-160738'
};
webappMappings['7002']=webappMappings['7002-472']={
webappId:    '7002',
documentId:  '17412',
internalId:  '472',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1515',
internalId:  '',
customField: '20100207-152506'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5501',
internalId:  '',
customField: '20100207-161100'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '43223',
internalId:  '',
customField: '20100426-134856'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26623',
internalId:  '',
customField: '20100419-152444'
};
var canonHostname = 'wsc.genotec.ch';
var accountId     = 'AGT010IN2QHO';
var companyName   = 'Einrad+Club+Arlesheim';
var htmlTitle	  = 'Einrad+Club+Arlesheim';
var metaKeywords  = 'Einrad%2C+einrad%2C+Einradhockey%2C+Snakes%2C+Einradrennen%2C+Freestyle%2C+Arlesheim%2C+Unicycle%2C+Monocycle%2C+Training%2C';
var metaContents  = 'Der+Einradclub+Arlesheim+foerdert+den+Einradsport+in+allen+Sparten+und+vertritt+durch+aktive+Mitarbeit+in+Kommissionen+des+Kompetenzcenter-Einrad+die+Interessen+seiner+Mitglieder.+Im+Weiteren+setzt+er+sich+insbesondere+ein+f%C3%BCr+die+Foerderung+eines+professionellen+sportlichen+Umfeldes.';
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();
};
