/* [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','24201',jdecode('News'),jdecode(''), jdecode('%2F24201.html'), 'true',[],'',''],
	['PAGE','6843',jdecode('Wir+bieten...'),jdecode(''), jdecode('%2F6843%2Findex.html'), 'true',[ 
		['PAGE','6801',jdecode('Dienstleistungen'),jdecode(''), jdecode('%2F6843%2F6801.html'), 'true',[],'',''],
		['PAGE','7722',jdecode('Strategic+Partner'),jdecode(''), jdecode('%2F6843%2F7722.html'), 'true',[],'',''],
		['PAGE','7701',jdecode('CVS%C2%AE+L%C3%BCftung'),jdecode(''), jdecode('%2F6843%2F7701.html'), 'true',[],'',''],
		['PAGE','9901',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''), jdecode('%2F6843%2F9901.html'), 'false',[],'','']
	],'',''],
	['PAGE','1101',jdecode('Wir+%C3%BCber+uns...'),jdecode(''), jdecode('%2F1101%2Findex.html'), 'true',[ 
		['PAGE','29001',jdecode('Pr%C3%A4sentation'),jdecode(''), jdecode('%2F1101%2F29001.html'), 'true',[],'','']
	],'',''],
	['PAGE','9401',jdecode('Kontakt'),jdecode(''), jdecode('%2F9401%2Findex.html'), 'true',[ 
		['PAGE','100601',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''), jdecode('%2F9401%2F100601.html'), 'false',[],'','']
	],'','']];
var siteelementCount=10;
theSitetree.topTemplateName='Profile';
theSitetree.paletteFamily='003399';
theSitetree.keyvisualId='1235';
theSitetree.keyvisualName='handschlag.jpg';
theSitetree.fontsetId='192';
theSitetree.graphicsetId='228';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2QE'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Profile',
				paletteFamily: 	'003399',
				keyvisualId: 	'1235',
				keyvisualName: 	'handschlag.jpg',
				fontsetId: 		'192',
				graphicsetId: 	'228',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'003399',
				b_color: 		'000066',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-5348']={
webappId:    '7008',
documentId:  '7722',
internalId:  '5348',
customField: 'language:de;country:CH;'
};
webappMappings['7008']=webappMappings['7008-5349']={
webappId:    '7008',
documentId:  '9401',
internalId:  '5349',
customField: 'language:de;country:CH;'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '7701',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6843',
internalId:  '',
customField: '20100810-224339'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24201',
internalId:  '',
customField: '20111223-111443'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6801',
internalId:  '',
customField: '20111223-112922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7722',
internalId:  '',
customField: '20111223-113538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9901',
internalId:  '',
customField: '20070120-121345'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7701',
internalId:  '',
customField: '20101228-102829'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '1101',
internalId:  '',
customField: '20100810-224243'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29001',
internalId:  '',
customField: '20111223-132253'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9401',
internalId:  '',
customField: '20100810-230944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '100601',
internalId:  '',
customField: '20090125-110248'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0IN27F0';
var companyName   = 'VKP+AG++...+eine+innovative+Dienstleistung';
var htmlTitle	  = 'http%3A%2F%2Fwww.vkp-ag.ch';
var metaKeywords  = 'L%C3%BCftung%2C+Bayernluft%2C+Comfort+ventilation+system%2C+dezentrale+L%C3%BCftung%2C+W%C3%A4rmer%C3%BCckgewinnung%2C+Areazione%2C+ventilazione+controllata%2C+VKP%2C+VKP+AG%2C+Lueftung%2C+Kontrollierte+Lueftung%2C+CVS%2C+CVS%3F%2C+Komfortlueftung%2C+comfort%2C+ventilation%2C+system%2C+comfort+ventilation+system%2C+Waermetauscher%2C+effizient%2C+WT%2C+Sensor%2C+Temperatur%2C+Temperatursensor%2C+Feuchte%2C+Feuchtesensor%2C+Stroemung%2C+Stroemungssensor%2C++Messtechnik%2C+Fuehler%2C+Verkauf%2C+Dienstleistung%2C+Marketing%2C+Messgeraete%2C+Temperaturmesstechnik%2C+Sales%2C+Druck%2C+Licht%2C+Lux%2C+pH%2C+Leitfaehigkeit%2C+Sonden%2C+Beratung%2C+Temperatur-+Mess-+und+Regeltechnik%2C++RTD%2C+Measuring%2C+Technology%2C+Temperature%2C+temperatur+sensor%2C+Humidity%2C+humdity+sensor%2C+Flow%2C+flow+sensor%2C+EX%2C+ATEX%2C+Fuehler%2C+Thermoelemente%2C+Thermometer%2C+Widerstandsthermometer%2C+Widerstandsthermoelemente%2C+Kabelfuehler%2C+Anlegefuehler%2C+Einsteckfuehler%2C+CVS+robusto+A%2C+CVS+robusto+B%2C+kontrolliertes+Lueftungssystem%2C+dezentral%2C+comfort+ventilation+system%2C+HVAC%2C+Klima%2C+Lueftungstechnik%2C+Kontrollierte+Lueftung%2C+Waermerueckgewinnung%2C+%28WRG%29%2C+Einzelraumlueftung%2C+Einzelraumlueftungsgeraet%2C+Raumlueftung%2C+Raumlueftungsgeraet%2C+Lueftungsgeraet%2C+Stroemungssensoren%2C+Messtechnik%2C+Mikrosysteme%2C+Feuchtesensoren%2C+Temperatursensoren%2C+Sensor%2C+MST%2C+Duennschicht%2C+Duennschicht-Sensoren%2C+Duennschicht-Technologie%2C+Thinfilm%2C+Thinfilm+technology%2C+Probe%2C+probes%2C+temperature+probes%2C+sondes%2C+sondes+de+temperature%2C+couche+mince%2C+senseurs%2C+capteur%2C+capteurs%2C+capteurs+de+temperature%2C+debit%2C+flux%2C+humidite%2C+sonda%2C+sonde+temperatura%2C+temperatura%2C+Einzelraumlueftungssysteme%2C+sensori%2C+sensore%2C+portata%2C+flusso%2C+temperatura%2C+livello%2C+';
var metaContents  = 'L%C3%BCftung%2C+Comfort+ventilation+system%2C+dezentrale+L%C3%BCftung%2C+W%C3%A4rmer%C3%BCckgewinnung%2C+VKP%2C+VKP+AG%2C+Lueftung%2C+Kontrollierte+Lueftung%2C+CVS%2C+CVS%3F%2C+Komfortlueftung%2C+comfort%2C+ventilation%2C+system%2C+comfort+ventilation+system%2C+Waermetauscher%2C+effizient%2C+WT%2C+Sensor%2C+Temperatur%2C+Temperatursensor%2C+Feuchte%2C+Feuchtesensor%2C+Stroemung%2C+Stroemungssensor%2C++Messtechnik%2C+Fuehler%2C+Verkauf%2C+Dienstleistung%2C+Marketing%2C+Messgeraete%2C+Temperaturmesstechnik%2C+Sales%2C+Druck%2C+Licht%2C+Lux%2C+pH%2C+Leitfaehigkeit%2C+Sonden%2C+Beratung%2C+Temperatur-+Mess-+und+Regeltechnik%2C++RTD%2C+Measuring%2C+Technology%2C+Temperature%2C+temperatur+sensor%2C+Humidity%2C+humdity+sensor%2C+Flow%2C+flow+sensor%2C+EX%2C+ATEX%2C+Fuehler%2C+Thermoelemente%2C+Thermometer%2C+Bayernluft%2C+Widerstandsthermometer%2C+Widerstandsthermoelemente%2C+Kabelfuehler%2C+Anlegefuehler%2C+Einsteckfuehler%2C+CVS+robusto+A%2C+CVS+robusto+B%2C+kontrolliertes+Lueftungssystem%2C+dezentral%2C+comfort+ventilation+system%2C+HVAC%2C+Klima%2C+Lueftungstechnik%2C+Kontrollierte+Lueftung%2C+Waermerueckgewinnung%2C+%28WRG%29%2C+Einzelraumlueftung%2C+Einzelraumlueftungsgeraet%2C+Raumlueftung%2C+Raumlueftungsgeraet%2C+Lueftungsgeraet%2C+Stroemungssensoren%2C+Messtechnik%2C+Mikrosysteme%2C+Feuchtesensoren%2C+Temperatursensoren%2C+Sensor%2C+MST%2C+Duennschicht%2C+Duennschicht-Sensoren%2C+Duennschicht-Technologie%2C+Thinfilm%2C+Thinfilm+technology%2C+Probe%2C+probes%2C+temperature+probes%2C+sondes%2C+sondes+de+temperature%2C+couche+mince%2C+senseurs%2C+capteur%2C+capteurs%2C+capteurs+de+temperature%2C+debit%2C+flux%2C+humidite%2C+sonda%2C+sonde+temperatura%2C+temperatura%2C+Einzelraumlueftungssysteme%2C+sensori%2C+sensore%2C+portata%2C+flusso%2C+temperatura%2C+livello%2C+areazione%2C+ventilazione+controllata%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();
};

