/* [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','4478',jdecode('Home'),jdecode(''),'/4478.html','true',[],'',''],
	['PAGE','64498',jdecode('Jobs'),jdecode(''),'/64498.html','true',[],'',''],
	['PAGE','60817',jdecode('Wir+%C3%BCber+uns'),jdecode(''),'/60817/index.html','true',[ 
		['PAGE','61893',jdecode('Das+Unternehmen'),jdecode(''),'/60817/61893.html','true',[],'',''],
		['PAGE','61902',jdecode('Unsere+Philosophie'),jdecode(''),'/60817/61902.html','true',[],'',''],
		['PAGE','14421',jdecode('Unser+Team'),jdecode(''),'/60817/14421.html','true',[],'','']
	],'',''],
	['PAGE','4616',jdecode('Gallerie'),jdecode(''),'/4616.html','true',[],'',''],
	['PAGE','4562',jdecode('Geb%C3%A4udeh%C3%BClle'),jdecode(''),'/4562.html','true',[],'',''],
	['PAGE','60835',jdecode('Dienstleistungen'),jdecode(''),'/60835/index.html','true',[ 
		['PAGE','63359',jdecode('Kundendienst'),jdecode(''),'/60835/63359.html','true',[],'',''],
		['PAGE','61911',jdecode('Spenglertechnik'),jdecode(''),'/60835/61911.html','true',[],'',''],
		['PAGE','60844',jdecode('Blitzschutz'),jdecode(''),'/60835/60844.html','true',[],'',''],
		['PAGE','60871',jdecode('Steild%C3%A4cher'),jdecode(''),'/60835/60871.html','true',[],'',''],
		['PAGE','60862',jdecode('Flachd%C3%A4cher'),jdecode(''),'/60835/60862.html','true',[],'',''],
		['PAGE','60880',jdecode('Dachbegr%C3%BCnungen'),jdecode(''),'/60835/60880.html','true',[],'',''],
		['PAGE','63756',jdecode('Plattenbel%C3%A4ge'),jdecode(''),'/60835/63756.html','true',[],'',''],
		['PAGE','60853',jdecode('Fassadenbau'),jdecode(''),'/60835/60853.html','true',[],'','']
	],'',''],
	['PAGE','39017',jdecode('Referenzen'),jdecode(''),'/39017/index.html','true',[ 
		['PAGE','63414',jdecode('Beratung+und+Planung'),jdecode(''),'/39017/63414.html','true',[],'',''],
		['PAGE','63441',jdecode('Kundendienst'),jdecode(''),'/39017/63441.html','true',[],'',''],
		['PAGE','63423',jdecode('Geb%C3%A4udeh%C3%BClle'),jdecode(''),'/39017/63423.html','true',[],'','']
	],'',''],
	['PAGE','40172',jdecode('Standort%2F+Adresse'),jdecode(''),'/40172.html','true',[],'',''],
	['PAGE','28223',jdecode('Kontaktformular'),jdecode(''),'/28223.html','true',[],'',''],
	['PAGE','61967',jdecode('Ihr+Weg+zu+uns'),jdecode(''),'/61967.html','true',[],'',''],
	['PAGE','62106',jdecode('Anfahrt'),jdecode(''),'/62106.html','true',[],'',''],
	['PAGE','68201',jdecode('Homepage'),jdecode(''),'/68201.html','true',[],'','']];
var siteelementCount=26;
theSitetree.topTemplateName='Bow';
theSitetree.paletteFamily='A51C20';
theSitetree.keyvisualId='12019';
theSitetree.keyvisualName='kv_12019.jpg';
theSitetree.fontsetId='33250';
theSitetree.graphicsetId='14116';
theSitetree.contentColor='333333';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Bow',
				paletteFamily: 	'A51C20',
				keyvisualId: 	'12019',
				keyvisualName: 	'kv_12019.jpg',
				fontsetId: 		'33250',
				graphicsetId: 	'14116',
				contentColor: 	'333333',
				contentBGColor: 'FFFFFF',
				a_color: 		'F2F5F8',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4478',
internalId:  '',
customField: '20100115-170837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '64498',
internalId:  '',
customField: '20100708-180115'
};
webappMappings['7008']=webappMappings['7008-873']={
webappId:    '7008',
documentId:  '28223',
internalId:  '873',
customField: 'language:de;country:CH;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '61967',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '62106',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60817',
internalId:  '',
customField: '20091007-165416'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61893',
internalId:  '',
customField: '20100708-181520'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61902',
internalId:  '',
customField: '20090205-172149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '14421',
internalId:  '',
customField: '20100708-182256'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4616',
internalId:  '',
customField: '20090505-170309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4562',
internalId:  '',
customField: '20071104-092514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60835',
internalId:  '',
customField: '20071102-092450'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63359',
internalId:  '',
customField: '20071102-080927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61911',
internalId:  '',
customField: '20071102-080356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60844',
internalId:  '',
customField: '20071102-080702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60871',
internalId:  '',
customField: '20071102-102328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60862',
internalId:  '',
customField: '20090203-081348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60880',
internalId:  '',
customField: '20071102-081403'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63756',
internalId:  '',
customField: '20071102-081530'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '60853',
internalId:  '',
customField: '20080411-080340'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39017',
internalId:  '',
customField: '20090213-075328'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63414',
internalId:  '',
customField: '20071102-100653'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63423',
internalId:  '',
customField: '20090212-160257'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63441',
internalId:  '',
customField: '20071102-100815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '40172',
internalId:  '',
customField: '20100708-181111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28223',
internalId:  '',
customField: '20080121-110812'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '61967',
internalId:  '',
customField: '20071112-170218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62106',
internalId:  '',
customField: '20071102-102400'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4478',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '68201',
internalId:  '',
customField: '20091030-160329'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXH89';
var companyName   = 'IHR+KOMPETENZ-+UND+KUNDENDIENST-+PARTNER';
var htmlTitle	  = 'KSB+geb%C3%A4udeh%C3%BCllen+ag';
var metaKeywords  = 'Spenglerei+BedachungBedachungenGeb%EF%BF%BDudeh%EF%BF%BDllenAbdichtungenBleche';
var metaContents  = 'MinergieCO2Geb%EF%BF%BDudeh%EF%BF%BDllenFlachdachSpenglerSteildachDachreparaturBlitzschutzKlimarappen';
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();
};
