/* [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','4606',jdecode('Home'),jdecode(''),'/4606.html','true',[],'',''],
	['PAGE','10903',jdecode('Steuererkl%C3%A4rungen'),jdecode(''),'/10903/index.html','true',[ 
		['PAGE','10930',jdecode('Private+Unterlagen%3F'),jdecode(''),'/10903/10930.html','true',[],'',''],
		['PAGE','10957',jdecode('Unterlagen+Gesch%C3%A4ft%3F'),jdecode(''),'/10903/10957.html','true',[],'','']
	],'',''],
	['PAGE','10984',jdecode('Treuhandarbeiten%2C+Tax+refund'),jdecode(''),'/10984.html','true',[],'',''],
	['PAGE','11011',jdecode('Firmengr%C3%BCndungen'),jdecode(''),'/11011.html','true',[],'',''],
	['PAGE','11038',jdecode('Honorare+%2F+Tarife+in+2010'),jdecode(''),'/11038.html','true',[],'',''],
	['PAGE','11065',jdecode('Kontakt+%2F+B.HENSCHEL+finden'),jdecode(''),'/11065.html','true',[],'','']];
var siteelementCount=8;
theSitetree.topTemplateName='Movement';
theSitetree.paletteFamily='AC2323';
theSitetree.keyvisualId='1738';
theSitetree.keyvisualName='boerse.jpg';
theSitetree.fontsetId='291';
theSitetree.graphicsetId='356';
theSitetree.contentColor='FFFFFF';
theSitetree.contentBGColor='AC2323';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				name: 			'Movement',
				paletteFamily: 	'AC2323',
				keyvisualId: 	'1738',
				keyvisualName: 	'boerse.jpg',
				fontsetId: 		'291',
				graphicsetId: 	'356',
				contentColor: 	'FFFFFF',
				contentBGColor: 'AC2323',
				a_color: 		'AC2323',
				b_color: 		'480F0F',
				c_color: 		'FFFFFF',
				d_color: 		'FFFFFF',
				e_color: 		'FFFFFF',
				f_color: 		'FFFFFF',
				hasCustomLogo: 	'false',
				contentFontFace:'Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['1006']=webappMappings['1006-1006']={
webappId:    '1006',
documentId:  '4606',
internalId:  '1006',
customField: '1006'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '4606',
internalId:  '',
customField: '20100119-225159'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11038',
internalId:  '',
customField: '20100313-171901'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10903',
internalId:  '',
customField: '20100119-221025'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10930',
internalId:  '',
customField: '20100301-105139'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10957',
internalId:  '',
customField: '20100301-105800'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '10984',
internalId:  '',
customField: '20100119-223356'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11011',
internalId:  '',
customField: '20060103-222839'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '11065',
internalId:  '',
customField: '20100119-223638'
};
var canonHostname = 'webomat02.hostpoint.ch';
var accountId     = 'AHOPT0IN3O70';
var companyName   = 'B.+HENSCHEL+FiNANCE+GmbH';
var htmlTitle	  = '';
var metaKeywords  = 'www.bhfin.com%2C+henschel%2C+R%C3%BCmlang%2C+Steuererkl%C3%A4rung%2C+Treuhandb%C3%BCro%2C+Z%C3%BCrich%2C+Buchhaltung%2C+Firmengr%C3%BCndung%2C+Mwst%2C+Mehrwertsteuer%2C+Budgetberatung%2C+Tax+refund%2C+Tax+return%2C+Kanton+Z%C3%BCrich%2C+Tempor%C3%A4rarbeit%2C+Steuern%2C+2008%2C+2009%2C+Schweiz%2C+VAT%2C+Z%C3%BCrich-Nord%2C+Glattal%2C+Unterland%2C+Quellensteuer%2C+Tax+return%2C+Einkommenssteuererkl%C3%A4rung%2C+Steuererkl%C3%A4rungen%2C+META+NAME%3DROBOTS+CONTENT%3Dindex%2C+META+NAME%3DROBOTS+CONTENT%3Dnofollow%2C+META+NAME%3DREVISIT-AFTER+CONTENT%3D20+days%2C+META+NAME%3DLANGUAGE+CONTENT%3Dde';
var metaContents  = 'Die+B.HENSCHEL+FiNANCE+GmbH+macht+meine+Steuererkl%C3%A4rung%3A+das+Treuhandb%C3%BCro+in+R%C3%BCmlang%2C+15+Min.+von+Z%C3%BCrich-City%2C+Schweiz.+www.bhfin.com+macht+auch+Tax+refund+von+Mehrwertsteuer.';
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();
};
