/* [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','501',jdecode('HOME'),jdecode(''), jdecode('%2F501.html'), 'true',[],'',''],
	['PAGE','6722',jdecode('WIR+%C3%9CBER+UNS'),jdecode(''), jdecode('%2F6722%2Findex.html'), 'true',[ 
		['PAGE','6743',jdecode('Das+Unternehmen'),jdecode(''), jdecode('%2F6722%2F6743.html'), 'true',[],'',''],
		['PAGE','4801',jdecode('Unser+Team'),jdecode(''), jdecode('%2F6722%2F4801.html'), 'true',[],'','']
	],'',''],
	['PAGE','4822',jdecode('DIENSTLEISTUNGEN'),jdecode(''), jdecode('%2F4822%2Findex.html'), 'true',[ 
		['PAGE','4843',jdecode('Treuhand'),jdecode(''), jdecode('%2F4822%2F4843.html'), 'true',[],'',''],
		['PAGE','4864',jdecode('Buchhaltungen'),jdecode(''), jdecode('%2F4822%2F4864.html'), 'true',[],'',''],
		['PAGE','4885',jdecode('Personaladministration'),jdecode(''), jdecode('%2F4822%2F4885.html'), 'true',[],'',''],
		['PAGE','4906',jdecode('Informatik'),jdecode(''), jdecode('%2F4822%2F4906.html'), 'true',[],'','']
	],'',''],
	['PAGE','6995',jdecode('JOBS'),jdecode(''), jdecode('%2F6995.html'), 'true',[],'',''],
	['PAGE','7016',jdecode('KONTAKT'),jdecode(''), jdecode('%2F7016%2Findex.html'), 'true',[ 
		['PAGE','7037',jdecode('So+erreichen+Sie+uns'),jdecode(''), jdecode('%2F7016%2F7037.html'), 'true',[],'',''],
		['PAGE','11401',jdecode('So+finden+Sie+uns'),jdecode(''), jdecode('%2F7016%2F11401.html'), 'true',[],'','']
	],'',''],
	['PAGE','7079',jdecode('TIPPS%2C+TRICKS%2C+LINKS'),jdecode(''), jdecode('%2F7079.html'), 'true',[],'','']];
var siteelementCount=14;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='333F65';
theSitetree.keyvisualId='1741';
theSitetree.keyvisualName='ebusiness.jpg';
theSitetree.fontsetId='291';
theSitetree.graphicsetId='355';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='333F65';
var localeDef={
  language: 'de',
  country: 'CH'
};
var prodDef={
  wl_name: 'hostpoint',
  product: 'WSCSYSSSSLYTC21F'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'333F65',
				keyvisualId: 	'1741',
				keyvisualName: 	'ebusiness.jpg',
				fontsetId: 		'291',
				graphicsetId: 	'355',
				contentColor: 	'FFFFFF',
				contentBGColor: '333F65',
				a_color: 		'333F65',
				b_color: 		'040507',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '501',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6995',
internalId:  '',
customField: '20120118-150358'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6722',
internalId:  '',
customField: '20090310-102734'
};
webappMappings['2001']=webappMappings['2001-location']={
webappId:    '2001',
documentId:  '11401',
internalId:  'location',
customField: 'language:de;country:CH;isIncluded:false;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '501',
internalId:  '',
customField: '20090604-110309'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '6743',
internalId:  '',
customField: '20090310-104142'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4801',
internalId:  '',
customField: '20110628-091212'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4822',
internalId:  '',
customField: '20070813-192311'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4843',
internalId:  '',
customField: '20070813-192355'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4864',
internalId:  '',
customField: '20070826-185600'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4885',
internalId:  '',
customField: '20070813-193003'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4906',
internalId:  '',
customField: '20070907-070922'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7016',
internalId:  '',
customField: '20070829-205348'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7037',
internalId:  '',
customField: '20070827-094227'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11401',
internalId:  '',
customField: '20070828-133848'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '7079',
internalId:  '',
customField: '20070916-185301'
};
var webAppHostname = 'cgi.webomat.ch:80';
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'AHOPT0IN3W20';
var companyName   = 'TREUHAND+%2B+MEHR';
var htmlTitle	  = 'TREUHAND+%2B+MEHR';
var metaKeywords  = 'Treuhand%2C+Buchhaltung%2C+Controlling%2C+Betriebsbuchhaltung%2C+Unternehmensberatung%2C+Steuern%2C+Steuerberatung%2C+Personal%2C+Personaladministration%2C+Mehrwertsteuer%2C+Personalberatung%2C+Informatik%2C+Hardware%2C+Software%2C+ASP%2C+Serverhousing%2C+Liegenschaftenverwaltung%2C+';
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();
};

