/* [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','4599',jdecode('Home'),jdecode(''), jdecode('%2F4599.html'), 'true',[],'',''],
	['PAGE','9523',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F9523%2Findex.html'), 'true',[ 
		['PAGE','9550',jdecode('Das+Unternehmen'),jdecode(''), jdecode('%2F9523%2F9550.html'), 'true',[],'',''],
		['PAGE','9577',jdecode('Standorte'),jdecode(''), jdecode('%2F9523%2F9577.html'), 'true',[],'',''],
		['PAGE','9604',jdecode('Das+Team'),jdecode(''), jdecode('%2F9523%2F9604.html'), 'true',[],'',''],
		['PAGE','36701',jdecode('Unsere+Philosophie'),jdecode(''), jdecode('%2F9523%2F36701.html'), 'true',[],'','']
	],'',''],
	['PAGE','9631',jdecode('Produkte%2C+Leistungen'),jdecode(''), jdecode('%2F9631%2Findex.html'), 'true',[ 
		['PAGE','27801',jdecode('W%C3%A4rmeerzeuger'),jdecode(''), jdecode('%2F9631%2F27801.html'), 'true',[],'',''],
		['PAGE','28901',jdecode('Umw%C3%A4lzpumpen'),jdecode(''), jdecode('%2F9631%2F28901.html'), 'true',[],'',''],
		['PAGE','28928',jdecode('Druckausdehnungsgef%C3%A4sse'),jdecode(''), jdecode('%2F9631%2F28928.html'), 'true',[],'',''],
		['PAGE','28955',jdecode('Elysator'),jdecode(''), jdecode('%2F9631%2F28955.html'), 'true',[],'',''],
		['PAGE','30101',jdecode('Kampmann+Produkte'),jdecode(''), jdecode('%2F9631%2F30101.html'), 'true',[],'',''],
		['PAGE','36755',jdecode('W%C3%A4rmepumpenboiler'),jdecode(''), jdecode('%2F9631%2F36755.html'), 'true',[],'',''],
		['PAGE','39907',jdecode('Thermometer-Kugelhahnen'),jdecode(''), jdecode('%2F9631%2F39907.html'), 'true',[],'','']
	],'',''],
	['PAGE','9658',jdecode('Kontakt'),jdecode(''), jdecode('%2F9658%2Findex.html'), 'true',[ 
		['PAGE','9685',jdecode('Adresse%2C+Telefon'),jdecode(''), jdecode('%2F9658%2F9685.html'), 'true',[],'','']
	],'',''],
	['PAGE','10501',jdecode('Links'),jdecode(''), jdecode('%2F10501.html'), 'true',[],'',''],
	['PAGE','10902',jdecode('Ihr+Weg+zu+uns'),jdecode(''), jdecode('%2F10902.html'), 'true',[],'',''],
	['PAGE','41601',jdecode('Anfahrt'),jdecode(''), jdecode('%2F41601.html'), 'true',[],'',''],
	['PAGE','42955',jdecode('E-Shop'),jdecode(''), jdecode('%2F42955.html'), 'true',[],'','']];
var siteelementCount=20;
theSitetree.topTemplateName='Stylus';
theSitetree.paletteFamily='B0CBD6';
theSitetree.keyvisualId='1972';
theSitetree.keyvisualName='handwerk.jpg';
theSitetree.fontsetId='330';
theSitetree.graphicsetId='383';
theSitetree.contentColor='000066';
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: 	'1972',
				keyvisualName: 	'handwerk.jpg',
				fontsetId: 		'330',
				graphicsetId: 	'383',
				contentColor: 	'000066',
				contentBGColor: 'FFFFFF',
				a_color: 		'B0CBD6',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4599',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9523',
internalId:  '',
customField: '20120104-165343'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9550',
internalId:  '',
customField: '20120104-165817'
};
webappMappings['1501']=webappMappings['1501-2254161']={
webappId:    '1501',
documentId:  '4599',
internalId:  '2254161',
customField: '1501'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '10902',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4599',
internalId:  '',
customField: '20090108-170621'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '41601',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9577',
internalId:  '',
customField: '20070927-171903'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9604',
internalId:  '',
customField: '20100309-184224'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36701',
internalId:  '',
customField: '20071001-100726'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9631',
internalId:  '',
customField: '20111026-172517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '27801',
internalId:  '',
customField: '20050926-132923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28901',
internalId:  '',
customField: '20111026-173551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28928',
internalId:  '',
customField: '20100820-094937'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28955',
internalId:  '',
customField: '20100820-094406'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '30101',
internalId:  '',
customField: '20041006-165038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '36755',
internalId:  '',
customField: '20070927-172111'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39907',
internalId:  '',
customField: '20060309-140125'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9658',
internalId:  '',
customField: '20071001-100910'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9685',
internalId:  '',
customField: '20090108-164221'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10501',
internalId:  '',
customField: '20050926-133053'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10902',
internalId:  '',
customField: '20100820-111625'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41601',
internalId:  '',
customField: '20071001-102243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '42955',
internalId:  '',
customField: '20100817-144347'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0INXVXB';
var companyName   = '';
var htmlTitle	  = 'Neutherm+Heiztechnik+Schaefer+Interdomo+Kampmann+EMB-Pumpen+Allmess+Reflex+Elysator+Oventrop+De+Dietrich';
var metaKeywords  = 'Neutherm+Heizung%2C+Schaefer-Heiztechnik%2C+Kampmann%2C+Reflex%2C+EMB%2C+Grundfoss%2C+Danfoss%2C+Oventrop%2C+De+Dietrich%2C+De+Dietrich+Heizung%2C+Protherm%2C+Interdomo%2C+Elysator%2C+Caleffi%2C+Hummel%2C+Simplex%2C+TKM%2C+Lufterhitzer%2C+Bodenkanalheizung%2C+Deckenstrahlplatten%2C+Heizungspumpen%2C+Thermostatventile%2C+Heizkoerper%2C+Heizk%C3%B6rper%2C+Rohrhaltegabeln%2C+Sanipex%2C+Warmwasserboiler%2C+Thermometerkugelhahn%2C+Kugelhahn%2C+Heizungsverteiler%2C+Conex+Verschraubung%2C+Druckausdehnungsgefaess+Reflex%2C+Expansionsgefaess+Reflex%2CExpansionsgefaess+Pneumatex%2C+Domoplus%2C+Schutzvlies+Floorleiner%2C+Bodenkanalkonvektoren%2C+Kampmann+Lufterhitzer%2C+Kampmann+Luftheizapparat%2C+T%C3%BCrluftschleier%2C+SBS+Holzheizkessel';
var metaContents  = 'Heiztechnik%2C+Heizkessel%2C+Pumpen%2C+Waermezaehler%2C+Gasheizung%2C+Oelheizung%2C+Holzheizung%2C+Waermepumpen%2C';
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();
};

