var addPhotoButtonsDisabled=false;function pageLoaded(){initImmersive();initProfileAjax()}var isInFullScreen=false;var viewModeTabsHeight=0;var footerHeight=0;function setImmersiveHeight(c){if((document.getElementById("editPhotoContent")!=null&&document.getElementById("editPhotoContent").style.display!="none")||(document.getElementById("viewProfileContent")!=null&&document.getElementById("viewProfileContent").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<510){a=510}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(d,a,b){clearFormFields();showAddPhotoPanel();var c=document.forms.imageUpload;c.elements.individual_id.value=d;if(typeof a!="undefined"){c.elements.initiator_guid.value=a}if(typeof b!="undefined"){c.elements.imageTitle.value=b}}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 CONNECT_DISCONNECT_PANEL_WIDTH=300;var isPersonalPhotoPanelDisplayed=false;var isConnectDisconnectPanelDisplayed=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")}function connectIndividual(b,a){connectDisconnectIndividual(b,a,true)}function disconnectIndividual(b,a){connectDisconnectIndividual(b,a,false)}function connectDisconnectIndividual(e,d,c){var f=document.getElementById("flashcontent");if(f){connectProperties={siteID:e,individualID:d,isConnect:c};if(!isConnectDisconnectPanelDisplayed){var a=f.clientWidth;f.style.width=(a-1)+"px";var b=new Accelimation(f.style,"width",a-CONNECT_DISCONNECT_PANEL_WIDTH,500,0.75,"px");b.onend=onConnectDisconnectPanelDisplay;b.start()}else{onConnectDisconnectPanelDisplay()}isConnectDisconnectPanelDisplayed=true}}function onConnectDisconnectPanelDisplay(){var d=document.getElementById("flashcontent");var c=document.getElementById("personalPhotoContainer");if(d&&c){c.style.width=CONNECT_DISCONNECT_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="none"}d.style.width="100%";renderConnectDisconnectPanel()}}function renderConnectDisconnectPanel(){if(connectProperties==null){return}var b=document.getElementById("personalPhotoContainer");var a=(connectProperties.isConnect?"/FP/API/FamilyTree/attach.php":"/FP/API/FamilyTree/detach.php");a+="?s="+connectProperties.siteID+"&individualID="+connectProperties.individualID+"&height="+b.offsetHeight;b.innerHTML='<table id="connectDisconnectPreloader" cellspacing="0" cellpadding="0" border="0" width="100%" height="100%">	<tr>		<td align="center" valign="middle">			<img src="'+AssetManager.R_IMG("/FP/Assets/Images/Misc/Loading-4.gif")+'"></img>		</td>	</tr></table>';b.innerHTML+='<iframe id="connectDisconnectIframe" frameborder="0" border="0" style="border-width:0;width:0;height:0" src="'+a+'">'}function connectDisconnectRemovePreloader(){var a=document.getElementById("connectDisconnectPreloader");var b=document.getElementById("connectDisconnectIframe");if(a){a.style.display="none"}if(b){b.style.height="100%";b.style.width="100%"}}function closeConnectDisconnectPanel(){var f=document.getElementById("flashcontent");var e=document.getElementById("personalPhotoContainer");if(f&&e){var a=f.clientWidth;f.style.width=(a-1)+"px";var c=new Accelimation(f.style,"width",a+CONNECT_DISCONNECT_PANEL_WIDTH,500,0.75,"px");c.onend=onConnectDisconnectPanelHide;e.style.width="0px";e.style.height="";c.start();isConnectDisconnectPanelDisplayed=false}var d=document.getElementById(IMMERSIVE_NAME);if(d!=null){var b=d.cancelConnectOrDisconnectIndividual()}}function onConnectDisconnectPanelHide(){var b=document.getElementById("flashcontent");var a=document.getElementById("personalPhotoContainer");if(b&&a){b.style.width="100%";a.innerHTML=""}}function connectDisconnectProcessDone(b){var a=location.href;if(a.indexOf("rootIndivudalID=")>=0){a=a.replace(/rootIndivudalID=[0-9]+/,"rootIndivudalID="+b)}else{if(a.indexOf("?")>=0){a+="&"}else{a+="?"}a+="rootIndivudalID="+b}var c=(b-(b%1000000))/1000000;if(a.indexOf("familyTreeID=")>=0){a=a.replace(/familyTreeID=[0-9]+/,"familyTreeID="+c)}else{if(a.indexOf("?")>=0){a+="&"}else{a+="?"}a+="familyTreeID="+c}location.href=a}function displayProfilePageByCanvas(b,a){profileViaAjax(a)}function displayProfilePageByCanvasInner(e,a,b){if(typeof individualID=="undefined"||individualID==null){hideFlashShowViewProfile()}var f=new SWFObject(editPhotoPreloader,"editPhotoPreloader","65","65");f.addParam("quality","best");f.addParam("allowScriptAccess","never");f.addParam("bgcolor","#ffffff");displayLoadingData(document.getElementById("viewProfileContent"),'<table border="0" cellspacing="0" cellpadding="0" id="editPhotoPreloader" class="PageLabel" width="100%"><tr height="'+(parseInt(flashContentHeight)-50)+'"><td align="middle">'+f.getSWFHTML()+"</td></tr></table>");if(typeof loadProfileFromCanvas!="undefined"){loadProfileFromCanvas(e,a,b)}else{var c=new LazyScriptDownloader(function(){loadProfileFromCanvas(e,a,b)});c.addScript(LSDPrefix,"jQuery","jquery.js",TAGSHOT_JQUERY_JS_FILE_VERSION);c.addScript(LSDPrefix,"Tagshot/prototype","prototype.js",TAGSHOT_PROTOTYPE_JS_FILE_VERSION);c.addScript(LSDPrefix,"Members","individualsComboBox.js",MEMBERS_INDIVIDUALS_COMBO_BOX_JS_FILE_VERSION);c.addScript(LSDPrefix,"Lightbox","lightboxCombined.js",LIGHTBOX_LIGHTBOX_COMBINED_JS_FILE_VERSION);c.addScript(LSDPrefix,"Profile","Profile.js",PROFILE_PROFILE_JS_FILE_VERSION);c.addScript(LSDPrefix,"Timeline","timeline.js",TIMELINE_TIMELINE_JS_FILE_VERSION);c.startDownload();var d=new LazyCssDownloader();d.addCss(LSDPrefix,"Profile","Profile.css",PROFILE_PROFILE_CSS_FILE_VERSION);d.startDownload()}}function hideFlashShowViewProfile(){var d=document.getElementById("flashcontent");var b=document.getElementById("viewProfileContent");if(d==null){alert("flashcontent is null");return}if(b==null){alert("viewProfileContent is null");return}if(wasCanvasFullScreen){fullScreenOff();wasCanvasFullScreen=true}flashContentHeight=d.style.height;d.style.height="0px";if(!isFF){d.style.overflow="hidden"}hideImmersive();var c=document.getElementById("familyTreesComboBox");if(c){c.style.display="none"}var a=document.getElementById("masterPageFooter");if(a){a.style.display="none"}if(typeof jQuery!="undefined"){jQuery("#masterPageNotificationPanel").addClass("makpetza_grid")}b.style.display="block"}function hideViewProfileShowFlash(){var c=document.getElementById("flashcontent");var a=document.getElementById("viewProfileContent");if(c==null){alert("flashcontent is null");return}if(a==null){alert("viewProfileContent is null");return}a.style.display="none";a.innerHTML="";if(typeof jQuery!="undefined"){jQuery("#masterPageNotificationPanel").removeClass("makpetza_grid")}c.style.height=flashContentHeight;if(!isFF){c.style.overflow=""}showImmersive();if(wasCanvasFullScreen){fullScreenOn()}var b=document.getElementById("familyTreesComboBox");if(b){b.style.display="block"}}function initProfileAjax(){startProfileAnchorListener()}function startProfileAnchorListener(){checkProfileAnchorTimer=window.setInterval("checkProfileAnchor()",300)}var currentProfileAnchor="";function checkProfileAnchor(){actOnNewProfileAnchor(window.location.hash)}function actOnNewProfileAnchor(d){if(d.indexOf("#")==0){d=d.substr(1)}if(currentProfileAnchor!=d){currentProfileAnchor=d;var b=currentProfileAnchor;if(b==""&&typeof viewProfileBackClicked!="undefined"){viewProfileBackClicked();return}var e=b.match(/!profile-([0-9]+)(-[a-z]+|)/);if(e==null){return}var a=e[1];var c=e[2];if(c==""){c="info"}else{c=c.substr(1)}if(typeof individualID!="undefined"&&individualID==a){if((typeof currentTab!="undefined"&&c==currentTab)||(c!="info"&&c!="events"&&c!="timeline")){return}ajaxGetProfileTab(c)}else{displayProfilePageByCanvasInner(siteID,a,c)}}}function profileViaAjax(c,a){var b="#!profile-"+c;if(typeof a!="undefined"){b+="-"+a}crossBrowserNavigateToHash(b);checkProfileAnchor();return false};

