/* [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','4595',jdecode('Home'),jdecode(''), jdecode('%2F4595.html'), 'true',[],'',''],
	['PAGE','4652',jdecode('Wir+%C3%BCber+uns'),jdecode(''), jdecode('%2F4652%2Findex.html'), 'true',[ 
		['PAGE','6103',jdecode('Team'),jdecode(''), jdecode('%2F4652%2F6103.html'), 'true',[],'',''],
		['PAGE','47630',jdecode('Links+zu+Kunden'),jdecode(''), jdecode('%2F4652%2F47630.html'), 'true',[],'','']
	],'',''],
	['PAGE','7203',jdecode('PROFIBU'),jdecode(''), jdecode('%2F7203%2Findex.html'), 'true',[ 
		['PAGE','10403',jdecode('Finanzbuchhaltung'),jdecode(''), jdecode('%2F7203%2F10403.html'), 'true',[],'',''],
		['PAGE','10430',jdecode('Debitoren+und+Kreditoren'),jdecode(''), jdecode('%2F7203%2F10430.html'), 'true',[],'',''],
		['PAGE','10730',jdecode('Lohnbuchhaltung'),jdecode(''), jdecode('%2F7203%2F10730.html'), 'true',[],'',''],
		['PAGE','10757',jdecode('Fakturierung'),jdecode(''), jdecode('%2F7203%2F10757.html'), 'true',[],'',''],
		['PAGE','10784',jdecode('Lagerbuchhaltung'),jdecode(''), jdecode('%2F7203%2F10784.html'), 'true',[],'',''],
		['PAGE','10811',jdecode('Projekte'),jdecode(''), jdecode('%2F7203%2F10811.html'), 'true',[],'',''],
		['PAGE','10838',jdecode('Kostenstellen'),jdecode(''), jdecode('%2F7203%2F10838.html'), 'true',[],'','']
	],'',''],
	['PAGE','7230',jdecode('Service'),jdecode(''), jdecode('%2F7230%2Findex.html'), 'true',[ 
		['PAGE','25202',jdecode('Downloads+PROFIBU'),jdecode(''), jdecode('%2F7230%2F25202.html'), 'true',[],'','']
	],'',''],
	['PAGE','7257',jdecode('Kontakt'),jdecode(''), jdecode('%2F7257%2Findex.html'), 'true',[ 
		['PAGE','7302',jdecode('Kontakt+%28Folgeseite%29'),jdecode(''), jdecode('%2F7257%2F7302.html'), 'false',[],'','']
	],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Kreis';
theSitetree.paletteFamily='4CD28A';
theSitetree.keyvisualId='578';
theSitetree.keyvisualName='edv.jpg';
theSitetree.fontsetId='124';
theSitetree.graphicsetId='141';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='000000';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MS'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Kreis',
				paletteFamily: 	'4CD28A',
				keyvisualId: 	'578',
				keyvisualName: 	'edv.jpg',
				fontsetId: 		'124',
				graphicsetId: 	'141',
				contentColor: 	'FFFFFF',
				contentBGColor: '000000',
				a_color: 		'4CD28A',
				b_color: 		'77F897',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4595',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4652',
internalId:  '',
customField: '20050909-105317'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4595',
internalId:  '',
customField: '20110427-223556'
};
webappMappings['7008']=webappMappings['7008-6876']={
webappId:    '7008',
documentId:  '7257',
internalId:  '6876',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6103',
internalId:  '',
customField: '20060911-191103'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47630',
internalId:  '',
customField: '20110603-185218'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7203',
internalId:  '',
customField: '20080204-132601'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10403',
internalId:  '',
customField: '20040902-160916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10430',
internalId:  '',
customField: '20060318-175321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10730',
internalId:  '',
customField: '20040914-165246'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10757',
internalId:  '',
customField: '20040902-175731'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10784',
internalId:  '',
customField: '20040902-180552'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10811',
internalId:  '',
customField: '20040902-180746'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10838',
internalId:  '',
customField: '20040902-181702'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7230',
internalId:  '',
customField: '20110520-161920'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '25202',
internalId:  '',
customField: '20061206-081538'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7257',
internalId:  '',
customField: '20040701-165634'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7302',
internalId:  '',
customField: '20040830-190847'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01a.bluewin.ch';
var accountId     = 'ABW0X0INX3ZN';
var companyName   = 'EDV-Beratung+R.+Heckendorn';
var htmlTitle	  = 'PROFIBU';
var metaKeywords  = 'Buchhaltung%2C+ERP%2C+Fibu%2C+KMU%2C+Kostenrechnung%2C+Kostenstellen%2C+Projekte%2C+Lohn%2C+Debitoren%2C+Kreditoren%2C+Fakturierung%2C+Schulung%2C+Softwareentwicklung%2C+Analyse%2C+Hardware%2C+Beratung%2C+PROFIBU%2C+Heckendorn%2C';
var metaContents  = 'Die+Standardsoftware+PROFIBU+f%C3%BCr+Buchhaltung%2C+Kostenrechnung+und+Lohn+ist+auf+den+Bereich+KMU+ausgelegt.+Wir+verf%C3%BCgen+%C3%BCber+langj%C3%A4hrige+Erfahrung+in+den+Bereichen+Softwareentwicklung%2C+betriebswirtschaftliche+Beratung+und+Schulung.';
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();
};

