
/* header.js */
if("undefined"==typeof TGN){TGN={}}if("undefined"==typeof TGN.Header){TGN.Header={}}if("undefined"==typeof TGN.Header.Drawer){TGN.Header.Drawer={}}if("undefined"==typeof TGN.Header.Navigation){TGN.Header.Navigation={}}if("undefined"==typeof _HDrwr){_HDrwr=TGN.Header.Drawer}if("undefined"==typeof _HNav){_HNav=TGN.Header.Navigation}if("undefined"==typeof _YDom){_YDom=YAHOO.util.Dom}if("undefined"==typeof _YConn){_YConn=YAHOO.util.Connect}if("undefined"==typeof _YDDM){_YDDM=YAHOO.util.DragDropMgr}if("undefined"==typeof _YEvent){_YEvent=YAHOO.util.Event}if("undefined"==typeof _YAnim){_YAnim=YAHOO.util.Anim}var _drawerObjs;var _addQlDialog;var _showTodosView=true;var _favsDrwr;var _todoDrwr;var _myAcctHovering=false;var _lameChomeCounter=0;var _HNavTreeMoreString;var _HNavTreeError;var _HNavAddQlErrorMessage;var _HNavAddQlSuccess;var _HNavGetQlSuccess;var _HNavTodoSuccess;var _HNavCompletedTodos;var _HNavCompletedCount=0;var _HNavSubZIndex=99;var _HNavTrees=[];var treesMnu;var searchMnu;var communityMnu;var learningMnu;_HNav.callLoader=function(e,d,f,b){var a=new YAHOO.util.YUILoader({onSuccess:f});var c;if(d!=null){c=_HNavServicePath+"?f="+e+d}else{c=_HNavServicePath+"?f="+e}a.addModule({name:e,type:"js",fullpath:c});a.require(e);a.insert()};_HNav.AncMenu=function(f,e,d,b,a){this.headerObj=_YDom.get(f);this.mnuContainerObj=_YDom.get(e);this.mnuContentObj=_YDom.get(d);if(this.headerObj&&this.mnuContainerObj&&this.mnuContentObj){var c=this.headerObj.offsetWidth+1;if(c<185){c=185}this.mnuContainerObj.style.width=c+"px";this.mnuContentObj.style.width=c+"px";this.recentHover=false;this.isHovering=false;this.isOpen=false;this.dynamicContentLoaded=true;this.height=_HNav.getElementHeight(e);this.callbackFn=b;this.callbackPm=a}};_HNav.toggleSitesBox=function(a){if(_YDom.get("ftrSitesContainer").style.display=="block"){_YDom.get("ftrSitesContainer").style.display="none"}else{_YDom.get("ftrSitesContainer").style.display="block"}};_YEvent.addListener("ftrNavDD","click",_HNav.toggleSitesBox);_YEvent.addListener("closeFtrSitesX","click",_HNav.toggleSitesBox);_HNav.dynamicCallBack=function(a){this.func=a};_HNav.animColorMouseOver=function(c){var b={backgroundColor:{from:"#fcfff3",to:"#e8eebb"}};var a=new YAHOO.util.ColorAnim(this.id,b,0.3);a.animate()};_HNav.animColorMouseOut=function(c){var b={backgroundColor:{from:"#e8eebb",to:"#fcfff3"}};var a=new YAHOO.util.ColorAnim(this.id,b,0.3);a.animate()};_HNav.open=function(b,a){a.isHovering=true;a.recentHover=true;a.mnuContainerObj.style.zIndex=_HNavSubZIndex++;setTimeout(function(){_HNav.getDynamicContent(a)},250)};_HNav.close=function(b,a){a.headerObj.style.backgroundColor="";a.isHovering=false;setTimeout(function(){_HNav.animClose(a)},500)};_HNav.getDynamicContent=function(c){if(c.isHovering==true&&c.isOpen==false){if(_HNavUserLoggedIn=="True"&&c.callbackFn!=null){try{c.dynamicContentLoaded=false;setTimeout(function(){_HNav.startSpinner(c)},1000);var b=new _HNav.dynamicCallBack(c.callbackFn);b.func()}catch(a){}}else{_HNav.animOpen(c)}}};_HNav.startSpinner=function(a){if(!a.dynamicContentLoaded){a.headerObj.className+=" G-NavItemLoading";setTimeout(function(){_HNav.stopSpinnerOpenMenu(a)},2000)}};_HNav.stopSpinnerOpenMenu=function(a){a.dynamicContentLoaded=true;a.headerObj.className=a.headerObj.className.replace("G-NavItemLoading","");_HNav.animOpen(a)};_HNav.animOpen=function(d){if(d.isHovering==true&&d.isOpen==false){d.mnuContainerObj.style.height="1px";var a=_HNav.getElementHeight(d.mnuContentObj.id);d.mnuContainerObj.style.display="block";var b={height:{from:0,to:a}};var c=new _YAnim(d.mnuContainerObj.id,b,0.4,YAHOO.util.Easing.easeOut);c.animate();d.isOpen=true}};_HNav.animClose=function(d){if(d.recentHover==true){setTimeout(function(){_HNav.animClose(d)},1000);d.recentHover=false}else{if(d.isHovering==false&&d.isOpen==true){d.isOpen=false;var a=_HNav.getElementHeight(d.mnuContainerObj.id);var b={height:{from:a,to:0}};var c=new _YAnim(d.mnuContainerObj.id,b,0.3,YAHOO.util.Easing.easeIn);c.animate()}}};_HNav.getTrees=function(){_HNav.callLoader("GetTrees",null,_HNav.getTreesSuccess,null)};_HNav.getTreesSuccess=function(){if(!_HNavTreeError){var b=_HNavTrees;try{var a=_HNavTreeTotalCount;var g=_HNavTreesDomain;if(b!=undefined&&b.length>0){var f="";for(var c=0;c<b.length;c++){f+='<li id="'+b[c].tid+'">';f+='<a href="http://'+g+"/pt/pedigree.aspx?tid="+b[c].tid+'">'+b[c].name+"</a>";f+="</li>"}if(a!=undefined&&a>b.length){f+='<li id="moreTrees">';f+='<a href="http://'+g+'/pt/treelist.aspx">'+_HNavTreeMoreString+"...</a>";f+="</li>"}document.getElementById("loadTrees").innerHTML=f}_HNav.stopSpinnerOpenMenu(treesMnu)}catch(d){_HNav.stopSpinnerOpenMenu(treesMnu)}}else{_HNav.stopSpinnerOpenMenu(treesMnu)}};_HNav.getTreesFail=function(){_HNav.stopSpinnerOpenMenu(treesMnu)};_HNav.MouseOverMyAcctDD=function(){_myAcctHovering=true;setTimeout("_HNav.OpenMyAcctDD()",300)};_HNav.MouseOutMyAcctDD=function(){_myAcctHovering=false;setTimeout("_HNav.CloseMyAcctDD()",600)};_HNav.OpenMyAcctDD=function(){if(_myAcctHovering==true){var a=document.getElementById("acctDD");a.style.display=""}};_HNav.CloseMyAcctDD=function(){if(_myAcctHovering!=true){var a=document.getElementById("acctDD");a.style.display="none"}};_HNav.getElementHeight=function(a){var b;if(document.getElementById){b=document.getElementById(a);b.style.overflow="scroll"}else{if(document.all){b=document.all[a]}}b.style.overflow="hidden";return b.scrollHeight-8};_HNav.subMenuHover=function(b){var c=document.getElementById(b);c.style.backgroundColor="#fcfff3";var a=c.style.backgroundColor};_HNav.initMenus=function(){try{treesMnu=new _HNav.AncMenu("treesNav","treesSubNav","treesContent",_HNav.getTrees);_YEvent.on("treesNav","mouseover",_HNav.open,treesMnu);_YEvent.on("treesNav","mouseout",_HNav.close,treesMnu);_YEvent.on("treesSubNav","mouseover",function(){_HNav.subMenuHover("treesNav")})}catch(b){}try{searchMnu=new _HNav.AncMenu("searchNav","searchSubNav","searchContentNav",null);_YEvent.on("searchNav","mouseover",_HNav.open,searchMnu);_YEvent.on("searchNav","mouseout",_HNav.close,searchMnu);_YEvent.on("searchSubNav","mouseover",function(){_HNav.subMenuHover("searchNav")})}catch(d){}try{communityMnu=new _HNav.AncMenu("communityNav","communitySubNav","communityContentNav",null);_YEvent.on("communityNav","mouseover",_HNav.open,communityMnu);_YEvent.on("communityNav","mouseout",_HNav.close,communityMnu);_YEvent.on("communitySubNav","mouseover",function(){_HNav.subMenuHover("communityNav")})}catch(c){}try{learningMnu=new _HNav.AncMenu("learningNav","learningSubNav","learningContentNav",null);_YEvent.on("learningNav","mouseover",_HNav.open,learningMnu);_YEvent.on("learningNav","mouseout",_HNav.close,learningMnu);_YEvent.on("learningSubNav","mouseover",function(){_HNav.subMenuHover("learningNav")})}catch(a){}};_YEvent.onDOMReady(_HNav.initMenus);_HDrwr.Drawer=function(o,c,e,f,n,k,d,h,a,b,g,m,j,l){this.isOpen=false;this.li=_YDom.get(o);this.left=_YDom.get(c);this.right=_YDom.get(e);this.container=_YDom.get(f);this.link=_YDom.get(n);this.em=_YDom.get(k);this.span=_YDom.get(d);this.top=_YDom.get(h);this.content=_YDom.get(a);this.noContent=_YDom.get(b);this.altContent=null;if(g!=null){this.altContent=_YDom.get(g)}this.noAltContent=null;if(m!=null){this.noAltContent=_YDom.get(m)}this.callbackFn=l;this.spinner=_YDom.get(j);this.openTab=function(){_YDom.get(o).style.marginTop="-4px";_YDom.get(c).className="DrwSelectL";_YDom.get(e).className="DrwSelectR";_YDom.get(f).className="DrwSelect";_YDom.get(n).className="CalloutActive";_YDom.get(k).className="CallbublActv";_YDom.get(d).className="CallBublLeftActv";_YDom.get(h).style.display="block";_YDom.get(a).style.display="block"};this.close=function(){_YDom.get(o).style.marginTop="0px";_YDom.get(c).className="";_YDom.get(e).className="";_YDom.get(f).className="";_YDom.get(n).className="Callout";_YDom.get(k).className="Callbubl";_YDom.get(d).className="";_YDom.get(b).style.display="none";_YDom.get(j).style.display="none";if(g!=null){_YDom.get(g).style.display="none"}if(m!=null){_YDom.get(m).style.display="none"}this.isOpen=false}};_HDrwr.closeDrwrTop=function(a){a.top.style.display="none";a.content.style.display="none"};_HDrwr.openDrawerTab=function(b,a){_HDrwr.closeAllDrawerTabs();a.openTab();_HDrwr.getDynamicContent(a)};_HDrwr.animOpenDrawer=function(b){b.top.style.display="block";b.content.style.display="block";var a=_HNav.getElementHeight("DrwWrapper")+11;if(b.isOpen==false){var c=new YAHOO.util.Anim("DrwSlider",{height:{to:a}},0.5,YAHOO.util.Easing.easeOut);c.animate();setTimeout(function(){b.spinner.style.display="none"},500)}else{_YDom.get("DrwSlider").style.height=a+"px"}b.isOpen=true};_HDrwr.closeAllDrawerTabs=function(){if(_drawerObjs){for(var a=0;a<_drawerObjs.length;a++){_drawerObjs[a].close()}}};_HDrwr.animClose=function(){_HDrwr.closeAllDrawerTabs();var a=_HNav.getElementHeight("DrwWrapper")+11;var b=new YAHOO.util.Anim("DrwSlider",{height:{from:a,to:0}},0.5,YAHOO.util.Easing.easeIn);b.animate()};_HDrwr.dynamicCallBack=function(a){this.func=a};_HDrwr.getDynamicContent=function(c){if(c.callbackFn!=null){try{var b=new _HDrwr.dynamicCallBack(c.callbackFn);b.func()}catch(a){}}};_HDrwr.DragDrop={initHdrTodo:function(){var d=new YAHOO.util.DDTarget("hdrTodos","hdrTdList");var c=document.getElementById("hdrTodos");d.unlock();if(c){var a=c.getElementsByTagName("li");for(var b=0;b<a.length;b=b+1){var e=new _HDrwr.DDList(a[b].id,"hdrTdList")}}},initHdrQuickLinks:function(){var e=new YAHOO.util.DDTarget("hdrFavs","hdrFavList");var d=document.getElementById("hdrFavs");e.unlock();if(d){var b=d.getElementsByTagName("li");for(var c=0;c<b.length;c=c+1){var a=new _HDrwr.DDList(b[c].id,"hdrQLList")}}}};_HDrwr.DDList=function(d,a,b){_HDrwr.DDList.superclass.constructor.call(this,d,a,b);this.logger=this.logger||YAHOO;var c=this.getDragEl();_YDom.setStyle(c,"opacity",0.67);this.goingUp=false;this.lastY=0};YAHOO.extend(_HDrwr.DDList,YAHOO.util.DDProxy,{startDrag:function(b,d){this.logger.log(this.id+" startDrag");var a=this.getDragEl();var c=this.getEl();_YDom.setStyle(c,"visibility","hidden");a.innerHTML=c.innerHTML;_YDom.setStyle(a,"color",_YDom.getStyle(c,"color"));_YDom.setStyle(a,"backgroundColor",_YDom.getStyle(c,"backgroundColor"));_YDom.setStyle(a,"border","2px solid gray")},endDrag:function(h){var d=this.getEl();var f=this.getDragEl();_YDom.setStyle(f,"visibility","");var b=new YAHOO.util.Motion(f,{points:{to:_YDom.getXY(d)}},0.2,YAHOO.util.Easing.easeOut);var c=f.id;var j=this.id;b.onComplete.subscribe(function(){_YDom.setStyle(c,"visibility","hidden");_YDom.setStyle(j,"visibility","")});b.animate();var g=d.parentNode;if(g.id=="hdrTodos"||g.id=="hdrFavs"){_HDrwr.reorderDrwrItems(g.id)}},onDragDrop:function(f,g){if(_YDDM.interactionInfo.drop.length===1){var d=_YDDM.interactionInfo.point;var c=_YDDM.interactionInfo.sourceRegion;if(!c.intersect(d)){var a=_YDom.get(g);var b=_YDDM.getDDById(g);a.appendChild(this.getEl());b.isEmpty=false;_YDDM.refreshCache()}}},onDrag:function(a){var b=_YEvent.getPageY(a);if(b<this.lastY){this.goingUp=true}else{if(b>this.lastY){this.goingUp=false}}this.lastY=b},onDragOver:function(f,g){var c=this.getEl();var b=_YDom.get(g);if(b.nodeName.toLowerCase()=="li"){var a=c.parentNode;var d=b.parentNode;if(this.goingUp){d.insertBefore(c,b)}else{d.insertBefore(c,b.nextSibling)}_YDDM.refreshCache()}}});_HDrwr.reorderDrwrItems=function(a){try{var e=_YDom.get(a);var d=e.getElementsByTagName("li");var f="";for(i=0;i<d.length;i++){f+=d[i].id+","}var b="&orderedStr="+f;_HNav.callLoader("ReorderDrawerItems",b,_HDrwr.reorder_Success,null)}catch(c){this.dump(c)}};_HDrwr.reorder_Success=function(){var a=_HNavReorderSuccess};_HDrwr.QuickLink=function(c,b,a){this.id=c;this.linkName=b;this.linkUrl=a;this.draw=function(){var d;var e=_YDom.get("favs_template");d=e.innerHTML;d=d.replace("__favId__",this.id);d=d.replace("__favId2__",this.id);d=d.replace("__favName__",unescape(this.linkName));d=d.replace("__favName2__",this.linkName);d=d.replace("__favURL__",this.linkUrl);return d}};_HDrwr.getQuickLinks=function(){setTimeout(function(){if(!_favsDrwr.isOpen){_favsDrwr.spinner.style.display="block"}},500);var a="&partnerId="+_HNavPartnerId+"&subType="+_HNavSubType+"&lameChrome="+_lameChomeCounter++;_HNav.callLoader("GetQuickLinks",a,_HDrwr.getQuickLinks_Success,null)};_HDrwr.getQuickLinks_Success=function(){if(_HNavGetQlSuccess){_YDom.get("drwrError").style.display="none";_YDom.get("todoPhaseout").style.display="none";_HDrwr.drawQuickLinks(_HNavGetQlSuccess,_HNavQuickLinks,_HNavQlTotalCount)}else{_YDom.get("drwrError").style.display="block"}_HDrwr.closeDrwrTop(_todoDrwr);_HDrwr.animOpenDrawer(_favsDrwr);_favsDrwr.spinner.style.display="none"};_HDrwr.drawQuickLinks=function(g,f,d){var c=_YDom.get("hdrFavs");c.innerHTML="";if(g){_YDom.get("favCount").innerHTML="("+d+")";if(f.length>0){_YDom.get("noQuickLinks").style.display="none";var b;var a;for(var e=0;e<f.length;e++){b=f[e];a=new _HDrwr.QuickLink(b.id,b.linkName,b.linkUrl);c.innerHTML+=a.draw()}_HDrwr.DragDrop.initHdrQuickLinks()}else{_YDom.get("noQuickLinks").style.display="block"}}};_HDrwr.addNewQuickLink=function(){var d=_YDom.get("ql_urlTxt");var c=_YDom.get("ql_nameTxt");if(d.value!=""&&c.value!=""){if(d.value.indexOf("http://")!=0&&d.value.indexOf("https://")!=0){d.value="http://"+d.value}var a=encodeURIComponent(d.value);var b="&linkName="+c.value+"&partnerId="+_HNavPartnerId+"&subType="+_HNavSubType+"&linkUrl="+a;_HNav.callLoader("AddQuickLink",b,_HDrwr.addQuickLink_Success,null)}else{_YDom.get("addHdrQuickLink_needInfo").style.display="inline"}};_HDrwr.addQuickLink_Success=function(){if(_HNavAddQlSuccess!=null&&_HNavAddQlSuccess=="true"){_YDom.get("ql_urlTxt").value="http://";_YDom.get("ql_nameTxt").value="";_HDrwr.toggleAddQuickLink();_HDrwr.getQuickLinks()}};_HDrwr.deleteQuickLink=function(d,c){var a=_HNavDeleteItemConf;if(confirm(a+"\n\n"+unescape(c))){var b="&linkId="+d;_HNav.callLoader("DeleteQuickLink",b,_HDrwr.deleteQuickLink_Success,null)}};_HDrwr.deleteQuickLink_Success=function(){_HDrwr.getQuickLinks()};_HDrwr.toggleAddQuickLink=function(b){var a=_YDom.get("addHdrQuickLink");if(b){var e=location.href;var c=document.title;a.style.display="block";_YDom.get("ql_urlTxt").value=e;_YDom.get("ql_nameTxt").value=c;_YDom.get("addHdrQuickLink_needInfo").style.display="none"}else{if(a.style.display=="none"){a.style.display="block";var f=_YDom.get("ql_urlTxt");f.focus();if(f.createTextRange){var d=f.createTextRange();d.moveStart("character",f.value.length);d.collapse();d.select()}_YDom.get("addHdrQuickLink_needInfo").style.display="none"}else{a.style.display="none"}}return false};_HNav.QuickLink={};_HNav.QuickLink.isFireFox=function(){return navigator.userAgent.indexOf("Firefox")!=-1};_HNav.QuickLink.ancestryDomain="www.ancestry.com";_HNav.QuickLink.show=function(n){if(n!="undefined"&&n.length>0){_HNav.QuickLink.ancestryDomain=n}var e;var p;var h=document.createElement("div");h.setAttribute("id","ql_dropSheet");if(_HNav.QuickLink.isFireFox()){e=document.body.scrollWidth;p=document.body.scrollHeight}else{e=document.body.clientWidth;p=document.body.clientHeight}h.style.width=e+"px";h.style.height=p+"px";var g="370px";var m="180px";var j=document.createElement("div");j.setAttribute("id","ql_dialog");var o=document.getElementById("ql_dialogTemplate");j.innerHTML=o.innerHTML;j.style.display="none";j.style.width=g;j.style.height=m;var c=document.getElementsByTagName("body")[0];c.insertBefore(j,c.firstChild);c.insertBefore(h,j);var d;var b;var a=370;var f=180;if(_HNav.QuickLink.isFireFox()){d=window.innerWidth;b=window.innerHeight}else{if(document.documentElement.clientHeight>0){b=document.documentElement.clientHeight}else{b=document.body.clientHeight}if(document.documentElement.clientWidth>0){d=document.documentElement.clientWidth}else{d=document.body.clientWidth}}j.style.display="block";j.style.left=((d-a)/2)+"px";j.style.top=((b-f)/2)+"px";var l=document.getElementsByTagName("title")[0];var k=document.getElementById("ql_name");if(typeof TGN.KeyWatcher!="undefined"){TGN.KeyWatcher.addListener(k)}k.value=l.innerHTML};_HNav.QuickLink.addQuickLink=function(){_YDom.get("ql_content").style.display="none";_YDom.get("ql_buttons").style.display="none";_YDom.get("ql_result").style.display="block";_YDom.get("ql_image").style.display="none";var c=document.location;var b=document.getElementById("ql_name");if(c!=""&&b.value!=""){var a="&linkName="+b.value+"&partnerId="+_HNavPartnerId+"&subType="+_HNavSubType+"&linkUrl="+encodeURIComponent(c.href);_HNav.callLoader("AddQuickLink",a,_HNav.QuickLink.addQuickLink_Success,null)}};_HNav.QuickLink.addQuickLink_Success=function(){if(_HNavAddQlErrorMessage==null){if(_HNavAddQlSuccess=="true"){_YDom.get("ql_AddSuccess").style.display="block";_YDom.get("ql_AddFail").style.display="none"}else{_YDom.get("ql_AddSuccess").style.display="none";_YDom.get("ql_AddFail").style.display="block"}}else{_YDom.get("ql_AddSuccess").style.display="none";_YDom.get("ql_AddFail").style.display="block"}};_HNav.QuickLink.closeDialog=function(){var a=document.getElementsByTagName("body")[0];a.removeChild(document.getElementById("ql_dropSheet"));a.removeChild(document.getElementById("ql_dialog"))};_HDrwr.Todo=function(c,a,b){this.todoName=a;this.id=c;this.draw=function(){var d;var e=_YDom.get("todo_template");d=e.innerHTML;d=d.replace("__todoItemId__",this.id);d=d.replace("__todoItemTxt__",unescape(this.todoName));d=d.replace("__todoItemId2__",this.id);d=d.replace("__todoItemTxt2__",this.todoName);d=d.replace("__todoChBId__","chB_"+this.id);d=d.replace("__todoId__",this.id);if(b){d=d.replace("__checked__",'checked="checked"');d=d.replace("__callbackFn__","_HDrwr.retaskTodo")}else{d=d.replace("__checked__","");d=d.replace("__callbackFn__","_HDrwr.completeTodo")}return d}};_HDrwr.getTodos=function(){setTimeout(function(){if(!_todoDrwr.isOpen){_todoDrwr.spinner.style.display="block"}},500);var a="&lameChrome="+_lameChomeCounter++;_HNav.callLoader("GetTodos",a,_HDrwr.getTodos_Success,null)};_HDrwr.getTodos_Success=function(){if(_HNavTodoSuccess){_YDom.get("drwrError").style.display="none";_HDrwr.drawTodos(_HNavTodoSuccess,_HNavTodos,_HNavTodoCount,_HNavCompletedTodos,_HNavCompletedCount)}else{_YDom.get("drwrError").style.display="block"}_HDrwr.closeDrwrTop(_favsDrwr);_HDrwr.changeTodoView();_todoDrwr.spinner.style.display="none"};_HDrwr.drawTodos=function(n,a,p,c,m){if(n){_YDom.get("todoPhaseout").style.display="block";var e=_YDom.get("hdrTodos");e.innerHTML="";if(_YDom.get("todoViewDD").value=="todos"){if(p==0){_YDom.get("noTodos").style.display="block"}else{_YDom.get("noTodos").style.display="none"}}else{if(m==0){_YDom.get("noCompletedItems").style.display="block"}else{try{_YDom.get("noCompletedItems").style.display="none"}catch(o){}}}var f;var d;for(var h=0;h<a.length;h++){f=a[h];d=new _HDrwr.Todo(f.id,f.todoName,false);e.innerHTML+=d.draw()}_HDrwr.DragDrop.initHdrTodo();var k=_YDom.get("hdrCompletedItems");k.innerHTML="";var b;var l;for(var g=0;g<m;g++){b=c[g];l=new _HDrwr.Todo(b.id,b.todoName,true);k.innerHTML+=l.draw()}_YDom.get("todoCount").innerHTML="("+p+")";_YDom.get("completedCount").innerHTML="("+m+")";if(_showTodosView){e.style.display="block";k.style.display="none"}else{e.style.display="none";k.style.display="block"}}};_HDrwr.saveNewTodo=function(){var a=_YDom.get("addTodoTxt");if(a.value!=""){var c=encodeURIComponent(a.value);var b="&subject="+c+"&partnerId="+_HNavPartnerId+"&subType="+_HNavSubType;_HNav.callLoader("AddTodo",b,_HDrwr.getTodos,null);_YDom.get("addTodoTxt").value=""}_HDrwr.toggleAddTodo();_HDrwr.getTodos()};_HDrwr.completeTodo=function(b){var a="&todoId="+b;_HNav.callLoader("CompleteTodo",a,_HDrwr.getTodos,null)};_HDrwr.completeTodo_success=function(){_HDrwr.getTodos()};_HDrwr.deleteTodo=function(d,b){var a=_HNavDeleteItemConf;if(confirm(a+"\n\n"+unescape(b))){var c="&todoId="+d;_HNav.callLoader("DeleteTodo",c,_HDrwr.deleteTodo_Success,null)}};_HDrwr.deleteTodo_Success=function(){_HDrwr.getTodos()};_HDrwr.retaskTodo=function(b){var a="&todoId="+b;_HNav.callLoader("ReTaskTodo",a,_HDrwr.retaskTodo_success,null)};_HDrwr.retaskTodo_success=function(){_HDrwr.getTodos()};_HDrwr.toggleAddTodo=function(){var a=_YDom.get("addTodoBox");if(a.style.display=="none"){a.style.display="block";_YDom.get("addTodoTxt").focus()}else{a.style.display="none"}return false};_HDrwr.changeTodoView=function(){if(_YDom.get("todoViewDD").value=="todos"){_YDom.get("hdrTodos").style.display="block";_YDom.get("hdrCompletedItems").style.display="none";_YDom.get("addTodoBtn").style.display="block";_YDom.get("todoCount").style.display="inline";_YDom.get("completedCount").style.display="none";_YDom.get("noCompletedItems").style.display="none";_YDom.get("todoInstruction").style.display="block";if(_HNavTodoCount==0){_YDom.get("noTodos").style.display="block"}_HDrwr.animOpenDrawer(_todoDrwr)}else{_YDom.get("hdrCompletedItems").style.display="block";_YDom.get("hdrTodos").style.display="none";_YDom.get("addTodoBtn").style.display="none";_YDom.get("todoCount").style.display="none";_YDom.get("completedCount").style.display="inline";_YDom.get("noTodos").style.display="none";_YDom.get("todoInstruction").style.display="none";if(_HNavCompletedCount==0){_YDom.get("noCompletedItems").style.display="block"}var a=_HNav.getElementHeight("DrwWrapper")+11;_YDom.get("DrwSlider").style.height=a+"px";setTimeout(function(){_todoDrwr.spinner.style.display="none"},500)}};_HDrwr.initDrawers=function(){_todoDrwr=new _HDrwr.Drawer("todosLi","todosLeft","todosRight","todosContainer","todosLink","todosEm","todosSpan","todoTop","hdrTodos","noTodos","hdrCompletedItems","noCompletedItems","todoSpinner",_HDrwr.getTodos);_YEvent.on("todosLi","click",_HDrwr.openDrawerTab,_todoDrwr);_favsDrwr=new _HDrwr.Drawer("favsLi","favsLeft","favsRight","favsContainer","favsLink","favsEm","favsSpan","favTop","hdrFavs","noQuickLinks",null,null,"favsSpinner",_HDrwr.getQuickLinks);_YEvent.on("favsLi","click",_HDrwr.openDrawerTab,_favsDrwr);_YEvent.on("todoCloser","click",_HDrwr.animClose);_YEvent.on("favCloser","click",_HDrwr.animClose);_drawerObjs=[_todoDrwr,_favsDrwr]};_YEvent.onDOMReady(_HDrwr.initDrawers);function g_createTab(c,b,f,e){var a=_YDom.get("_HdrNav");if(a!=null&&f==true){a.innerHTML+='<li class="G-NavItem"><a href="'+b+'">'+c+"</a></li>"}else{if(!f){var d=document.getElementById("_HdrReturnBtn");d.style.display="block";d.innerHTML='<div style="position:absolute; left:0; top:0; height:30px; width:auto;"><a href="'+b+'" class="gbtn med-green"><em><span class="flat_icon arrow1left_white"></span>'+c+"</em></a></div><br>"}}}if(typeof(document.getElementsByClassName)=="undefined"){document.getElementsByClassName=function(k,j,q){var p=[],o=[],n=0,m=0,l=[];if(typeof(q)=="undefined"){q=document}else{if(typeof(q)==typeof("string")){q=document.getElementById(q)}}if(typeof(j)=="undefined"){j="*"}o=q.getElementsByTagName(j);for(n=0;n<o.length;n++){if(o[n].className){l=o[n].className.split(" ");for(m=0;m<l.length;m++){if(l[m]==k){p.push(o[n]);break}}}}return(p)}}function hasClassName(d,c){return d.className.match(new RegExp("(\\s|^)"+c+"(\\s|$)"))}function addClassName(d,c){if(!hasClassName(d,c)){d.className+=" "+c;return true}return false}function removeClassName(e,d){if(hasClassName(e,d)){var f=new RegExp("(\\s|^)"+d+"(\\s|$)");e.className=e.className.replace(f," ");return true}return false}function setButtonStates(c){if(c&&c.length>0){for(var b=0;b<c.length;b++){c[b].onmouseover=function(){if(hasClassName(this,"disabled")){return false}this.style.backgroundPosition="left center";for(var a=0;a<this.childNodes.length;a++){if(this.childNodes[a].nodeName.toLowerCase()=="em"){this.childNodes[a].style.backgroundPosition="right center";break}}return true};c[b].onmousedown=function(){if(hasClassName(this,"disabled")){return false}this.style.backgroundPosition="left bottom";for(var a=0;a<this.childNodes.length;a++){if(this.childNodes[a].nodeName.toLowerCase()=="em"){this.childNodes[a].style.backgroundPosition="right bottom";break}}return true};c[b].onmouseup=function(){if(hasClassName(this,"disabled")){return false}this.style.backgroundPosition="left center";for(var a=0;a<this.childNodes.length;a++){if(this.childNodes[a].nodeName.toLowerCase()=="em"){this.childNodes[a].style.backgroundPosition="right center";break}}return true};c[b].onmouseout=function(){if(hasClassName(this,"disabled")){return false}this.style.backgroundPosition="left top";for(var a=0;a<this.childNodes.length;a++){if(this.childNodes[a].nodeName.toLowerCase()=="em"){this.childNodes[a].style.backgroundPosition="right top";break}}return true}}}}function setTranBtnStates(c){if(c&&c.length>0){for(var b=0;b<c.length;b++){c[b].onmouseover=function(){if(hasClassName(this,"disabled")){return false}for(var a=0;a<this.childNodes.length;a++){if(this.childNodes[a].nodeName.toLowerCase()=="span"){this.childNodes[a].style.backgroundPosition="left center"}if(this.childNodes[a].nodeName.toLowerCase()=="em"){this.childNodes[a].style.backgroundPosition="right center"}}return true};c[b].onmousedown=function(){if(hasClassName(this,"disabled")){return false}for(var a=0;a<this.childNodes.length;a++){if(this.childNodes[a].nodeName.toLowerCase()=="span"){this.childNodes[a].style.backgroundPosition="left bottom"}if(this.childNodes[a].nodeName.toLowerCase()=="em"){this.childNodes[a].style.backgroundPosition="right bottom"}}return true};c[b].onmouseup=function(){if(hasClassName(this,"disabled")){return false}for(var a=0;a<this.childNodes.length;a++){if(this.childNodes[a].nodeName.toLowerCase()=="span"){this.childNodes[a].style.backgroundPosition="left center"}if(this.childNodes[a].nodeName.toLowerCase()=="em"){this.childNodes[a].style.backgroundPosition="right center"}}return true};c[b].onmouseout=function(){if(hasClassName(this,"disabled")){return false}for(var a=0;a<this.childNodes.length;a++){if(this.childNodes[a].nodeName.toLowerCase()=="span"){this.childNodes[a].style.backgroundPosition="left top"}if(this.childNodes[a].nodeName.toLowerCase()=="em"){this.childNodes[a].style.backgroundPosition="right top"}}return true}}}}_YEvent.onDOMReady(function(){var a=document.getElementsByClassName("gbtn","a");setButtonStates(a);a=document.getElementsByClassName("gbtn_in","a");setButtonStates(a);a=document.getElementsByClassName("gtbtn","a");setTranBtnStates(a)});function GetCommunicationBanner(){if(typeof clientId!="undefined"){var a=document.getElementById(clientId+"_hdnStackName").value;if(_HNavUserLoggedIn=="True"&&bannerOff.toLowerCase()=="true"&&(a=="c_lihp"||a=="c_home"||a=="c_trees"||a=="c_boards"||a=="c_search"||a=="c_learn")){var b="&stack="+a;_HNav.callLoader("CommunicationBanner",b,GetBannerSucc,null)}}}function GetBannerSucc(){var j=document.getElementById(clientId+"_hdnStackName").value;var a,e;var f=new String();try{if(!_HNavBannertext==""){a=document.getElementById(clientId+"_banComMessage");a.innerHTML="";var h,g;var d=new String();e=document.createElement("div");e.id="wrpDiv";f=_HNavBannertext;if(_HNavBannertext.indexOf("<LANG")>-1){f=CanadaLanguageBanner(_HNavBannertext)}if(!f==""){f=f.concat('<a class="close" href="javascript:void(0)" onclick="CloseBannerClick();">'+closeStr+"</a>");switch(_HNavColor){case"green":h="grnWrp";g="grnBtm";break;case"yellow":h="yloWrp";g="yloBtm";break;case"red":h="redWrp";g="redBtm";break;case"orange":h="orangeWrp";g="orangeBtm";break;case"blue":h="bluWrp";g="bluBtm";break;default:h="bluWrp";g="bluBtm";break}e.className=h+" gHeaderAlert";f=f.concat('<div class="tl"></div><div class="tr"></div>');document.getElementById(clientId+"_hdnbannerID").value=_HNavBannerid;if(_HNavAddtext==""){f=f.concat('<div class="bl"></div><div class="br"></div>');e.innerHTML=f;a.appendChild(e)}else{e.innerHTML=f;a.appendChild(e);var b=document.createElement("div");d=_HNavAddtext;b.ID="addDiv";b.className=g;d=d.concat('<div class="bl"></div><div class="br"></div>');b.innerHTML=d;a.appendChild(b)}document.getElementById(clientId+"_bannerCommunication").style.display="block";document.getElementById("fbanner").style.display="block"}}else{document.getElementById(clientId+"_bannerCommunication").style.display="none";document.getElementById("fbanner").style.display="none"}}catch(c){document.getElementById(clientId+"_bannerCommunication").style.display="none";document.getElementById("fbanner").style.display="none"}}_YEvent.onDOMReady(function(){GetBannerSucc()});function CloseBannerClick(){var c=document.getElementById(clientId+"_hdnbannerID").value;var b=document.getElementById(clientId+"_hdnStackName").value;document.getElementById(clientId+"_bannerCommunication").style.display="none";document.getElementById("fbanner").style.display="none";var a="&bannerId="+c+"&stack="+b;_HNav.callLoader("CommunicationBanner",a,GetBannerSucc,null)}function CanadaLanguageBanner(f){var c=-1;var b=-1;var a="";try{var d=cultureName;c=f.indexOf("<LANG"+d+">");b=f.indexOf("</LANG"+d+">");if(c>-1&&b>-1&&b>c){a=f.substring(c+11,b)}}catch(e){}return a};
/* searchwidgets.js */
$D=YAHOO.util.Dom;$=$D.get;if(document.implementation.hasFeature("XPath","3.0")){if(typeof XMLDocument=="undefined"){XMLDocument=Document}XMLDocument.prototype.selectNodes=function(d,e){if(!e){e=this}var b=this.createNSResolver(this.documentElement);var a=this.evaluate(d,e,b,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var f=[];for(var c=0;c<a.snapshotLength;c++){f[c]=a.snapshotItem(c)}return f};XMLDocument.prototype.selectSingleNode=function(b,c){if(!c){c=this}var a=this.selectNodes(b,c);if(a.length>0){return a[0]}else{return null}};Element.prototype.selectNodes=function(a){if(this.ownerDocument.selectNodes){return this.ownerDocument.selectNodes(a,this)}else{throw"For XML Elements Only"}};Element.prototype.selectSingleNode=function(a){if(this.ownerDocument.selectSingleNode){return this.ownerDocument.selectSingleNode(a,this)}else{throw"For XML Elements Only"}}}if(typeof TGN=="undefined"){var TGN={};TGN.Search={};TGN.SearchWidget={};TGN.Search.BrowseDate={}}if(typeof TGN.SearchWidget=="undefined"){TGN.SearchWidget={}}if(typeof TGN.Search=="undefined"){TGN.Search={};TGN.Search.BrowseDate={}}if(typeof TGN.Search.BrowseDate=="undefined"){TGN.Search.BrowseDate={}}if(typeof TGN.Ancestry=="undefined"){TGN.Ancestry={}}if(typeof TGN.Ancestry.Search=="undefined"){TGN.Ancestry.Search={}}if(typeof dbid=="undefined"&&typeof TGN.SResults!="undefined"){if(typeof TGN.SResults.Browse!="undefined"){if(typeof TGN.SResults.Browse.dbid!="undefined"){dbid=TGN.SResults.Browse.dbid}}}if(typeof TGN.I18N=="undefined"){TGN.I18N={}}TGN.I18N.getTrans=function(a){if(TGN.I18N[a]===null||TGN.I18N[a]=="undefined"){return"$"+a}else{return TGN.I18N[a]}};TGN.SearchWidget.AddString=function(a,b){TGN.I18N[a]=b};TGN.SearchWidget.NameChanged=0;TGN.SearchWidget.TreeLoadingPanel=null;TGN.SearchWidget.PersonACHandles={};TGN.SearchWidget.PersonAutoComplete=function(CtrlName,lNameContainer,formFieldArray,guid,cache,tid,tName){this.NameTextBox=CtrlName;this.NameContainer=lNameContainer;var aCDS=new YAHOO.widget.DS_XHR("AjaxBaseHandler.ashx",["ResultSet.Result","Name","YearRange","tid","pid"]);aCDS.scriptQueryAppend="a=MFN.Shared.Search&f=MFN.Shared.Search.WebControls.PersonAutoComplete|DoCallback&guid="+guid+"&tid="+tid;aCDS.responseType=YAHOO.widget.DS_XHR.TYPE_JSON;aCDS.connTimeout=4000;aCDS.queryMatchSubset=true;this.YUI_AC=new YAHOO.widget.AutoComplete(this.NameTextBox,this.NameContainer,aCDS);this.YUI_AC.animVert=false;this.YUI_AC.minQueryLength=3;this.YUI_AC.maxResultsDisplayed=12;this.YUI_AC.queryDelay=0.5;this.YUI_AC.useShadow=true;this.YUI_AC.useIFrame=true;this.YUI_AC.autoHighlight=false;this.setTid=function(newTid){this.YUI_AC.dataSource.scriptQueryAppend="a=MFN.Shared.Search&f=MFN.Shared.Search.WebControls.PersonAutoComplete|DoCallback&guid="+guid+"&tid="+newTid;this.YUI_AC.dataSource.flushCache();var nTB=$(this.NameTextBox);if(nTB!=null){this.YUI_AC.sendQuery(nTB.value);nTB.focus()}};this.fnFormatter=function(ResultSet,query){var returnV="<div class='treeName'>";returnV+=ResultSet[0]+"</div><div class='treeYears'>"+ResultSet[1]+"</div>";return returnV};this.YUI_AC.formatResult=this.fnFormatter;var PopulateForm={success:function(o){if(TGN.SearchWidget.TreeLoadingPanel!=null){TGN.SearchWidget.TreeLoadingPanel.destroy();TGN.SearchWidget.TreeLoadingPanel=null}if(TGN.SM.TreeLoadingFader!=null){TGN.SM.TreeLoadingFader.stop()}var theGExactCB=$(o.argument.GlobalExactCB);if(theGExactCB!=null&&theGExactCB.checked){TGN.SM.Clear(o.argument.FormId,"",null,false)}else{TGN.SM.Clear(o.argument.FormId)}var person=eval("("+o.responseText+")");for(FieldName in o.argument.KVPairs){var fId=$(FieldName);if(fId!=null){if(fId.tagName!="SPAN"){fId.value=person[o.argument.KVPairs[FieldName]]}else{if(fId.innerHTML!="undefined"){fId.innerHTML=person[o.argument.KVPairs[FieldName]]}else{if(TGN.SM.GetText(fId)!=null){TGN.SM.SetText(fId,person[o.argument.KVPairs[FieldName]])}}}}}for(FuncName in o.argument.Callbacks){var tCallb=o.argument.Callbacks[FuncName];tCallb.callback(tCallb.domId,person[tCallb.fType],tCallb.args)}TGN.SearchWidget.NameChanged=0;var FMC=TGN.SM.InstContainer[o.argument.FormId.replace("moduleSearchtemplate","search-form")].FMC;if("undefined"!=FMC&&null!=FMC){FMC.Clear();for(ndx in person.familyMembers){FMC.AddRow(person.familyMembers[ndx].relationship,person.familyMembers[ndx].givenName,person.familyMembers[ndx].surname,"","")}}},failure:function(o){if(o.status==500){if(TGN.SearchWidget.TreeLoadingPanel!=null){TGN.SearchWidget.TreeLoadingPanel.setBody("<div class='g_alert'><strong>"+TGN.I18N.getTrans("treeLoadingErrorH")+"</strong><br/>"+TGN.I18N.getTrans("treeLoadingErrorB")+"</div>");setTimeout("TGN.SearchWidget.TreeLoadingPanel.destroy()",5000)}if(TGN.SM.TreeLoadingFader!=null){TGN.SM.TreeLoadingFader.stop()}}},argument:formFieldArray};this.fnItemSelectEvent=function(oSelf,eArr,oData){TGN.SM.RegSubmitCancelled=true;var url="AjaxBaseHandler.ashx?a=MFN.Shared.Search&f=MFN.Shared.Search.WebControls.PersonAutoComplete|GetPersonCallback&guid=";url+=guid;url+="&tid="+eArr[2][2];url+="&pid="+eArr[2][3];if(eArr[1]!=null){var cEl=eArr[1];while(cEl!=null&&cEl!=document){if(cEl.className.indexOf("search-form")>=0||cEl.className.indexOf("search-refined")>=0){TGN.SM.ShowTreeLoading(cEl.id,cache);break}cEl=cEl.parentNode}}YAHOO.util.Connect.asyncRequest("GET",url,PopulateForm)};this.YUI_AC.itemSelectEvent.subscribe(this.fnItemSelectEvent);this.fnUnmatchedEvent=function(oSelf,sQuery){var gsfn=$(CtrlName+"_gsfn");if(gsfn!==null){gsfn.value=""}var gsln=$(CtrlName+"_gsln");if(gsln!==null){gsln.value=""}};this.YUI_AC.unmatchedItemSelectEvent.subscribe(this.fnUnmatchedEvent)};TGN.SearchWidget.GetTreeList=function(theDiv,guid,tid,personP){var el;var AddTreePicker={success:function(o){var resp=eval("("+o.responseText+")");if(resp!=null){var theSize=0;for(el in resp){theSize+=1}if(theSize>5){theSize=5}var sBox="<select style='width:225px' size='"+theSize+"' ";sBox+="onchange=\"TGN.SearchWidget.SetPrefTree('"+personP+"',this)\" >";for(el in resp){sBox+="<option value='"+resp[el];if(resp[el]==tid){sBox+="' selected >"}else{sBox+="'>"}sBox+=el+"</option>"}sBox=sBox+"</select>";if(sBox!="<select>"){var tCh=$(theDiv);if(tCh!=null){tCh.innerHTML=sBox}}}},failure:function(o){}};YAHOO.util.Connect.asyncRequest("GET","AjaxBaseHandler.ashx?a=MFN.Shared.Search&f=MFN.Shared.Search.WebControls.PersonAutoComplete|GetAllTrees&guid="+guid,AddTreePicker)};TGN.SearchWidget.SetPrefTree=function(b,a){TGN.SearchWidget.PersonACHandles[b].setTid(a.options[a.selectedIndex].value)};TGN.SearchWidget.PlaceAutoComplete=function(h,c,k,g,n,m,f,a,d,b){if(n==null||n=="undefined"||n==""){n=null}if(d==null||d=="undefined"||d==""){d=null}this.aCDS=new YAHOO.widget.DS_XHR("AjaxBaseHandler.ashx",["ResultSet.Result","PlaceText","Gpid","GpidH","HitC","Level","PHInfo"]);var e="a=MFN.Shared.Search&f=MFN.Shared.Search.WebControls.PlaceTypeAheadHandler|ProcessRequest&Use302Redirect=1&lcid="+g;if(n!=null){e+="&GetGH=1"}if(d!=null){e+="&GetPI=1"}if(m!="undefined"&&m){e+="&MGpid=1"}if(f!="undefined"&&f!=-1){e+="&dbid="+f}if(a!="undefined"&&a!=0){e+="&eventT="+a}this.aCDS.scriptQueryAppend=e;this.aCDS.responseType=YAHOO.widget.DS_XHR.TYPE_JSON;this.aCDS.connTimeout=4000;this.YUI_AC=new YAHOO.widget.AutoComplete(h,c,this.aCDS);this.YUI_AC.minQueryLength=3;this.YUI_AC.maxResultsDisplayed=15;this.YUI_AC.animVert=false;this.YUI_AC.queryDelay=0.2;this.YUI_AC.useShadow=true;this.YUI_AC.useIFrame=true;this.YUI_AC.autoHighlight=false;this.fnFormatter=function(o,p){var q="";if(typeof o[3]!="undefined"){if(o[3]!="0"){q=" <span class='hitC'>"+o[0]+"  ("+o[3]+")</span><span class='hitCAlt'>";if(o[0].length>18){q+=o[0].substring(0,18)+"..."}else{q+=o[0]}q+=" ("+o[3]+")</span>"}else{q="<span class='zeroH'>"+o[0]+" ("+o[3]+")</span><span class='zeroHAlt'>";if(o[0].length>18){q+=o[0].substring(0,18)+"..."}else{q+=o[0]}q+=" (0)";q+="</span>"}}else{q=o[0]}return q};this.YUI_AC.formatResult=this.fnFormatter;this.fnItemSelectEvent=function(r,o,v){TGN.SM.RegSubmitCancelled=true;var u=$(k);if(u!=null){u.value=o[2][1]}if(d!=null){var p=$(d+"_PInfo");if(o[2].length>5){var q=o[2][4];var s=o[2][5];p.value=q+"-"+s;TGN.SM.LocGpidSet(d,q,s,b)}}if(n!=null){var t=$(n);if(t!=null){t.value=o[2].length>2?o[2][2]:""}}};this.YUI_AC.itemSelectEvent.subscribe(this.fnItemSelectEvent);this.fnUnmatchedEvent=function(p,s){var r=$(k);if(r!==null){r.value=""}if(n!=null){var q=$(n);if(q!==null){q.value=""}}if(d!=null){var o=$(d+"_PInfo");o.value="";TGN.SM.LocGpidRefused(d,b)}};this.YUI_AC.unmatchedItemSelectEvent.subscribe(this.fnUnmatchedEvent)};if(typeof TGN.SM=="undefined"){TGN.SM={}}TGN.SM.Inst=function(d,a,e,f){var c=0;var b=0;this.initShowAdv=f;this.showAdv=f;TGN.SM.InstContainer[d]=this;this.moduleDiv=d;this.clientId=a;this.XCBArray=new Array();this.ToggleAdv=function(u){this.showAdv=!this.showAdv;if(u==null){u=""}var n;var r;var t=$(d);var h=$(this.clientId+"_xcb");if(h!=null&&h.checked){h.checked=!h.checked;this.AdvCBToggle(h)}var k=$(a+"_Name");var q=$(a+"_Name_gsfn");var o=$(a+"_Name_gsln");if(q!=null&&o!=null&&k!=null){if(this.showAdv){k=k.value;if(q.value==""&&o.value==""){if(k!=null){q.value=k.substring(0,k.lastIndexOf(" "));o.value=k.substring(k.lastIndexOf(" ")+1)}}}else{k.value=q.value;if(o.value!=""){k.value+=" "+o.value}}}if(t!=null){if(this.showAdv){t.className=t.className+" advanced"}else{t.className=t.className.replace(" advanced","")}n=t.getElementsByTagName("INPUT");if(this.showAdv){for(p=0,m=n.length;p<m;p++){if(n[p].className.indexOf("SM_regOpt")>-1){r=$(n[p].id+"-x");if(r!==null){var g=n[p].value.match(/\d{4}/);if(g!==null&&g!=""){r.value=g}}}}}else{for(p=0,m=n.length;p<m;p++){if(n[p].className.indexOf("SM_advOpt")>-1){var w=n[p].id.substring(0,n[p].id.length-2);r=$(w);if(r!=null&&r.value==""){r.value=n[p].value}}}}}var v=$(a+"_msAV");if(v!=null){if(this.showAdv){v.value="1"}else{v.value="0"}}if(YAHOO.env.ua.ie>5&&YAHOO.env.ua.ie<7){n=YAHOO.util.Dom.getElementsByClassName("mod open");for(var p=0,m=n.length;p<m;p++){var s=new TGN.SM.AdvElem(n[p]);setTimeout(s.go,1)}}};this.ExactCBToggle=function(h){var g=$(this.clientId+"_xcb");var k=$(a+"_msAV");if(h.checked==true){if(this.p_CheckCB(h,true)){g.checked=h.checked;k.value="2"}else{g.checked=false;k.value="1"}}else{g.checked=false;k.value="1"}};this.p_CheckCB=function(k,p){var h=$(this.clientId+"_xcb");var o=$(this.moduleDiv);if(o!=null){var n=o.getElementsByTagName("INPUT");for(var m=0,g=n.length;m<g;m++){if(n[m].type=="checkbox"){if(n[m]==k||n[m]==h){continue}if(n[m].checked!=p){return false}}}}return true};this.AdvCBToggle=function(h){if(h==null){h=$(this.clientId+"_xcb")}var n=$(this.moduleDiv);if(n!=null){var m=n.getElementsByTagName("INPUT");for(var k=0,g=m.length;k<g;k++){if(h.checked&&m[k].className.indexOf("SM_exactOnlyChoice")>-1){TGN.SM.SetExactOnly(m[k])}else{if(!h.checked&&m[k].className.indexOf("SM_nonExactChoice")>-1){TGN.SM.SetExactOnly(m[k])}else{if(m[k].type=="checkbox"&&(m[k].name.indexOf("_x")+2)==m[k].name.length){m[k].checked=h.checked}else{if(m[k].type=="hidden"&&(m[k].name.indexOf("_x")+2)==m[k].name.length){m[k].value=h.checked?"1":""}else{if(m[k].type=="hidden"&&(m[k].name=="MSAV")){m[k].value=h.checked?"2":"1"}}}}}}}};this.CheckBucket=function(h,n){var m=$(this.clientId+"-catBucketSubmit");var g="";var k=$(this.clientId+"-catBucket-r");if(typeof k!="undefined"&&k.checked){g+="r"}k=$(this.clientId+"-catBucket-s");if(typeof k!="undefined"&&k.checked){g+="s"}k=$(this.clientId+"-catBucket-t");if(typeof k!="undefined"&&k.checked){g+="t"}k=$(this.clientId+"-catBucket-p");if(typeof k!="undefined"&&k.checked){g+="p"}if(g==""){alert(TGN.I18N.getTrans("catBuckErr"));m.value=n;h.checked=true}else{m.value=g}}};TGN.SM.InstContainer=new Array();TGN.SM.InstMgr=function(c,a){var b=TGN.SM.InstContainer[c];if(b==null){b=new TGN.SM.Inst(c,a,"",true)}return b};TGN.SM.AdvElem=function(a){this.go=function(){a.className="mod";a.className="mod open"}};if(typeof TGN.SM.CONFIG=="undefined"){TGN.SM.CONFIG=new Array()}TGN.SM.GetConfig=function(a){return TGN.SM.CONFIG[a]};TGN.SM.SyncExactCB=function(a,c){var b=$(c);if(b!=null){if(a.checked){b.value="1"}else{b.value=""}}};TGN.SM.HideShow=function(c){var b=$(c);var a=b.className.indexOf(" open");if(a>0){b.className=b.className.substring(0,a)}else{b.className=b.className+" open"}};TGN.SM.TogSumCat=function(b){tEl=$(b);if(tEl!=null){var a=tEl.className.indexOf(" closed");if(a>0){tEl.className=tEl.className.substring(0,a)}else{tEl.className=tEl.className+" closed"}}};TGN.SM.showMoreLocation=function(c,a,h){var f=0;var m=0;for(var d=1;d<=c;d++){var k=$(a+d+"_Div");if(k!=null){if(f==0&&k.innerHTML==""){f=d;m=d;h-=(f-1)*2}else{if(k.innerHTML!=""){if(k.style.display=="none"){k.style.display="block";return}m=d}else{break}}}}if((m+1)>c){var g=$("resAddAnother");if(g!=null){g.style.display="none"}}if(f==0){return}k=$(a+f+"_Div");if(k!=null){k.innerHTML+="<style type='text/css'> #"+a+f+"_AutoComplete .yui-ac-content{ z-index:"+h+";} #"+a+f+"_AutoComplete .yui-ac-shadow { z-index:"+(h-1)+"; } #"+a+f+"_AutoComplete { z-index:"+h+" } </style> <input type='hidden' class='clear' id='"+a+f+"_Gpid' name='msrpn"+f+"' value='' /><div class='PlaceBox_CN'><div id='"+a+f+"_AutoComplete'><input type='text' id='"+a+f+"_ftp' name='msrpn"+f+"__ftp' value='' class='field' /><div id='"+a+f+"_ACContainer'></div> </div></div>";k.style.display="block";(function(){this.personWidget=new TGN.SearchWidget.PlaceAutoComplete(a+f+"_ftp",a+f+"_ACContainer",a+f+"_Gpid","1033","")})();if(YAHOO.env.ua.ie>5&&YAHOO.env.ua.ie<=8){var e=$(a+f+"_AutoComplete");if(e!=null){e.style.zIndex=h}var b=YAHOO.util.Dom.getElementsByClassName("yui-ac-content",null,a+f+"_AutoComplete");if(b!=null&&b.length>0){b[0].style.zIndex=h}YAHOO.util.Dom.getElementsByClassName("PlaceBox_CN","div",null,function(o){o.className=o.className+" clear"})}if(typeof TGN.KeyWatcher!="undefined"){var n=$(a+f+"_ftp");if(n!=null){TGN.KeyWatcher.addListener(n)}}}};TGN.SM.popGenderR=function(c,b,a){if(b=="m"){b="f"}else{if(b=="f"){b="m"}}TGN.SM.popGender(c,b,a)};TGN.SM.popGender=function(f,e,c){var a=$(f);if(e=="m"){e="f"}else{if(e=="f"){e="m"}}if(a!=null){for(var d=0,b=a.options.length;d<b;d++){if(a.options[d].value==e){a.selectedIndex=d;if(c[0]!=null){modD=$(c[0]);if(modD!=null){if(modD.innerHTML!="undefined"){modD.innerHTML=a.options[d].text}else{if(TGN.SM.GetText(modD)!=null){TGN.SM.SetText(modD,a.options[d].text)}}}}break}}}};TGN.SM.cFormEl=function(a,c){var b=document.createElement("input");b.setAttribute("type","hidden");b.setAttribute("name",a);b.setAttribute("value",c);return b};TGN.SM.PersonKeyPress=function(a){if(a.keyCode!=13&&a.keyCode!=9&&!(a.keyCode>=37&&a.keyCode<=40)&&!(a.keyCode>=16&&a.keyCode<=19)){TGN.SearchWidget.NameChanged+=1}};TGN.SM.CloseSSO=function(a){if(a||TGN.SM.CloseTimer!=null){var b=$("startsearchoverDD");if(b!=null&&b.className.indexOf("indivHide")==-1){b.className+=" indivHide"}YAHOO.util.Event.removeListener("ssoClose","blur")}};TGN.SM.CloseTimer=null;TGN.SM.CloseSSOM=function(){TGN.SM.CloseTimer=setTimeout(function(){TGN.SM.CloseSSO(false)},3000)};TGN.SM.SSOMOver=function(){if(TGN.SM.CloseTimer!=null){clearTimeout(TGN.SM.CloseTimer);TGN.SM.CloseTimer=null}};TGN.SM.InitSSOLink=function(){var d=$("startsearchoverDD");d.style.position="absolute";d.style.zIndex=50;function c(f){f.className+=" yuimenuitem-selected"}function a(f){f.className=f.className.replace(" yuimenuitem-selected","")}YAHOO.util.Dom.getElementsBy(function(){return true},"li",d,function(f){YAHOO.util.Event.addListener(f,"mouseover",function(){c(f)});YAHOO.util.Event.addListener(f,"mouseout",function(){a(f)})});function b(f){return(function(){if(f.className.indexOf("indivHide")>=0){f.className=f.className.replace(" indivHide","");YAHOO.util.Dom.setX(f,YAHOO.util.Dom.getX("ssoLink")-5);YAHOO.util.Dom.setY(f,YAHOO.util.Dom.getY("ssoLink")+10);var g=$("ssoClose");if(g!=null){g.focus()}YAHOO.util.Event.addListener("ssoClose","blur",function(){TGN.SM.CloseSSO(false)})}})}var e=b(d);YAHOO.util.Event.addListener("ssoLink","click",e)};TGN.SM.ClearedValues=null;TGN.SM.ClearAndSave=function(e){var b=0;if(TGN.SM.ClearedValues==null){TGN.SM.ClearedValues=new Array()}else{TGN.SM.Clear(e,"");return}var a="";var d=$(e);if(d!=null){var c=d.getElementsByTagName("INPUT");for(b=0,l=c.length;b<l;b++){if(c[b].className.indexOf("SMNoClear")>-1){continue}if(c[b].type=="checkbox"){if(c[b].id.indexOf("catBucket")<0){TGN.SM.ClearedValues[c[b].id]=c[b].checked;c[b].checked=false}}else{if(c[b].type=="text"&&c[b].className.indexOf("field")>=0){TGN.SM.ClearedValues[c[b].id]=c[b].value;c[b].value=a}else{if(c[b].type=="hidden"){if(c[b].className.indexOf("clear")>=0){TGN.SM.ClearedValues[c[b].id]=c[b].value;c[b].value=""}}}}}c=d.getElementsByTagName("SELECT");for(b=0,l=c.length;b<l;b++){if(c[b].name=="cp"||c[b].className.indexOf("SMNoClear")!=-1){continue}TGN.SM.ClearedValues[c[b].id]=c[b].selectedIndex;c[b].selectedIndex=0}}};TGN.SM.RestoreClear=function(f){var b=0;var a=0;var e=$(f);if(TGN.SM.ClearedValues==null){return}var d=TGN.SM.ClearedValues;if(e!=null){var c=e.getElementsByTagName("INPUT");for(b=0,a=c.length;b<a;b++){if(c[b].type=="checkbox"&&d[c[b].id]!="undefined"){if(typeof TGN.SM.ClearedValues[c[b].id]!="undefined"){c[b].checked=TGN.SM.ClearedValues[c[b].id]}}else{if(c[b].type=="text"&&d[c[b].id]!="undefined"&&c[b].className.indexOf("field")>=0){if(typeof TGN.SM.ClearedValues[c[b].id]!="undefined"){c[b].value=TGN.SM.ClearedValues[c[b].id]}}else{if(c[b].type=="hidden"&&d[c[b].id]!="undefined"){if(c[b].className.indexOf("clear")>=0){c[b].value=TGN.SM.ClearedValues[c[b].id]}}}}}c=e.getElementsByTagName("SELECT");for(b=0,a=c.length;b<a;b++){if(c[b].name=="cp"||d[c[b].id]!="undefined"){continue}c[b].selectedIndex=TGN.SM.ClearedValues[c[b].id]}}};TGN.SM.Clear=function(h,b,g,c){var d=0;var a=0;if(b==null){b=""}if(c==null){c=true}var f=$(h);if(f!=null){if(g==null||confirm(g)){var e=f.getElementsByTagName("INPUT");for(d=0,a=e.length;d<a;d++){if(e[d].className.indexOf("SMNoClear")>-1){continue}if(e[d].type=="checkbox"&&c){if(e[d].id.indexOf("catBucket")<0){e[d].checked=false}}else{if(e[d].type=="text"&&e[d].className.indexOf("field")>=0){e[d].value=b}else{if(e[d].type=="hidden"){if(e[d].className.indexOf("clear")>=0){e[d].value=""}if(e[d].name=="MSAV"&&e[d].value=="2"){e[d].value="1"}}else{if(e[d].type=="radio"){if(e[d].className.indexOf("SM_nonExactChoice")>=0){TGN.SM.SetExactOnly(e[d])}}}}}}e=f.getElementsByTagName("SELECT");for(d=0,a=e.length;d<a;d++){if(e[d].name=="cp"||e[d].className.indexOf("SMNoClear")!=-1){continue}e[d].selectedIndex=0}}}};TGN.SM.ToggleFloatDD=function(b){var a=document.getElementById(b);if(typeof a!="undefined"){if(a.style.display=="block"){a.style.display="none"}else{a.style.display="block"}}};TGN.SM.FloatDDMouseOutStops={};TGN.SM.MOutFloatDD=function(c,b){if(TGN.SM.FloatDDMouseOutStops[b.id]){return}if(c.type!="mouseout"&&c.type!="mouseover"){return}var a=c.relatedTarget?c.relatedTarget:c.type=="mouseout"?c.toElement:c.fromElement;while(a&&a!=b){a=a.parentNode}if(a==b){return}TGN.SM.CloseFloatDD(b)};TGN.SM.CloseFloatDD=function(a){a.style.display="none"};TGN.SM.ClearExactOnlyCheckBox=function(b){var a=$(b+"_xcb");var c=$(b+"_msAV");if("undefined"!=typeof a&&null!=a){a.checked=false;if(c.value=="2"){c.value="1"}}};TGN.SM.LocFilterSet=function(g,f,h,k,b){var c=document.getElementById(f+"_DDLabel");if(c!=null){var a="pw"+g.value;if(g.value==""){a="pwDefaultSettings";TGN.SM.ClearExactOnlyCheckBox(b)}c.innerHTML=TGN.I18N.getTrans(a)}if(typeof k!="undefined"){var d=document.getElementById(k);if(d!=null){if(g.value=="XO"){d.value="1"}else{d.value=""}}}var e=document.getElementById(f+"_Filter");TGN.SM.CloseFloatDD(e)};TGN.SM.NameFilters={};TGN.SM.NameFilterSet=function(o,n,m,s,k,e,b){var p=(k?"L_":"F_");if(n!=null){TGN.SM.NameFilters[p+"check_"+m+"_"+s]=n}if(o!=null){TGN.SM.NameFilters[p+"selectedRadio_"+m]=o;TGN.SM.NameFilters[p+"radio_"+m+"_"+s]=o}if(o!=null&&s=="defRadio"){for(var q in TGN.SM.NameFilters){if("undefined"!=typeof q&&null!=q&&q.substring(0,2)==p&&q.substring(2,7)=="check"){TGN.SM.NameFilters[q].checked=false}}TGN.SM.ClearExactOnlyCheckBox(e)}if(n!=null){if("undefined"==typeof TGN.SM.NameFilters[p+"selectedRadio_"+m]||TGN.SM.NameFilters[p+"selectedRadio_"+m].id==m+"_defRadio"){var d=$(m+"_XO");d.checked=true;TGN.SM.NameFilters[p+"selectedRadio_"+m]=d}}var f=document.getElementById(m+"_DDLabel");if(f!=null){if("undefined"!=typeof TGN.SM.NameFilters[p+"selectedRadio_"+m]&&TGN.SM.NameFilters[p+"selectedRadio_"+m].id==m+"_XO"){var c=TGN.I18N.getTrans("nwXO");for(q in TGN.SM.NameFilters){if("undefined"!=typeof q&&null!=q&&q.substring(0,2)==p&&q.substring(2,7)=="check"&&TGN.SM.NameFilters[q].checked==true){var r=q.lastIndexOf("_");var a=q.substring(r+1);c+=", "+TGN.I18N.getTrans("nw"+a)}}f.innerHTML=c}else{f.innerHTML=TGN.I18N.getTrans("nwDefaultSettings")}}var h="";if("undefined"!=typeof TGN.SM.NameFilters[p+"selectedRadio_"+m]&&TGN.SM.NameFilters[p+"selectedRadio_"+m].id==m+"_XO"){h="XO";for(q in TGN.SM.NameFilters){if("undefined"!=typeof q&&null!=q&&q.substring(0,2)==p&&q.substring(2,7)=="check"&&TGN.SM.NameFilters[q].checked==true){r=q.lastIndexOf("_");a=q.substring(r+1);if(h=="XO"){h=""}if(h.length>0){h+="_"}h+=a}}}var g=$(m+"_hidden");g.value=h};TGN.SM.SetExactOnly=function(widget){widget.checked=true;try{if(typeof widget.onclick=="function"){widget.onclick.call(widget)}else{eval(widget.onclick)}}catch(e){}};TGN.SM.LocGpidRefused=function(b,a){TGN.SM.LocGpidSet(b,0,null,a)};TGN.SM.LocGpidSet=function(h,e,f,a){var d=null;var c=false;if(typeof a!="undefined"){var b=document.getElementById(a);if(b!=null){if(b.checked){c=true}}}var g;if(c){d=$(h+"_XO_input");if(d!=null){d.checked=true;g=document.getElementById(h+"_DDLabel");if(g!=null){g.innerHTML=TGN.I18N.getTrans("pwXO")}}}else{d=$(h+"_defRadio");if(d!=null){d.checked=true;g=document.getElementById(h+"_DDLabel");if(g!=null){g.innerHTML=TGN.I18N.getTrans("pwDefaultSettings")}}}if(e>7&&f.indexOf("|5027|")==-1&&f.indexOf("|3243|")==-1){TGN.SM.WidgetOn(h+"_PCO")}else{TGN.SM.WidgetOff(h+"_PCO")}if(e>=7&&f.indexOf("|5027|")==-1&&f.indexOf("|3243|")==-1){d=$(h+"_PACO");if(d!=null){d.style.display=""}}else{d=$(h+"_PACO");if(d!=null){d.style.display="none"}}if(e>=5&&f.indexOf("|3257|")==-1&&f.indexOf("|3250|")==-1){d=$(h+"_PAS");if(d!=null){d.style.display=""}}else{d=$(h+"_PAS");if(d!=null){d.style.display="none"}}if(e>5&&f.indexOf("|3257|")==-1&&f.indexOf("|3250|")==-1){d=$(h+"_PS");if(d!=null){d.style.display=""}}else{d=$(h+"_PS");if(d!=null){d.style.display="none"}}d=$(h+"_PC");if(e>3){if(d!=null){d.style.display=""}d=$(h+"_RestrictThis");if(d!=null){d.style.display=""}}else{if(d!=null){d.style.display="none"}d=$(h+"_RestrictThis");if(d!=null){d.style.display="none"}}};TGN.SM.WidgetOn=function(a){radioW=$(a);if(radioW!=null){radioW.style.display=""}};TGN.SM.WidgetOff=function(a){radioW=$(a);if(radioW!=null){radioW.style.display="none"}};TGN.SM.ShowHelp=function(c,b){if(screen){leftPos=screen.width-425}var a=window.open("http://"+c+"/Search/Help/SearchForm.aspx?topic="+b,"stHelp","toolbar=0,location=0,status=0,menubar=0,scrollbars=yes,resizable=1,top=5,left=10,width=600,height=625");if(a){a.focus()}};TGN.SM.TrackTemplate=function(a,e){var d=s_gi(s_account);var c="Simple";if(e){c="Advanced"}var f="unknown";if(typeof TGN!="undefined"&&typeof TGN.Ancestry!="undefined"&&typeof TGN.Ancestry.Search!="undefined"&&typeof TGN.Ancestry.Search.SearchInfo!="undefined"){if(typeof TGN.Ancestry.Search.SearchInfo.pageType!="undefined"){f=TGN.Ancestry.Search.SearchInfo.pageType}}var b="Search:RForm:"+f+":"+c;if(a){b="Search:RForm:"+f+":"+c}s_pageName=b;void (d.t())};TGN.SM.ToggleSearchCat=function(a,b){TGN.SM.HideNewSearch();TGN.SM.ShowNewSearch(a,b,false,true)};TGN.SM.TogSboCB=function(c,e){var b=$("hiddenSbo"+e);b.value=c.checked?"0":"1";var a=$(e+"_TogColPCB");var d=$(e+"_ColPExact");if(a!=null&&d!=null){a.checked=c.checked;if(c.checked){d.value="1"}else{d.value="0"}}};TGN.SM.TogColPriority=function(c,e){var b=$(e+"_ColPExact");var a=document.getElementById("hiddenSbo"+e);var d=document.getElementById("sboCB"+e);if(c.checked){b.value="1";if(a!=null&&d!=null){a.value="0";d.checked=true}}else{b.value="0";if(a!=null&&d!=null){a.value="1";d.checked=false}}};TGN.SM.ColPriorityChanged=function(e,h){var a=$(h+"_TogColDiv");var g=$(h+"_TogColPCB");var d=e.selectedIndex;var b=e.options[d].value;switch(b){case"100":case"101":case"102":var c="HideDiv";if(a.className.indexOf(c)==-1){a.className=a.className+" "+c}break;default:var f=a.className.split(" ");if(f.length>1&&f[1]=="HideDiv"){a.className=f.splice(0,f.length-1).join(" ")}break}};TGN.SM.SubmitFormReturnVoid=function(e,d,a,b,c){TGN.SM.SubmitForm(e,d,a,b,c)};TGN.SM.SubmitFormReturnFalse=function(e,d,a,b,c){TGN.SM.SubmitForm(e,d,a,b,c);return false};TGN.SM.SubmitForm=function(g,f,c,d,e){if(typeof e=="undefined"){var a=$(f);a.focus()}setTimeout("TGN.SM.SubmitFormNow('"+g+"','"+f+"','"+c+"','"+d+"')",1)};TGN.SM.FamilyMemberFieldCheck=function(c){var a=0;var d=5;if(c.substr(a,d)==="mssng"||c.substr(a,d)==="mssns"||c.substr(a,d)==="mscng"||c.substr(a,d)==="mscns"||c.substr(a,d)==="msbng"||c.substr(a,d)==="msbns"){return true}return false};TGN.SM.SubmitFormNow=function(s,n,r,h){var w=0;var u=0;var z=$(n);z.className=z.className+" disabled";var d=$("top_"+n);if(d!=null){d.className=d.className+" disabled"}$(r).innerHTML=TGN.I18N.getTrans("Searching");var B=$("top_"+r);if(B!=null){B.innerHTML=TGN.I18N.getTrans("Searching")}var e=$(s);var g=$(h);var p=false;var x="SM_advOpt";if(g!=null&&(g.value=="1"||g.value=="2")){x="SM_regOpt";p=true}var v=document.createElement("form");v.setAttribute("method","GET");v.setAttribute("action",e.action);alltags=e.getElementsByTagName("INPUT");var A;var f=new Array();var m=new Array();var t=new Array();var y=new Array();var q=0;var c=0;var k=0;var a=0;for(w=0,u=alltags.length;w<u;w++){var o=alltags[w];if(o.className.indexOf(x)>-1||o.name==null||o.value==null||o.name==""||o.value==""||o.style.display=="none"){continue}if(o.type=="checkbox"||o.type=="radio"){if(o.checked){A=TGN.SM.cFormEl(o.name,o.value);A.checked=o.checked;if(TGN.SM.FamilyMemberFieldCheck(o.name)){f[q]=A;q++}else{v.appendChild(A)}}}else{if(o.type=="hidden"){if(!p&&(o.name.indexOf("_x")+2)==o.name.length){if(o.className.indexOf("SM_DND")<=-1){continue}}A=TGN.SM.cFormEl(o.name,o.value);v.appendChild(A)}else{if(!p&&(o.name=="gsfn"||o.name=="gsln")&&TGN.SearchWidget.NameChanged>0){continue}A=TGN.SM.cFormEl(o.name,o.value);if(TGN.SM.FamilyMemberFieldCheck(o.name)){f[q]=A;q++}else{v.appendChild(A)}}}}alltags=e.getElementsByTagName("select");for(w=0,u=alltags.length;w<u;w++){o=alltags[w];if(o.className.indexOf(x)>-1){continue}else{if(o.value!=""){A=TGN.SM.cFormEl(o.name,o.value);v.appendChild(A)}}}for(fmi=0;fmi<f.length;fmi++){A=f[fmi];if(A.name.substr(0,5)==="mssng"||A.name.substr(0,5)==="mssns"){m[c]=A;c++}if(A.name.substr(0,5)==="mscng"||A.name.substr(0,5)==="mscns"){t[k]=A;k++}if(A.name.substr(0,5)==="msbng"||A.name.substr(0,5)==="msbns"){y[a]=A;a++}}for(w=0;w<m.length;w++){A=m[w];v.appendChild(A)}for(w=0;w<t.length;w++){A=t[w];v.appendChild(A)}for(w=0;w<y.length;w++){A=y[w];v.appendChild(A)}document.body.appendChild(v);v.submit();return false};TGN.SM.RegSubmitCancelled=false;TGN.SM.RegSubmit=function(d,a){var e=document.getElementById(d);if(e!=null){var c=function(f){if(typeof f!="undefined"){if(f.keyCode==13&&!TGN.SM.RegSubmitCancelled){a()}TGN.SM.RegSubmitCancelled=false}};for(var b=0;b<e.length;b++){if(e[b].type=="text"){YAHOO.util.Event.addListener(e[b],"keydown",c)}}}};TGN.SM.ShowWaitMessage=function(a){if(typeof TGN.SM.WaitPanel=="undefined"||TGN.SM.WaitPanel==null){var b=document.createElement("div");b.setAttribute("id","waitPanel");document.body.appendChild(b);TGN.SM.WaitPanel=new YAHOO.widget.Panel("waitPanel",{close:false,draggable:false,modal:true,visible:true,width:200,underlay:"none",zIndex:101});TGN.SM.WaitPanel.setBody(a);TGN.SM.WaitPanel.render(document.body)}TGN.SM.PositionAndShow(TGN.SM.WaitPanel)};TGN.SM.TreeLoadingFader=null;TGN.SM.ShowTreeLoading=function(d,a){if(typeof TGN.SM.TreeWaitPanel=="undefined"||TGN.SM.TreeWaitPanel==null){var b=$(d);if(b!=null){TGN.SM.TreeLoadingFader=new YAHOO.util.Anim(d,{opacity:{to:0.1}},3,YAHOO.util.Easing.easeOut);TGN.SM.TreeLoadingFader.onComplete.subscribe(function(){b.style.opacity=1;if(b.style.filter!=null){b.style.filter=""}});TGN.SM.TreeLoadingFader.animate();var c=document.createElement("div");c.setAttribute("id","treeWaitPanel");b.appendChild(c);YAHOO.util.Dom.setXY(c,YAHOO.util.Dom.getXY(b));TGN.SearchWidget.TreeLoadingPanel=new YAHOO.widget.Panel("treeWaitPanel",{constrainttoviewport:true,close:false,underlay:"none",visible:true,draggable:false});TGN.SearchWidget.TreeLoadingPanel.setBody("<img src='"+a+"/css/search/i/Loading32.gif' /><span class='loadingMsg'>"+TGN.I18N.getTrans("loadingMsg")+"</span>");TGN.SearchWidget.TreeLoadingPanel.render()}}};TGN.SM.HideWaitMessage=function(){if(typeof TGN.SM.WaitPanel!="undefined"&&TGN.SM.WaitPanel!=null){TGN.SM.WaitPanel.hide()}};TGN.SM.ShowMore=function(d,b){var c=$(d);var a=$(b);if(c!=null){c.style.display="block"}if(a!=null){a.style.display="none"}};TGN.SM.ShowSearchPanel=function(){TGN.SM.PositionAndShow(TGN.SM.NewSearchPanel);TGN.SM.HideWaitMessage();TGN.SM.FocusFirstInput("newT_search-form")};TGN.SM.PositionAndShow=function(b){var a=$D.getDocumentScrollLeft()+(($D.getViewportWidth()-b.element.offsetWidth)/2);if(a<10){a=10}var c=$D.getDocumentScrollTop()+50;b.cfg.setProperty("zIndex",201);b.cfg.setProperty("x",a);b.cfg.setProperty("y",c);b.show()};TGN.SM.SetACZ=function(e,d){if(YAHOO.env.ua.ie>5&&YAHOO.env.ua.ie<=7){var a=YAHOO.util.Dom.getElementsByClassName("yui-ac","div",e);if(document.styleSheets&&document.styleSheets.length>0){var c=document.styleSheets[0];if(typeof(c.addRule)=="object"){for(var b=0;b<a.length;b++){if(a[b].id!=null&&a[b].id!=""){c.addRule("#"+a[b].id,"z-index:"+d);c.addRule("#"+a[b].id+" .yui-ac-content","z-index:"+d--);c.addRule("#"+a[b].id+" .yui-ac-shadow","z-index:"+d--)}}}}}};TGN.SM.HandleSuccess=function(c){if(typeof TGN.SM.NewSearchPanel=="undefined"||TGN.SM.NewSearchPanel==null){if(c.responseText!="undefined"){var d=document.createElement("div");d.setAttribute("id","newSearch");if(YAHOO.env.ua.ie>5&&YAHOO.env.ua.ie<=7){document.body.appendChild(d);d.innerHTML+=c.responseText}else{d.innerHTML+=c.responseText;document.body.appendChild(d)}TGN.SM.NewSearchPanel=new YAHOO.widget.Panel("newT_search-form",{close:true,draggable:true,modal:true,visible:true,width:450,underlay:"none",effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.1}});TGN.SM.NewSearchPanel.cfg.getProperty("strings").close=" ";if(typeof TGN.KeyWatcher!="undefined"){TGN.KeyWatcher.disable();TGN.KeyWatcher.lockState()}TGN.SM.NewSearchPanel.hideEvent.subscribe(function(){if(typeof TGN.KeyWatcher!="undefined"){TGN.KeyWatcher.unlockState();TGN.KeyWatcher.enable()}});TGN.SM.NewSearchPanel.showEvent.subscribe(function(){if(typeof TGN.KeyWatcher!="undefined"){TGN.KeyWatcher.disable();TGN.KeyWatcher.lockState()}});TGN.SM.NewSearchPanel.element.className+=" modal";var b=$("newT_search-form");b.className=b.className.replace(" yui-panel","");TGN.SM.NewSearchPanel.render(document.body);$("newT_mod-search").innerHTML+="<span class='lnk-cancel'>&nbsp;"+TGN.I18N.getTrans("or")+"&nbsp;<a href='javascript:TGN.SM.HideNewSearch();'>"+TGN.I18N.getTrans("newSearchCancel")+"</a></span>";if(c.argument[0]=="clear"){TGN.SM.Clear("newT_search-form")}TGN.SM.ShowSearchPanel();if(YAHOO.env.ua.ie<=7){var a=function(f,e){return function(){TGN.SM.SetACZ(f,e)}};setTimeout(a(TGN.SM.NewSearchPanel.element,150),1)}}}else{TGN.SM.ShowSearchPanel()}};TGN.SM.HandleFailure=function(a){document.location.href="/"};TGN.SM.ShowNewSearch=function(c,d,f,b){if(typeof d=="undefined"){d=true}if(typeof f=="undefined"){f=false}if(c==null){c=""}if(typeof TGN.SM.NewSAdvT=="undefined"){TGN.SM.NewSAdvT=0}var e=TGN.SM.NewSAdvT;if(d){TGN.SM.NewSAdvT=1}else{TGN.SM.NewSAdvT=2}if(f&&typeof TGN.SM.NewSearchPanel!="undefined"){e=TGN.SM.NewSAdvT+1}if(e!=0&&e!=TGN.SM.NewSAdvT){TGN.SM.NewSearchPanel.destroy();if(TGN.SM.WaitPanel!=null){TGN.SM.WaitPanel.destroy()}TGN.SM.NewSearchPanel=null;TGN.SM.WaitPanel=null}if(typeof TGN.SM.NewSearchPanel=="undefined"||TGN.SM.NewSAdvT!=e||f){if(YAHOO.env.ua.ie>5&&YAHOO.env.ua.ie<=7){TGN.SM.ShowWaitMessage(TGN.I18N.getTrans("Loading"))}var a="clear";if(typeof b!="undefined"&&b){a="keep"}setTimeout("YAHOO.util.Connect.asyncRequest('GET', '/Mercury/Pages/AJAX/DefaultSearchTemplate.aspx"+c.replace(/'/g,"&#39;")+"', {success: TGN.SM.HandleSuccess, argument:['"+a+"'], failure: TGN.SM.HandleFailure})",1)}else{TGN.SM.ShowSearchPanel()}};TGN.SM.HideNewSearch=function(){if(typeof TGN.SM.NewSearchPanel!="undefined"){TGN.SM.NewSearchPanel.hide()}TGN.SM.HideWaitMessage()};TGN.SM.HideRefineSearch=function(){if(typeof TGN.SM.RefineSearchPanel!="undefined"){TGN.SM.RefineSearchPanel.hide()}TGN.SM.HideWaitMessage()};TGN.SM.InitRefineSearch=function(){TGN.SM.RefineSearchPanel=new YAHOO.widget.Panel("refineT_search-form",{close:true,draggable:true,modal:true,visible:false,width:450,underlay:"none"});TGN.SM.RefineSearchPanel.cfg.getProperty("strings").close=" ";TGN.SM.RefineSearchPanel.hideEvent.subscribe(function(){if(typeof TGN.KeyWatcher!="undefined"){TGN.KeyWatcher.unlockState();TGN.KeyWatcher.enable()}});TGN.SM.RefineSearchPanel.showEvent.subscribe(function(){if(typeof TGN.KeyWatcher!="undefined"){TGN.KeyWatcher.disable();TGN.KeyWatcher.lockState()}});TGN.SM.RefineSearchPanel.element.className+=" modal";var a=$("refineT_search-form");a.className=a.className.replace(" yui-panel","");TGN.SM.RefineSearchPanel.render(document.body);$("refineT_mod-search").innerHTML+="<span class='lnk-cancel'>&nbsp;"+TGN.I18N.getTrans("or")+"&nbsp;<a href='javascript:TGN.SM.HideRefineSearch();'>"+TGN.I18N.getTrans("newSearchCancel")+"</a></span>"};TGN.SM.LoadModTemplate=function(d){var e=$("ModTemplateStore");if(e!=null){if(d.responseText!="undefined"){if(YAHOO.env.ua.ie>5&&YAHOO.env.ua.ie<=7){e.innerHTML+=d.responseText}else{var c=document.createElement("div");c.innerHTML+=d.responseText;e.appendChild(c)}if(typeof TGN.KeyWatcher!="undefined"){TGN.KeyWatcher.addListeners()}if(d.argument[0]=="refine"){TGN.SM.InitRefineSearch();TGN.SM.PositionAndShow(TGN.SM.RefineSearchPanel,d.argument[1]+"_search-form");TGN.SM.ShowMore("more_"+d.argument[1],"moreLink_"+d.argument[1])}else{var a=0}if(d.argument[2]==true){TGN.SM.ClearAndSave(d.argument[1]+"_search-form")}if(YAHOO.env.ua.ie==7){var b=function(g,f){return function(){TGN.SM.SetACZ(g,f)}};setTimeout(b(TGN.SM.RefineSearchPanel.element,150),1)}}}};TGN.SM.ShowRefineLock=true;TGN.SM.ShowRefineSearchT=function(a){if(a){TGN.SM.ShowRefineSearchImpl("true")}else{TGN.SM.ShowRefineSearchImpl("false")}};TGN.SM.ShowRefineSearch=function(a,b){var c="false";if(typeof b!="undefined"&&b[1].keyCode==78){c="true"}TGN.SM.ShowRefineSearchImpl(c)};TGN.SM.ShowRefineSearchImpl=function(d,f){if(!TGN.SM.ShowRefineLock){return}else{TGN.SM.ShowRefineLock=false}if(typeof TGN.KeyWatcher!="undefined"){TGN.KeyWatcher.disable()}var b=$("refineT_msAV");var c=false;if(b!=null&&(b.value=="1"||b.value=="2")){c=true}setTimeout(function(){TGN.SM.TrackTemplate(d,c)},10);var a=document.location.search;var e=$("ModTemplateStore");if(e!=null){if(typeof TGN.SM.RefineSearchPanel!="undefined"){TGN.SM.PositionAndShow(TGN.SM.RefineSearchPanel);if(typeof f=="undefined"||f=="true"){TGN.SM.ShowMore("more_refineT","moreLink_refineT")}if(d=="true"){TGN.SM.ClearAndSave("refineT_search-form")}else{TGN.SM.RestoreClear("refineT_search-form")}}else{setTimeout("YAHOO.util.Connect.asyncRequest('GET', '/Mercury/Pages/AJAX/DefaultSearchTemplate.aspx"+a.replace(/'/g,"&#39;")+"&tDomId=refineT', {success: TGN.SM.LoadModTemplate, argument:['refine','refineT',"+d+"], failure: TGN.SM.HandleFailure})",1)}}if(typeof TGN.KeyWatcher!="undefined"){TGN.KeyWatcher.enable()}TGN.SM.ShowRefineLock=true};TGN.SM.getStyle=function(a,b){return null};if(document.body.currentStyle){TGN.SM.getStyle=function(a,b){return a.currentStyle[b]}}else{if(window.getComputedStyle){TGN.SM.getStyle=function(a,b){return document.defaultView.getComputedStyle(a,null).getPropertyValue(b)}}}TGN.SM.FocusFirstInput=function(b){try{var f=$(b).getElementsByTagName("input");var d=null;for(var c=0,a=f.length;c<a;c++){d=f[c].type;if(!f[c].disabled&&!f[c].readOnly&&("text"==d||"password"==d)){if(TGN.SM.isDisplayed(f[c])){var g=$(f[c].id);if(g.value!=null&&g.value==""){setTimeout(function(){if(g.value==""){try{g.focus()}catch(k){}}},1)}break}}}}catch(h){}};TGN.SM.isDisplayed=function(a){var b=a.form;while(a!=b){if(TGN.SM.getStyle(a,"display")=="none"||TGN.SM.getStyle(a,"visibility")=="hidden"){return false}else{a=a.parentNode}}return true};TGN.SM.NameHintShown=false;TGN.SM.NameHintListener=function(f,b,d){if(TGN.SM.NameHintShown){return}if(b.value!=null&&b.value.length>=4){TGN.SM.NameHintShown=true;var a=$(d+"_gSrchTipsName");var c=$(d+"_gSearchTips");if(typeof c!="undefined"&&typeof a!="undefined"){a.style.display="inline";c.style.display="inline"}YAHOO.util.Event.removeListener(b,"keyup",this)}};TGN.SM.NameHintCleared=false;TGN.SM.DateHintListener=function(g,c,f){TGN.SM.NameHintShown=true;var d=null;if(!TGN.SM.NameHintCleared){TGN.SM.NameHintCleared=true;var b=$(f+"_gSrchTipsName");d=$(f+"_gSearchTips");b.style.display="none";d.style.display="none"}if(c.value!=null&&c.value.length>=4){var a=c.value.match(/\d{4}/);if(a!==null&&a!=""){d=$(f+"_gSearchTips");var h=$(f+"_gSrchTipsDate");if(typeof d!="undefined"&&typeof h!="undefined"){if(a>1930){h.style.display="inline";d.style.display="inline"}else{if(a<=1930){h.style.display="none";d.style.display="none"}}}}}};TGN.SM.GetHitReason=function(a){switch(a){case"exact":return" matched exactly.";break;case"wildcard":return" matched a specified wildcard.";break;case"normalized":return" matched because of a normalized name match or a place authority lookup match.";break;case"initial":return" matched because the first letter of a specified name matches this initial.";break;case"soundex":return" matched based on Soundex which matches mispelled names or names that sound similar when pronounced (e.g. Smith, Smyth, and Smythe all sound alike).";break;case"proximity":return" matched because it was close to a date or location specified.";break;case"range":return" matched because it was within a range of dates, numbers, or text strings.";break;case"county":return" matched because the location specified does not correspond exactly but is contained within the same county.";break;case"state":return" matched because the location specified does not correspond exactly but is contained within the same state.";break;case"country":return" matched because the location specified does not correspond exactly but is contained within the same country.";break;default:break}return""};TGN.SM.GetHitShortReason=function(a){switch(a){case"exact":return" matched exactly.";break;case"wildcard":return" matched a wildcard.";break;case"normalized":return" matched a normalized name or place.";break;case"initial":return" matched first letter of a name.";break;case"soundex":return" matched based on Soundex.";break;case"proximity":return" matched by proximity.";break;case"range":return" matched range of dates, numbers, or text strings.";break;case"county":return" matched because location is contained within the same county.";break;case"state":return" matched because location but is contained within the same state.";break;case"country":return" matched because location is contained within the same country.";break;default:break}return""};TGN.SM.HideRecordHits=function(){if(null!=TGN.SM.HitDetailPanel){TGN.SM.HitDetailPanel.hide();TGN.SM.HitDetailPanel.destroy();TGN.SM.HitDetailPanel=null}};TGN.SM.IndivRecCallback={success:function(g){var f=g.responseXML;var d,e;if(f!=undefined){var a=f.selectNodes("/response/record/field");for(var c=0,b=a.length;c<b;c++){d=TGN.SM.GetText(a[c].childNodes[0]);if(d!="DBTitle"&&d!="ImageID"){e=TGN.SM.GetText(a[c].childNodes[1])}}}},failure:function(a){},argument:[]};TGN.SM.ShowRecordHits=function(){var d=document.createElement("div");d.setAttribute("id","HitDetail");document.body.appendChild(d);var o=450;var s='<table  border="0" cellpadding="0" cellspacing="0" class="srchTerms">';var f=document.getElementById("searchDescCategory");if(null!=f){s+="<tr><td>Category:</td><td>"+TGN.SM.GetText(f)+"</td></tr>"}var c=["Name","Birth","Death","FamilyMembers","Migration","MilitaryService","Marriage","Other"];for(j in c){f=document.getElementById("refine_"+c[j]+"_mod");if(undefined!=f){var p=f.getElementsByTagName("strong");var q=f.getElementsByTagName("span");if(q.length>0){var m=TGN.SM.GetText(q[0]);if(m!=null&&m.length>0){s+="<tr><td>"+TGN.SM.GetText(p[0])+"</td><td>"+m+"</td></tr>"}}}}s+="</table>";var n=$D.getAncestorByClassName(this,"record");if(null!=n){var r=$D.getElementsByClassName("srchFoundDB","span",n);if(r.length>0){var b=r[0].parentNode.innerHTML;var e=b.indexOf("showIndiv2(");if(e!=-1){e+=11;var k=b.indexOf(")",e);if(k!=-1){var h=b.slice(e,k).replace(/'/g,"").split(",");var a="/Mercury/Pages/Ajax/IndivRec.aspx?IndivAjax=1&recid="+h[2]+"&db="+h[1]+"&output=xml&Use302Redirect=t";if(h[4]){a+="&noSub=1"}if(h[9]){a+="&NonHover=1"}if(h[5]!=null&&h[6]!=null){a+="&iid="+h[5]+"&rc="+h[6]}if(h[7]!=null){a+="&"+h[7]}var g=YAHOO.util.Connect.asyncRequest("GET",a,TGN.SM.IndivRecCallback,null)}}}s+='<div id="results"><div id="results-main"><table  border="0" cellpadding="0" cellspacing="0" class="s_gsResults">'+n.innerHTML+'</table></div></div><div id="hitIndiv"></div><br />';o=n.offsetWidth+52}s+=TGN.SM.HitReason(this);s+='<br /><a class="closeBtn btn btn-cta" href="javascript:TGN.SM.HideRecordHits()"><span>Close</span></a>';TGN.SM.HitDetailPanel=new YAHOO.widget.Panel("HitDetail",{close:true,draggable:true,modal:true,visible:true,width:o,underlay:"none",effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.5}});TGN.SM.HitDetailPanel.setHeader("<h3>Why Am I Seeing This Record?</h3>");TGN.SM.HitDetailPanel.setBody(s);TGN.SM.HitDetailPanel.render(document.body);TGN.SM.PositionAndShow(TGN.SM.HitDetailPanel)};TGN.SM.HitReason=function(e){var c="";var f=e.getElementsByTagName("hlt");if(f.length!=0){c="This record is dispayed as a match for your search because the following items matched exactly or were considered similar to the terms you specified:<ul>";for(var d=0,a=f.length;d<a;d++){var b=f[d].attributes;c+='<li>"<strong>'+b.match.nodeValue+'</strong>" was found '+b.count.nodeValue+" times in this record and "+TGN.SM.GetHitReason(b.type.nodeValue)+" Total score: "+b.score.nodeValue+"</li>"}c+="</ul>The overall score calculated for this record was "+e.getAttribute("score")}return c};TGN.SM.HitReasonTip=function(h){var s="";var v=h.getElementsByTagName("hlt");if(v!=null&&v.length>0){var e=[];for(var g=0,f=v.length;g<f;g++){var o=99;switch(v[g].getAttribute("type")){case"exact":o=1;break;case"wildcard":o=2;break;case"normalized":o=3;break;case"initial":o=4;break;case"soundex":o=5;break;case"proximity":o=6;break;case"range":o=7;break;case"county":o=8;break;case"state":o=9;break;case"country":o=10;break;default:o=99;break}v[g].setAttribute("itype",o);e.push(v[g])}e.sort(function(n,m){var c=n.getAttribute("itype");var r=m.getAttribute("itype");if(c==r){return m.getAttribute("score")-n.getAttribute("score")}return c-r});var k="";s+="<ul>";for(var a in e){var q=e[a].attributes;var u=q.type.nodeValue;var d='"<strong>'+q.match.nodeValue+'</strong>"';var p=q.count.nodeValue!=null?1*q.count.nodeValue:0;if(p>1){d+=" ("+p+" occurrences)"}if(k==u){var b=a*1;if(b==e.length-1||u!=e[b+1].getAttribute("type")){s+=" and "+d}else{s+=", "+d}}else{if(a==0){s+="<li>"+d}else{s+=TGN.SM.GetHitShortReason(k)+"</li><li>"+d}k=u}}s+=TGN.SM.GetHitShortReason(k)+"</li></ul><br />Click for detailed reasons."}return s};TGN.SM.HitHighlightInit=function(){var e=YAHOO.util.Dom.getElementsByClassName("record","tr",$("results-main"));var g=0,q=0;var k=new Array();var d=new Array();for(var b in e){var o=e[b].getElementsByTagName("span");for(var t=0,f=o.length;t<f;t++){if(o[t].className.indexOf("stars")>-1){var n=o[t];n.id="star"+q++;n.onclick=TGN.SM.ShowRecordHits;var m=TGN.SM.HitReasonTip(n);if(m.length>0){n.title=m;d.push(n.id)}}if(o[t].className.indexOf("srchMatch")>-1){o[t].id="srchMatch"+g++;var a=TGN.SM.GetText(o[t]);var p=o[t].getAttribute("type");if(p!=null){o[t].title="<strong>"+a+"</strong>"+TGN.SM.GetHitShortReason(p)}k.push(o[t].id)}}}if(k.length!=0){var h=new YAHOO.widget.Tooltip("matchFieldTips",{appendtodocumentbody:true,context:k,width:"300px",autodismissdelay:10000,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.2}});h.element.className+=" alert"}if(d.length!=0){var c=new YAHOO.widget.Tooltip("whyMatchTip",{appendtodocumentbody:true,context:d,width:"300px",autodismissdelay:15000,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.2}});c.element.className+=" alert";c.setHeader("<h5>Why Am I Seeing This Record?</h5>")}};TGN.SM.GetText=function(a){if(a.innerText!=undefined){return a.innerText}if(a.textContent!=undefined){return a.textContent}if(a.innerHtml!=undefined){return a.innerHtml}return null};TGN.SM.SetText=function(b,a){if(b.innerText!=undefined){b.innerText=a}if(b.textContent!=undefined){b.textContent=a}};TGN.Search.BrowseDate.Calendar=function(c,b){var a="";a+='<div id="browse_body"><table width="408" id="calendar"><tr align="center" valign="top">';a+='<td height="30" colspan="7"><nobr><select class="calendar" id="Month" name="Month" onchange="TGN.Search.BrowseDate.changeMonth();">';var e=0;for(im=0;im<availMonths[b].length;im++){if(availMonths[b][im]==c){a+='<option value="'+availMonths[b][im]+'" SELECTED>'+monthNames[availMonths[b][im]-1]+"</option>";e=im}else{a+='<option value="'+availMonths[b][im]+'">'+monthNames[availMonths[b][im]-1]+"</option>"}}a+='</select>&nbsp;&nbsp;<select class="calendar" ID="Year" NAME="Year" onChange="TGN.Search.BrowseDate.changeYear();">';for(iy=0;iy<years.length;iy++){if(years[iy]==b){a+='<option value="'+years[iy]+'" SELECTED>'+years[iy]+"</option>"}else{a+='<option value="'+years[iy]+'">'+years[iy]+"</option>"}}a+="</select></nobr></td></tr>";firstDay=new Date(b,c-1,1);startDay=firstDay.getDay();if(((b%4==0)&&(b%100!=0))||(b%400==0)){browseDateDays[1]=29}else{browseDateDays[1]=28}a+='<tr id="days">';for(i=0;i<7;i++){a+="<td>"+dow[i]+"</td>"}a+='</tr><tr class="week">';var d=0;for(i=0;i<startDay;i++,d++){a+='<td class="blank">&nbsp;</td>'}for(i=1;i<=browseDateDays[c-1];i++,d++){if(availDays[b][e]&(1<<(i-1))){a+="<td><a href=\"javascript:TGN.Search.BrowseDate.submitDay('"+dbid+"',"+i+","+c+","+b+')">'+i+"</a></td>"}else{a+='<td class="blank">'+i+"</td>"}if(d==6&&i!=browseDateDays[c-1]){a+='</tr><tr class="week">';d=-1}}if(d>0){for(i=1;d<7;i++,d++){a+='<td class="blank">&nbsp;</td>'}}a+="</tr></table></div>";return a};TGN.Search.BrowseDate.submitDay=function(d,a,c,b){TGN.Search.BrowseDate.submitFromCalendar(a,c,b);setDictionaryCookie("BROWSES","bm",c,null,null);setDictionaryCookie("BROWSES","by",b,null,null)};TGN.Search.BrowseDate.submitFromCalendar=function(a,c,b){document.location="/Browse/view.aspx?dbid="+dbid+"&path="+b+"."+c+"."+a};TGN.Search.BrowseDate.fnReplaceHtml=function(c,b){var a=YAHOO.util.Dom.get(c);if("undefined"!=typeof a&&null!=a){var d=document.createElement(a.nodeName);d.id=a.id;d.className=a.className;d.innerHTML=b;a.parentNode.replaceChild(d,a)}return d};TGN.Search.BrowseDate.reload=function(d,c){var b=YAHOO.util.Dom.get("CalendarSpot");var a=TGN.Search.BrowseDate.Calendar(d,c);setDictionaryCookie("BROWSES","bm",d,null,null);setDictionaryCookie("BROWSES","by",c,null,null);TGN.Search.BrowseDate.fnReplaceHtml(b,a)};TGN.Search.BrowseDate.changeMonth=function(){var d=$("Month");var c=$("Year");var b=d.options[d.selectedIndex].value;var a=c.options[c.selectedIndex].value;TGN.Search.BrowseDate.reload(b,a);d.focus()};TGN.Search.BrowseDate.changeYear=function(){var e=$("Month");var d=$("Year");var c=e.options[e.selectedIndex].value;var a=d.options[d.selectedIndex].value;var b=false;for(i=0;i<availMonths[a].length;i++){if(c==availMonths[a][i]){b=true;break}}if(!b){c=availMonths[a][0]}TGN.Search.BrowseDate.reload(c,a);d.focus()};TGN.Search.BrowseDate.buildCalendar=function(){var a;var d=null;var e=null;var c=getQueryStringParameter("path");if(null!=c){var b=c.split(".");if(b.length>0&&b[0].length==4){d=b[0];if(b.length>1){e=b[1]}else{e=availMonths[d][0]}}}if(null==e||null==d||null==availMonths[d]){d=getDictionaryCookie("BROWSES","by");e=getDictionaryCookie("BROWSES","bm")}if(null==e||null==d||null==availMonths[d]){d=years[years.length-1];e=availMonths[d][availMonths[d].length-1]}a=TGN.Search.BrowseDate.Calendar(e,d);TGN.Search.BrowseDate.fnReplaceHtml("CalendarSpot",a)};var browseDateDays=new Array(31,28,31,30,31,30,31,31,30,31,30,31);TGN.Ancestry.Search.FamilyMemberContainer=function(){this.UniqueID="";this.PageType="Global";this.MaxFather=1;this.MaxMother=1;this.MaxSpouse=10;this.MaxChild=10;this.MaxSibling=10;this.CurrentRow=0;this.NotSetPrefix="msnotset";this.FatherFieldPrefix="msfn";this.MotherFieldPrefix="msmn";this.ChildFieldPrefix="mscn";this.SpouseFieldPrefix="mssn";this.SiblingFieldPrefix="msbn";this.RowIDPrefix="row_";this.SelectOptionIDPrefix="rel_";this.FirstNameIDPrefix="fmfn_";this.LastNameIDPrefix="fmln_";this.FirstNameExactIDPrefix="fmfnx_";this.LastNameExactIDPrefix="fmlnx_";this.FirstNameExactDivPrefix="fmfnxdiv_";this.LastNameExactDivPrefix="fmlnxdiv_";this.HasQueryValues=false;this.AvailableFields={f:{g:false,s:false},m:{g:true,s:true},s:{g:true,s:true},c:{g:true,s:true},b:{g:true,s:true}};this.FamilyMembers="{ }";this.Relationships={ns:0,f:0,m:0,s:0,c:0,b:0};this.Resources={HeadingFamilyMember:"Family Member",HeadingFirstName:"First Name",HeadingLastName:"Last Name",OptionFather:"Father",OptionMother:"Mother",OptionSpouse:"Spouse",OptionSibling:"Sibling",OptionChild:"Child",AddRowText:"Add Row",RemoveRowText:"Remove",ExactOnlyText:"Exact Only",ChooseText:"Choose...",NotAvailableText:"This value is not available in our index"};this.Init=function(a){this.PageType=this.GetSetting("PageType",a);this.MaxFather=this.GetSetting("MaxFather",a);this.MaxMother=this.GetSetting("MaxMother",a);this.MaxSpouse=this.GetSetting("MaxSpouse",a);this.MaxChild=this.GetSetting("MaxChild",a);this.MaxSibling=this.GetSetting("MaxSibling",a);this.Relationships=this.GetSetting("Relationships",a);this.HasQueryValues=this.GetSetting("HasQueryValues",a);this.FamilyMembers=this.GetSetting("FamilyMembers",a);this.AvailableFields=this.GetSetting("AvailableFields",a);this.UniqueID=this.GetSetting("UniqueID",a);this.Resources=this.GetSetting("Resources",a);this.AvailableFields=this.GetSetting("AvailableFields",a);this.Setup(a);this.ParentForm().FMC=this};this.SetMaximums=function(){if(!this.IsRelationshipAllowed("f")){this.MaxFather=0}if(!this.IsRelationshipAllowed("m")){this.MaxMother=0}if(!this.IsRelationshipAllowed("s")){this.MaxSpouse=0}if(!this.IsRelationshipAllowed("c")){this.MaxChild=0}if(!this.IsRelationshipAllowed("b")){this.MaxSibling=0}};this.AdjustSettingsBasedOnPageType=function(){if(this.PageType=="Collection"){this.MaxSpouse=1}};this.Setup=function(a){this.AdjustSettingsBasedOnPageType();this.SetMaximums();if(!this.HasQueryValues){this.AddRow("","","","","")}else{this.PopulateFromQueryString()}this.CheckHideEverything()};this.ParentForm=function(){return TGN.SM.InstContainer[this.UniqueID+"_search-form"]};this.PopulateFromQueryString=function(){for(var a=0;a<this.FamilyMembers.length;a++){this.AddRow(this.FamilyMembers[a].Relationship,this.FamilyMembers[a].FirstName,this.FamilyMembers[a].LastName,this.FamilyMembers[a].FirstNameExact,this.FamilyMembers[a].LastNameExact)}};this.AddRow=function(e,u,q,m,n){if(this.ShouldAbortAddRow(e,u,q)){return}if(null==u||"undefined"==u){u=""}if(null==q||"undefined"==q){q=""}var g=this.GetMainTable();var k=g.getElementsByTagName("tbody").item(0);var a=document.createElement("tr");var h=document.createElement("td");var f=document.createElement("td");var d=document.createElement("td");var c=document.createElement("td");h.innerHTML=this.RenderSelect(e);f.innerHTML=this.RenderFirstName(u,m);d.innerHTML=this.RenderLastName(q,n);c.innerHTML=this.RenderRemove();a.appendChild(h);a.appendChild(f);a.appendChild(d);a.appendChild(c);k.appendChild(a);this.SetID(a,this.RowIDPrefix+this.CurrentRow);a.setAttribute("rowid",this.CurrentRow);var s=this.GetEl(this.SelectOptionIDPrefix+this.CurrentRow);this.OptionChanged(s);if(typeof TGN.KeyWatcher!="undefined"){var r=this.GetControlID(this.CurrentRow,e,"g","");var p=this.GetControlID(this.CurrentRow,e,"s","");var o=this.GetEl(r);var t=this.GetEl(p);TGN.KeyWatcher.addListener(s);TGN.KeyWatcher.addListener(o);TGN.KeyWatcher.addListener(t)}this.CurrentRow++;this.CheckNoMoreRows();var b=this.CountSetRelationships();if(b>3){if(s.options[s.selectedIndex].value!=e){s.selectedIndex=1;this.OptionChanged(s)}}};this.RenderSelect=function(a){var c="";var b=this.SelectOptionIDPrefix+this.CurrentRow;c+='<select oldRel="0" class="ancSelect memRel cmbRel SMNoClear " id="'+this.GetID(b)+'" onchange="TGN.SM.InstMgr(\''+this.UniqueID+"_search-form','"+this.UniqueID+"').FMC.OptionChanged(this)\">";c+='<option sort="0" value="0" '+(a==""?"selected":"")+">"+this.Resources.ChooseText+"</option>";if(this.IsRelationshipAllowed("f")){c+='<option sort="1" value="f" '+(a=="f"?"selected":"")+">"+this.Resources.OptionFather+"</option>"}if(this.IsRelationshipAllowed("m")){c+='<option sort="2" value="m" '+(a=="m"?"selected":"")+">"+this.Resources.OptionMother+"</option>"}if(this.IsRelationshipAllowed("s")){c+='<option sort="3" value="s" '+(a=="s"?"selected":"")+">"+this.Resources.OptionSpouse+"</option>"}if(this.IsRelationshipAllowed("c")){c+='<option sort="4" value="c" '+(a=="c"?"selected":"")+">"+this.Resources.OptionChild+"</option>"}if(this.IsRelationshipAllowed("b")){c+='<option sort="5" value="b" '+(a=="b"?"selected":"")+">"+this.Resources.OptionSibling+"</option>"}c+="</select>";return c};this.RenderFirstName=function(d,f){var g="";var c=this.GetID(this.GetControlIDNew("g",""));var b=this.GetControlIDNew("g","");var k=this.GetID(this.GetControlIDNew("g","_x"));var h=this.GetControlIDNew("g","_x");var e=this.GetID(this.FirstNameExactDivPrefix+this.CurrentRow);var a="javascript:TGN.SM.InstMgr('"+this.UniqueID+"_search-form','"+this.UniqueID+"').ExactCBToggle(this)";if(null==d||"undefined"==d){d=""}if((null==f||undefined==f||"0"==f||""==f)){f=""}else{f='checked="yes"'}if(this.IsMatchAllExactChecked()){f='checked="yes"'}g='<div><input id="'+c+'" name="'+b+'" class="ancText field" type="text" value="'+d.replace(/"/g,"&quot;")+'" /></div><div id="'+e+'"><div class="sf-exact"><label><input id="'+k+'" name="'+h+'" class="ancCheckbox SM_advOpt" type="checkbox" '+f+' tabindex="9999" value="1" onclick="'+a+'" /> '+this.Resources.ExactOnlyText+"</label></div></div>";return g};this.RenderLastName=function(h,e){var f="";var c=this.GetID(this.GetControlIDNew("s",""));var b=this.GetControlIDNew("s","");var k=this.GetID(this.GetControlIDNew("s","_x"));var g=this.GetControlIDNew("s","_x");var d=this.GetID(this.LastNameExactDivPrefix+this.CurrentRow);var a="javascript:TGN.SM.InstMgr('"+this.UniqueID+"_search-form','"+this.UniqueID+"').ExactCBToggle(this)";if(null==h||"undefined"==h){h=""}if((null==e||undefined==e||"0"==e||""==e)){e=""}else{e='checked="yes"'}if(this.IsMatchAllExactChecked()){e='checked="yes"'}f='<div><input id="'+c+'" name="'+b+'" class="ancText field" type="text" value="'+h.replace(/"/g,"&quot;")+'" /></div><div id="'+d+'"><div class="sf-exact"><label><input id="'+k+'" name="'+g+'" class="ancCheckbox SM_advOpt" type="checkbox" '+e+' tabindex="9999" value="1" onclick="'+a+'" /> '+this.Resources.ExactOnlyText+"</label></div></div>";return f};this.RenderRemove=function(){var a="&nbsp;";a='<a href="javascript:;" tabindex="-1" onclick="TGN.SM.InstMgr(\''+this.UniqueID+"_search-form','"+this.UniqueID+"').FMC.RemoveRow(this)\">"+this.Resources.RemoveRowText+"</a>";return a};this.RemoveRow=function(a){var e=this.GetMainTable();var b=a.parentNode.parentNode.rowIndex;var d=this.GetEl(this.SelectOptionIDPrefix+(b-1).toString());var c=d.options[d.selectedIndex].value;e.deleteRow(b);this.Relationships[c]--;this.EnforceRelationships();this.RenumberControls();this.ReDoControlNames();this.CurrentRow--;this.CheckNoMoreRows()};this.Clear=function(){this.Relationships.ns=0;this.Relationships.m=0;this.Relationships.f=0;this.Relationships.s=0;this.Relationships.c=0;this.Relationships.b=0;this.CurrentRow=0;var c=this.GetMainTable();var a=c.rows;for(var b=c.rows.length-1;b>0;b--){c.deleteRow(b)}};this.OptionChanged=function(a){this.SetRelationshipCounts(a);this.EnforceRelationships();this.SetControlIDsRow(a.parentNode.parentNode.getAttribute("rowid"));this.CheckDisableEnabledState(a);this.ReDoControlNames();this.ShowHideAvailableFields(a);this.EnforceCheckboxRules(a)};this.HideExact=function(b,c,a){$(b.replace(this.SelectOptionIDPrefix,this.FirstNameExactDivPrefix)).style.display="none";$(b.replace(this.SelectOptionIDPrefix,this.LastNameExactDivPrefix)).style.display="none";this.GetEl(this.GetControlID(c,a,"g","_x")).style.display="none";this.GetEl(this.GetControlID(c,a,"s","_x")).style.display="none"};this.ShowExact=function(e,a,k){var h=$(e.replace(this.SelectOptionIDPrefix,this.FirstNameExactDivPrefix));var g=$(e.replace(this.SelectOptionIDPrefix,this.LastNameExactDivPrefix));var c=this.GetEl(this.GetControlID(a,k,"g",""));var b=this.GetEl(this.GetControlID(a,k,"s",""));var f=this.GetEl(this.GetControlID(a,k,"g","_x"));var d=this.GetEl(this.GetControlID(a,k,"s","_x"));if(c.readOnly!=true){h.style.display="";f.style.display="";if(this.IsMatchAllExactChecked()){f.checked=true}}else{h.style.display="none";f.style.display="none"}if(b.readOnly!=true){g.style.display="";d.style.display="";if(this.IsMatchAllExactChecked()){d.checked=true}}else{g.style.display="none";d.style.display="none"}};this.EnforceCheckboxRules=function(c){var b=c.parentNode.parentNode.getAttribute("rowid");var a=c.options[c.selectedIndex].value;switch(a){case"m":this.ShowExact(c.id,b,a);break;case"f":this.ShowExact(c.id,b,a);break;case"s":this.ShowExact(c.id,b,a);break;case"c":this.HideExact(c.id,b,a);break;case"b":this.HideExact(c.id,b,a);break;default:this.HideExact(c.id,b,a);break}};this.CheckDisableEnabledState=function(c){var f="";var p="";var m="";var g="";var b=c.options[c.selectedIndex].value;var h=this.GetRelationshipPrefix(b);var d=c.parentNode.parentNode;var a=d.getAttribute("rowid");var q=c.options[c.selectedIndex].value;f=this.GetControlID(a,q,"g","");p=this.GetControlID(a,q,"s","");m=this.GetControlID(a,q,"g","_x");g=this.GetControlID(a,q,"s","_x");var o=this.GetEl(f);var n=this.GetEl(p);var e=this.GetEl(m);var k=this.GetEl(g);if(b=="0"){this.EnableDisableField(o,false);this.EnableDisableField(n,false);e.setAttribute("readonly","true");k.setAttribute("readonly","true")}else{this.EnableDisableField(o,true);this.EnableDisableField(n,true);e.removeAttribute("readonly","true");k.removeAttribute("readonly","true")}};this.ReDoControlNames=function(){var e=this.GetMainTable();var h=e.getElementsByTagName("tr");var c={"0":0,f:0,m:0,s:0,c:0,b:0};for(var g=0;g<(h.length);g++){if(g>0){try{var m=(g-1).toString();var d=h[g];var a=this.GetEl(this.SelectOptionIDPrefix+m);var b=a.options[a.selectedIndex].value;var o=this.GetEl(this.GetRelationshipPrefix(b)+"g"+m);var n=this.GetEl(this.GetRelationshipPrefix(b)+"s"+m);var k=this.GetEl(this.GetRelationshipPrefix(b)+"g"+m+"_x");var p=this.GetEl(this.GetRelationshipPrefix(b)+"s"+m+"_x");o.name=this.GetRelationshipPrefix(b)+"g"+c[b].toString();n.name=this.GetRelationshipPrefix(b)+"s"+c[b].toString();k.name=this.GetRelationshipPrefix(b)+"g"+c[b].toString()+"_x";p.name=this.GetRelationshipPrefix(b)+"s"+c[b].toString()+"_x";c[b]++}catch(f){}}}};this.SetControlIDsRow=function(g,e){var b=this.GetEl(this.SelectOptionIDPrefix+g);var f=b.options[b.selectedIndex].value;var m=b.getAttribute("oldRel");var k="";var h="";var o="";var a="";if(null==e||"undefined"==e){e=g}k=this.GetRelationshipPrefix(m);h=this.GetRelationshipPrefix(f);b.setAttribute("oldRel",f);a=e.toString();if(h==""){return""}o=g.toString();var r=this.GetEl(k+"g"+o);var q=this.GetEl(k+"s"+o);var d=this.GetEl(k+"g"+o+"_x");var s=this.GetEl(k+"s"+o+"_x");var n=this.GetEl(this.FirstNameExactDivPrefix+o);var p=this.GetEl(this.LastNameExactDivPrefix+o);var c=b.parentNode.parentNode;this.SetID(c,this.RowIDPrefix+e.toString());c.setAttribute("rowid",e.toString());this.SetID(b,this.SelectOptionIDPrefix+e.toString());this.SetID(r,h+"g"+a);this.SetID(q,h+"s"+a);this.SetID(d,h+"g"+a+"_x");this.SetID(s,h+"s"+a+"_x");this.SetID(n,this.FirstNameExactDivPrefix+a);this.SetID(p,this.LastNameExactDivPrefix+a);return""};this.RenumberControls=function(){var e=this.GetMainTable();var a=e.getElementsByTagName("tr");for(var c=0;c<(a.length);c++){if(c>0){try{var b=a[c];this.SetControlIDsRow(b.getAttribute("rowid"),c-1)}catch(d){}}}};this.SetRelationshipCounts=function(b){var c=b.options[b.selectedIndex].value;var a=b.getAttribute("oldRel");if(c==a){a="-1"}switch(a){case"0":this.Relationships.ns--;break;case"m":this.Relationships.m--;break;case"f":this.Relationships.f--;break;case"s":this.Relationships.s--;break;case"c":this.Relationships.c--;break;case"b":this.Relationships.b--;break}switch(c){case"0":this.Relationships.ns++;break;case"m":this.Relationships.m++;break;case"f":this.Relationships.f++;break;case"s":this.Relationships.s++;break;case"c":this.Relationships.c++;break;case"b":this.Relationships.b++;break}};this.EnforceRelationships=function(){var b=(this.Relationships.m>=this.MaxMother);var g=(this.Relationships.f>=this.MaxFather);var v=(this.Relationships.s>=this.MaxSpouse);var k=(this.Relationships.c>=this.MaxChild);var n=(this.Relationships.b>=this.MaxSibling);var h=(this.AvailableFields.f.g==false&&this.AvailableFields.f.s==false);var u=(this.AvailableFields.m.g==false&&this.AvailableFields.m.s==false);var s=(this.AvailableFields.s.g==false&&this.AvailableFields.s.s==false);var p=(this.AvailableFields.c.g==false&&this.AvailableFields.c.s==false);var e=(this.AvailableFields.b.g==false&&this.AvailableFields.b.s==false);var r;var d=this.GetMainTable();var f=d.getElementsByTagName("tr");for(var t=0;t<(f.length);t++){if(t>0){var a=f[t];var m=a.getAttribute("rowid");var o=this.GetEl(this.SelectOptionIDPrefix+m);var c=o.options[o.selectedIndex].value;var q=o.selectedIndex;if(g&&c!="f"){this.RemoveSelectOptionByValue(o,"f")}else{if(!this.DoesSelectHaveValue(o,"f")&&!h){r=new Option(this.Resources.OptionFather,"f",false,false);o.options[o.length]=r;this.SortSelect(o)}}if(b&&c!="m"){this.RemoveSelectOptionByValue(o,"m")}else{if(!this.DoesSelectHaveValue(o,"m")&&!u){r=new Option(this.Resources.OptionMother,"m",false,false);o.options[o.length]=r;this.SortSelect(o)}}if(v&&c!="s"){this.RemoveSelectOptionByValue(o,"s")}else{if(!this.DoesSelectHaveValue(o,"s")&&!s){r=new Option(this.Resources.OptionSpouse,"s",false,false);o.options[o.length]=r;this.SortSelect(o)}}if(k&&c!="c"){this.RemoveSelectOptionByValue(o,"c")}else{if(!this.DoesSelectHaveValue(o,"c")&&!p){r=new Option(this.Resources.OptionChild,"c",false,false);o.options[o.length]=r;this.SortSelect(o)}}if(n&&c!="b"){this.RemoveSelectOptionByValue(o,"b")}else{if(!this.DoesSelectHaveValue(o,"b")&&!e){r=new Option(this.Resources.OptionSibling,"b",false,false);o.options[o.length]=r;this.SortSelect(o)}}}}};this.RemoveSelectOptionByValue=function(d,c){for(var a=0;a<d.length;a++){var b=d.options[a];if(b.value==c){d.remove(a)}}};this.SortSelect=function(a){var b=document.createElement("select");b=a;this.SortIndividualOption(b,a,"0");if(this.IsRelationshipAllowed("f")){this.SortIndividualOption(b,a,"f")}if(this.IsRelationshipAllowed("m")){this.SortIndividualOption(b,a,"m")}if(this.IsRelationshipAllowed("s")){this.SortIndividualOption(b,a,"s")}if(this.IsRelationshipAllowed("c")){this.SortIndividualOption(b,a,"c")}if(this.IsRelationshipAllowed("b")){this.SortIndividualOption(b,a,"b")}};this.SortIndividualOption=function(f,b,a){for(var c=0;c<f.length;c++){var d=f.options[c];if(d.value==a){try{b.options[b.length]=d}catch(e){b.appendChild(d)}return}}};this.IsRelationshipAllowed=function(a){if(null==a||"undefined"==a||a==""||a=="0"){return true}if(this.AvailableFields[a].g==true||this.AvailableFields[a].s==true){return true}return false};this.GetRelationshipPrefix=function(a){var b="";switch(a){case"f":b=this.FatherFieldPrefix;break;case"m":b=this.MotherFieldPrefix;break;case"s":b=this.SpouseFieldPrefix;break;case"c":b=this.ChildFieldPrefix;break;case"b":b=this.SiblingFieldPrefix;break;default:b=this.NotSetPrefix;break}return b};this.DoesSelectHaveValue=function(d,b){for(var a=0;a<d.length;a++){var c=d.options[a];if(c.value==b){return true}}return false};this.GetControlIDNew=function(c,b){var d=this.NotSetPrefix;var a=this.CurrentRow;var e=d+c+a+b;return e};this.GetControlID=function(b,a,e,d){var g=this.GetRelationshipPrefix(a);var f=(null==d?"":d);var c=b.toString();var h=g+e+c+f;return h};this.SetName=function(b,a){b.name=a};this.GetID=function(a){return a+"_"+this.UniqueID};this.SetID=function(a,b){a.id=b+"_"+this.UniqueID};this.GetMainID=function(){return"FMC_"+this.UniqueID};this.GetMainTable=function(){return document.getElementById("fmcTable_"+this.UniqueID)};this.GetEl=function(a){return document.getElementById(a+"_"+this.UniqueID)};this.GetSetting=function(b,a){if(null!=a[b]&&"undefined"!=a[b]){return a[b]}else{return this[b]}};this.ShouldAbortAddRow=function(a,d,b){var c=false;switch(a){case"f":if(this.Relationships.f>=this.MaxFather){c=true}break;case"m":if(this.Relationships.m>=this.MaxMother){c=true}break;case"s":if(this.Relationships.s>=this.MaxSpouse){c=true}break;case"c":if(this.Relationships.c>=this.MaxChild){c=true}break;case"b":if(this.Relationships.b>=this.MaxSibling){c=true}break}if(null==d||"undefined"==d){d=""}if(null==b||"undefined"==b){b=""}if(this.MaximumReached()){c=true}if(!this.IsRelationshipAllowed(a)){c=true}return c};this.MaximumReached=function(){if(this.CurrentRow==this.GetMaxAllowedRows()){return true}return false};this.CheckNoMoreRows=function(){var a=this.GetEl("fmcAddLink");if(this.CurrentRow>=this.GetMaxAllowedRows()){a.style.display="none"}else{a.style.display=""}};this.ShowHideAvailableFields=function(d){var g=true;var o=true;var m=d.options[d.selectedIndex].value;var e=d.parentNode.parentNode;var c=e.getAttribute("rowid");switch(m){case"f":if(this.AvailableFields.f.g!=true){g=false}if(this.AvailableFields.f.s!=true){o=false}break;case"m":if(this.AvailableFields.m.g!=true){g=false}if(this.AvailableFields.m.s!=true){o=false}break;case"s":if(this.AvailableFields.s.g!=true){g=false}if(this.AvailableFields.s.s!=true){o=false}break;case"c":if(this.AvailableFields.c.g!=true){g=false}if(this.AvailableFields.c.s!=true){o=false}break;case"b":if(this.AvailableFields.b.g!=true){g=false}if(this.AvailableFields.b.s!=true){o=false}break;case"0":break}var b=this.GetID(this.GetControlID(c,m,"g",""));var n=this.GetID(this.GetControlID(c,m,"s",""));var k=document.getElementById(b);var a=this.GetEl(this.FirstNameExactDivPrefix+c);var f=document.getElementById(n);var h=this.GetEl(this.LastNameExactDivPrefix+c);if(g==false){this.EnableDisableField(k,false);k.setAttribute("title",this.Resources.NotAvailableText);a.style.display="none"}else{k.setAttribute("title","");a.style.display=""}if(o==false){this.EnableDisableField(f,false);f.setAttribute("title",this.Resources.NotAvailableText);h.style.display="none"}else{f.setAttribute("title","");h.style.display=""}};this.IsMatchAllExactChecked=function(){var a=document.getElementById(this.UniqueID+"_xcb");if(a.checked){return true}else{return false}};this.GetMaxAllowedRows=function(){var a=this.MaxFather+this.MaxMother+this.MaxSpouse+this.MaxChild+this.MaxSibling;return a};this.RemoveBlankRows=function(){var g=this.GetMainTable();var b=g.getElementsByTagName("tr");for(var f=0;f<(b.length);f++){if(f>0){var e=b[f];var d=e.getAttribute("rowid");var c=this.GetEl(this.SelectOptionIDPrefix+d);var a=c.options[c.selectedIndex].value;if(a=="0"){this.RemoveRow(e)}}}};this.GetRelNumber=function(a){var b=0;if(null==a||"undefined"==a){a=""}switch(a){case"":case"0":b=this.Relationships.ns;break;case"f":b=this.Relationships.f;break;case"m":b=this.Relationships.m;break;case"s":b=this.Relationships.s;break;case"c":b=this.Relationships.c;break;case"b":b=this.Relationships.b;break}if(b>0){b--}return b};this.EnableDisableField=function(a,b){if(b==false){a.setAttribute("readonly","true");a.readOnly=true;a.className=a.className+" disabled"}else{a.removeAttribute("readonly","true");a.readOnly=false;a.className=a.className.replace(" disabled","")}};this.CheckHideEverything=function(){if(!this.AvailableFields.f.g&&!this.AvailableFields.f.s&&!this.AvailableFields.m.g&&!this.AvailableFields.m.s&&!this.AvailableFields.s.g&&!this.AvailableFields.s.s&&!this.AvailableFields.c.g&&!this.AvailableFields.c.s&&!this.AvailableFields.b.g&&!this.AvailableFields.b.s){var a=this.GetEl("FMC");a.style.display="none"}};this.CountSetRelationships=function(){var a=0;if(!this.AvailableFields.f.g&&!this.AvailableFields.f.s){a++}if(!this.AvailableFields.m.g&&!this.AvailableFields.m.s){a++}if(!this.AvailableFields.s.g&&!this.AvailableFields.s.s){a++}if(!this.AvailableFields.c.g&&!this.AvailableFields.c.s){a++}if(!this.AvailableFields.b.g&&!this.AvailableFields.b.s){a++}return a}};
/* hovertip.js */
if(typeof TGN=="undefined"){var TGN={}}if(typeof TGN.Util=="undefined"){TGN.Util={}}TGN.Util.HoverTip=function(){this.init()};TGN.Util.HoverTip.tipHideTimer=null;TGN.Util.HoverTip.tipShowTimer=null;TGN.Util.HoverTip.tipHideTimout=0;if(typeof setCookie=="undefined"){document.write("<script type='text/javascript' src='http://c.mfcreative.com/js/utility.js'> <\/script>")}TGN.Util.HoverTip.tip=null;TGN.Util.HoverTip.prototype.init=function(){this.panel=new YAHOO.widget.Panel("div_hoverTip",{fixedcenter:false,underlay:false,close:true,modal:false,visible:false,zIndex:1100,draggable:false});this.panel.setHeader("");this.panel.setBody("");this.panel.setFooter("");this.panel.cfg.getProperty("strings").close=" ";this.panel.cfg.setProperty("zIndex",1100);this.panel.render(document.body);document.getElementById("div_hoverTip").className="hovertip"};TGN.Util.HoverTip.CurrTip=null;TGN.Util.HoverTip.prototype.show=function(){if(TGN.Util.HoverTip.CurrTip!=null&&TGN.Util.HoverTip.CurrTip==this.elementId&&this.panel.cfg.getProperty("visible")){return}TGN.Util.HoverTip.CurrTip=this.elementId;this.panel.setHeader("<h3>"+this.title+"</h3>");var e='<div id="knub"></div><div class="tl"></div><div class="tr"></div><div class="bl"></div><div class="br"></div><div id="tp_content" class="content">'+this.body+"</div>";this.panel.setBody(e);this.panel.cfg.setProperty("context",[this.elementId,this.tAlign,this.eAlign]);if(this.width>0){document.getElementById("div_hoverTip").style.width=this.width+"px";document.getElementById("tp_content").style.width=this.width-26+"px";document.getElementById("tp_content").style.marginLeft="-"+(this.width-14)+"px";document.getElementById("tp_content").style.paddingLeft="6px";document.getElementById("tp_content").style.paddingRight="6px";document.getElementById("tp_bd").style.marginLeft=this.width-14+"px"}var a="knub";if(this.tAlign[1]=="r"){var b=document.getElementById(a);b.style.background="url(i/tip_knub_r.png) no-repeat 0 0;";var g=YAHOO.util.Dom.getXY(this.elementId);document.getElementById("div_hoverTip_c").style.left=(g[0]-this.width-30)+"px"}document.getElementById("div_hoverTip").style.display="block";document.getElementById(a).style.top=(0.8*((document.getElementById("div_hoverTip").scrollHeight/2)-(23)))+"px";document.getElementById("div_hoverTip").style.top=(0.8*(0-((document.getElementById("div_hoverTip").scrollHeight/2)-(document.getElementById(this.elementId).scrollHeight/2))))+"px";this.panel.show();var f=document.getElementById(this.elementId);if(TGN.Util.HoverTip.tipHideTimout>=0&&f.tagName=="INPUT"){function c(h){return(function(){TGN.Util.HoverTip.close();YAHOO.util.Event.removeListener(h,"blur")})}function d(h,i){return(function(){document.getElementById(i).focus();YAHOO.util.Event.addListener(i,"blur",c(i))})}setTimeout(d(this.panel,this.elementId),100)}};TGN.Util.HoverTip.close=function(){if(null!=TGN.Util.HoverTip.tip&&null!=TGN.Util.HoverTip.tip.panel&&TGN.Util.HoverTip.tip.panel.cfg.getProperty("visible")){TGN.Util.HoverTip.tip.panel.hide()}};TGN.Util.HoverTip.showHoverTip=function(a,h,f,i,d,k,b,e,g){TGN.Util.HoverTip.stopHideHoverTipTimer();if(g!=null&&typeof g=="number"&&g>0){clearInterval(TGN.Util.HoverTip.tipShowTimer);TGN.Util.HoverTip.tipShowTimer=setInterval(function(){TGN.Util.HoverTip.showHoverTip(a,h,f,i,d,k,b,e,0)},g);return}if(e==null||typeof e!="number"||e<1){e=0}if(TGN.Util.HoverTip.tip==null){TGN.Util.HoverTip.tip=new TGN.Util.HoverTip();if(e>0){YAHOO.util.Event.addListener(document.getElementById("div_hoverTip"),"mouseout",TGN.Util.HoverTip.startHideHoverTipTimer)}if(g>0){YAHOO.util.Event.addListener(document.getElementById("div_hoverTip"),"mouseover",TGN.Util.HoverTip.stopHideHoverTipTimer)}}if(e>0){TGN.Util.HoverTip.tipHideTimout=e}if(d==null||typeof d=="undefined"||d.length<1){d="tr"}if(k==null||typeof k=="undefined"||k.length<1){k="tl"}if(i==null||typeof i=="undefined"||i.length<1){i="Get Better Matches"}if(b==null||typeof b=="undefined"||b<1){b=200}TGN.Util.HoverTip.tip.elementId=a;TGN.Util.HoverTip.tip.body=f;TGN.Util.HoverTip.tip.title=i;TGN.Util.HoverTip.tip.eAlign=d;TGN.Util.HoverTip.tip.tAlign=k;TGN.Util.HoverTip.tip.width=b;var j;if(h=="name"||h=="date"||h=="place"){j=getDictionaryCookie("hvt",h);if(j==1){return}var c=new Date();c.setFullYear(c.getFullYear()+20,0,14);setDictionaryCookie("hvt",h,1,"",c)}else{j=getDictionaryCookie("hvt",h);if(j==1){return}}TGN.Util.HoverTip.tip.show()};TGN.Util.HoverTip.turnHoverTipsOn=function(){var a=new Date();a.setFullYear(a.getFullYear()+20,0,14);setDictionaryCookie("hvt","name",0,"",a);setDictionaryCookie("hvt","date",0,"",a);setDictionaryCookie("hvt","place",0,"",a)};TGN.Util.HoverTip.startHideHoverTipTimer=function(a){if(a==null||typeof a!="number"||a.length<1){a=TGN.Util.HoverTip.tipHideTimout}clearInterval(TGN.Util.HoverTip.tipHideTimer);clearInterval(TGN.Util.HoverTip.tipShowTimer);if(TGN.Util.HoverTip.tip!=null&&typeof TGN.Util.HoverTip.tip!="undefined"){TGN.Util.HoverTip.tipHideTimer=setInterval(TGN.Util.HoverTip.tip.close,a)}};TGN.Util.HoverTip.HideKWTips=function(){setDictionaryCookie("hvt","kw",1,"","");location.reload(true)};TGN.Util.HoverTip.stopHideHoverTipTimer=function(){clearInterval(TGN.Util.HoverTip.tipHideTimer);clearInterval(TGN.Util.HoverTip.tipShowTimer)};document.write('<div id="div_hoverTip" class="hovertip" style="display:none"><div id="tp_bd" class="bd"></div></div>');