/* [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','401',jdecode('Home'),jdecode(''),'/401.html','true',[],'',''],
	['PAGE','187401',jdecode('%C3%9Cber+uns'),jdecode(''),'/187401.html','true',[],'',''],
	['PAGE','224401',jdecode('Kontakt'),jdecode(''),'/224401.html','true',[],'',''],
	['PAGE','210301',jdecode('Kunden+%26+Partner'),jdecode(''),'/210301.html','true',[],'',''],
	['PAGE','29401',jdecode('Produkte'),jdecode(''),'/29401/index.html','true',[ 
		['PAGE','29422',jdecode('+++MicroPlot'),jdecode(''),'/29401/29422.html','true',[],'',''],
		['PAGE','212901',jdecode('+++JobServer'),jdecode(''),'/29401/212901.html','true',[],'',''],
		['PAGE','185901',jdecode('+++ComputerInventory'),jdecode(''),'/29401/185901.html','true',[],'','']
	],'',''],
	['PAGE','95301',jdecode('Dienstleistung'),jdecode(''),'/95301/index.html','true',[ 
		['PAGE','188501',jdecode('Beratung'),jdecode(''),'/95301/188501.html','true',[],'',''],
		['PAGE','188522',jdecode('J+Programmierung'),jdecode(''),'/95301/188522.html','true',[],'',''],
		['PAGE','194301',jdecode('...+in+der+Theorie+1'),jdecode(''),'/95301/194301.html','true',[],'',''],
		['PAGE','203501',jdecode('...+in+der+Theorie+2'),jdecode(''),'/95301/203501.html','true',[],'',''],
		['PAGE','194322',jdecode('...+in+der+Praxis+1'),jdecode(''),'/95301/194322.html','true',[],'',''],
		['PAGE','203522',jdecode('...+in+der+Praxis+2'),jdecode(''),'/95301/203522.html','true',[],'','']
	],'',''],
	['PAGE','29485',jdecode('Impressum'),jdecode(''),'/29485.html','true',[],'','']];
var siteelementCount=16;
theSitetree.topTemplateName='Startup';
theSitetree.paletteFamily='336699';
theSitetree.keyvisualId='1415';
theSitetree.keyvisualName='pr_agenten.jpg';
theSitetree.fontsetId='235';
theSitetree.graphicsetId='284';
theSitetree.contentColor='666666';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Startup',
				paletteFamily: 	'336699',
				keyvisualId: 	'1415',
				keyvisualName: 	'pr_agenten.jpg',
				fontsetId: 		'235',
				graphicsetId: 	'284',
				contentColor: 	'666666',
				contentBGColor: 'FFFFFF',
				a_color: 		'336699',
				b_color: 		'333333',
				c_color: 		'000000',
				d_color: 		'FF0000',
				e_color: 		'FF0000',
				f_color: 		'FF0000',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '401',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '401',
internalId:  '',
customField: '20100805-122047'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '187401',
internalId:  '',
customField: '20100808-092916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '210301',
internalId:  '',
customField: '20100808-105227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29401',
internalId:  '',
customField: '20100805-140621'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29422',
internalId:  '',
customField: '20100808-100734'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '212901',
internalId:  '',
customField: '20100808-102923'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '185901',
internalId:  '',
customField: '20100808-103058'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95301',
internalId:  '',
customField: '20100808-104310'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '188501',
internalId:  '',
customField: '20100808-105539'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '188522',
internalId:  '',
customField: '20100808-105755'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '194301',
internalId:  '',
customField: '20100808-105818'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '203501',
internalId:  '',
customField: '20100808-105832'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '194322',
internalId:  '',
customField: '20100808-105854'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '203522',
internalId:  '',
customField: '20100808-105911'
};
webappMappings['7008']=webappMappings['7008-7010']={
webappId:    '7008',
documentId:  '224401',
internalId:  '7010',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29485',
internalId:  '',
customField: '20100105-081249'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '224401',
internalId:  '',
customField: '20090822-083655'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN2F78';
var companyName   = 'Datavision+GmbH';
var htmlTitle	  = 'Datavision+GmbH';
var metaKeywords  = 'microplot+plotten+neutralformat+oms+output+management+system+tiff+jpeg+pdf+sap+plot+client+jobserver+jobscheduler+batch+job+scheduler+computerinventory+inventar+inventarisierung+hardware+jsoftware+programmierung+coaching';
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();
};
