/* [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','4598',jdecode('Home'),jdecode(''), jdecode('%2F4598.html'), 'true',[],'',''],
	['PAGE','4655',jdecode('Dienstleistungsangebot'),jdecode(''), jdecode('%2F4655.html'), 'true',[],'',''],
	['PAGE','16153',jdecode('News'),jdecode(''), jdecode('%2F16153.html'), 'true',[],'',''],
	['PAGE','35853',jdecode('Notf%C3%A4lle+und+Erste+Hilfe'),jdecode(''), jdecode('%2F35853.html'), 'true',[],'',''],
	['PAGE','11853',jdecode('Impfen+von+Hunden'),jdecode(''), jdecode('%2F11853.html'), 'true',[],'',''],
	['PAGE','35143',jdecode('Impfen+von+Katzen'),jdecode(''), jdecode('%2F35143.html'), 'true',[],'',''],
	['PAGE','35134',jdecode('Stressfreies+Entwurmen%2C+Microchip'),jdecode(''), jdecode('%2F35134.html'), 'true',[],'',''],
	['PAGE','32792',jdecode('Reisekrankheiten+beim+Hund'),jdecode(''), jdecode('%2F32792.html'), 'true',[],'',''],
	['PAGE','35152',jdecode('L%C3%A4ufigkeit+bei+der+H%C3%BCndin'),jdecode(''), jdecode('%2F35152.html'), 'true',[],'',''],
	['PAGE','35161',jdecode('Rolligkeit+bei+der+Katze'),jdecode(''), jdecode('%2F35161.html'), 'true',[],'',''],
	['PAGE','35125',jdecode('Ausbildung+bei+Junghunden'),jdecode(''), jdecode('%2F35125.html'), 'true',[],'',''],
	['PAGE','4709',jdecode('Praxisteam'),jdecode(''), jdecode('%2F4709.html'), 'true',[],'',''],
	['PAGE','30680',jdecode('Arbeits-+und+Lehrstellen'),jdecode(''), jdecode('%2F30680.html'), 'true',[],'',''],
	['PAGE','4736',jdecode('So+finden+Sie+uns'),jdecode(''), jdecode('%2F4736.html'), 'true',[],'',''],
	['PAGE','4790',jdecode('Kontakt'),jdecode(''), jdecode('%2F4790%2Findex.html'), 'true',[ 
		['PAGE','5758',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''), jdecode('%2F4790%2F5758.html'), 'false',[],'','']
	],'',''],
	['PAGE','4817',jdecode('Wichtige+Telefonnummern+und+Links'),jdecode(''), jdecode('%2F4817.html'), 'true',[],'','']];
var siteelementCount=17;
theSitetree.topTemplateName='Stylus';
theSitetree.paletteFamily='B0CBD6';
theSitetree.keyvisualId='1989';
theSitetree.keyvisualName='stetoskop.jpg';
theSitetree.fontsetId='328';
theSitetree.graphicsetId='383';
theSitetree.contentColor='A00000';
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: 			'Stylus',
				paletteFamily: 	'B0CBD6',
				keyvisualId: 	'1989',
				keyvisualName: 	'stetoskop.jpg',
				fontsetId: 		'328',
				graphicsetId: 	'383',
				contentColor: 	'A00000',
				contentBGColor: 'FFFFFF',
				a_color: 		'B0CBD6',
				b_color: 		'FFFFFF',
				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:  '4598',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4655',
internalId:  '',
customField: '20111218-120827'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4598',
internalId:  '',
customField: '20111027-203152'
};
webappMappings['7008']=webappMappings['7008-2834']={
webappId:    '7008',
documentId:  '4790',
internalId:  '2834',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35853',
internalId:  '',
customField: '20110131-101426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '16153',
internalId:  '',
customField: '20111218-121155'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11853',
internalId:  '',
customField: '20091013-081109'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35143',
internalId:  '',
customField: '20080104-171824'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35134',
internalId:  '',
customField: '20091013-080258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '32792',
internalId:  '',
customField: '20080104-165933'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35152',
internalId:  '',
customField: '20080104-172006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35161',
internalId:  '',
customField: '20080104-171855'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35125',
internalId:  '',
customField: '20080104-164110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4709',
internalId:  '',
customField: '20111030-085127'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30680',
internalId:  '',
customField: '20100806-145500'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4736',
internalId:  '',
customField: '20040505-170620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4790',
internalId:  '',
customField: '20100918-103900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5758',
internalId:  '',
customField: '20040912-103025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4817',
internalId:  '',
customField: '20110123-164643'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXEHD';
var companyName   = 'Kleintierpraxis+Dr.+med.+vet.+A.+Dittus';
var htmlTitle	  = 'Kleintierpraxis+Dr.+med.+vet.+Alexandra+Dittus';
var metaKeywords  = 'TierarztTiermedizinL%C3%A4ufigkeitImpfungenKastration';
var metaContents  = 'Tiermedizinisches+Dienstleistungsangebot';
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();
};

