/* [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','141301',jdecode('Begr%C3%BC%C3%9Fung'),jdecode(''), jdecode('%2F141301.html'), 'true',[],'',''],
	['PAGE','701',jdecode('%C3%9Cber+uns'),jdecode(''), jdecode('%2F701.html'), 'true',[],'',''],
	['PAGE','20601',jdecode('Konzept'),jdecode(''), jdecode('%2F20601.html'), 'true',[],'',''],
	['PAGE','20622',jdecode('Trainer'),jdecode(''), jdecode('%2F20622.html'), 'true',[],'',''],
	['PAGE','20643',jdecode('Kurse'),jdecode(''), jdecode('%2F20643.html'), 'true',[],'',''],
	['PAGE','156401',jdecode('Koordinationskurs'),jdecode(''), jdecode('%2F156401.html'), 'true',[],'',''],
	['PAGE','143201',jdecode('Feriencamps'),jdecode(''), jdecode('%2F143201.html'), 'true',[],'',''],
	['PAGE','176901',jdecode('Kindergeburtstag'),jdecode(''), jdecode('%2F176901.html'), 'true',[],'',''],
	['PAGE','41601',jdecode('Anmeldung'),jdecode(''), jdecode('%2F41601.html'), 'true',[],'',''],
	['PAGE','20706',jdecode('Neuigkeiten'),jdecode(''), jdecode('%2F20706.html'), 'true',[],'',''],
	['PAGE','20685',jdecode('Partner'),jdecode(''), jdecode('%2F20685.html'), 'true',[],'',''],
	['PAGE','35401',jdecode('St%C3%BCtzpunkt'),jdecode(''), jdecode('%2F35401.html'), 'true',[],'',''],
	['PAGE','102201',jdecode('Presse'),jdecode(''), jdecode('%2F102201.html'), 'true',[],'',''],
	['PAGE','100801',jdecode('Chronik'),jdecode(''), jdecode('%2F100801.html'), 'true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Seifenblase';
theSitetree.paletteFamily='69C151';
theSitetree.keyvisualId='2353';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='379';
theSitetree.graphicsetId='428';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'DE'
};
var prodDef={
  wl_name: 'netcologne',
  product: 'WSCSYSSSSLYTCPLG'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Seifenblase',
				paletteFamily: 	'69C151',
				keyvisualId: 	'2353',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'379',
				graphicsetId: 	'428',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'339900',
				e_color: 		'33CC00',
				f_color: 		'66CC66',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '141301',
internalId:  '',
customField: '20100925-123402'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '35401',
internalId:  'location',
customField: 'language:de;country:DE;isIncluded:false;'
};
webappMappings['7008']=webappMappings['7008-17']={
webappId:    '7008',
documentId:  '41601',
internalId:  '17',
customField: 'language:de;country:DE;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '701',
internalId:  '',
customField: '20100619-133449'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20601',
internalId:  '',
customField: '20100529-093008'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '141301',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '156401',
internalId:  '',
customField: '20100801-112308'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20622',
internalId:  '',
customField: '20100611-180551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20643',
internalId:  '',
customField: '20111001-081116'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41601',
internalId:  '',
customField: '20090719-132019'
};
webappMappings['1501']=webappMappings['1501-3208253']={
webappId:    '1501',
documentId:  '141301',
internalId:  '3208253',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '143201',
internalId:  '',
customField: '20111120-110136'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '102201',
internalId:  '',
customField: '20091028-080920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20706',
internalId:  '',
customField: '20110828-123512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20685',
internalId:  '',
customField: '20100619-140312'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35401',
internalId:  '',
customField: '20091229-211257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100801',
internalId:  '',
customField: '20101228-100939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '176901',
internalId:  '',
customField: '20101022-175135'
};
var webAppHostname = 'cm4all.netcologne.de:80';
var canonHostname = 'cm4all4.netcologne.de';
var accountId     = 'ANC020IN2YWX';
var companyName   = 'Siegburger-Torwartschule+T%C3%A9Se+08+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++';
var htmlTitle	  = '1.Siegburger+Fu%C3%9Fball-Torwartschule+T%C3%A9Se+08';
var metaKeywords  = 'Torwartschule+TeSe08+T%EF%BF%BD';
var metaContents  = 'Siegburger-Fussballschule+TeSe+08';
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();
};

