/* [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','4601',jdecode('Home'),jdecode(''), jdecode('%2F4601.html'), 'true',[],'',''],
	['PAGE','4652',jdecode('News'),jdecode(''), jdecode('%2F4652.html'), 'true',[],'',''],
	['PAGE','5101',jdecode('Jahresprogramm'),jdecode(''), jdecode('%2F5101.html'), 'true',[],'',''],
	['PAGE','4673',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F4673%2Findex.html'), 'true',[ 
		['PAGE','4694',jdecode('Geschichte'),jdecode(''), jdecode('%2F4673%2F4694.html'), 'false',[],'',''],
		['PAGE','4715',jdecode('Der+Vorstand'),jdecode(''), jdecode('%2F4673%2F4715.html'), 'true',[],'',''],
		['PAGE','4736',jdecode('Statuten'),jdecode(''), jdecode('%2F4673%2F4736.html'), 'true',[],'',''],
		['PAGE','4757',jdecode('Unser+Team'),jdecode(''), jdecode('%2F4673%2F4757.html'), 'false',[],'','']
	],'',''],
	['PAGE','4778',jdecode('Resultate'),jdecode(''), jdecode('%2F4778%2Findex.html'), 'true',[ 
		['PAGE','42001',jdecode('2011'),jdecode(''), jdecode('%2F4778%2F42001.html'), 'true',[],'',''],
		['PAGE','31601',jdecode('2010'),jdecode(''), jdecode('%2F4778%2F31601.html'), 'true',[],'',''],
		['PAGE','12101',jdecode('2009'),jdecode(''), jdecode('%2F4778%2F12101.html'), 'true',[],'',''],
		['PAGE','27701',jdecode('Abendschwimmen+2009'),jdecode(''), jdecode('%2F4778%2F27701.html'), 'true',[],'',''],
		['PAGE','38001',jdecode('Abendschwimmen+2010'),jdecode(''), jdecode('%2F4778%2F38001.html'), 'true',[],'','']
	],'',''],
	['PAGE','14501',jdecode('Swimathlon'),jdecode(''), jdecode('%2F14501.html'), 'true',[],'',''],
	['PAGE','25001',jdecode('Fotogalerie'),jdecode(''), jdecode('%2F25001%2Findex.html'), 'true',[ 
		['PAGE','25301',jdecode('Schwimmlager+2009'),jdecode(''), jdecode('%2F25001%2F25301.html'), 'true',[],'',''],
		['PAGE','36301',jdecode('Schwimmlager+2010'),jdecode(''), jdecode('%2F25001%2F36301.html'), 'true',[],'',''],
		['PAGE','51901',jdecode('Schwimmlager+2011'),jdecode(''), jdecode('%2F25001%2F51901.html'), 'true',[],'','']
	],'',''],
	['PAGE','4799',jdecode('Mitglied+werden'),jdecode(''), jdecode('%2F4799.html'), 'true',[],'',''],
	['PAGE','9001',jdecode('Hallenbad+Urdorf'),jdecode(''), jdecode('%2F9001.html'), 'true',[],'',''],
	['PAGE','4820',jdecode('Kontakt'),jdecode(''), jdecode('%2F4820.html'), 'true',[],'',''],
	['PAGE','4841',jdecode('Interessante+Links'),jdecode(''), jdecode('%2F4841.html'), 'true',[],'',''],
	['PAGE','10401',jdecode('Suche'),jdecode(''), jdecode('%2F10401.html'), 'true',[],'',''],
	['PAGE','4862',jdecode('Impressum'),jdecode(''), jdecode('%2F4862.html'), 'true',[],'',''],
	['PAGE','10422',jdecode('Disclaimer'),jdecode(''), jdecode('%2F10422.html'), 'true',[],'',''],
	['PAGE','52301',jdecode('Testseite'),jdecode(''), jdecode('%2F52301.html'), 'false',[],'','']];
var siteelementCount=27;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='003399';
theSitetree.keyvisualId='1230';
theSitetree.keyvisualName='delphinschwimmer.jpg';
theSitetree.fontsetId='190';
theSitetree.graphicsetId='228';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Profile',
				paletteFamily: 	'003399',
				keyvisualId: 	'1230',
				keyvisualName: 	'delphinschwimmer.jpg',
				fontsetId: 		'190',
				graphicsetId: 	'228',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'003399',
				b_color: 		'000066',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4601',
internalId:  '',
customField: '20120122-212329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4652',
internalId:  '',
customField: '20120122-212254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4673',
internalId:  '',
customField: '20101111-234739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5101',
internalId:  '',
customField: '20120122-212357'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4601',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-29206146']={
webappId:    '1501',
documentId:  '4601',
internalId:  '29206146',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4736',
internalId:  '',
customField: '20110314-220059'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4694',
internalId:  '',
customField: '20090419-005542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4715',
internalId:  '',
customField: '20110712-222641'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4757',
internalId:  '',
customField: '20090419-005542'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4778',
internalId:  '',
customField: '20111109-223455'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4799',
internalId:  '',
customField: '20111106-235404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4820',
internalId:  '',
customField: '20090425-020722'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4841',
internalId:  '',
customField: '20110904-130609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4862',
internalId:  '',
customField: '20090512-234457'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '9001',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9001',
internalId:  '',
customField: '20090629-230201'
};
webappMappings['8002']=webappMappings['8002-search']={
webappId:    '8002',
documentId:  '10401',
internalId:  'search',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10401',
internalId:  '',
customField: '20090429-221115'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10422',
internalId:  '',
customField: '20090420-011855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12101',
internalId:  '',
customField: '20100103-225812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14501',
internalId:  '',
customField: '20110502-113941'
};
webappMappings['7060']=webappMappings['7060-eb5354b761330458fe87e1265fecb769']={
webappId:    '7060',
documentId:  '25001',
internalId:  'eb5354b761330458fe87e1265fecb769',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25001',
internalId:  '',
customField: '20120123-234353'
};
webappMappings['7060']=webappMappings['7060-64b26abd2b803992e833c5f6e613266d']={
webappId:    '7060',
documentId:  '25301',
internalId:  '64b26abd2b803992e833c5f6e613266d',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25301',
internalId:  '',
customField: '20091025-222301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27701',
internalId:  '',
customField: '20100103-235719'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31601',
internalId:  '',
customField: '20101111-233255'
};
webappMappings['7060']=webappMappings['7060-27c70ce6139c7bfc7209a69787b8e0cc']={
webappId:    '7060',
documentId:  '36301',
internalId:  '27c70ce6139c7bfc7209a69787b8e0cc',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36301',
internalId:  '',
customField: '20101026-232200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '38001',
internalId:  '',
customField: '20101211-003704'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42001',
internalId:  '',
customField: '20120111-235628'
};
webappMappings['7060']=webappMappings['7060-182b40351f8656f3c901ba3fee9794c5']={
webappId:    '7060',
documentId:  '51901',
internalId:  '182b40351f8656f3c901ba3fee9794c5',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '51901',
internalId:  '-',
customField: '20120123-234700'
};
webappMappings['5000']=webappMappings['5000--']={
webappId:    '5000',
documentId:  '52301',
internalId:  '-',
customField: '20120123-235637'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW330INEOND';
var companyName   = 'Schwimmclub+Butterfly+Urdorf';
var htmlTitle	  = 'Schwimmclub+Urdorf';
var metaKeywords  = 'Schwimmclub+Urdorf+Schwimmverein+Sportverein';
var metaContents  = 'Schwimmclub+Urdorf+SCUR';
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();
};

