/* [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','4554',jdecode('Home'),jdecode(''), jdecode('%2F4554.html'), 'true',[],'',''],
	['PAGE','209575',jdecode('Aktuelles'),jdecode(''), jdecode('%2F209575%2Findex.html'), 'true',[ 
		['PAGE','223367',jdecode('Formular'),jdecode(''), jdecode('%2F209575%2F223367.html'), 'true',[],'','']
	],'',''],
	['PAGE','10972',jdecode('Unsere+Motivation'),jdecode(''), jdecode('%2F10972.html'), 'true',[],'',''],
	['PAGE','13247',jdecode('Erlebnisbericht'),jdecode(''), jdecode('%2F13247.html'), 'true',[],'',''],
	['PAGE','200908',jdecode('Wie+operieren%3F'),jdecode(''), jdecode('%2F200908.html'), 'true',[],'',''],
	['PAGE','4665',jdecode('Das+Basler+Konzept'),jdecode(''), jdecode('%2F4665%2Findex.html'), 'true',[ 
		['PAGE','90174',jdecode('Fragen'),jdecode(''), jdecode('%2F4665%2F90174.html'), 'true',[],'',''],
		['PAGE','201161',jdecode('Legenden'),jdecode(''), jdecode('%2F4665%2F201161.html'), 'true',[],'',''],
		['PAGE','204775',jdecode('Emotionen'),jdecode(''), jdecode('%2F4665%2F204775.html'), 'true',[],'',''],
		['PAGE','192482',jdecode('Widerstand'),jdecode(''), jdecode('%2F4665%2F192482.html'), 'true',[],'','']
	],'',''],
	['PAGE','157079',jdecode('Updates'),jdecode(''), jdecode('%2F157079.html'), 'true',[],'',''],
	['PAGE','4746',jdecode('Kontakt+'),jdecode(''), jdecode('%2F4746%2Findex.html'), 'true',[ 
		['PAGE','116675',jdecode('Spit%C3%A4ler+'),jdecode(''), jdecode('%2F4746%2F116675.html'), 'true',[],'',''],
		['PAGE','144475',jdecode('Wegbeschreibung'),jdecode(''), jdecode('%2F4746%2F144475.html'), 'true',[],'',''],
		['PAGE','116729',jdecode('Ihre+R%C3%BCckmeldung'),jdecode(''), jdecode('%2F4746%2F116729%2Findex.html'), 'true',[ 
			['PAGE','189122',jdecode('Ihre+R%C3%BCckmeldung+an+uns+%28Form+followup+page%29'),jdecode(''), jdecode('%2F4746%2F116729%2F189122.html'), 'false',[],'','']
		],'','']
	],'',''],
	['PAGE','116702',jdecode('Links'),jdecode(''), jdecode('%2F116702.html'), 'true',[],'',''],
	['PAGE','13354',jdecode('G%C3%A4stebuch'),jdecode(''), jdecode('%2F13354%2Findex.html'), 'false',[ 
		['PAGE','13353',jdecode('Ihr+Beitrag'),jdecode(''), jdecode('%2F13354%2F13353.html'), 'true',[],'',''],
		['PAGE','21320',jdecode('Archiv'),jdecode(''), jdecode('%2F13354%2F21320.html'), 'true',[],'','']
	],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Powering';
theSitetree.paletteFamily='154186';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10735';
theSitetree.graphicsetId='10566';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='808080';
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: 			'Powering',
				paletteFamily: 	'154186',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10735',
				graphicsetId: 	'10566',
				contentColor: 	'000000',
				contentBGColor: '808080',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4554',
internalId:  '1006',
customField: '1006'
};
webappMappings['1002']=webappMappings['1002-13353ABW0X0INX37L']={
webappId:    '1002',
documentId:  '13353',
internalId:  '13353ABW0X0INX37L',
customField: 'icq=false'
};
webappMappings['1009']=webappMappings['1009-4604055']={
webappId:    '1009',
documentId:  '189122',
internalId:  '4604055',
customField: 'isFollowupPage:true;documentId:116729;'
};
webappMappings['7008']=webappMappings['7008-4301']={
webappId:    '7008',
documentId:  '223367',
internalId:  '4301',
customField: 'language:de;country:CH;'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '144475',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['1501']=webappMappings['1501-1865343']={
webappId:    '1501',
documentId:  '4554',
internalId:  '1865343',
customField: '1501'
};
webappMappings['7008']=webappMappings['7008-4300']={
webappId:    '7008',
documentId:  '116729',
internalId:  '4300',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4554',
internalId:  '',
customField: '20120202-182650'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '209575',
internalId:  '',
customField: '20111008-115314'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '223367',
internalId:  '',
customField: '20071219-091817'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10972',
internalId:  '',
customField: '20050316-223034'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13247',
internalId:  '',
customField: '20111008-112858'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '200908',
internalId:  '',
customField: '20111008-114513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4665',
internalId:  '',
customField: '20120202-215217'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '90174',
internalId:  '',
customField: '20050322-110729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '201161',
internalId:  '',
customField: '20100806-163828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '204775',
internalId:  '',
customField: '20100806-163852'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '192482',
internalId:  '',
customField: '20050322-083503'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '157079',
internalId:  '',
customField: '20111008-112742'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4746',
internalId:  '',
customField: '20050322-111224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116675',
internalId:  '',
customField: '20100806-173513'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '144475',
internalId:  '',
customField: '20040805-115450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116729',
internalId:  '',
customField: '20040805-114330'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '189122',
internalId:  '',
customField: '20041125-155125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '116702',
internalId:  '',
customField: '20111008-184127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13354',
internalId:  '',
customField: '20070608-144739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13353',
internalId:  '',
customField: '20041004-154415'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21320',
internalId:  '',
customField: '20041201-160154'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INX37L';
var companyName   = 'LKGS+-+kein+Schicksalsschlag+%21';
var htmlTitle	  = 'LKG-Spalten%3A+kein+Schicksalsschlag%21+Wir+geben+Ihnen+unsere+Erfahrungen+weiter%21';
var metaKeywords  = 'LKG-Selbsthilfe.+LKGS.+Betroffenes+Elternpaar+schildert+seine+Erlebnisse.+Basler+Konzept.+Lippen-%2C+Kiefer-+und+Gaumenspalten.+All-in-one-Verfahren.+';
var metaContents  = 'Lippen-%2C+Kiefer-+und+Gaumenspalten+%28LKGS%29.+Kein+Schicksalsschlag+%21+';
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();
};

