/* [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 theSitetree=[ 
	['PAGE','801',jdecode('WELCOME'),jdecode(''),'/801.html','true',[],''],
	['PAGE','852',jdecode('NEWS'),jdecode(''),'/852.html','true',[],''],
	['PAGE','873',jdecode('CARLOS'),jdecode(''),'/873/index.html','true',[ 
		['PAGE','6901',jdecode('STECKBRIEF'),jdecode(''),'/873/6901.html','true',[],''],
		['PAGE','6922',jdecode('BIOGRAPHIE'),jdecode(''),'/873/6922.html','true',[],''],
		['PAGE','6943',jdecode('FAMILIE'),jdecode(''),'/873/6943.html','true',[],'']
	],''],
	['PAGE','894',jdecode('SPORT'),jdecode(''),'/894/index.html','true',[ 
		['PAGE','6964',jdecode('HANDBALL'),jdecode(''),'/894/6964.html','true',[],''],
		['PAGE','6985',jdecode('SWISS+OLYMPIC'),jdecode(''),'/894/6985.html','true',[],''],
		['PAGE','7006',jdecode('LEICHTATHLETIK'),jdecode(''),'/894/7006.html','true',[],'']
	],''],
	['PAGE','915',jdecode('PARTNER'),jdecode(''),'/915/index.html','true',[ 
		['PAGE','7069',jdecode('SMP'),jdecode(''),'/915/7069.html','true',[],'']
	],''],
	['PAGE','7111',jdecode('LINKS'),jdecode(''),'/7111.html','true',[],''],
	['PAGE','978',jdecode('FOTOS'),jdecode(''),'/978/index.html','true',[ 
		['PAGE','7174',jdecode('SPORT'),jdecode(''),'/978/7174.html','true',[],''],
		['PAGE','7195',jdecode('MODE'),jdecode(''),'/978/7195.html','true',[],''],
		['PAGE','7216',jdecode('PRIVAT'),jdecode(''),'/978/7216.html','true',[],'']
	],''],
	['PAGE','11906',jdecode('GUESTS'),jdecode(''),'/11906/index.html','true',[ 
		['PAGE','11901',jdecode('EINTR%C3%84GE'),jdecode(''),'/11906/11901.html','false',[],''],
		['PAGE','7132',jdecode('AUTOGRAMME'),jdecode(''),'/11906/7132.html','true',[],'']
	],'']];
var siteelementCount=20;
theSitetree.topTemplateName='Orbit';
theSitetree.paletteFamily='000000';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='174';
theSitetree.graphicsetId='206';
theSitetree.contentColor='A6A6A6';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				name: 			'Orbit',
				paletteFamily: 	'000000',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'174',
				graphicsetId: 	'206',
				contentColor: 	'A6A6A6',
				contentBGColor: '000000',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'666666',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '801',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-11906abw0x0in2mbs']={
webappId:    '1002',
documentId:  '11906',
internalId:  '11906abw0x0in2mbs',
customField: 'icq=false'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '801',
internalId:  '',
customField: '20080915-151601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '852',
internalId:  '',
customField: '20090816-162933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '873',
internalId:  '',
customField: '20080915-154208'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6901',
internalId:  '',
customField: '20090304-193724'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6922',
internalId:  '',
customField: '20080915-154920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6943',
internalId:  '',
customField: '20081028-175314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '894',
internalId:  '',
customField: '20080915-153957'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6964',
internalId:  '',
customField: '20080915-154041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6985',
internalId:  '',
customField: '20080915-154116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7006',
internalId:  '',
customField: '20080915-154140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '915',
internalId:  '',
customField: '20080915-153752'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7069',
internalId:  '',
customField: '20080915-152357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7111',
internalId:  '',
customField: '20080915-153651'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '978',
internalId:  '',
customField: '20080915-153214'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7174',
internalId:  '',
customField: '20080915-153332'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7195',
internalId:  '',
customField: '20080915-153415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7216',
internalId:  '',
customField: '20080915-153510'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11906',
internalId:  '',
customField: '20080915-153140'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11901',
internalId:  '',
customField: '20080915-153041'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7132',
internalId:  '',
customField: '20080915-152957'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN2MBS';
var companyName   = 'CARLOS+LIMA';
var htmlTitle	  = 'Carlos+Lima';
var metaKeywords  = 'Handballer%2C+Carlos+Lima%2C+Model%2C+Sportwissenschaftler.';
var metaContents  = 'Pers%C3%B6nliche+Homepage%2C+Carlos+Lima+';
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();
};
