var isGedcomFormEnabled=true;var isGoBtnDisabled=false;function companyHomeFormLoaded(){updatePersonDetails("rootPerson");updateCountryCombobox()}function loadPromoter(){var a=document.getElementById("promoter");if(getWindowViewWidth()<1024){a.style.width="250px";a.style.height="270px"}var c=new SWFObject(homepagePromoter,"HomepagePromoter","100%","100%","8","#ffffff","high");c.addParam("quality","best");c.addParam("allowScriptAccess","always");c.addParam("bgcolor","#ffffff");c.addParam("wmode","window");c.addVariable("pathToConfig","/FP/Library/Company/Home/companyHomePromoterXML.php");c.addVariable("cyclic","true");c.addVariable("fontName","Arial");c.addVariable("lang",displayLang);c.addVariable("appStartupDelay","1");c.addVariable("appInitText"," ");c.addVariable("hiRes","1");c.addVariable("slidesBasePath",slidesPath);c.addVariable("pathToFlagsFolder",flagsPath);c.write("promoter");var b=document.getElementById("noFlashPromoter");if(b){b.style.display=""}}function pausePromoter(){var a=document.getElementById("HomepagePromoter");if(a){try{a.pauseSlideshow()}catch(b){}}}function grabLastNameFocus(a){var b=document.getElementById("researchLastName");b.focus()}function researchFormSubmit(){var b=document.getElementById("researchLastName");lastName=trim(b.value);if(lastName==researchLastNameText){lastName=""}if(lastName==""){alert(errLastNameEmpty);grabLastNameFocus();return false}lastName=normalizeGenoogleString2(lastName);if(lastName.length<2){alert(errLastNameMin);b.focus();return false}var a=document.getElementById("submittedLastName");a.value=lastName;var c=document.getElementById("submittedFirstName");var e=document.getElementById("researchLastName");c.value=e;var d=document.getElementById("dmSoundexCode");d.value=soundex(lastName);return true}function researchFieldFocus(b){var a=trim(b.value);if((b.id=="researchFirstName"&&b.value==researchFirstNameText)||(b.id=="researchLastName"&&b.value==researchLastNameText)){b.value="";b.className="CompanyHomeBarResearchField"}}function researchFieldBlur(b){var a=trim(b.value);if(b.id=="researchFirstName"&&(a==""||a==researchFirstNameText)){b.className="CompanyHomeBarResearchFieldEmpty";b.value=researchFirstNameText}else{if(b.id=="researchLastName"&&(a==""||a==researchLastNameText)){b.className="CompanyHomeBarResearchFieldEmpty";b.value=researchLastNameText}}}function getCheckedValue(b){if(!b){return""}var c=b.length;if(c==undefined){if(b.checked){return b.value}else{return""}}for(var a=0;a<c;a++){if(b[a].checked){return b[a].value}}return""}g_shouldUpdateFatherLastName=true;function updatePersonDetails(a){var b=new Object();b.type=a;b.firstName=document.getElementById(a+"FirstName").value;b.lastName=document.getElementById(a+"LastName").value;if(b.firstName==""&&b.lastName==""){if(b.type=="father"){b.firstName=myFatherText}else{if(b.type=="mother"){b.firstName=myMotherText}else{if(b.type=="rootPerson"){b.firstName=mySelfText}}}b.lastName==""}if(a=="rootPerson"){b.gender=getCheckedValue(document.getElementsByName("gender"));if(b.gender=="M"){var d=document.getElementById("rootPersonLastNameLabel");setObjInnerText(d,"* "+lastNameText)}else{if(b.gender=="F"){var d=document.getElementById("rootPersonLastNameLabel");setObjInnerText(d,"* "+maidenNameText)}}b.birthYear=document.getElementById("birthYear").value;if(isInConventionMode&&g_shouldUpdateFatherLastName){var c=document.getElementById("fatherLastName");c.value=b.lastName}}updateCards(b)}function updateCards(c){if(c==null){return}var d=null;if(c.type=="rootPerson"){d=document.getElementById("myName")}else{if(c.type=="father"){d=document.getElementById("fatherName")}else{if(c.type=="mother"){d=document.getElementById("motherName")}}}if(d==null){return}setObjInnerText(d,prepareTextForBox(c.firstName+" "+c.lastName));if((isInConventionMode)&&(g_shouldUpdateFatherLastName)&&(c.type=="rootPerson")){var a=document.getElementById("fatherName");var b=a.firstName+" "+c.lastName;if(a.firstName==undefined){b=c.lastName}setObjInnerText(a,prepareTextForBox(b))}}function prepareTextForBox(d){var a=document.getElementById("TextSizer");var c="";for(var b=0;b<d.length;b++){setObjInnerText(a,c+d.charAt(b));if(a.offsetHeight>68){setObjInnerText(a,c.substr(0,c.length-2)+"...");break}else{if(a.offsetWidth>121){setObjInnerText(a,c.substr(0,c.length-1)+" "+c.substr(c.length-1)+d.charAt(b));if(a.offsetHeight>68){setObjInnerText(a,c.substr(0,c.length-2)+"...");break}}}c=getObjInnerText(a)}return getObjInnerText(a)}var redirectAfterLoginURL="";function validateAndSubmitTreeWizard(){if(isGoBtnDisabled){return}disableGoBtn();clearErrors();var c=true;var a=document.forms.familyTreeWizardForm;var k="";if(isEmpty(a.elements.rootPersonFirstName.value)){setLabelStatus("rootPersonFirstNameLabel",false);c=false}if(isEmpty(a.elements.rootPersonLastName.value)){setLabelStatus("rootPersonLastNameLabel",false);c=false}if(isEmpty(a.elements.email.value)){setLabelStatus("emailLabel",false);c=false}if(isEmpty(getCheckedValue(document.getElementsByName("gender")))){setLabelStatus("genderMaleLabel",false);setLabelStatus("genderFemaleLabel",false);c=false}if(isGedcomFormEnabled){if(isEmpty(a.elements.gedcomFile.value)){setLabelStatus("gedcomFileLabel",false);c=false}}else{if(isEmpty(a.elements.fatherLastName.value)){setLabelStatus("fatherLastNameLabel",false);c=false}var g=document.getElementById("country");if(g!=null){if(g.value==""){setLabelStatus("countryLabel",false);c=false}}}if(c){var h=true;var b=a.elements.email.value.split("@");if(b.length==3&&b[2].toLowerCase()=="good"){h=false;b.length=2;a.elements.email.value=b.join("@")}if(!isEmail(a.elements.email.value,h)){setLabelStatus("emailLabel",false);k=fillInValidText;c=false}else{if(isGedcomFormEnabled){var j=a.elements.gedcomFile.value;var d=j.split(".");var i=d[d.length-1];if(i.toUpperCase()!="GED"){setLabelStatus("gedcomFileLabel",false);c=false;k=gedExtensionText}}}}else{k=fillInFieldsText}if(c){realEmailToUse=a.elements.email.value;redirectAfterLoginURL="";if(isGedcomFormEnabled){var f="?";if(testEmailIsInUseUrl.indexOf("?")>-1){f="&"}var e=testEmailIsInUseUrl+f+"email="+encodeURIComponent(realEmailToUse);$("pleaseWaitDiv").style.display="block";new Ajax.Request(e,{method:"get",onComplete:function(o){var l=o.responseText;if(l.indexOf("|")<0){showFTWError()}else{var n=l.substr(0,l.indexOf("|"));var m=l.substr(l.indexOf("|")+1);realEmailToUse=m.substr(0,m.indexOf("|"));if(n==FTW_SUCCESS){submitform()}else{if(n==FTW_EMAIL_IS_IN_THE_SYSTEM){redirectAfterLoginURL=m.substr(m.indexOf("|")+1);emailIsInUse(realEmailToUse)}else{if(n==FTW_EMAIL_IS_IN_THE_SYSTEM_WITH_NO_SITE){emailIsInUse(realEmailToUse)}else{showFTWError()}}}}}})}else{submitform()}}else{displayErrorMessage(k);enableGoBtn()}}function emailIsInUse(a){$("pleaseWaitDiv").style.display="";openCenteredPopup2(memberLoginURLFromWizard+"&email="+a,564,260,"","scroll:no;","emailIsInUseCallback","",true);realEmailToUse=a}function emailIsInUseCallback(a){disableGoBtn();if(typeof a=="undefined"){$("email").activate();enableGoBtn()}else{if(redirectAfterLoginURL!=""){location.href=redirectAfterLoginURL}else{submitform()}}}function submitform(){var a=$("familyTreeWizardForm");disableGoBtn();$("email").value=realEmailToUse;$("pleaseWaitDiv").style.display="block";trackNewTreeConversion();if(isGedcomFormEnabled){a.submit();if(isIE){setTimeout("$('pleaseWaitImg').src = '"+$("pleaseWaitImg").src+"'",10)}}else{a.request({onComplete:function(d){var b=d.responseText;if(b.indexOf("|")<0){showFTWError()}else{var c=b.substr(0,b.indexOf("|"));if(c==FTW_SUCCESS){location.href=b.substr(b.indexOf("|")+1)}else{if(c==FTW_EMAIL_IS_IN_THE_SYSTEM){redirectAfterLoginURL=b.substr(b.indexOf("|")+1);emailIsInUse(realEmailToUse)}else{if(c==FTW_EMAIL_IS_IN_THE_SYSTEM_WITH_NO_SITE){emailIsInUse(realEmailToUse)}else{showFTWError()}}}}}})}}function showFTWError(){displayErrorMessage(FTW_GENERAL_ERROR_MESSAGE);$("pleaseWaitDiv").style.display="";enableGoBtn()}function initilizeValuesInImmersiveLight(){updatePersonDetails("rootPerson");updatePersonDetails("father");updatePersonDetails("mother")}function showHideGedcomForm(){clearErrors();isGedcomFormEnabled=!isGedcomFormEnabled;var b=document.getElementById("gedcomForm");var c=document.getElementById("noGedcomForm");var a=document.getElementById("gedcomLink");var d=document.getElementById("userGotGedcom");if(isGedcomFormEnabled){b.className="showAll";c.className="hideAll";a.innerHTML=gedcomBackText;d.value="true"}else{b.className="hideAll";c.className="showAll";a.innerHTML=gotGedcomText;d.value="false"}}function setLabelStatus(c,b){var a=document.getElementById(c);if(a){if(b){a.className="CompanyHomeFormLabel"}else{a.className="CompanyHomeFormLabelError"}}}function displayErrorMessage(b){var a=document.getElementById("errorMessage");if(a){if(b.length!=0){a.innerHTML="<nobr>"+b+"</nobr>"}else{a.innerHTML=""}}}function clearErrors(){displayErrorMessage("");setLabelStatus("rootPersonFirstNameLabel",true);setLabelStatus("rootPersonLastNameLabel",true);setLabelStatus("fatherLastNameLabel",true);setLabelStatus("countryLabel",true);setLabelStatus("emailLabel",true);setLabelStatus("genderMaleLabel",true);setLabelStatus("genderFemaleLabel",true);setLabelStatus("gedcomFileLabel",true)}function disableGoBtn(){isGoBtnDisabled=true;disableButtonSprite2("goBtn")}function enableGoBtn(){isGoBtnDisabled=false;restoreButtonSprite2("goBtn",true)}function handleFamilySlideClicked(a){if(lightboxSupportedLangs.indexOf(":"+preferredLang+":")==-1){var c=a.split("/");c=c[c.length-1];var g=c.split("_")[0];if(lightboxSupportedLangs.indexOf(":"+g+":")==-1){var j="EN-US"}else{var j=g}}else{var j=preferredLang}j=j.toLowerCase().replace("-","_");var d=(getViewportHeight()<775);var i="h";if(d){i="l"}var b=[[resourcePath+"/frontpage_"+j+"_"+i+".jpg",homepageText,homepageCaptionText],[resourcePath+"/familyTree_"+j+"_"+i+".jpg",familyTreeText,familyTreeCaptionText],[resourcePath+"/pam_"+j+"_"+i+".jpg",familyPhotosText,familyPhotosCaptionText],[resourcePath+"/calendar_"+j+"_"+i+".jpg",familyEventsText,familyEventsCaptionText]];try{pausePromoter()}catch(h){}var f=new Lightbox(true);f.setCaption(lightboxText);if(d){f.setIsUsingSmallFonts(true)}f.start(null,b);writeActivityIndicator(ACTIVITY_LOGIN,SCENARIO_LOGIN_LIGHTBOX_OPENED,false)}function updateCountryCombobox(){var b=document.getElementById("countryComboboxContainer");if(b==null){return}var a=getAjaxObject();var c="cssClass=CompanyHomeFormCombo";sendAjaxRequest(a,getCountriesComboboxURL,c,"","GET","getCountriesComboboxCallback")}function getCountriesComboboxCallback(c,a){a=unescape(a);var b=document.getElementById("countryComboboxContainer");if(b==null){return}b.innerHTML=a};

