/* [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','2501',jdecode('Home'),jdecode(''), jdecode('%2F2501.html'), 'true',[],'',''],
	['PAGE','2552',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F2552%2Findex.html'), 'true',[ 
		['PAGE','11601',jdecode('Team'),jdecode(''), jdecode('%2F2552%2F11601.html'), 'true',[],'',''],
		['PAGE','21201',jdecode('Jobs'),jdecode(''), jdecode('%2F2552%2F21201.html'), 'true',[],'','']
	],'',''],
	['PAGE','2573',jdecode('Kundendienst'),jdecode(''), jdecode('%2F2573.html'), 'true',[],'',''],
	['PAGE','2594',jdecode('Elektroinstallation'),jdecode(''), jdecode('%2F2594%2Findex.html'), 'true',[ 
		['PAGE','5601',jdecode('Stark-%2FSchwachstrom'),jdecode(''), jdecode('%2F2594%2F5601.html'), 'true',[],'','']
	],'',''],
	['PAGE','2615',jdecode('Umbau+und+Sanierung'),jdecode(''), jdecode('%2F2615%2Findex.html'), 'true',[ 
		['PAGE','7801',jdecode('Wohn-%2FGesch%C3%A4ftsr%C3%A4ume'),jdecode(''), jdecode('%2F2615%2F7801.html'), 'true',[],'','']
	],'',''],
	['PAGE','2636',jdecode('Geb%C3%A4udeautomation'),jdecode(''), jdecode('%2F2636%2Findex.html'), 'true',[ 
		['PAGE','8901',jdecode('Showraum'),jdecode(''), jdecode('%2F2636%2F8901.html'), 'true',[],'',''],
		['PAGE','9401',jdecode('Fotogalerie'),jdecode(''), jdecode('%2F2636%2F9401.html'), 'true',[],'','']
	],'',''],
	['PAGE','2657',jdecode('Erneuerbare+Energien'),jdecode(''), jdecode('%2F2657.html'), 'true',[],'',''],
	['PAGE','34934',jdecode('Neuheit+E-Box'),jdecode(''), jdecode('%2F34934.html'), 'true',[],'',''],
	['PAGE','41334',jdecode('Aktuelles'),jdecode(''), jdecode('%2F41334%2Findex.html'), 'true',[ 
		['PAGE','45734',jdecode('Elektroauto'),jdecode(''), jdecode('%2F41334%2F45734.html'), 'true',[],'',''],
		['PAGE','41355',jdecode('Asbest-Schulung'),jdecode(''), jdecode('%2F41334%2F41355.html'), 'true',[],'',''],
		['PAGE','37934',jdecode('Wir+sagen+Danke'),jdecode(''), jdecode('%2F41334%2F37934.html'), 'true',[],'',''],
		['PAGE','23201',jdecode('Neue+Firma+gegr%C3%BCndet'),jdecode(''), jdecode('%2F41334%2F23201.html'), 'true',[],'','']
	],'',''],
	['PAGE','2699',jdecode('Hit-Angebot'),jdecode(''), jdecode('%2F2699.html'), 'true',[],'',''],
	['PAGE','24212',jdecode('Kontakt'),jdecode(''), jdecode('%2F24212.html'), 'true',[],'','']];
var siteelementCount=21;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='555454';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10461';
theSitetree.graphicsetId='10892';
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: 			'Alpha',
				paletteFamily: 	'555454',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10461',
				graphicsetId: 	'10892',
				contentColor: 	'000000',
				contentBGColor: 'FFFFFF',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'555454',
				e_color: 		'555454',
				f_color: 		'555454',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2501',
internalId:  '',
customField: '20110725-154043'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2552',
internalId:  '',
customField: '20110524-095408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2573',
internalId:  '',
customField: '20110121-100836'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2594',
internalId:  '',
customField: '20110218-144038'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5601',
internalId:  '',
customField: '20100511-112517'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2615',
internalId:  '',
customField: '20100511-112529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7801',
internalId:  '',
customField: '20100511-112543'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2636',
internalId:  '',
customField: '20100512-101143'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8901',
internalId:  '',
customField: '20100511-112606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9401',
internalId:  '',
customField: '20100511-112620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2657',
internalId:  '',
customField: '20110318-152045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '37934',
internalId:  '',
customField: '20110524-115154'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '34934',
internalId:  '',
customField: '20110523-162342'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11601',
internalId:  '',
customField: '20110331-110939'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '2699',
internalId:  '',
customField: '20110523-160731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41334',
internalId:  '',
customField: '20110725-154010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '21201',
internalId:  '',
customField: '20110524-150821'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '2501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '23201',
internalId:  '',
customField: '20110817-161327'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '24212',
internalId:  '',
customField: '20100512-102659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '41355',
internalId:  '',
customField: '20110725-153821'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '45734',
internalId:  '',
customField: '20110725-154120'
};
var webAppHostname = 'wsc-app.webland.ch:80';
var canonHostname = 'wsc02.webland.ch';
var accountId     = 'AWB010IN2RTG';
var companyName   = 'STARK+UND+STROM';
var htmlTitle	  = 'Nussbaumer+Elektro+Zug+AG+-+Stark+und+Strom';
var metaKeywords  = 'Andreas+Hostettler+Nussbaumer+Elektro+Zug+AG+Nussbaumer+Ernst+Elektroservice+Kundendienst+Elektroinstallation+Umbau+und+Sanierung+Geb%C3%A4udeautomation+Erneuerbare+Energien+It+und+Telematik+sch%C3%B6nes+Licht+indirekte+Beleuchtung+elekto+Aegeri+%C3%84geri+Starkstrom+Schwachstrom+waschmaschinen+tumbler+ger%C3%A4tetausch+unterhalt+und+service+verwaltungen+elektrische+installationen+lichtl%C3%B6sungen+elektroanlagen+gegensprechanlagen+brandmeldeanlagen+fernseh+und+radio+showraum+zug+notbeleuchtung+sicherheit+beleuchtung';
var metaContents  = 'Nussbaumer+Elektro+Zug+AG%0D%0AEin+Unternehmen+mit+Tradition%2C+Engagement+und+Verantwortung.+';
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();
};

