/* [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','4509',jdecode('Startseite'),jdecode(''),'/4509.html','true',[],'',''],
	['PAGE','4566',jdecode('Portrait'),jdecode(''),'/4566.html','true',[],'',''],
	['PAGE','4593',jdecode('Dienstleistungen'),jdecode(''),'/4593.html','true',[],'',''],
	['PAGE','9624',jdecode('Referenzen'),jdecode(''),'/9624.html','true',[],'',''],
	['PAGE','4620',jdecode('Angebot'),jdecode(''),'/4620.html','true',[],'',''],
	['PAGE','4701',jdecode('Tipps%2FLinks'),jdecode(''),'/4701.html','true',[],'',''],
	['PAGE','9651',jdecode('Kontakt'),jdecode(''),'/9651/index.html','true',[ 
		['PAGE','10157',jdecode('Impressum+%28Folgeseite%29'),jdecode(''),'/9651/10157.html','false',[],'','']
	],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Clipping';
theSitetree.paletteFamily='30366D';
theSitetree.keyvisualId='4536';
theSitetree.keyvisualName='kv_4536.jpg';
theSitetree.fontsetId='13621';
theSitetree.graphicsetId='11271';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='30366D';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Clipping',
				paletteFamily: 	'30366D',
				keyvisualId: 	'4536',
				keyvisualName: 	'kv_4536.jpg',
				fontsetId: 		'13621',
				graphicsetId: 	'11271',
				contentColor: 	'FFFFFF',
				contentBGColor: '30366D',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'true',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4566',
internalId:  '',
customField: '20070506-124405'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4509',
internalId:  '',
customField: '20070708-151656'
};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4509',
internalId:  '1006',
customField: '1006'
};
webappMappings['7008']=webappMappings['7008-1601']={
webappId:    '7008',
documentId:  '9651',
internalId:  '1601',
customField: 'language:de;country:CH;'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4593',
internalId:  '',
customField: '20070518-112150'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9624',
internalId:  '',
customField: '20070518-113321'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4620',
internalId:  '',
customField: '20070518-112549'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4701',
internalId:  '',
customField: '20090504-214507'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '9651',
internalId:  '',
customField: '20070506-130331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10157',
internalId:  '',
customField: '20051019-140152'
};
var canonHostname = 'webomat01.hostpoint.ch';
var accountId     = 'Ahp010INEML5';
var companyName   = '2win+gmbh+-+unkompliziert+kompetent';
var htmlTitle	  = '2win%2C+Ihr+Partner+f%C3%BCr+Treuhanddienstleistungen';
var metaKeywords  = '2win%2CBuchhaltung%2C+Controlling%2CFinanzdienstleistungen%2C+Outsourcing%2CFinanz%2CRechnungswesen%2C+Consulting%2CBeratung%2CSteuern%2CTreuhand%2CRevisionen%2CFamily-Office%2CSteuerberatung%2CRelocations%2COffice-Sharing%2COfficesharing%2Ctaxsaving+CH%2CSteuern+sparen%2Csteuerg%C3%BCnstiges+Umfeld%2Ctempor%C3%A4re+B%C3%BCroarbeitspl%C3%A4tze%2Cbetriebswirtschaftliche+Beratung%2Cwin-win%2Chrsxx22';
var metaContents  = '2win%2C+Innovation+im+Finanz+und+Rechnungswesen%21+Sie+suchen+einen+Partner+im+Treuhandbereich%3F+Sie+m%C3%B6chten+professionelle+Finanzdienstleistungen+zu+einem+objektiven+Preis%3F+Telefonieren+Sie+uns%2C+wir+unterbreiten+Ihnen+gerne+ein+Angebot.';
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();
};
