/* [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(''), jdecode('%2F401.html'), 'true',[],'',''],
	['PAGE','187401',jdecode('%C3%9Cber+uns'),jdecode(''), jdecode('%2F187401.html'), 'true',[],'',''],
	['PAGE','29401',jdecode('Produkte'),jdecode(''), jdecode('%2F29401%2Findex.html'), 'true',[ 
		['PAGE','228801',jdecode('+++MicroData'),jdecode(''), jdecode('%2F29401%2F228801.html'), 'true',[],'',''],
		['PAGE','29422',jdecode('+++MicroPlot'),jdecode(''), jdecode('%2F29401%2F29422.html'), 'true',[],'','']
	],'',''],
	['PAGE','95301',jdecode('Dienstleistungen'),jdecode(''), jdecode('%2F95301.html'), 'true',[],'',''],
	['PAGE','232801',jdecode('Just+for+fun%21'),jdecode(''), jdecode('%2F232801.html'), 'true',[],'',''],
	['PAGE','210301',jdecode('Kunden+%26+Partner'),jdecode(''), jdecode('%2F210301.html'), 'true',[],'',''],
	['PAGE','224401',jdecode('Kontakt'),jdecode(''), jdecode('%2F224401.html'), 'true',[],'',''],
	['PAGE','240101',jdecode('Pressemitteilungen'),jdecode(''), jdecode('%2F240101.html'), 'true',[],'',''],
	['PAGE','29485',jdecode('Impressum'),jdecode(''), jdecode('%2F29485.html'), 'true',[],'','']];
var siteelementCount=11;
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 prodDef={
  wl_name: 'bluewin',
  product: 'WSCBLUSSSLYTC2MX'
};
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:     'true'
			  };
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: '20111025-115546'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '187401',
internalId:  '',
customField: '20111004-074938'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '210301',
internalId:  '',
customField: '20110922-112205'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29401',
internalId:  '',
customField: '20111004-074529'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '29422',
internalId:  '',
customField: '20110922-105023'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '232801',
internalId:  '',
customField: '20111004-075837'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '95301',
internalId:  '',
customField: '20111004-085418'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '240101',
internalId:  '',
customField: '20111002-104558'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '228801',
internalId:  '',
customField: '20111004-090249'
};
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: '20110212-094234'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '224401',
internalId:  '',
customField: '20090822-083655'
};
var webAppHostname = 'cgi.hpt001.bluewin.ch:80';
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN2F78';
var companyName   = 'Datavision+GmbH';
var htmlTitle	  = 'Datavision+GmbH';
var metaKeywords  = 'microdata+kmu+business+administration+auftrag+rechnungen+rapport+microplot+plotten+neutralformat+output+management+system+tiff+jpeg+pdf+sap+plot+client+jsoftware+programmierung+coaching+cad+medusa+autocad+solidworks+proe+pro+engineer';
var metaContents  = 'Datavision+GmbH+ist+seit+2007+am+Markt+und+entwickelt+Software+f%C3%BCr+die+Verwaltung+von+Gesch%C3%A4ftsdaten+%28MicroData%29%2C+sowie+f%C3%BCr+die+Ausgabe+von+Grafikdaten+auf+Drucker+und+Grossformatplotter+%28MicroPlot%29.+Als+Spezialistin+f%C3%BCr+die+Integration+von+CAD-Systemen+in+SAP+PDM%2FPLM+bietet+das+Unternehmen+professionelle+Dienstleistungen+zu+attraktiven+Konditionen+an.';
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();
};

