/* [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','4520',jdecode('Home'),jdecode(''),'/4520.html','true',[],'',''],
	['PAGE','8897',jdecode('Oeffnungszeiten'),jdecode(''),'/8897.html','true',[],'',''],
	['PAGE','4577',jdecode('Praxisteam'),jdecode(''),'/4577.html','true',[],'',''],
	['PAGE','8461',jdecode('Werdegang'),jdecode(''),'/8461.html','true',[],'',''],
	['PAGE','4631',jdecode('Unsere+Praxis'),jdecode(''),'/4631.html','true',[],'',''],
	['PAGE','4658',jdecode('So+finden+Sie+uns'),jdecode(''),'/4658.html','true',[],'',''],
	['PAGE','4685',jdecode('Angebot'),jdecode(''),'/4685.html','true',[],'',''],
	['PAGE','4712',jdecode('Kontakt'),jdecode(''),'/4712/index.html','true',[ 
		['PAGE','5277',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''),'/4712/5277.html','false',[],'','']
	],'','']];
var siteelementCount=9;
theSitetree.topTemplateName='Medium';
theSitetree.paletteFamily='F5F5F5';
theSitetree.keyvisualId='2182';
theSitetree.keyvisualName='zahnmedizin.jpg';
theSitetree.fontsetId='355';
theSitetree.graphicsetId='407';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='F5F5F5';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Medium',
				paletteFamily: 	'F5F5F5',
				keyvisualId: 	'2182',
				keyvisualName: 	'zahnmedizin.jpg',
				fontsetId: 		'355',
				graphicsetId: 	'407',
				contentColor: 	'000000',
				contentBGColor: 'F5F5F5',
				a_color: 		'F5F5F5',
				b_color: 		'8EBFC6',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4520',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4520',
internalId:  '',
customField: '20081230-122902'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4577',
internalId:  '',
customField: '20100819-173517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8461',
internalId:  '',
customField: '20090219-074435'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8897',
internalId:  '',
customField: '20061218-211813'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4631',
internalId:  '',
customField: '20050506-222306'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4658',
internalId:  '',
customField: '20060928-191922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4685',
internalId:  '',
customField: '20081230-120207'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4712',
internalId:  '',
customField: '20050419-225824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5277',
internalId:  '',
customField: '20050413-202942'
};
webappMappings['7008']=webappMappings['7008-10416']={
webappId:    '7008',
documentId:  '4712',
internalId:  '10416',
customField: 'language:de;country:CH;'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXZBX';
var companyName   = 'www.bestdent.ch';
var htmlTitle	  = 'Willkommen+in+unserer+Praxis+an+der+Hauptstrasse+18+in+4552+Derendingen.';
var metaKeywords  = 'Dieter+Probst%2C+Max+Probst%2C+Arzt%2C+Aerzte%2C+Zahnarzt%2C+Dentist%2C+Zahn%C3%A4rzte%2C+Zahnstein%2C+Zahnsteinentfernung%2C+Zahnreinigung%2C+Zahnbehandlung%2C+Zahnheilkunde%2C+Veneer%2C+Verblendschalen%2C+Keramik%2C+Derendingen%2C+Solothurn%2C+Wasseramt%2C+SSO%2C+Zahn%2C+Z%C3%A4hne%2C+Zahnprobleme%2C+Zahnschmerzen%2C+Zahnersatz%2C+Zahnarztpraxis%2C+Zahnprothesen%2C+Zahnf%C3%BCllung%2C+F%C3%BCllung%2C+Kunststoff%C3%BCllung%2C+Porzellanf%C3%BCllung%2C+Spezialgebiet%2C+Zahnweh%2C+Zahnkontrolle%2C+Zahnr%C3%B6ntgen%2C+Therapie%2C+Totalprothese%2C+Teilprothese%2C+Prothesen%2C+Br%C3%BCcke%2C+Kronen%2C+Keramikkrone%2C+Wurzelbehandlung%2C+Implantate%2C+Prothetik%2C+Parodontitis%2C+Zahnstellungskorrekturen%2C+Zahnkorrekturen%2C+Porzellankrone%2C+Spange%2C+Implantatprothesen%2C+Implantatz%C3%A4hne%2C+Implantate%2C+Implantat%2C++Implantation%2C+Stiftzahn%2C+Zahnfleischprobleme%2C+Zahnfleischentz%C3%BCndung%2C+Kauprobleme%2C+Karies%2C+Zahnkaries%2C+Kariespr%C3%A4vention%2C+Mundhygiene%2C+Zahnversicherung%2C+Zahnheilkunde%2C+Zahnarztpraxisgemeinschaft%2C+Prothesenreparatur%2C+Familienzahnarzt%2C+Kinderzahnmedizin%2C+Amalgamentfernung%2C+Amalgamsanierung%2C+F%C3%BCllungsersatz%2C+Schulzahnarzt%2C+Zahnbleichung%2C+Bleaching%2C+aesthetische+Zahnmedizin%2C';
var metaContents  = 'Willommen+auf+unserer+Homepage+www.bestdent.ch.+Gerne+beraten+wir+Sie+in+einem+pers%C3%B6nlichen+Gespr%C3%A4ch.+Kontaktieren+Sie+uns%2C+wir+freuen+uns+auf+Ihren+Besuch.+';
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();
};

