var addPhotoButtonsDisabled=false;function pageLoaded(){initImmersive()}var isInFullScreen=false;var viewModeTabsHeight=0;var footerHeight=0;function setImmersiveHeight(c){if(document.getElementById("editPhotoContent")!=null&&document.getElementById("editPhotoContent").style.display!="none"){return}if(typeof c=="undefined"){c=isInFullScreen}else{isInFullScreen=c}if(isIE){var e=document.body.offsetHeight}else{var e=window.innerHeight}var d=document.getElementById("flashcontent");if(d!=null){var b=getRelTop(d);var a=e-b;if(c){if(isIE){a-=6}}else{if(viewModeTabsHeight==0&&footerHeight==0){if(isIE){viewModeTabsHeight=document.getElementById("treeModeSelection").offsetHeight+2;footerHeight=document.getElementById("masterPageFooter").offsetHeight+2}else{viewModeTabsHeight=document.getElementById("treeModeSelection").clientHeight;footerHeight=document.getElementById("masterPageFooter").clientHeight}}a-=(viewModeTabsHeight+footerHeight+1)}if(a<470){a=470}d.style.height=a+"px";immersiveHeight=a}}function familyTreeLoaded(){var b=document.getElementById("flashpreloader");if(b){b.style.display="none"}var a=document.getElementById("immersiveFamilyTree");if(a){a.height="100%"}}function showImmersive(){var c=document.getElementById("flashcontent");var b=document.getElementById("treeModeSelection");var a=document.getElementById("CanvasBorder");if(immersiveFamilyTree){immersiveFamilyTree.style.height="100%"}if(c){c.style.height=immersiveHeight}if(b){b.style.display="block"}if(a){a.className="CanvasBorder"}}function hideImmersive(){var a=document.getElementById("immersiveFamilyTree");var d=document.getElementById("flashcontent");var c=document.getElementById("treeModeSelection");var b=document.getElementById("CanvasBorder");if(a){a.style.height="0px"}if(d){d.style.height="0px"}if(c){c.style.display="none"}if(b){b.className=""}}function redirectToImmersive(){location.href=immersiveLink}function clearFormFields(){clearFormFieldsInner(browserName)}function immersiveFamilyTreeChanged(a){selectedFamiltTreeID=a.options[a.selectedIndex].value;treePageUrl=replace(treePageUrl,"familyTreeID=","familyTreeID="+selectedFamiltTreeID);location.href=treePageUrl}function flashInstallation(){location.href=flashInstallPath}function isValidFile(a){if(a.value==""){alert(selectPhotoText);return false}if(!checkSourceFileExtensionFor2CanonicalImg(a.value)){alert(fileNotSupportedText);return false}return true}function gedcomExport(a,c,b){if(exportGedcomUrl!=""){location.href=exportGedcomUrl}}function generateFTBReport(b,d,c,a){if(chartsUrl!=""){a=d*MAX_INDIVIDUAL_ID_PER_FAMILY_TREE+(1*a);chartsUrl+="&familyTreeID="+d+"&individualID="+a;location.href=chartsUrl}}function photoUploadedSuccessfully(d,b,h,f,e,g,c,a){if(b!=""&&d!=""){d=d-(familyTreeID*MAX_INDIVIDUAL_ID_PER_FAMILY_TREE);if(d<0){uploadCanceled()}uploadSuccess(d,b,h,f,e,g,c,a)}else{uploadCanceled()}return}function initializeImmersive(){immersiveObj=document.getElementById(IMMERSIVE_NAME)}var immersiveObj=null;function reloadPage(){location.reload();return false}var timerlen=5;var slideAniLen=400;var timerID=new Array();var startTime=new Array();var obj=new Array();var endHeight=new Array();var moving=new Array();var dir=new Array();function slidedown(a){if(moving[a]){return}if(document.getElementById(a).style.display!="none"){return}moving[a]=true;dir[a]="down";startslide(a)}function slideup(a){if(moving[a]){return}if(document.getElementById(a).style.display=="none"){return}moving[a]=true;dir[a]="up";startslide(a)}function startslide(a){obj[a]=document.getElementById(a);endHeight[a]=parseInt(obj[a].style.height);startTime[a]=(new Date()).getTime();if(dir[a]=="down"){obj[a].style.height="1px"}obj[a].style.display="block";timerID[a]=setInterval("slidetick('"+a+"');",timerlen)}function slidetick(c){var a=(new Date()).getTime()-startTime[c];if(a>slideAniLen){endSlide(c)}else{var b=Math.round(a/slideAniLen*endHeight[c]);if(dir[c]=="up"){b=endHeight[c]-b}obj[c].style.height=b+"px"}return}function endSlide(a){clearInterval(timerID[a]);if(dir[a]=="up"){obj[a].style.display="none"}obj[a].style.height=endHeight[a]+"px";delete (moving[a]);delete (timerID[a]);delete (startTime[a]);delete (endHeight[a]);delete (obj[a]);delete (dir[a]);return}function cancelHandler(){uploadCanceled()}function photoUploadFailed(a){uploadCanceled()}function openUploadImageFormCallBack(a){uploadCanceled()}function clearFormFieldsInner(c){var b=document.forms.imageUpload;b.elements.individual_id.value="";if(c=="IE"){b.elements.imageFile.removeNode(true);var a=document.createElement('<input type="file" onkeypress="return false" dir="LTR" size="35" width="style:100%" accept="image/*" name="imageFile" id="imageFile" >');inputFileCell.appendChild(a)}else{b.elements.imageFile.value=""}b.elements.imageTitle.value=""}function hideAddPhotoPanel(){var a=document.getElementById("pleaseWaitDiv");if(a){a.style.display="none"}slideup("photoUploadDiv");addPhotoButtonsDisabled=false;restoreButtonSprite2("saveButton",true);return false}function showAddPhotoPanel(){if(isPersonalPhotoPanelDisplayed){closePersonalPhotoPanel()}slidedown("photoUploadDiv");addPhotoButtonsDisabled=false;restoreButtonSprite2("saveButton",true);window.scrollTo(0,0);return false}function hideNotificationPanel(){var a=document.getElementById("notificationPanel");if(a!=null){a.style.display="none"}}function uploadSuccess(d,b,h,f,e,g,c,a){hideAddPhotoPanel();if(immersiveObj!=null){if(e==""&&g==""){if(treeMode=="immersive"){immersiveObj.photoUploadSuccess(h+"",d+"",b,f)}else{immersiveObj.photoUploadSuccess(h+"",d+"",b,f,null,null,c+"",a+"")}}else{if(treeMode=="immersive"){immersiveObj.photoUploadSuccess(h+"",d+"",b,f,e,g)}else{immersiveObj.photoUploadSuccess(h+"",d+"",b,f,e,g,c+"",a+"")}}}clearFormFields()}function uploadCanceled(){hideAddPhotoPanel();if(immersiveObj!=null){immersiveObj.photoUploadCanceled()}clearFormFields()}function initPhotoUpload(c,a){clearFormFields();showAddPhotoPanel();var b=document.forms.imageUpload;b.elements.individual_id.value=c;b.elements.initiator_guid.value=a}function saveHandler(){if(!addPhotoButtonsDisabled){var b=document.forms.imageUpload;if(isValidFile(b.imageFile)){var a=document.getElementById("pleaseWaitDiv");if(a){a.style.display="block"}addPhotoButtonsDisabled=true;disableButtonSprite2("saveButton");b.submit()}}}function fullScreenOn(){if(isOpera){return}var g=document.getElementById("masterPageHeader");if(g){g.style.display="none"}var i=document.getElementById("masterPageNotificationPanel");if(i){i.style.display="none"}var h=document.getElementById("familyTreesComboBox");if(h){h.style.display="none"}var e=document.getElementById("treeModeSelection");if(e){e.style.display="none"}var d=document.getElementById("masterPageFooterSeparator");if(d){d.style.display="none"}var a=document.getElementById("masterPageFooter");if(a){a.style.display="none"}var c=document.getElementById("topBannerAdContainer");if(c){c.style.display="none"}var f=document.getElementById("sideBannerAdContainer");if(f){f.style.display="none"}setImmersiveHeight(true);var b=document.getElementById("immersiveFamilyTree");if(b){b.height="100%"}wasCanvasFullScreen=true}function fullScreenOff(){if(isOpera){return}var b=document.getElementById("masterPageHeader");if(b){b.style.display="block"}var d=document.getElementById("masterPageNotificationPanel");if(d){d.style.display="block"}var c=document.getElementById("familyTreesComboBox");if(c){c.style.display="block"}var g=document.getElementById("treeModeSelection");if(g){g.style.display="block"}var e=document.getElementById("masterPageFooterSeparator");if(e){e.style.display="block"}var a=document.getElementById("masterPageFooter");if(a){a.style.display="block"}var h=document.getElementById("topBannerAdContainer");if(h&&topBannerClosed==false){h.style.display="block"}var f=document.getElementById("sideBannerAdContainer");if(f){f.style.display="block"}setImmersiveHeight(false);wasCanvasFullScreen=false}function photoUploadStopped(b){var a=document.getElementById("pleaseWaitDiv");if(a){a.style.display="none"}addPhotoButtonsDisabled=false;restoreButtonSprite2("saveButton",true);return false}function gotoUpgradePage(){writeActivityIndicator(ACTIVITY_PLANS,SCENARIO_PLAN_WEB_TREE_EXCEEDING_QUOTA_UPGRADE_CLICKED);if(upgradeSiteUrl!=""){document.location.href=upgradeSiteUrl}}var PERSONAL_PHOTO_PANEL_WIDTH=360;var isPersonalPhotoPanelDisplayed=false;var personalPhotoProperties=null;function displayChangePersonalPhotoPanel(g,l,k,d,j,i,c,e,b){var h=document.getElementById("flashcontent");if(h){personalPhotoProperties={siteID:g,displayLang:l,individualID:k,memberID:d,displayName:j,gender:i,relation:c,data5:e,pathToCurrentThumbnailPhoto:b};if(!isPersonalPhotoPanelDisplayed){var f=h.clientWidth;h.style.width=(f-1)+"px";var a=new Accelimation(h.style,"width",f-PERSONAL_PHOTO_PANEL_WIDTH,500,0.75,"px");a.onend=onPersonalPhotoPanelDisplay;a.start()}else{onPersonalPhotoPanelDisplay()}isPersonalPhotoPanelDisplayed=true}}function personalPhotoSubmitted(d,c){closePersonalPhotoPanel();var b=document.getElementById(IMMERSIVE_NAME);if(b!=null){var a=b.updatePersonalPhotoOfIndividual(d,c)}}function closePersonalPhotoPanel(){var g=document.getElementById("flashcontent");var f=document.getElementById("personalPhotoContainer");if(g&&f){var a=g.clientWidth;g.style.width=(a-1)+"px";var c=new Accelimation(g.style,"width",a+PERSONAL_PHOTO_PANEL_WIDTH,500,0.75,"px");c.onend=onPersonalPhotoPanelHide;f.style.width="0px";f.style.height="";var e=document.getElementById("personalPhotoDivider");if(e){e.style.display="none"}c.start();isPersonalPhotoPanelDisplayed=false}var d=document.getElementById(IMMERSIVE_NAME);if(d!=null){var b=d.cancelPersonalPhotoOfIndividual()}}function onPersonalPhotoPanelDisplay(){var d=document.getElementById("flashcontent");var c=document.getElementById("personalPhotoContainer");if(d&&c){c.style.width=PERSONAL_PHOTO_PANEL_WIDTH+"px";c.style.height="100%";var a=d.clientHeight;if(c.clientHeight!=a){c.style.height=a+"px"}var b=document.getElementById("personalPhotoDivider");if(b){b.style.display=""}d.style.width="100%";renderPersonalPhoto()}}function onPersonalPhotoPanelHide(){var b=document.getElementById("flashcontent");var a=document.getElementById("personalPhotoContainer");if(b&&a){b.style.width="100%";a.innerHTML=""}}function renderPersonalPhoto(){if(personalPhotoProperties==null){return}var a=new SWFObject(personalPhotoPlayer,"PersonalPhoto","100%","100%","8","#ffffff","high","");a.addParam("quality","best");a.addParam("allowScriptAccess","always");a.addParam("bgcolor","#ffffff");a.addVariable("siteID",personalPhotoProperties.siteID);a.addVariable("displayLang",personalPhotoProperties.displayLang);a.addVariable("data5",personalPhotoProperties.data5);a.addVariable("memberID",personalPhotoProperties.memberID);a.addVariable("IDOfIndividualToSet",personalPhotoProperties.individualID);a.addVariable("displayName",personalPhotoProperties.displayName);a.addVariable("gender",personalPhotoProperties.gender);a.addVariable("relation",personalPhotoProperties.relation);a.addVariable("pathToCurrentThumbnailPhoto",personalPhotoProperties.pathToCurrentThumbnailPhoto);a.addVariable("dialogTitle",PERSONAL_PHOTO_TITLE);a.addVariable("OKBtnLabel",PERSONAL_PHOTO_OK_LABEL);a.addVariable("cancelBtnLabel",PERSONAL_PHOTO_CANCEL_LABEL);a.addVariable("applicationServer","http://"+applicationServer);a.write("personalPhotoContainer")};
