/* [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','4501',jdecode('Home'),jdecode(''), jdecode('%2F4501.html'), 'true',[],'',''],
	['PAGE','4552',jdecode('Dienstleistungen'),jdecode(''), jdecode('%2F4552%2Findex.html'), 'true',[ 
		['PAGE','34901',jdecode('Reparaturen+%26+Neuwicklungen'),jdecode(''), jdecode('%2F4552%2F34901.html'), 'true',[],'',''],
		['PAGE','35001',jdecode('Verkauf'),jdecode(''), jdecode('%2F4552%2F35001.html'), 'true',[],'',''],
		['PAGE','35022',jdecode('Konstruktion+%26+Bau'),jdecode(''), jdecode('%2F4552%2F35022.html'), 'true',[],'',''],
		['PAGE','51801',jdecode('Steuerungen'),jdecode(''), jdecode('%2F4552%2F51801.html'), 'true',[],'',''],
		['PAGE','56001',jdecode('Bildergalerie'),jdecode(''), jdecode('%2F4552%2F56001.html'), 'true',[],'','']
	],'',''],
	['PAGE','4573',jdecode('Firma'),jdecode(''), jdecode('%2F4573%2Findex.html'), 'true',[ 
		['PAGE','4615',jdecode('Unser+Team'),jdecode(''), jdecode('%2F4573%2F4615.html'), 'true',[],'',''],
		['PAGE','62212',jdecode('Ausbildung'),jdecode(''), jdecode('%2F4573%2F62212.html'), 'true',[],'','']
	],'',''],
	['PAGE','4636',jdecode('Kontakt'),jdecode(''), jdecode('%2F4636.html'), 'true',[],'',''],
	['PAGE','4657',jdecode('Impressum'),jdecode(''), jdecode('%2F4657.html'), 'true',[],'','']];
var siteelementCount=12;
theSitetree.topTemplateName='Office';
theSitetree.paletteFamily='727D9C';
theSitetree.keyvisualId='11165';
theSitetree.keyvisualName='kv_11165.jpg';
theSitetree.fontsetId='32062';
theSitetree.graphicsetId='13879';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'webland',
  product: 'WSCSYSSSSLY0XFY2'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Office',
				paletteFamily: 	'727D9C',
				keyvisualId: 	'11165',
				keyvisualName: 	'kv_11165.jpg',
				fontsetId: 		'32062',
				graphicsetId: 	'13879',
				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:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4501',
internalId:  '',
customField: '20111107-091447'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4552',
internalId:  '',
customField: '20110418-104912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4573',
internalId:  '',
customField: '20110907-092347'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4636',
internalId:  '',
customField: '20110417-160819'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4615',
internalId:  '',
customField: '20110729-082751'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4657',
internalId:  '',
customField: '20110418-192916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34901',
internalId:  '',
customField: '20110907-213211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35001',
internalId:  '',
customField: '20111103-124305'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '35022',
internalId:  '',
customField: '20110418-193106'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51801',
internalId:  '',
customField: '20110418-100912'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '62212',
internalId:  '',
customField: '20111103-124543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '56001',
internalId:  '',
customField: '20110417-164637'
};
webappMappings['7060']=webappMappings['7060-78d0415caabdc8d650c036e8f73577b0']={
webappId:    '7060',
documentId:  '56001',
internalId:  '78d0415caabdc8d650c036e8f73577b0',
customField: 'language:de;country:CH;'
};
var webAppHostname = 'wsc-app.webland.ch:80';
var canonHostname = 'wsc02.webland.ch';
var accountId     = 'AWB010IN2SWJ';
var companyName   = '';
var htmlTitle	  = 'Zimmermann+AG+Elektromaschinen';
var metaKeywords  = 'Elektromotoren%2C+Elektromaschinen%2C+Generatoren%2C+Neuwicklungen%2C+Zimmermann%2C+Baupumpen%2C+Motoren%2C+Steuerungen%2C+Antriebe%2C+Getriebemotoren%2C+Gleichstrommotoren%2C+Schwimmbadpumpen%2C+Hallenbadpumpen%2C+B%C3%A4derpumpen%2C+Poolpumpen%2C+Handwerkzeug%2C+Winkelschleifer%2C+Bohrmaschinen%2C+Baufr%C3%A4sen%2C+Kranmotoren%2C+Werkzeuge%2C+Staubsauger%2C+Industriestaubsauger%2C+Transformatoren%2C+Frequenzumrichter%2C+Frequenzumformer%2C+Sanftanlasser%2C+Heul%C3%BCfter%2C+Ventilator%2C+Ventilatoren%2C+Gebl%C3%A4se%2C+L%C3%BCftungsanlagen%2C+L%C3%BCftungsmotor%2C+Wechselstrommotor%2C+H%C3%BCnenberg%2C+Horw%2C+Automatiker+EFZ%2C+Ausbildung%2C+Lehrstelle';
var metaContents  = 'Kompetenter+und+zuverl%C3%A4ssiger+Partner+f%C3%BCr+Elektromotoren+und+Antriebe.';
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();
};

