/* [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','2001',jdecode('Home'),jdecode(''), jdecode('%2F2001.html'), 'true',[],'',''],
	['PAGE','2022',jdecode('Firma'),jdecode(''), jdecode('%2F2022.html'), 'true',[],'',''],
	['PAGE','39401',jdecode('Aktuell'),jdecode(''), jdecode('%2F39401.html'), 'true',[],'',''],
	['PAGE','2094',jdecode('Leistungen'),jdecode(''), jdecode('%2F2094%2Findex.html'), 'true',[ 
		['PAGE','2136',jdecode('Holzbau'),jdecode(''), jdecode('%2F2094%2F2136.html'), 'true',[],'',''],
		['PAGE','2241',jdecode('Holzhausbau'),jdecode(''), jdecode('%2F2094%2F2241.html'), 'true',[],'',''],
		['PAGE','2157',jdecode('Komplettd%C3%A4cher'),jdecode(''), jdecode('%2F2094%2F2157.html'), 'true',[],'',''],
		['PAGE','2220',jdecode('Innenausbau'),jdecode(''), jdecode('%2F2094%2F2220.html'), 'true',[],'',''],
		['PAGE','2199',jdecode('T%C3%BCren+%2F+Fenster'),jdecode(''), jdecode('%2F2094%2F2199.html'), 'true',[],'',''],
		['PAGE','2262',jdecode('Treppen'),jdecode(''), jdecode('%2F2094%2F2262.html'), 'true',[],'',''],
		['PAGE','2115',jdecode('Dachst%C3%BChle'),jdecode(''), jdecode('%2F2094%2F2115.html'), 'true',[],'','']
	],'',''],
	['PAGE','2178',jdecode('K%C3%BCchen'),jdecode(''), jdecode('%2F2178.html'), 'true',[],'',''],
	['PAGE','2304',jdecode('Service'),jdecode(''), jdecode('%2F2304.html'), 'true',[],'',''],
	['PAGE','2325',jdecode('Referenzen'),jdecode(''), jdecode('%2F2325.html'), 'true',[],'',''],
	['PAGE','2346',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F2346%2Findex.html'), 'true',[ 
		['PAGE','2367',jdecode('Unser+Team'),jdecode(''), jdecode('%2F2346%2F2367.html'), 'true',[],'','']
	],'',''],
	['PAGE','2283',jdecode('So+finden+Sie+uns'),jdecode(''), jdecode('%2F2283.html'), 'true',[],'',''],
	['PAGE','2073',jdecode('Kontakt'),jdecode(''), jdecode('%2F2073.html'), 'true',[],'','']];
var siteelementCount=18;
theSitetree.topTemplateName='Cube';
theSitetree.paletteFamily='154186';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10354';
theSitetree.graphicsetId='10488';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'hostpoint',
  product: 'WSCSYSSSSLYTC21Y'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Cube',
				paletteFamily: 	'154186',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10354',
				graphicsetId: 	'10488',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'000000',
				e_color: 		'000000',
				f_color: 		'000000',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '2283',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2022',
internalId:  '',
customField: '20111226-063149'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2094',
internalId:  '',
customField: '20100423-042614'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2001',
internalId:  '',
customField: '20111113-081157'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2073',
internalId:  '',
customField: '20111113-081108'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2136',
internalId:  '',
customField: '20100423-045215'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2346',
internalId:  '',
customField: '20111008-152402'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2115',
internalId:  '',
customField: '20100403-055438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2241',
internalId:  '',
customField: '20100418-084442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2220',
internalId:  '',
customField: '20100403-062426'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2178',
internalId:  '',
customField: '20110714-170900'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2262',
internalId:  '',
customField: '20111008-170357'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2325',
internalId:  '',
customField: '20110714-162359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2304',
internalId:  '',
customField: '20110228-181711'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2022',
internalId:  '1006',
customField: '1006'
};
webappMappings['1501']=webappMappings['1501-23308623']={
webappId:    '1501',
documentId:  '2022',
internalId:  '23308623',
customField: '1501'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2283',
internalId:  '',
customField: '20100807-133514'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2367',
internalId:  '',
customField: '20111008-150942'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2157',
internalId:  '',
customField: '20100403-055438'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2199',
internalId:  '',
customField: '20111008-171433'
};
webappMappings['7008']=webappMappings['7008-3468']={
webappId:    '7008',
documentId:  '2073',
internalId:  '3468',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '39401',
internalId:  '',
customField: '20110610-042258'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'AHOPT0IN34DU';
var companyName   = 'HUMA+Holzbau+AG';
var htmlTitle	  = '';
var metaKeywords  = 'Holzbau%2C+Zimmerei%2C+Elementh%C3%A4user%2C+Schreinerei%2C+Bedachung%2C+Fassade%2C+B%C3%B6den%2C+Parkett%2C+Kork%2C+Kautschukboden%2C+T%C3%BCren%2C+Fenster%2C+S%C3%A4gerei%2C+Einstellplatz%2C+K%C3%BCche%2C+K%C3%BCchen%2C+Euro-K%C3%BCchen%2C+Einbauk%C3%BCche%2C+';
var metaContents  = 'der+Holzbaubetrieb+in+der+Region+Fraubrunnen%2C+Grafenried%2C+Jegenstorf%2C+Sch%C3%B6nb%C3%BChl%2C+B%C3%A4tterkinden%2C+Utzenstorf%2C+Messen%2C+M%C3%BClchi%2C+Limpach%2C+Ruppoldsried%2C+Rapperswil%2C+Scheunen%2C+Iffwil%2C+Etzelkofen%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();
};

