/* [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','301',jdecode('Home'),jdecode(''),'/301.html','true',[],'',''],
	['PAGE','8001',jdecode('Ladenbau'),jdecode(''),'/8001.html','true',[],'',''],
	['PAGE','8085',jdecode('Fachgebiet'),jdecode(''),'/8085.html','true',[],'',''],
	['PAGE','8043',jdecode('Beratung'),jdecode(''),'/8043.html','true',[],'',''],
	['PAGE','8064',jdecode('Planung'),jdecode(''),'/8064/index.html','true',[ 
		['PAGE','19601',jdecode('Hand-Skizzen'),jdecode(''),'/8064/19601.html','true',[],'',''],
		['PAGE','19622',jdecode('CAD-Pl%C3%A4ne'),jdecode(''),'/8064/19622.html','true',[],'',''],
		['PAGE','19643',jdecode('Visualisierung'),jdecode(''),'/8064/19643.html','true',[],'','']
	],'',''],
	['PAGE','8022',jdecode('Umsetzung'),jdecode(''),'/8022/index.html','true',[ 
		['PAGE','19664',jdecode('Beispiel+Theke'),jdecode(''),'/8022/19664.html','true',[],'',''],
		['PAGE','19685',jdecode('Beispiel+Bistro'),jdecode(''),'/8022/19685.html','true',[],'',''],
		['PAGE','22701',jdecode('Beispiel+Fachmarkt'),jdecode(''),'/8022/22701.html','true',[],'','']
	],'',''],
	['PAGE','8106',jdecode('Aktuelle+Projekte'),jdecode(''),'/8106/index.html','false',[ 
		['PAGE','19706',jdecode('Ressort+Walensee'),jdecode(''),'/8106/19706.html','true',[],'',''],
		['PAGE','19727',jdecode('AVIA+Kannenfeld'),jdecode(''),'/8106/19727.html','true',[],'',''],
		['PAGE','19748',jdecode('Debrunner+Carouge'),jdecode(''),'/8106/19748.html','true',[],'',''],
		['PAGE','19769',jdecode('Dorfmarkt+Wuppenau'),jdecode(''),'/8106/19769.html','true',[],'','']
	],'',''],
	['PAGE','8127',jdecode('Referenzen'),jdecode(''),'/8127/index.html','true',[ 
		['PAGE','12001',jdecode('Handwerker-Stores'),jdecode(''),'/8127/12001.html','true',[],'',''],
		['PAGE','10422',jdecode('Tankstellen-Shops'),jdecode(''),'/8127/10422.html','true',[],'',''],
		['PAGE','12022',jdecode('Bistro+%26+Gastronomie'),jdecode(''),'/8127/12022.html','true',[],'',''],
		['PAGE','12043',jdecode('Lebensmittel'),jdecode(''),'/8127/12043.html','true',[],'',''],
		['PAGE','10401',jdecode('Detailhandel'),jdecode(''),'/8127/10401.html','true',[],'',''],
		['PAGE','10443',jdecode('Fach-+%26+Grossm%C3%A4rkte'),jdecode(''),'/8127/10443.html','true',[],'',''],
		['PAGE','22722',jdecode('Individuall%C3%B6sungen'),jdecode(''),'/8127/22722.html','true',[],'','']
	],'',''],
	['PAGE','8148',jdecode('Team'),jdecode(''),'/8148/index.html','true',[ 
		['PAGE','13001',jdecode('Gesch%C3%A4ftsleitung'),jdecode(''),'/8148/13001.html','true',[],'',''],
		['PAGE','19790',jdecode('Projektleiter'),jdecode(''),'/8148/19790.html','true',[],'',''],
		['PAGE','19811',jdecode('Office'),jdecode(''),'/8148/19811.html','true',[],'','']
	],'',''],
	['PAGE','6201',jdecode('Kontakt'),jdecode(''),'/6201.html','true',[],'',''],
	['PAGE','26501',jdecode('Impressum'),jdecode(''),'/26501.html','true',[],'','']];
var siteelementCount=31;
theSitetree.topTemplateName='Seifenblase';
theSitetree.paletteFamily='ADADAD';
theSitetree.keyvisualId='2353';
theSitetree.keyvisualName='blanko.jpg';
theSitetree.fontsetId='381';
theSitetree.graphicsetId='429';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Seifenblase',
				paletteFamily: 	'ADADAD',
				keyvisualId: 	'2353',
				keyvisualName: 	'blanko.jpg',
				fontsetId: 		'381',
				graphicsetId: 	'429',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'FFFFFF',
				b_color: 		'FFFFFF',
				c_color: 		'FFFFFF',
				d_color: 		'999999',
				e_color: 		'666666',
				f_color: 		'CCCCCC',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['7008']=webappMappings['7008-1067']={
webappId:    '7008',
documentId:  '6201',
internalId:  '1067',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19601',
internalId:  '',
customField: '20090213-093436'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '301',
internalId:  '',
customField: '20090218-071944'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8001',
internalId:  '',
customField: '20090213-093246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8022',
internalId:  '',
customField: '20090213-093551'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8043',
internalId:  '',
customField: '20090213-093350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8064',
internalId:  '',
customField: '20090213-093411'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8085',
internalId:  '',
customField: '20090213-093329'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8106',
internalId:  '',
customField: '20090218-071953'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8127',
internalId:  '',
customField: '20090213-093928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8148',
internalId:  '',
customField: '20090217-064850'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6201',
internalId:  '',
customField: '20090213-094101'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10401',
internalId:  '',
customField: '20090209-072227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10422',
internalId:  '',
customField: '20090209-072104'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10443',
internalId:  '',
customField: '20090209-072301'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12001',
internalId:  '',
customField: '20090209-072040'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '13001',
internalId:  '',
customField: '20090217-065121'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12022',
internalId:  '',
customField: '20090209-072130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '12043',
internalId:  '',
customField: '20090209-072202'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19622',
internalId:  '',
customField: '20090213-093502'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19643',
internalId:  '',
customField: '20090213-093527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19664',
internalId:  '',
customField: '20090213-093609'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19685',
internalId:  '',
customField: '20090213-093632'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19706',
internalId:  '',
customField: '20090213-093758'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19727',
internalId:  '',
customField: '20090213-093816'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19748',
internalId:  '',
customField: '20090213-093844'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19769',
internalId:  '',
customField: '20090218-072114'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19790',
internalId:  '',
customField: '20090213-094033'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19811',
internalId:  '',
customField: '20090217-065006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22701',
internalId:  '',
customField: '20090213-093702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '22722',
internalId:  '',
customField: '20090209-072401'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26501',
internalId:  '',
customField: '20090213-093222'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '301',
internalId:  '1006',
customField: '1006'
};
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INEJ63';
var companyName   = 'Wir+bauen+Emotionen.';
var htmlTitle	  = 'Wir+bauen+L%C3%A4den+mit+Emotionen';
var metaKeywords  = '';
var metaContents  = 'Ladenbau%2CLadenbauer%2CLaden+bauen%2Cumbauen%2Cneubau%2Crenovieren%2Ctheke%2Claden%2Cgestell%2Cregal%2Ceinrichtung%2Cbistro%2Ccc%2Ctopcc%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();
};

