function TreeViewHandler(d){var c=this;this.treeview=jQuery("#"+d+"_in");this.loadingImage=jQuery("#"+d+"_loading");this.toolbox=jQuery("#tv_tools");this.buttons=jQuery(".tv_button:first",this.toolbox);this.zoom=100;this.boxWidth=180;this.boxExpandedWidth=250;this.cookieDays=3;this.ajaxUrl="module.php?mod=tree&ged="+encodeURIComponent(WT_GEDCOM)+"&instance="+d+"&mod_action=";this.container=this.treeview.parent();this.updating=this.auto_box_width=!1;"true"===readCookie("compact")&&c.compact();c.treeview.draggable({cursor:"move",stop:function(){c.updateTree()}});c.toolbox.find("#tvbCompact").each(function(e,b){b.onclick=function(){c.compact()}});c.toolbox.find("#tvbAllPartners").each(function(e,b){b.onclick=function(){createCookie("allPartners","true"===readCookie("allPartners")?"false":"true",c.cookieDays);document.location=document.location}});c.toolbox.find("#tvbOpen").each(function(g,b){var f=jQuery(b,c.toolbox);b.onclick=function(){f.addClass("tvPressed");c.setLoading();var e=jQuery.Event("click");c.treeview.find(".tv_box:not(.boxExpanded)").each(function(i,h){var a=jQuery(h,c.treeview).offset();a.left>=c.leftMin&&a.left<=c.leftMax&&a.top>=c.topMin&&a.top<=c.topMax&&c.expandBox(h,e)});f.removeClass("tvPressed");c.setComplete()}});c.toolbox.find("#tvbClose").each(function(b,g){var f=jQuery(g,c.toolbox);g.onclick=function(){f.addClass("tvPressed");c.setLoading();c.treeview.find(".tv_box.boxExpanded").each(function(h,e){jQuery(e).css("display","none").removeClass("boxExpanded").parent().find(".tv_box.collapsedContent").css("display","block")});f.removeClass("tvPressed");c.setComplete()}});c.centerOnRoot()}TreeViewHandler.prototype.setLoading=function(){this.treeview.css("cursor","wait");this.loadingImage.css("display","block")};TreeViewHandler.prototype.setComplete=function(){this.treeview.css("cursor","move");this.loadingImage.css("display","none")};TreeViewHandler.prototype.getSize=function(){var d=this.container.parent(),c=d.offset();this.leftMin=c.left;this.leftMax=this.leftMin+d.innerWidth();this.topMin=c.top;this.topMax=this.topMin+d.innerHeight()};TreeViewHandler.prototype.updateTree=function(g,f){var j=this,i=[],h=[];this.getSize();j.treeview.find("td[abbr]").each(function(c,d){d=jQuery(d,j.treeview);var e=d.offset();e.left>=j.leftMin&&e.left<=j.leftMax&&e.top>=j.topMin&&e.top<=j.topMax&&(i.push(d.attr("abbr")),h.push(d))});0