/* [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','24685',jdecode('Wir+%C3%BCber+uns'),jdecode(''),'/24685/index.html','true',[ 
		['PAGE','24703',jdecode('Mitarbeiter+B%C3%BCro'),jdecode(''),'/24685/24703.html','true',[],'',''],
		['PAGE','24712',jdecode('Mitarbeiter+Lager'),jdecode(''),'/24685/24712.html','true',[],'','']
	],'',''],
	['PAGE','28322',jdecode('Kontakt'),jdecode(''),'/28322.html','true',[],'',''],
	['PAGE','21100',jdecode('Preislisten+'),jdecode(''),'/21100.html','true',[],'',''],
	['PAGE','4589',jdecode('Eigenproduktion'),jdecode(''),'/4589.html','true',[],'',''],
	['PAGE','23610',jdecode('ASD+Gummimatten+'),jdecode(''),'/23610/index.html','true',[ 
		['PAGE','31501',jdecode('Produkte'),jdecode(''),'/23610/31501.html','true',[],'',''],
		['PAGE','31701',jdecode('Datenbl%C3%A4tter'),jdecode(''),'/23610/31701.html','true',[],'','']
	],'',''],
	['PAGE','4562',jdecode('Hochbau'),jdecode(''),'/4562.html','true',[],'',''],
	['PAGE','20400',jdecode('Bestelllisten'),jdecode(''),'/20400.html','true',[],'',''],
	['PAGE','24400',jdecode('Pr%C3%BCfberichte'),jdecode(''),'/24400.html','true',[],'',''],
	['PAGE','23962',jdecode('DE+RYCK+Produkte'),jdecode(''),'/23962/index.html','true',[ 
		['PAGE','23971',jdecode('Kataloge'),jdecode(''),'/23962/23971.html','true',[],'',''],
		['PAGE','23980',jdecode('Preisliste'),jdecode(''),'/23962/23980.html','true',[],'',''],
		['PAGE','23989',jdecode('Farbmuster'),jdecode(''),'/23962/23989.html','true',[],'','']
	],'',''],
	['PAGE','8295',jdecode('Lichtkuppeln'),jdecode(''),'/8295.html','true',[],'',''],
	['PAGE','19286',jdecode('Ihr+Weg+zu+uns'),jdecode(''),'/19286.html','true',[],'',''],
	['PAGE','8968',jdecode('Umfrage'),jdecode(''),'/8968.html','true',[],'',''],
	['PAGE','5522',jdecode('G%C3%A4stebuch'),jdecode(''),'/5522/index.html','true',[ 
		['PAGE','5523',jdecode('Eintr%C3%A4ge'),jdecode(''),'/5522/5523.html','false',[],'','']
	],'',''],
	['PAGE','23515',jdecode('Links'),jdecode(''),'/23515.html','true',[],'','']];
var siteelementCount=23;
theSitetree.topTemplateName='Disco';
theSitetree.paletteFamily='3D5465';
theSitetree.keyvisualId='4606';
theSitetree.keyvisualName='architekt.jpg';
theSitetree.fontsetId='307';
theSitetree.graphicsetId='364';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='3D5465';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Disco',
				paletteFamily: 	'3D5465',
				keyvisualId: 	'4606',
				keyvisualName: 	'architekt.jpg',
				fontsetId: 		'307',
				graphicsetId: 	'364',
				contentColor: 	'FFFFFF',
				contentBGColor: '3D5465',
				a_color: 		'3D5465',
				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:  '4478',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '28322',
internalId:  '',
customField: '20090414-094550'
};
webappMappings['1002']=webappMappings['1002-5522ABW0X0INXSY3']={
webappId:    '1002',
documentId:  '5522',
internalId:  '5522ABW0X0INXSY3',
customField: 'icq=false'
};
webappMappings['1501']=webappMappings['1501-88920']={
webappId:    '1501',
documentId:  '4478',
internalId:  '88920',
customField: '1501'
};
webappMappings['7005']=webappMappings['7005-195']={
webappId:    '7005',
documentId:  '8968',
internalId:  '195',
customField: 'language:de;country:CH;'
};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '19286',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4478',
internalId:  '',
customField: '20100604-131709'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8295',
internalId:  '',
customField: '20030729-145739'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21100',
internalId:  '',
customField: '20090414-103705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23962',
internalId:  '',
customField: '20080307-140554'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23971',
internalId:  '',
customField: '20090330-144828'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23980',
internalId:  '',
customField: '20090330-144912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23989',
internalId:  '',
customField: '20080307-143751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '20400',
internalId:  '',
customField: '20090414-100133'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24400',
internalId:  '',
customField: '20081029-113254'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4562',
internalId:  '',
customField: '20090414-110052'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4589',
internalId:  '',
customField: '20090414-110026'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23610',
internalId:  '',
customField: '20100604-113025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31501',
internalId:  '',
customField: '20100604-103518'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '31701',
internalId:  '',
customField: '20100604-111123'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5522',
internalId:  '',
customField: '20030725-093745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5523',
internalId:  '',
customField: '20030725-093745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8968',
internalId:  '',
customField: '20030730-084927'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19286',
internalId:  '',
customField: '20090414-103051'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23515',
internalId:  '',
customField: '20100604-142627'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24685',
internalId:  '',
customField: '20090305-104848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24703',
internalId:  '',
customField: '20090305-143848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24712',
internalId:  '',
customField: '20090323-110600'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXSY3';
var companyName   = 'Baumaterialien+Spezialprodukte';
var htmlTitle	  = '';
var metaKeywords  = 'ASD%2C+Herzog+%2B+Partner%2C+Bau%2C+Baumaterial%2C+Hochbaulager%2C+Steinwolle%2C+Bauartikel%2C+Hochbau%2C+Tiefbau%2C+Isolation%2C+Bauprodukte%2C+Material%2C+Materialhandel%2C+Gummimehl%2C+Gummipaletten%2C+Gummigranulat%2C+Steinwolle%2C+Stallmatten%2C+Isolierunsmatten%2C+Spielplatzmatten%2C+Golfmatten';
var metaContents  = 'ASD+Herzog+%2B+Partner%2C+Baumaterialien+und+Bauspezialprodukte';
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();
};

