/* [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 theSitetree=[ 
	['PAGE','51301',jdecode('DEUTSCH'),jdecode(''),'/51301/index.html','true',[ 
		['PAGE','5922',jdecode('Portrait'),jdecode(''),'/51301/5922.html','true',[],''],
		['PAGE','5901',jdecode('T%C3%A4tigkeitsgebiete'),jdecode(''),'/51301/5901.html','true',[],''],
		['PAGE','51601',jdecode('Honorar'),jdecode(''),'/51301/51601.html','true',[],''],
		['PAGE','5943',jdecode('Kooperation'),jdecode(''),'/51301/5943.html','true',[],'']
	],''],
	['PAGE','47822',jdecode('ENGLISH'),jdecode(''),'/47822/index.html','true',[ 
		['PAGE','47843',jdecode('About+us'),jdecode(''),'/47822/47843.html','true',[],''],
		['PAGE','47864',jdecode('Practice+areas'),jdecode(''),'/47822/47864.html','true',[],''],
		['PAGE','51322',jdecode('Legal+fee'),jdecode(''),'/47822/51322.html','true',[],''],
		['PAGE','47885',jdecode('Cooperation'),jdecode(''),'/47822/47885.html','true',[],'']
	],''],
	['PAGE','47906',jdecode('ESPA%C3%91OL'),jdecode(''),'/47906/index.html','true',[ 
		['PAGE','47927',jdecode('Perfil'),jdecode(''),'/47906/47927.html','true',[],''],
		['PAGE','49801',jdecode('Areas+de+actuaci%C3%B3n'),jdecode(''),'/47906/49801.html','true',[],''],
		['PAGE','51622',jdecode('Honorario'),jdecode(''),'/47906/51622.html','true',[],''],
		['PAGE','49822',jdecode('Cooperaci%C3%B3n'),jdecode(''),'/47906/49822.html','true',[],'']
	],''],
	['PAGE','5964',jdecode('Kontakt%2FContact%2Fcontacto'),jdecode(''),'/5964.html','true',[],''],
	['PAGE','74101',jdecode('MAP'),jdecode(''),'/74101.html','true',[],'']];
var siteelementCount=17;
theSitetree.topTemplateName='Alpha';
theSitetree.paletteFamily='5351C2';
theSitetree.keyvisualId='-1';
theSitetree.keyvisualName='keyv.jpg';
theSitetree.fontsetId='10555';
theSitetree.graphicsetId='10894';
theSitetree.contentColor='5351C2';
theSitetree.contentBGColor='FFFFFF';
var localeDef={
  language: 'de',
  country: 'CH'
};
var theTemplate={
				name: 			'Alpha',
				paletteFamily: 	'5351C2',
				keyvisualId: 	'-1',
				keyvisualName: 	'keyv.jpg',
				fontsetId: 		'10555',
				graphicsetId: 	'10894',
				contentColor: 	'5351C2',
				contentBGColor: 'FFFFFF',
				hasFlashNavigation: 'false',
				hasFlashLogo: 	'false',
				hasFlashCompanyname: 'false',
				hasFlashElements: 'false',
				hasCompanyname: 'false',
				a_color: 		'000000',
				b_color: 		'000000',
				c_color: 		'000000',
				d_color: 		'5351C2',
				e_color: 		'5351C2',
				f_color: 		'5351C2',
				hasCustomLogo: 	'true',
				contentFontFace:'Verdana, Arial, Helvetica, sans-serif',
				contentFontSize:'12',
				useFavicon:     'false'
			  };
var webappMappings = {};
webappMappings['2002']=webappMappings['2002-routing']={
webappId:    '2002',
documentId:  '74101',
internalId:  'routing',
customField: 'de_CH'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51301',
internalId:  '',
customField: '20090912-102916'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5922',
internalId:  '',
customField: '20090823-130814'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47906',
internalId:  '',
customField: '20081121-165250'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49822',
internalId:  '',
customField: '20090823-134350'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47927',
internalId:  '',
customField: '20090823-154929'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47822',
internalId:  '',
customField: '20090912-103815'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47843',
internalId:  '',
customField: '20090823-154705'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5964',
internalId:  '',
customField: '20090911-190637'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5901',
internalId:  '',
customField: '20090823-152031'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51601',
internalId:  '',
customField: '20070626-195223'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '5943',
internalId:  '',
customField: '20090107-093606'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47864',
internalId:  '',
customField: '20090823-135132'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51322',
internalId:  '',
customField: '20070625-174926'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '47885',
internalId:  '',
customField: '20090823-134528'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '49801',
internalId:  '',
customField: '20090823-145331'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '51622',
internalId:  '',
customField: '20070625-174638'
};
webappMappings['5000']=webappMappings['5000-']={
webappId:    '5000',
documentId:  '74101',
internalId:  '',
customField: '20090912-104244'
};
var canonHostname = 'hptworkerdb01b.bluewin.ch';
var accountId     = 'ABW0X0IN2TKK';
var companyName   = 'Anwaltskanzlei+Rita+Arnold+Haas';
var htmlTitle	  = 'Anwaltskanzlei+Rita+Arnold+Haas';
var metaKeywords  = 'Anwaltskanzlei+Rechtsanwalt+8001+Z%C3%BCrich+Bahnhofstrasse+Spanisch+Englisch+Rita%2BArnold+Haas+Scheidung+Haftpflicht+Familienrecht+attorney+abogada+divorcio+derecho+civil+bufete+Suiza+Zurich+international+internacional+separacion+migracion+defensa+mujer+latina+nosotras';
var metaContents  = 'Zurich+Rechtsanw%C3%A4ltin+Rechtsanwalt+Spanish+Spanisch+espa%C3%B1ol+attorney+lawyer+divorce+divorcio+Beratung+separacion+Nosotras%2BAargau';
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();
};
