/* [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','6501',jdecode('HOME'),jdecode(''), jdecode('%2F6501.html'), 'true',[],'',''],
	['PAGE','8701',jdecode('FIRMA'),jdecode(''), jdecode('%2F8701%2Findex.html'), 'true',[ 
		['PAGE','8722',jdecode('Partnerfirmen'),jdecode(''), jdecode('%2F8701%2F8722.html'), 'true',[],'','']
	],'',''],
	['PAGE','8743',jdecode('ENGINEERING'),jdecode(''), jdecode('%2F8743%2Findex.html'), 'true',[ 
		['PAGE','8764',jdecode('Projektplanung'),jdecode(''), jdecode('%2F8743%2F8764.html'), 'true',[],'',''],
		['PAGE','8785',jdecode('Abl%C3%A4ufe'),jdecode(''), jdecode('%2F8743%2F8785.html'), 'true',[],'',''],
		['PAGE','8806',jdecode('Kontaktpersonen'),jdecode(''), jdecode('%2F8743%2F8806.html'), 'true',[],'','']
	],'',''],
	['PAGE','8827',jdecode('MASCHINENPARK'),jdecode(''), jdecode('%2F8827%2Findex.html'), 'true',[ 
		['PAGE','9706',jdecode('Sattelschlepper'),jdecode(''), jdecode('%2F8827%2F9706.html'), 'true',[],'',''],
		['PAGE','9727',jdecode('Aufleger'),jdecode(''), jdecode('%2F8827%2F9727.html'), 'true',[],'',''],
		['PAGE','9748',jdecode('Hebeb%C3%BChnen'),jdecode(''), jdecode('%2F8827%2F9748.html'), 'true',[],'',''],
		['PAGE','19101',jdecode('25-t-Pneukran'),jdecode(''), jdecode('%2F8827%2F19101.html'), 'true',[],'',''],
		['PAGE','19122',jdecode('28-t-Pneukran'),jdecode(''), jdecode('%2F8827%2F19122.html'), 'true',[],'',''],
		['PAGE','19301',jdecode('35-t-Pneukran'),jdecode(''), jdecode('%2F8827%2F19301.html'), 'true',[],'',''],
		['PAGE','19322',jdecode('35-t-Pneukran'),jdecode(''), jdecode('%2F8827%2F19322.html'), 'true',[],'',''],
		['PAGE','9622',jdecode('40-t-Pneukran'),jdecode(''), jdecode('%2F8827%2F9622.html'), 'true',[],'',''],
		['PAGE','19364',jdecode('55-t-Pneukran'),jdecode(''), jdecode('%2F8827%2F19364.html'), 'true',[],'',''],
		['PAGE','19385',jdecode('65-t-Pneukran'),jdecode(''), jdecode('%2F8827%2F19385.html'), 'true',[],'',''],
		['PAGE','9643',jdecode('66-t-Pneukran'),jdecode(''), jdecode('%2F8827%2F9643.html'), 'true',[],'',''],
		['PAGE','19406',jdecode('75-t-Pneukran'),jdecode(''), jdecode('%2F8827%2F19406.html'), 'true',[],'',''],
		['PAGE','19427',jdecode('80-t-Pneukran'),jdecode(''), jdecode('%2F8827%2F19427.html'), 'true',[],'',''],
		['PAGE','19448',jdecode('90-t-Pneukran'),jdecode(''), jdecode('%2F8827%2F19448.html'), 'true',[],'',''],
		['PAGE','9664',jdecode('100-t-Pneukran'),jdecode(''), jdecode('%2F8827%2F9664.html'), 'true',[],'',''],
		['PAGE','19469',jdecode('100-t-Pneukran'),jdecode(''), jdecode('%2F8827%2F19469.html'), 'true',[],'',''],
		['PAGE','19490',jdecode('130-t-Pneukran'),jdecode(''), jdecode('%2F8827%2F19490.html'), 'true',[],'',''],
		['PAGE','9685',jdecode('150-t-Pneukran'),jdecode(''), jdecode('%2F8827%2F9685.html'), 'true',[],'',''],
		['PAGE','19511',jdecode('160-t-Pneukran'),jdecode(''), jdecode('%2F8827%2F19511.html'), 'true',[],'',''],
		['PAGE','19532',jdecode('180-t-Pneukran'),jdecode(''), jdecode('%2F8827%2F19532.html'), 'true',[],'',''],
		['PAGE','19553',jdecode('250-t-Pneukran'),jdecode(''), jdecode('%2F8827%2F19553.html'), 'true',[],'',''],
		['PAGE','19574',jdecode('500-t-Pneukran'),jdecode(''), jdecode('%2F8827%2F19574.html'), 'true',[],'',''],
		['PAGE','26801',jdecode('MK-80+Mobilbaukran'),jdecode(''), jdecode('%2F8827%2F26801.html'), 'true',[],'',''],
		['PAGE','26822',jdecode('MK-110+Mobilbaukran'),jdecode(''), jdecode('%2F8827%2F26822.html'), 'true',[],'','']
	],'',''],
	['PAGE','8932',jdecode('REPORTAGEN'),jdecode(''), jdecode('%2F8932%2Findex.html'), 'true',[ 
		['PAGE','8953',jdecode('Pomdor'),jdecode(''), jdecode('%2F8932%2F8953.html'), 'true',[],'',''],
		['PAGE','8974',jdecode('Littau'),jdecode(''), jdecode('%2F8932%2F8974.html'), 'true',[],'',''],
		['PAGE','8995',jdecode('B%C3%A4ume'),jdecode(''), jdecode('%2F8932%2F8995.html'), 'true',[],'','']
	],'',''],
	['PAGE','9016',jdecode('FOTOGALERIE'),jdecode(''), jdecode('%2F9016%2Findex.html'), 'true',[ 
		['PAGE','9037',jdecode('Pneukrane'),jdecode(''), jdecode('%2F9016%2F9037.html'), 'true',[],'',''],
		['PAGE','9058',jdecode('Schwertransporte'),jdecode(''), jdecode('%2F9016%2F9058.html'), 'true',[],'',''],
		['PAGE','9079',jdecode('Hebeb%C3%BChnen'),jdecode(''), jdecode('%2F9016%2F9079.html'), 'true',[],'',''],
		['PAGE','9100',jdecode('Impressionen'),jdecode(''), jdecode('%2F9016%2F9100.html'), 'true',[],'','']
	],'',''],
	['PAGE','9121',jdecode('FREY%2BEGLE+AG'),jdecode(''), jdecode('%2F9121%2Findex.html'), 'true',[ 
		['PAGE','9163',jdecode('Sch%C3%B6tz'),jdecode(''), jdecode('%2F9121%2F9163.html'), 'true',[],'',''],
		['PAGE','18001',jdecode('Luzern'),jdecode(''), jdecode('%2F9121%2F18001.html'), 'true',[],'','']
	],'',''],
	['PAGE','9226',jdecode('AGBs'),jdecode(''), jdecode('%2F9226.html'), 'true',[],'',''],
	['PAGE','15301',jdecode('KONTAKTFORMULAR'),jdecode(''), jdecode('%2F15301.html'), 'true',[],'','']];
var siteelementCount=46;
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:  '6501',
internalId:  '',
customField: '20111122-194623'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8701',
internalId:  '',
customField: '20111122-202904'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8722',
internalId:  '',
customField: '20111122-203302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8743',
internalId:  '',
customField: '20111122-170834'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8764',
internalId:  '',
customField: '20111122-170928'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8785',
internalId:  '',
customField: '20111122-171004'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8806',
internalId:  '',
customField: '20111122-171045'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8827',
internalId:  '',
customField: '20111122-171234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9706',
internalId:  '',
customField: '20111114-193209'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9121',
internalId:  '',
customField: '20111122-171404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9163',
internalId:  '',
customField: '20111114-183200'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9226',
internalId:  '',
customField: '20111114-193433'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9748',
internalId:  '',
customField: '20111114-193242'
};
webappMappings['7008']=webappMappings['7008-12556']={
webappId:    '7008',
documentId:  '15301',
internalId:  '12556',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9727',
internalId:  '',
customField: '20111114-181016'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8932',
internalId:  '',
customField: '20111122-171317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9016',
internalId:  '',
customField: '20111114-120258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9037',
internalId:  '',
customField: '20111114-120258'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '9163',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:true;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '15301',
internalId:  '',
customField: '20111114-174620'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19101',
internalId:  '',
customField: '20111122-133908'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9622',
internalId:  '',
customField: '20111122-154922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9643',
internalId:  '',
customField: '20111114-120755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9664',
internalId:  '',
customField: '20111122-192442'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9685',
internalId:  '',
customField: '20111114-120755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8953',
internalId:  '',
customField: '20111114-120258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8974',
internalId:  '',
customField: '20111114-120258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '8995',
internalId:  '',
customField: '20111114-120258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9058',
internalId:  '',
customField: '20111114-120258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9079',
internalId:  '',
customField: '20111114-120258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9100',
internalId:  '',
customField: '20111114-120258'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '18001',
internalId:  '',
customField: '20111114-184421'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19122',
internalId:  '',
customField: '20111122-132659'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19301',
internalId:  '',
customField: '20111122-153745'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19322',
internalId:  '',
customField: '20111122-154211'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26801',
internalId:  '',
customField: '20111122-163321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19364',
internalId:  '',
customField: '20111122-155138'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19385',
internalId:  '',
customField: '20111122-155408'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19406',
internalId:  '',
customField: '20111122-155729'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19427',
internalId:  '',
customField: '20111122-160010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19448',
internalId:  '',
customField: '20111122-192359'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19469',
internalId:  '',
customField: '20111122-161047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19490',
internalId:  '',
customField: '20111122-161350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19511',
internalId:  '',
customField: '20111122-192512'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19532',
internalId:  '',
customField: '20111122-192545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19553',
internalId:  '',
customField: '20111122-162317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '19574',
internalId:  '',
customField: '20111122-162545'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '26822',
internalId:  '',
customField: '20111122-163624'
};
var webAppHostname = 'wsc-app.webland.ch:80';
var canonHostname = 'wsc02.webland.ch';
var accountId     = 'AWB010INEKP5';
var companyName   = '';
var htmlTitle	  = '';
var metaKeywords  = '';
var metaContents  = '';
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();
};

