namespace("com.pictet.apps.fnc.web.component.basket");com.pictet.apps.fnc.web.component.basket.BasketLink=function(iDwrObject,iNoneLabel,iSingleLabel,iPluralLabel){com.pictet.apps.fnc.web.component.basket.BasketLink.superclass.constructor.call(this);this.dwrObject=iDwrObject;this.noneLabel=iNoneLabel;this.singleLabel=iSingleLabel;this.pluralLabel=iPluralLabel;};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.basket.BasketLink,com.pictet.apps.fnc.web.component.abstractcomponent.AbstractComponent);com.pictet.apps.fnc.web.component.basket.BasketLink.prototype.updateElementNumber=function(){$("#basketLinkText").css("display","none");$("#basketLinkWaitbar").css("display","block");this.onWaitbarShow.fire();var instance=this;this.dwrObject.getDocumentCount({callback:function(iDataFromServer){com.pictet.apps.fnc.web.component.basket.BasketLink.updateDisplayedNumber(iDataFromServer,instance);},errorHandler:function(errorString,exception){com.pictet.apps.fnc.web.component.basket.BasketLink.superclass.handleAjaxRemoteException(instance,errorString,exception);},textHtmlHandler:function(){com.pictet.apps.fnc.web.component.basket.BasketLink.superclass.handleAjaxSessionTimeout();}});};com.pictet.apps.fnc.web.component.basket.BasketLink.updateDisplayedNumber=function(response,iThisBasketLink){var displayedText;if(response==0){displayedText=iThisBasketLink.noneLabel.replace('{1}',"");}else if(response==1){displayedText=iThisBasketLink.singleLabel.replace('{0}',response);}else{displayedText=iThisBasketLink.pluralLabel.replace('{0}',response);}
iThisBasketLink.onWaitbarHide.fire();$("#basketLinkWaitbar").css("display","none");$("#basketLinkText").css("display","block");$("#basketLinkText").html(displayedText);};namespace("com.pictet.apps.fnc.web.component.basket");com.pictet.apps.fnc.web.component.basket.instance=null;com.pictet.apps.fnc.web.component.basket.Basket=function(componentId,iDwrObject,iPubListDwrObject,iEmptySelectionMsg,iEmptyPDFSelectionMsg,iSuccessAddingMsg,iSuccessRemovingMsg,iLoadingMsg,sendMailErrorMessage,sendMail404ErrorMessage,BrowserDoesNotSupportSendMailServiceErrorMessage,takeTooMuchTimeInfoMsg,iActionNotProceedOnMutimediaFileMsg,iActionNotProceedOnOfficeDocMsg,iUnableToSaveMultimediaDocMsg,iUnableToPrintMultimediaDocMsg,iUnableToPrintOfficeDocMsg,iUnableToSendMultimediaDocMsg,closeMessageLabel,getZipAttachmentUrl,getDocumentUrl,getPrintUrl,paramSeparator,iSepIdAndType,iFormatType,messagePaneCssUrl,iOfficeFormats,iPdfFormats,iMultimediaFormats,actionMediaPopupId,actionOfficePopupId,iUnableToSendManyDocumentsMsg,iUnableToZipSendManyDocumentsMsg,iLimitSendPrintSaveDoc){com.pictet.apps.fnc.web.component.basket.Basket.superclass.constructor.call(this,componentId);this.componentId=componentId;this.dwrObject=iDwrObject;this.pubListDwrObject=iPubListDwrObject;this.emptySelectionMsg=iEmptySelectionMsg;this.emptyPDFSelectionMsg=iEmptyPDFSelectionMsg;this.successAddingMsg=iSuccessAddingMsg;this.successRemovingMsg=iSuccessRemovingMsg;this.loadingMsg=iLoadingMsg;this.sendMailErrorMessage=sendMailErrorMessage;this.sendMail404ErrorMessage=sendMail404ErrorMessage;this.browserDoesNotSupportSendMailServiceErrorMessage=BrowserDoesNotSupportSendMailServiceErrorMessage;this.takeTooMuchTimeInfoMsg=takeTooMuchTimeInfoMsg;this.actionNotProceedOnMutimediaFileMsg=iActionNotProceedOnMutimediaFileMsg;this.actionNotProceedOnOfficeDocMsg=iActionNotProceedOnOfficeDocMsg;this.unableToSaveMultimediaDocMsg=iUnableToSaveMultimediaDocMsg;this.unableToPrintMultimediaDocMsg=iUnableToPrintMultimediaDocMsg;this.unableToPrintOfficeDocMsg=iUnableToPrintOfficeDocMsg;this.unableToSendMultimediaDocMsg=iUnableToSendMultimediaDocMsg;this.closeMessageLabel=closeMessageLabel;this.paramSeparator=paramSeparator;this.paramSepIdAndType=iSepIdAndType;this.formatType=iFormatType;this.messagePaneCssUrl=messagePaneCssUrl;this.onAddingFinish=new YAHOO.util.CustomEvent("onAddingFinish");this.onRemovingFinish=new YAHOO.util.CustomEvent("onRemovingFinish");this.onHasNonPDFInSelection=new YAHOO.util.CustomEvent("onHasNonPDFInSelection");this.officeFormats=iOfficeFormats;this.pdfFormats=iPdfFormats;this.multimediaFormats=iMultimediaFormats;this.unableToSendManyDocumentsMsg=iUnableToSendManyDocumentsMsg;this.unableToZipSendManyDocumentsMsg=iUnableToZipSendManyDocumentsMsg;this.limitSendPrintSaveDoc=iLimitSendPrintSaveDoc;this.actionMediaPopupId=actionMediaPopupId;this.actionOfficePopupId=actionOfficePopupId;var prefix=location.pathname.split('/');prefix.pop();var requestUrlPrefix=location.protocol+"//"+location.host+prefix.join('/')+"/";if(getDocumentUrl){this.fileLocationUrl=requestUrlPrefix+getDocumentUrl;}
if(getZipAttachmentUrl){this.zipfileLocationUrl=requestUrlPrefix+getZipAttachmentUrl;}
if(getPrintUrl){this.printLocationUrl=requestUrlPrefix+getPrintUrl;}
com.pictet.apps.fnc.web.component.basket.instance=this;};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.basket.Basket,com.pictet.apps.fnc.web.component.abstractcomponent.AbstractComponent);com.pictet.apps.fnc.web.component.basket.Basket.getInstance=function(){return com.pictet.apps.fnc.web.component.basket.instance;};com.pictet.apps.fnc.web.component.basket.Basket.prototype.removeABasketFromList=function(basketTableId,iId){if(iId!=""){var arrId=[];arrId.push(iId);if(arrId.length>0){this.removeBasketFromList(arrId);}}else{mainMessagePane.removeMessages();YAHOO.log("No document was selected","info");this.onMessage.fire([new com.pictet.apps.fnc.web.component.Message(this.emptySelectionMsg,"warning")]);}};com.pictet.apps.fnc.web.component.basket.Basket.prototype.removeSelectionFromList=function(basketTableId,docList){if(docList!=""){var arrTemp=[];arrTemp=docList.split(this.paramSeparator);var arrId=[];for(var i=0;i<arrTemp.length;i++){var arrIdType=[];arrIdType=arrTemp[i].split(this.paramSepIdAndType);if(arrIdType.length==2&&arrIdType[0]!=""){arrId.push(arrIdType[0]);}}
if(arrId.length>0){basketTableId.displayLoadingMessage();this.removeBasketFromList(arrId);}}else{mainMessagePane.removeMessages();YAHOO.log("No document was selected","info");this.onMessage.fire([new com.pictet.apps.fnc.web.component.Message(this.emptySelectionMsg,"warning")]);}};com.pictet.apps.fnc.web.component.basket.Basket.prototype.addDocuments=function(docIds){var messages=[];if(!docIds){mainMessagePane.removeMessages();messages[0]=new com.pictet.apps.fnc.web.component.Message(this.emptySelectionMsg,"warning");this.onMessage.fire(messages);}else{var instance=this;mainMessagePane.removeMessages();messages[0]=new com.pictet.apps.fnc.web.component.Message(this.loadingMsg,"info");this.onMessage.fire(messages);this.dwrObject.addDocuments(docIds.split(this.paramSeparator),{callback:function(iDataFromServer){com.pictet.apps.fnc.web.component.basket.Basket.afterAddDocuments(iDataFromServer,instance);},errorHandler:function(errorString,exception){mainMessagePane.removeMessages();com.pictet.apps.fnc.web.component.basket.Basket.superclass.handleAjaxRemoteException(instance,errorString,exception);},textHtmlHandler:function(){com.pictet.apps.fnc.web.component.basket.Basket.superclass.handleAjaxSessionTimeout();}});}};com.pictet.apps.fnc.web.component.basket.Basket.prototype.removeBasketFromList=function(docIds){if(!docIds||docIds.length==0){mainMessagePane.removeMessages();var messages=[];messages[0]=new com.pictet.apps.fnc.web.component.Message(this.emptySelectionMsg,"warning");this.onMessage.fire(messages);}else{var instance=this;this.dwrObject.removeDocuments(docIds,{callback:function(){com.pictet.apps.fnc.web.component.basket.Basket.afterRemoveDocuments(instance);},errorHandler:function(errorString,exception){com.pictet.apps.fnc.web.component.basket.Basket.superclass.handleAjaxRemoteException(instance,errorString,exception);},textHtmlHandler:function(){com.pictet.apps.fnc.web.component.basket.Basket.superclass.handleAjaxSessionTimeout();}});}};com.pictet.apps.fnc.web.component.basket.Basket.afterAddDocuments=function(response,iThisBasket){mainMessagePane.removeMessages();iThisBasket.onAddingFinish.fire();var errMsgs=response['errorAddingMsg'];var messages=[];if(errMsgs.length>0){for(var i=0;i<errMsgs.length;i++){messages.push(new com.pictet.apps.fnc.web.component.Message(errMsgs[i],"warning"));}}else{messages.push(new com.pictet.apps.fnc.web.component.Message(iThisBasket.successAddingMsg,"info"));}
iThisBasket.onMessage.fire(messages);};com.pictet.apps.fnc.web.component.basket.Basket.afterRemoveDocuments=function(iThisBasket){mainMessagePane.removeMessages();iThisBasket.onRemovingFinish.fire();var messages=[];var message=new com.pictet.apps.fnc.web.component.Message(iThisBasket.successRemovingMsg,"info");messages.push(message);iThisBasket.onMessage.fire(messages);};com.pictet.apps.fnc.web.component.basket.Basket.prototype.sendMail=function(recipient,attachmentFileId,isZip){mainMessagePane.removeMessages();try{var attachments=[];var ua=navigator.userAgent.toLowerCase();if(ua.indexOf('msie')==-1){this.onMessage.fire([new com.pictet.apps.fnc.web.component.Message(this.browserDoesNotSupportSendMailServiceErrorMessage,"error")]);}else if(attachmentFileId){this.onMessage.fire([]);var arrTemp=[];var arrDocPdfAttachment=[];arrTemp=attachmentFileId.split(this.paramSeparator);var nOfficeDoc=0;var nPdfDoc=0;var nMultimediaDoc=0;for(var i=0;i<arrTemp.length;i++){var arrIdType=[];arrIdType=arrTemp[i].split(this.paramSepIdAndType);if(arrIdType.length==2&&arrIdType[0]!=""){if(this.isPdfDocument(arrIdType[1])){nPdfDoc++;arrDocPdfAttachment.push(arrTemp[i]);}else if(this.isMultimediaDocument(arrIdType[1])){nMultimediaDoc++;}else{nOfficeDoc++;arrDocPdfAttachment.push(arrTemp[i]);}}}
var messages=[];if(nMultimediaDoc>0){if(nOfficeDoc+nPdfDoc>0){messages.push(new com.pictet.apps.fnc.web.component.Message(this.unableToSendMultimediaDocMsg,"warning"));}else{mainMessagePane.removeMessages();this.actionMediaPopupId.show();return;}}
var tooManyDocs=false;if(nOfficeDoc+nPdfDoc>this.limitSendPrintSaveDoc){if(isZip){messages.push(new com.pictet.apps.fnc.web.component.Message(this.unableToZipSendManyDocumentsMsg,"warning"));}else{messages.push(new com.pictet.apps.fnc.web.component.Message(this.unableToSendManyDocumentsMsg,"warning"));}
tooManyDocs=true;}
if(messages.length>0){this.onMessage.fire(messages);}
if(tooManyDocs){return;}
if(isZip==true){attachments=[this.zipfileLocationUrl+"?basketDocList="+this.createSortedDocumentListAsStr(arrDocPdfAttachment.join(this.paramSeparator))];}else{attachments=this.createSortedAttachmentList(arrDocPdfAttachment.join(this.paramSeparator));}
var instance=this;this.dwrObject.getMailSubjectAndBody({callback:function(data){var subject=data[0];var body=data[1];var memo=new NotesMemoFactory(recipient,subject,body,attachments,100*1024*1024*1024);memo.createMemos();return true;},errorHandler:function(errorString,exception){com.pictet.apps.fnc.web.component.basket.Basket.superclass.handleAjaxRemoteException(instance,errorString,exception);},textHtmlHandler:function(){com.pictet.apps.fnc.web.component.basket.Basket.superclass.handleAjaxSessionTimeout();}});}else{YAHOO.log("No attachment was selected","info");this.onMessage.fire([new com.pictet.apps.fnc.web.component.Message(this.emptySelectionMsg,"warning")]);return false;}}catch(e){if(e.cause=="404"){this.onMessage.fire([new com.pictet.apps.fnc.web.component.Message(this.sendMail404ErrorMessage,"error")]);}else{this.onMessage.fire([new com.pictet.apps.fnc.web.component.Message(this.sendMailErrorMessage+"\n"+e.message,"error")]);}
return false;}};com.pictet.apps.fnc.web.component.basket.Basket.prototype.saveSelectedDocument=function(docList){if(docList!=""){var arrTemp=[];arrTemp=docList.split(this.paramSeparator);var arrOfficeDoc=[];var arrPdfDoc=[];var arrMultimediaDoc=[];for(var i=0;i<arrTemp.length;i++){var arrIdType=[];arrIdType=arrTemp[i].split(this.paramSepIdAndType);if(arrIdType.length==2&&arrIdType[0]!=""){if(this.isPdfDocument(arrIdType[1])){arrPdfDoc.push(arrIdType[0]);}else if(this.isMultimediaDocument(arrIdType[1])){arrMultimediaDoc.push(arrIdType[0]);}else{arrOfficeDoc.push(arrIdType[0]);}}}
if(arrOfficeDoc.length+arrPdfDoc.length+arrMultimediaDoc.length>0){mainMessagePane.removeMessages();if(arrMultimediaDoc.length>0){if(arrOfficeDoc.length+arrPdfDoc.length>0){this.onMessage.fire([new com.pictet.apps.fnc.web.component.Message(this.unableToSaveMultimediaDocMsg,"warning")]);}else{mainMessagePane.removeMessages();this.actionMediaPopupId.show();return;}}else{this.onMessage.fire([new com.pictet.apps.fnc.web.component.Message(this.takeTooMuchTimeInfoMsg,"info")]);}
var instance=this;this.pubListDwrObject.canSaveDocuments(arrOfficeDoc.concat(arrPdfDoc),{callback:function(iDataFromServer){com.pictet.apps.fnc.web.component.basket.Basket.handleSaveAfterCheckToSave(iDataFromServer,instance);},errorHandler:function(errorString,exception){com.pictet.apps.fnc.web.component.basket.Basket.superclass.handleAjaxRemoteException(instance,errorString,exception);},textHtmlHandler:function(){com.pictet.apps.fnc.web.component.basket.Basket.superclass.handleAjaxSessionTimeout();}});}}else{mainMessagePane.removeMessages();YAHOO.log("No document was selected","info");this.onMessage.fire([new com.pictet.apps.fnc.web.component.Message(this.emptySelectionMsg,"warning")]);}};com.pictet.apps.fnc.web.component.basket.Basket.handleSaveAfterCheckToSave=function(response,iThisBasket){mainMessagePane.removeMessages();var arrId=response['publicationDocumentId'];var errMsg=response['errorSaveOrPrintMsg'];var messages=[];if(errMsg!=null&&errMsg!=""){var message=new com.pictet.apps.fnc.web.component.Message(errMsg,"warning");messages.push(message);iThisBasket.onMessage.fire(messages);}else{iThisBasket.generateIframe(arrId,iThisBasket.zipfileLocationUrl,false);}};com.pictet.apps.fnc.web.component.basket.Basket.prototype.printSelectedDocument=function(docList){if(docList!=""){var arrTemp=[];arrTemp=docList.split(this.paramSeparator);var arrId=[];var nOfficeDoc=0;var nPdfDoc=0;var nMultimediaDoc=0;for(var i=0;i<arrTemp.length;i++){var arrIdType=[];arrIdType=arrTemp[i].split(this.paramSepIdAndType);if(arrIdType.length==2&&arrIdType[1]!=""&&arrIdType[1]==this.formatType&&arrIdType[0]!=""){arrId.push(arrIdType[0]);}
if(this.isOfficeDocument(arrIdType[1])){nOfficeDoc++;}else if(this.isPdfDocument(arrIdType[1])){nPdfDoc++;}else if(this.isMultimediaDocument(arrIdType[1])){nMultimediaDoc++;}}
var messages=[];if(nMultimediaDoc>0){if(nOfficeDoc+nPdfDoc>0){messages.push(new com.pictet.apps.fnc.web.component.Message(this.unableToPrintMultimediaDocMsg,"warning"));}else{mainMessagePane.removeMessages();this.actionMediaPopupId.show();return;}}
if(nOfficeDoc>0){if(nPdfDoc+nMultimediaDoc>0){messages.push(new com.pictet.apps.fnc.web.component.Message(this.unableToPrintOfficeDocMsg,"warning"));}else{mainMessagePane.removeMessages();this.actionOfficePopupId.show();return;}}
if(arrId.length>0){if(arrId.length<arrTemp.length){this.onHasNonPDFInSelection.fire(arrId);}else{mainMessagePane.removeMessages();var instance=this;this.pubListDwrObject.canPrintDocuments(arrId,{callback:function(iDataFromServer){com.pictet.apps.fnc.web.component.basket.Basket.handlePrintAfterCheckToPrint(iDataFromServer,instance);},errorHandler:function(errorString,exception){com.pictet.apps.fnc.web.component.basket.Basket.superclass.handleAjaxRemoteException(instance,errorString,exception);},textHtmlHandler:function(){com.pictet.apps.fnc.web.component.basket.Basket.superclass.handleAjaxSessionTimeout();}});}}else{mainMessagePane.removeMessages();YAHOO.log("No PDF document was selected","info");this.onMessage.fire([new com.pictet.apps.fnc.web.component.Message(this.emptyPDFSelectionMsg,"warning")]);}
if(messages.length>0){mainMessagePane.removeMessages();this.onMessage.fire(messages);}}else{mainMessagePane.removeMessages();YAHOO.log("No document was selected","info");this.onMessage.fire([new com.pictet.apps.fnc.web.component.Message(this.emptySelectionMsg,"warning")]);}};com.pictet.apps.fnc.web.component.basket.Basket.handlePrintAfterCheckToPrint=function(response,iThisBasket){mainMessagePane.removeMessages();var arrId=response['publicationDocumentId'];var errMsg=response['errorSaveOrPrintMsg'];var messages=[];if(errMsg!=null&&errMsg!=""){var message=new com.pictet.apps.fnc.web.component.Message(errMsg,"warning");messages.push(message);iThisBasket.onMessage.fire(messages);}else{iThisBasket.onMessage.fire([new com.pictet.apps.fnc.web.component.Message(iThisBasket.takeTooMuchTimeInfoMsg,"info")]);iThisBasket.generateIframe(arrId,iThisBasket.printLocationUrl,false);}};com.pictet.apps.fnc.web.component.basket.Basket.prototype.generateIframe=function(arrId,locationUrl,onNewWindow){if($("#basketFrame")){$("#basketFrame").remove();}
var iFrame=document.createElement("iframe");iFrame.id="basketFrame";iFrame.style.height='0px';iFrame.style.border='none';iFrame.src='javascript:false;';document.body.appendChild(iFrame);var iframBody=['<html><head><link rel="stylesheet" type="text/css" href="',this.messagePaneCssUrl,'"/></head><body onload="startDownload()">','<form id="dwnForm" method="POST" action="',locationUrl,'" >','<input name="basketDocList" type="hidden" value="',com.pictet.apps.fnc.web.component.basket.Basket.prototype.createSortedDocumentListAsStr(arrId.join(this.paramSeparator)),'"/>','</form>','<script type="text/javascript">function startDownload() {document.getElementById(\'dwnForm\').submit();}','function hideMessage() {document.getElementById(\'messageArea\').style.display = "none";}</script>','<div id="messageArea" style="width: 95%; margin-top: 20px; margin-left: 20px; border: 1px solid #BDBDBD; background-color: #FFFFE1">','<table cellpadding="0" cellspacing="0" width="98%" style="margin-top: 5px; margin-bottom: 5px; margin-left: 8px;">','<tr><td style="vertical-align: top; width: 18px;">','<div class="messagePane"><div class="infoMessageIcon" style="font-size: 10; margin-top: 5px;">&#160;</div></div>','</td><td><table width="100%"><tr><td><div style="margin-left: 10px; color: #9A0000; width: 100%;  font-family: Verdana; font-size: 11px;">',this.takeTooMuchTimeInfoMsg,'</div></td></tr><tr><td align="right">','<div style="width: 50px; cursor: pointer; font-size: 12;" onclick="hideMessage()">',this.closeMessageLabel,'</div>','</td></tr></table></td></tr></table></div></body></html>'];var doc=null;if(onNewWindow){doc=window.open("javascript:false").document;}else{if(iFrame.contentDocument){doc=iFrame.contentDocument;}else if(iFrame.contentWindow){doc=iFrame.contentWindow.document;}else if(iFrame.document){doc=iFrame.document;}}
doc.open();doc.write(iframBody.join(""));doc.close();};com.pictet.apps.fnc.web.component.basket.Basket.prototype.createSortedDocumentListAsStr=function(docList){if(docList!=""){var fileList=[];var selectedDocumentIDs=docList.split(this.paramSeparator);for(var i=0;i<selectedDocumentIDs.length;i++){if(selectedDocumentIDs[i]){if(selectedDocumentIDs[i]!='-'){YAHOO.log("Attachment File "+i+" : "+selectedDocumentIDs[i],"debug");fileList.push(selectedDocumentIDs[i]);}}}
fileList.sort();YAHOO.log("File list "+fileList.join(this.paramSeparator));return fileList.join();}
return"";};com.pictet.apps.fnc.web.component.basket.Basket.prototype.createSortedAttachmentList=function(docList){var fileList=[];if(docList!=""){var selectedDocumentIDs=docList.split(this.paramSeparator);for(var i=0;i<selectedDocumentIDs.length;i++){if(selectedDocumentIDs[i]){if(selectedDocumentIDs[i]!='-'){YAHOO.log("Attachment File "+i+" : "+selectedDocumentIDs[i].split(this.paramSepIdAndType)[0],"debug");fileList.push(this.fileLocationUrl+selectedDocumentIDs[i].split(this.paramSepIdAndType)[0]);}}}}
return fileList;};com.pictet.apps.fnc.web.component.basket.Basket.prototype.printPdf=function(arrId){mainMessagePane.removeMessages();this.onMessage.fire([new com.pictet.apps.fnc.web.component.Message(this.takeTooMuchTimeInfoMsg,"info")]);this.generateIframe(arrId,this.printLocationUrl,false);};com.pictet.apps.fnc.web.component.basket.Basket.prototype.isOfficeDocument=function(type){for(var i=0;i<this.officeFormats.length;i++){if(type==this.officeFormats[i]){return true;}}
return false;};com.pictet.apps.fnc.web.component.basket.Basket.prototype.isPdfDocument=function(type){for(var i=0;i<this.pdfFormats.length;i++){if(type==this.pdfFormats[i]){return true;}}
return false;};com.pictet.apps.fnc.web.component.basket.Basket.prototype.isMultimediaDocument=function(type){for(var i=0;i<this.multimediaFormats.length;i++){if(type==this.multimediaFormats[i]){return true;}}
return false;};namespace("com.pictet.apps.fnc.web.business.myfundcenter");com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet=function(iFundTableGenerated,iCategoryValueSeparator,iCategoryCategorySeparator,iHiddenClusterFilterTextField,iFundTable,iDynamicSelection,iDynamicStatus,iSingleSelectionLabel,iPluralSelectionLabel,iStaticStatus,noneSortValue,ascSortValue,desSortValue,customSortValue,iDataChanged,iCanEditFundsSets,iIsDynamicCurrentFundsSet,iIsDynamicFundsList,isResetButtonClickTextField){this.fundTableGenerated=iFundTableGenerated;this.categoryValueSeparator=iCategoryValueSeparator;this.categoryCategorySeparator=iCategoryCategorySeparator;this.hiddenClusterFilterTextField=iHiddenClusterFilterTextField;this.fundTable=iFundTable;this.dynamicSelection=iDynamicSelection;this.dynamicStatus=iDynamicStatus;this.singleSelectionLabel=iSingleSelectionLabel;this.pluralSelectionLabel=iPluralSelectionLabel;this.staticStatus=iStaticStatus;this.sortType=[];this.sortType['none']=noneSortValue;this.sortType['asc']=ascSortValue;this.sortType['desc']=desSortValue;this.sortType['custom']=customSortValue;this.iDataChanged=iDataChanged;this.canEditFundsSets=iCanEditFundsSets;this.isDynamicCurrentFundsSet=iIsDynamicCurrentFundsSet;this.isDynamicFundsList=iIsDynamicFundsList;this.fundTableLoadDataFinish=false;this.defaultSelectedItemsNb=0;this.fundTableSize=0;this.isWithCluster=false;this.isResetButtonClickTextField=isResetButtonClickTextField;if(this.hiddenClusterFilterTextField.getValueAsStr()!=""){this.isWithCluster=true;}};com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.prototype.handleClusterChanged=function(type,arg){if(this.iDataChanged==false&&this.canEditFundsSets==true){this.iDataChanged=true;}
var criteriaList=arg[0];var strVal=[];if((typeof(this.isResetButtonClickTextField)=="undefined")||this.isResetButtonClickTextField.getValueAsStr()!="true"){for(var iKey in criteriaList){strVal.push(iKey);}
this.isWithCluster=strVal.length>0;}
this.hiddenClusterFilterTextField.setValue(strVal.join(this.categoryCategorySeparator));this.fundTableLoadDataFinish=false;this.defaultSelectedItemsNb=0;this.fundTable.applyExternalFiltersAndReloadTable();};com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.prototype.updateFundTableSize=function(type,arg){this.fundTableSize=arg[0].size;};com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.prototype.handleFundTableSelectionChanged=function(type,arg){var selectionObject=arg[0];if(this.fundTableLoadDataFinish){if(this.iDataChanged==false&&this.canEditFundsSets==true){this.iDataChanged=true;}
this.updateStatusAndTitleZone(selectionObject.size);this.defaultSelectedItemsNb=selectionObject.size;}else{this.defaultSelectedItemsNb=selectionObject.size;}};com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.prototype.updateStatusZoneAfterAsynchorousCallFinish=function(type,arg){this.fundTableLoadDataFinish=true;this.updateStatusAndTitleZone(this.defaultSelectedItemsNb);};com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.prototype.updateStatusAndTitleZone=function(itemsSelectedNb){var statusTextContent="";var hiddenSelectedFundsNb=nbOfHiddenSelectedFunds;if(hiddenSelectedFundsNb>0||(itemsSelectedNb!=this.fundTableSize&&itemsSelectedNb!=0)){$("#statusZoneType").addClass("staticFundSet").removeClass("dynamicFundSet").removeClass("noFundsFundSet");dynamicStaticTextField.setValue("false");var nbSelection="";var totalSelectedFunds=hiddenSelectedFundsNb+itemsSelectedNb;if(totalSelectedFunds==1){nbSelection=this.singleSelectionLabel.replace('{0}',["<b>",totalSelectedFunds,"</b>"].join(""));}else{nbSelection=this.pluralSelectionLabel.replace('{0}',["<b>",totalSelectedFunds,"</b>"].join(""));}
statusTextContent=[nbSelection,"<br/>",this.staticStatus].join("");}else{dynamicStaticTextField.setValue("true");if(this.isWithCluster){$("#statusZoneType").addClass("dynamicFundSet").removeClass("staticFundSet").removeClass("noFundsFundSet");if(itemsSelectedNb==0){statusTextContent=[this.dynamicSelection,"<br/>",this.dynamicStatus].join("");}else{var nbSelection="";if(itemsSelectedNb==1){nbSelection=this.singleSelectionLabel.replace('{0}',["<b>",itemsSelectedNb,"</b>"].join(""));}else{nbSelection=this.pluralSelectionLabel.replace('{0}',["<b>",itemsSelectedNb,"</b>"].join(""));}
statusTextContent=[nbSelection,"<br/>",this.dynamicStatus].join("");}}else{$("#statusZoneType").addClass("noFundsFundSet").removeClass("dynamicFundSet").removeClass("staticFundSet");statusTextContent=this.dynamicSelection;}}
$("#statusText").html(statusTextContent);}
com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.prototype.sortSelectionList=function(sortType){if(sortType==this.sortType['none']){this.changeToNoneSort();}else if(sortType==this.sortType['asc']){this.changeToAscSort();}else if(sortType==this.sortType['desc']){this.changeToDescSort();}else if(sortType==this.sortType['custom']){this.changeToCustomSort();}};com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.prototype.changeToAscSort=function(){$("#noneSort").addClass("hidden");$("#ascend").removeClass("hidden");$("#descend").addClass("hidden");$("#custom").addClass("hidden");$("#sortedZone").removeClass("custom");$("#sortedZone").removeClass("none").addClass("ascend");newSelectionList.sort(newSelectionList.SORT_ASC);sortTypeField.setValue(this.sortType['asc']);};com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.prototype.changeToDescSort=function(){$("#noneSort").addClass("hidden");$("#ascend").addClass("hidden");$("#descend").removeClass("hidden");$("#custom").addClass("hidden");$("#sortedZone").removeClass("custom");$("#sortedZone").removeClass("ascend").addClass("descend");newSelectionList.sort(newSelectionList.SORT_DESC);sortTypeField.setValue(this.sortType['desc']);};com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.prototype.changeToNoneSort=function(){$("#noneSort").removeClass("hidden");$("#ascend").addClass("hidden");$("#descend").addClass("hidden");$("#custom").addClass("hidden");$("#sortedZone").removeClass("custom");$("#sortedZone").removeClass("descend").addClass("none");newSelectionList.sort(newSelectionList.SORT_NONE);sortTypeField.setValue(this.sortType['none']);};com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.prototype.changeToCustomSort=function(){$("#noneSort").addClass("hidden");$("#ascend").addClass("hidden");$("#descend").addClass("hidden");$("#custom").removeClass("hidden");$("#sortedZone").removeClass("none");$("#sortedZone").removeClass("ascend");$("#sortedZone").removeClass("descend");$("#sortedZone").addClass("custom");newSelectionList.sort(newSelectionList.SORT_CUSTOM);sortTypeField.setValue(this.sortType['custom']);};com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.prototype.markErrorComponents=function(errorComponentList){var isSetFocus=false;for(var i=0;i<errorComponentList.length;i++){errorComponentList[i].markInvalid();if(!isSetFocus&&errorComponentList[i].focus()){isSetFocus=true;}}};com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.prototype.showPopup=function(){confirmLeave.show();};com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.prototype.hidePopup=function(){confirmLeave.hide();};com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.prototype.handleFinishEditing=function(){if(this.iDataChanged==false&&this.canEditFundsSets==true){this.iDataChanged=true;}};com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.prototype.handleSaveFundsList=function(){if(this.iDataChanged==false){fundsListForm.submitForm(fundsListForm.getUrlLink()+"&_eventId=saveFL");}else{confirmToSave.show();}};com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.prototype.handleSaveAsFundsList=function(){if(this.iDataChanged==false){fundsListForm.submitForm(fundsListForm.getUrlLink()+"&_eventId=saveAsFL");}else{confirmToSave.show();}};com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.generateTooltipContentForDynamic=function(selectedListJson){var res=["<div class=\"cluster\" style=\"background-color:transparent;border-bottom:none;\"><div class=\"selectedFacetsList\" style=\"border-top:none;\"><ul id=\"tooltip_listOfCriteria\">"];var first=true;for(var j=0;j<selectedListJson.length;j++){if(selectedListJson[j].children!==null&&selectedListJson[j].children.length>0){if(first==true){res.push("<li class=\"criteriaTitle\" style=\"border-top-width:0px;\">",selectedListJson[j].label);first=false;}else{res.push("<li class=\"criteriaTitle\">",selectedListJson[j].label);}
res.push("<ul>",com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.generateTooltipChildren(selectedListJson[j].children),"</ul></li>");}else{if(first==true){res.push("<li class=\"criteriaTitle\" style=\"border-top-width:0px;\">",selectedListJson[j].label,"</li>");first=false;}else{res.push("<li class=\"criteriaTitle\">",selectedListJson[j].label,"</li>");}}}
res.push("</ul></div></div>");return res.join("");};com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.generateTooltipChildren=function(parentNodeObject){var myHtml=[];for(var k=0;k<parentNodeObject.length;k++){var facetKey=parentNodeObject[k].key.substr(0,parentNodeObject[k].key.indexOf("::"));if(parentNodeObject[k].children!==null&&parentNodeObject[k].children.length>0){myHtml=["<li><div class=\"criteriaForToolTip\">","<div class=\"left\">",parentNodeObject[k].label,"</div></div>","<ul>",com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.generateTooltipChildren(parentNodeObject[k].children),"</ul></li>"];}else{myHtml=["<li><div class=\"criteriaForToolTip\">","<div class=\"left\">",parentNodeObject[k].label,"</div></div> </li>"];}}
return myHtml.join("");};com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.prototype.handleSaveExport=function(){if(this.iDataChanged==false){fundsListForm.submitForm(fundsListForm.getUrlLink()+"&_eventId=saveExport");}else{confirmToSave.show();}};com.pictet.apps.fnc.web.business.myfundcenter.FundsListDetailFundsSet.prototype.handleSaveAsExport=function(){if(this.iDataChanged==false){fundsListForm.submitForm(fundsListForm.getUrlLink()+"&_eventId=saveAsExport");}else{confirmToSave.show();}};namespace("com.pictet.apps.fnc.web.business.funds");com.pictet.apps.fnc.web.business.funds.FundsList=function(fundListTable,isAllowedSaveList,saveToolTip){this.fundListTable=fundListTable;this.isAllowedSaveList=isAllowedSaveList;this.saveToolTip=saveToolTip;}
com.pictet.apps.fnc.web.business.funds.FundsList.prototype.handleListSizeChange=function(type,arg){if(this.fundListTable.getWichInternalFilter()==null){this.handleTableInternalFilterChange(type,arg);}}
com.pictet.apps.fnc.web.business.funds.FundsList.prototype.handleTableInternalFilterChange=function(type,arg){if(this.isAllowedSaveList=='false'){$("#fundsListNameDiv").removeClass("listNameSaveIconEnabled").addClass("listNameSaveIconDisabled");YAHOO.util.Event.removeListener("fundsListNameDiv","click");$("#fundsListNameDiv").attr("title","");return;}
var eventData=arg[0];var fundIdList=this.fundListTable.getElementsOfColumn('fundId');var externalFilter=this.fundListTable.getExternalFilters();var internalFilter=this.fundListTable.getInternalFilters();var clusterFilter=externalFilter['clusterFilter'];var isClearInternalFilter=true;for(var column in internalFilter){if(internalFilter[column]['values']){isClearInternalFilter=false;break;}}
if(eventData==null){if(clusterFilter){$("#fundsListNameDiv").removeClass("listNameSaveIconDisabled").addClass("listNameSaveIconEnabled");this.addClickListener("fundsListNameDiv");$("#fundsListNameDiv").attr("title",this.saveToolTip);}else{$("#fundsListNameDiv").removeClass("listNameSaveIconEnabled").addClass("listNameSaveIconDisabled");YAHOO.util.Event.removeListener("fundsListNameDiv","click");$("#fundsListNameDiv").attr("title","");}}else if(fundIdList.length!=0){if(isClearInternalFilter){if(clusterFilter){$("#fundsListNameDiv").removeClass("listNameSaveIconDisabled").addClass("listNameSaveIconEnabled");this.addClickListener("fundsListNameDiv");$("#fundsListNameDiv").attr("title",this.saveToolTip);}else{$("#fundsListNameDiv").removeClass("listNameSaveIconEnabled").addClass("listNameSaveIconDisabled");YAHOO.util.Event.removeListener("fundsListNameDiv","click");$("#fundsListNameDiv").attr("title","");}}else{$("#fundsListNameDiv").removeClass("listNameSaveIconDisabled").addClass("listNameSaveIconEnabled");this.addClickListener("fundsListNameDiv");$("#fundsListNameDiv").attr("title",this.saveToolTip);}}else{$("#fundsListNameDiv").removeClass("listNameSaveIconEnabled").addClass("listNameSaveIconDisabled");YAHOO.util.Event.removeListener("fundsListNameDiv","click");$("#fundsListNameDiv").attr("title","");}}
com.pictet.apps.fnc.web.business.funds.FundsList.prototype.handleTableNewRequest=function(type,arg){if(this.isAllowedSaveList=='false'){$("#fundsListNameDiv").removeClass("listNameSaveIconEnabled").addClass("listNameSaveIconDisabled");YAHOO.util.Event.removeListener("fundsListNameDiv","click");$("#fundsListNameDiv").attr("title","");return;}
var externalFilter=this.fundListTable.getExternalFilters();var clusterFilter=externalFilter['clusterFilter'];if(clusterFilter){$("#fundsListNameDiv").removeClass("listNameSaveIconDisabled").addClass("listNameSaveIconEnabled");this.addClickListener("fundsListNameDiv");$("#fundsListNameDiv").attr("title",this.saveToolTip);}else{$("#fundsListNameDiv").removeClass("listNameSaveIconEnabled").addClass("listNameSaveIconDisabled");YAHOO.util.Event.removeListener("fundsListNameDiv","click");$("#fundsListNameDiv").attr("title","");}}
com.pictet.apps.fnc.web.business.funds.FundsList.prototype.addClickListener=function(componentId){YAHOO.util.Event.removeListener(componentId,"click");YAHOO.util.Event.addListener(componentId,"click",this.onSaveIconClick,this,true);}
com.pictet.apps.fnc.web.business.funds.FundsList.prototype.onSaveIconClick=function(){this.save();}
com.pictet.apps.fnc.web.business.funds.FundsList.prototype.save=function(){var fundIdList=fundListTable.getElementsOfColumn('fundId');var externalFilter=fundListTable.getExternalFilters();var clusterFilter=externalFilter['clusterFilter'];$("#clusterCriteriaFieldSave").attr('value',clusterFilter);$("#fundIdListFieldSave").attr('value',fundIdList);$("#fundListSavePopupForm").submit();}
com.pictet.apps.fnc.web.business.funds.newView=function(fundViewDetailUrl){document.location.href=fundViewDetailUrl;}
com.pictet.apps.fnc.web.business.funds.editView=function(editViewUrl){document.location.href=editViewUrl;}
com.pictet.apps.fnc.web.business.funds.editList=function(editListUrl){document.location.href=editListUrl;}
com.pictet.apps.fnc.web.business.funds.displayDetail=function(iId,fundDetailUrl,fundName){document.location.href=fundDetailUrl+"&fundId="+iId+"&fundName="+fundName;}
com.pictet.apps.fnc.web.business.funds.reloadFunds=function(){fundListTable.resetExternalFiltersAndReloadElement();}
com.pictet.apps.fnc.web.business.funds.searchFunds=function(){fundListTable.applyExternalFiltersAndReloadTable();}
com.pictet.apps.fnc.web.business.funds.saveAs=function(fundListTable,cannotSaveAsFundsList,cannotSaveAsAllFundsList,allFundsListId){var fundIdList=fundListTable.getElementsOfColumn('fundId');var externalFilter=fundListTable.getExternalFilters();var clusterFilter=externalFilter['clusterFilter'];var internalFilter=fundListTable.getInternalFilters();var listId=$("#listIdSaveAs").val();var isClearInternalFilter=true;for(var column in internalFilter){if(internalFilter[column]['values']){isClearInternalFilter=false;break;}}
if((!fundIdList&&!clusterFilter)||(fundIdList==''&&clusterFilter=='')){fundListTable.onMessage.fire([]);var messages=[];messages[0]=new com.pictet.apps.fnc.web.component.Message(cannotSaveAsFundsList,'error');fundListTable.onMessage.fire(messages);}else if(allFundsListId==listId&&(!clusterFilter||clusterFilter=='')&&isClearInternalFilter){fundListTable.onMessage.fire([]);var messages=[];messages[0]=new com.pictet.apps.fnc.web.component.Message(cannotSaveAsAllFundsList,'error');fundListTable.onMessage.fire(messages);}else{var isWithoutFilters=false;if(isClearInternalFilter&&clusterFilter==''){isWithoutFilters=true;}else{isWithoutFilters=false;}
$("#clusterCriteriaFieldSaveAs").attr('value',clusterFilter);$("#fundIdListFieldSaveAs").attr('value',fundIdList);$("#isWithoutFilters").attr('value',isWithoutFilters);$("#fundListSaveAsPopupForm").submit();}}
com.pictet.apps.fnc.web.business.funds.newExport=function(fundListTable,exportType,exportUrl){var fundIdList=fundListTable.getElementsOfColumn('fundId');var externalFilter=fundListTable.getExternalFilters();var clusterFilter=externalFilter['clusterFilter'];var hasInternalFilter=false;var internalFilter=fundListTable.getInternalFilters();for(var column in internalFilter){if(internalFilter[column]['values']){hasInternalFilter=true;break;}}
$("#clusterCriteriaFieldNewExport").attr('value',clusterFilter);$("#exportTypeFieldNewExport").attr('value',exportType);$("#fundIdListFieldNewExport").attr('value',fundIdList);$("#hasInternalFilterFieldNewExport").attr('value',hasInternalFilter);$("#fundListNewExportPopupForm").attr('action',exportUrl);$("#fundListNewExportPopupForm").submit();}
com.pictet.apps.fnc.web.business.funds.seePublicationsOfThisList=function(noFundsSelectedMessage){var fundIdList=fundListTable.getElementsOfColumn('fundId');if(!fundIdList||fundIdList==''){fundListTable.onMessage.fire([]);var messages=[];messages[0]=new com.pictet.apps.fnc.web.component.Message(noFundsSelectedMessage,'error');fundListTable.onMessage.fire(messages);}else{$("#fundIdFieldSeePublicationsOfThisList").attr('value',fundIdList);$("#seePublicationsOfThisListForm").submit();}}
com.pictet.apps.fnc.web.business.funds.openDpn=function(fundListTable,columnSeparator,valueSeparator){var fundIdList=fundListTable.getElementsOfColumn('fundId');var externalFilter=fundListTable.getExternalFilters();var clusterFilter=externalFilter['clusterFilter'];var internalFilter=fundListTable.getInternalFilters();var columnFilter="";for(var column in internalFilter){if(internalFilter[column]['values']){columnFilter+=column;columnFilter+=valueSeparator;columnFilter+=internalFilter[column]['values'];columnFilter+=columnSeparator;}}
$("#fundIdListDpn").attr('value',fundIdList);$("#dpnCluster").attr('value',clusterFilter);$("#dpnInternalFilter").attr('value',columnFilter);$("#dpnCreateForm").submit();}