/* [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','4519',jdecode('Home'),jdecode(''), jdecode('%2F4519.html'), 'true',[],'',''],
	['PAGE','4711',jdecode('News'),jdecode(''), jdecode('%2F4711.html'), 'true',[],'',''],
	['PAGE','5503',jdecode('Forst'),jdecode(''), jdecode('%2F5503%2Findex.html'), 'true',[ 
		['PAGE','47001',jdecode('Holzernte'),jdecode(''), jdecode('%2F5503%2F47001.html'), 'true',[],'',''],
		['PAGE','47022',jdecode('Pflege'),jdecode(''), jdecode('%2F5503%2F47022.html'), 'true',[],'',''],
		['PAGE','47043',jdecode('Holzhandel'),jdecode(''), jdecode('%2F5503%2F47043.html'), 'true',[],'',''],
		['PAGE','47064',jdecode('Privatwald'),jdecode(''), jdecode('%2F5503%2F47064.html'), 'true',[],'','']
	],'',''],
	['PAGE','47085',jdecode('Sicherheitsholzerei'),jdecode(''), jdecode('%2F47085%2Findex.html'), 'true',[ 
		['PAGE','47106',jdecode('Schutzwald'),jdecode(''), jdecode('%2F47085%2F47106.html'), 'true',[],'',''],
		['PAGE','47127',jdecode('Verkehrswege'),jdecode(''), jdecode('%2F47085%2F47127.html'), 'true',[],'',''],
		['PAGE','47148',jdecode('Garten-+und+Parkanlagen'),jdecode(''), jdecode('%2F47085%2F47148.html'), 'true',[],'','']
	],'',''],
	['PAGE','47169',jdecode('Gartenbau'),jdecode(''), jdecode('%2F47169%2Findex.html'), 'true',[ 
		['PAGE','47190',jdecode('Neuanlagen'),jdecode(''), jdecode('%2F47169%2F47190.html'), 'true',[],'',''],
		['PAGE','47211',jdecode('Um%C3%A4nderungen'),jdecode(''), jdecode('%2F47169%2F47211.html'), 'true',[],'',''],
		['PAGE','47232',jdecode('Unterhalt'),jdecode(''), jdecode('%2F47169%2F47232.html'), 'true',[],'',''],
		['PAGE','47253',jdecode('Baumpflege'),jdecode(''), jdecode('%2F47169%2F47253.html'), 'true',[],'','']
	],'',''],
	['PAGE','46901',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F46901%2Findex.html'), 'true',[ 
		['PAGE','5422',jdecode('Geschichte'),jdecode(''), jdecode('%2F46901%2F5422.html'), 'true',[],'',''],
		['PAGE','5449',jdecode('Das+Team'),jdecode(''), jdecode('%2F46901%2F5449.html'), 'true',[],'',''],
		['PAGE','5476',jdecode('Maschinen'),jdecode(''), jdecode('%2F46901%2F5476.html'), 'true',[],'','']
	],'',''],
	['PAGE','4738',jdecode('Kontakt'),jdecode(''), jdecode('%2F4738.html'), 'true',[],'',''],
	['PAGE','58801',jdecode('Holzernte+1'),jdecode(''), jdecode('%2F58801.html'), 'false',[],'',''],
	['PAGE','58822',jdecode('Holzernte+2'),jdecode(''), jdecode('%2F58822.html'), 'false',[],'',''],
	['PAGE','57801',jdecode('Holzernte+3'),jdecode(''), jdecode('%2F57801.html'), 'false',[],'',''],
	['PAGE','57822',jdecode('Holzernte+4'),jdecode(''), jdecode('%2F57822.html'), 'false',[],'',''],
	['PAGE','63401',jdecode('Pflege'),jdecode(''), jdecode('%2F63401.html'), 'false',[],'',''],
	['PAGE','63422',jdecode('Holzhandel'),jdecode(''), jdecode('%2F63422.html'), 'false',[],'',''],
	['PAGE','63443',jdecode('Privatwald'),jdecode(''), jdecode('%2F63443.html'), 'false',[],'',''],
	['PAGE','66401',jdecode('Schutzwald'),jdecode(''), jdecode('%2F66401.html'), 'false',[],'',''],
	['PAGE','70801',jdecode('Neuanlagen'),jdecode(''), jdecode('%2F70801.html'), 'false',[],'',''],
	['PAGE','70822',jdecode('Um%C3%A4nderungen'),jdecode(''), jdecode('%2F70822.html'), 'false',[],'',''],
	['PAGE','70843',jdecode('Unterhalt'),jdecode(''), jdecode('%2F70843.html'), 'false',[],'',''],
	['PAGE','70864',jdecode('Baumpflege'),jdecode(''), jdecode('%2F70864.html'), 'false',[],'',''],
	['PAGE','77401',jdecode('Verkehrswege'),jdecode(''), jdecode('%2F77401.html'), 'false',[],'',''],
	['PAGE','77422',jdecode('Parkanlagen'),jdecode(''), jdecode('%2F77422.html'), 'false',[],'','']];
var siteelementCount=35;
theSitetree.topTemplateName='Natural';
theSitetree.paletteFamily='40710E';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='154';
theSitetree.graphicsetId='166';
theSitetree.contentColor='000000';
theSitetree.contentBGColor='FCFCF4';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Natural',
				paletteFamily: 	'40710E',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'154',
				graphicsetId: 	'166',
				contentColor: 	'000000',
				contentBGColor: 'FCFCF4',
				a_color: 		'40710E',
				b_color: 		'00CC00',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'true'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58822',
internalId:  '',
customField: '20100525-131010'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47169',
internalId:  '',
customField: '20110525-135323'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '46901',
internalId:  '',
customField: '20110525-085707'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4519',
internalId:  '',
customField: '20110502-122225'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4711',
internalId:  '',
customField: '20110426-144913'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5422',
internalId:  '',
customField: '20110502-144036'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5449',
internalId:  '',
customField: '20110502-144110'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5476',
internalId:  '',
customField: '20110502-135126'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5503',
internalId:  '',
customField: '20110525-131151'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4738',
internalId:  '',
customField: '20110426-135951'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47085',
internalId:  '',
customField: '20110525-135342'
};
webappMappings['7008']=webappMappings['7008-2853']={
webappId:    '7008',
documentId:  '4738',
internalId:  '2853',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47022',
internalId:  '',
customField: '20110525-113130'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47001',
internalId:  '',
customField: '20110525-110815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47106',
internalId:  '',
customField: '20110525-111554'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47043',
internalId:  '',
customField: '20110525-112717'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47064',
internalId:  '',
customField: '20110525-111527'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47127',
internalId:  '',
customField: '20110525-135404'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47148',
internalId:  '',
customField: '20110525-135430'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47190',
internalId:  '',
customField: '20110525-110615'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47211',
internalId:  '',
customField: '20110525-110633'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47232',
internalId:  '',
customField: '20110525-110649'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47253',
internalId:  '',
customField: '20110525-110710'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57801',
internalId:  '',
customField: '20100525-130949'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '57822',
internalId:  '',
customField: '20100525-130919'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '58801',
internalId:  '',
customField: '20100525-143516'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63401',
internalId:  '',
customField: '20110525-112122'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63422',
internalId:  '',
customField: '20100525-150255'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '63443',
internalId:  '',
customField: '20100525-145356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '66401',
internalId:  '',
customField: '20100613-201015'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70801',
internalId:  '',
customField: '20110525-102302'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70822',
internalId:  '',
customField: '20110525-102331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70864',
internalId:  '',
customField: '20110525-110546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '70843',
internalId:  '',
customField: '20110525-110445'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77401',
internalId:  '',
customField: '20110525-133805'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '77422',
internalId:  '',
customField: '20110525-133932'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INXXU2';
var companyName   = '';
var htmlTitle	  = 'Spahr+%26+Co+Forstunternehmung';
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();
};

