/*
 * 
 * (c) Copyright Pictet & Cie 2007
 * 
 * ---------- YUI ------------
 * 
 * Copyright (c) 2007, Yahoo! Inc. All rights reserved.
 * Code licensed under the BSD License:
 * http://developer.yahoo.net/yui/license.txt
 * version: 2.5.2
 * 
 * --------- JQUERY ----------
 * 
 * jQuery 1.1.4 - New Wave Javascript
 *
 * Copyright (c) 2007 John Resig (jquery.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * Date: 2008-09-03 14:11:22 +0200 (Wed, 03 Sep 2008) 
 * $Rev: 6272 $
 * 
 * Copyright (c) 2006 Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
 *
 * $LastChangedDate: 2008-09-03 14:11:22 +0200 (Wed, 03 Sep 2008) $
 * $Rev: 6272 $
 *
 * Version: 2.2
 * 
 * 
 */

namespace("com.pictet.apps.fnc.web.component.abstractcomponent");com.pictet.apps.fnc.web.component.abstractcomponent.AbstractComponent=function(){this.onMessage=new YAHOO.util.CustomEvent("onMessage");this.onWaitbarShow=new YAHOO.util.CustomEvent("onWaitbarShow");this.onWaitbarHide=new YAHOO.util.CustomEvent("onWaitbarHide");this.onAsynchronousCallStart=new YAHOO.util.CustomEvent("onAsynchronousCallStart");this.onAsynchronousCallFinish=new YAHOO.util.CustomEvent("onAsynchronousCallFinish");this.labels=[];this.labels['label']=[];this.labels['error']=[];this.labels['warning']=[];this.labels['message']=[];this.ajaxBusinessException="com.pictet.apps.fnc.web.core.exception.BusinessException";this.ajaxServiceUnavailableExceptions=["com.pictet.apps.fnc.web.core.exception.ServiceUnavailableRuntimeException","com.pictet.apps.fnc.web.core.exception.ServiceTimeoutRuntimeException"];this.ajaxInvalidFlowAccessRuntimeException="com.pictet.apps.fnc.web.core.exception.InvalidFlowAccessRuntimeException";this.onTechnicalMessage=new YAHOO.util.CustomEvent("onTechnicalMessage");};com.pictet.apps.fnc.web.component.abstractcomponent.AbstractComponent.prototype.handleAjaxRemoteException=function(iInstance,errorString,exception)
{YAHOO.log("Error: "+errorString+" Exception: "+exception);var messages=[];function isSessionTimeout(){if(typeof exception=='undefined'){return false;}
return exception.javaClassName==iInstance.ajaxInvalidFlowAccessRuntimeException;}
function isBusinessException(){if(typeof exception=='undefined'){return false;}
if(exception.javaClassName==iInstance.ajaxBusinessException){return true;}
for(var i=0;i<iInstance.ajaxServiceUnavailableExceptions.length;i++){if(exception.javaClassName==iInstance.ajaxServiceUnavailableExceptions[i]){return true;}}
return false;}
if(isSessionTimeout()){iInstance.handleAjaxSessionTimeout();}else if(isBusinessException()){messages[0]=new com.pictet.apps.fnc.web.component.Message(errorString,"error");iInstance.onMessage.fire(messages);}else{iInstance.onTechnicalMessage.fire(exception.stackTrace);}
iInstance.onWaitbarHide.fire();iInstance.onAsynchronousCallFinish.fire();}
com.pictet.apps.fnc.web.component.abstractcomponent.AbstractComponent.prototype.handleAjaxSessionTimeout=function()
{var loginLink=window.location.href;if(loginLink){if(loginLink.lastIndexOf("#")==loginLink.length-1){loginLink=loginLink.substring(0,loginLink.length-1);}}
window.location.href=loginLink;}
com.pictet.apps.fnc.web.component.abstractcomponent.AbstractComponent.prototype.getErrorMessage=function(response){var messages=[];var messageHeader=response.messageHeader;var messageFooter=response.messageFooter;var message='';var messageContent='';if(messageFooter&&messageHeader){response.messageHeader='';response.messageFooter='';message=new com.pictet.apps.fnc.web.component.Message("","error",messageHeader,messageFooter);messages.push(message);}
for(aIdx in response){messageContent=response[aIdx];if(messageContent){message=new com.pictet.apps.fnc.web.component.Message(messageContent,"error");messages.push(message);}}
return messages;};com.pictet.apps.fnc.web.component.abstractcomponent.AbstractComponent.prototype.html2Entities=function(str){var re=/[<>"'&]/g
return str.replace(re,this.replaceHtmlCharsByEntityName);}
com.pictet.apps.fnc.web.component.abstractcomponent.AbstractComponent.prototype.replaceHtmlCharsByEntityName=function(match){if(match=="<"){return"&lt;";}else if(match==">"){return"&gt;";}else if(match=="\""){return"&quot;";}else if(match=="'"){return"&#039;";}else if(match=="&"){return"&amp;";}}
com.pictet.apps.fnc.web.component.abstractcomponent.AbstractComponent.prototype.focus=function(){return false;}
namespace("com.pictet.apps.fnc.web.component.filteredcomponent");com.pictet.apps.fnc.web.component.filteredcomponent.FilteredComponent=function(iComponentId){com.pictet.apps.fnc.web.component.filteredcomponent.FilteredComponent.superclass.constructor.call(this);this.componentId=iComponentId;};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.filteredcomponent.FilteredComponent,com.pictet.apps.fnc.web.component.abstractcomponent.AbstractComponent);com.pictet.apps.fnc.web.component.filteredcomponent.FilteredComponent.prototype.registerFilter=function(iFormInstance,iKey,iTrigger){alert("method addFilter() unimplemented in FilteredComponent subclass !");};namespace("com.pictet.apps.fnc.web.common.topmenu");com.pictet.apps.fnc.web.common.topmenu.onMenuBarReady=function(){var oMenuBar=new YAHOO.widget.MenuBar("topMenu",{iframe:false,minscrollheight:300,autosubmenudisplay:true,hidedelay:1000,showdelay:150,lazyload:true,width:"auto"});oMenuBar.render();};var menuOverLastTimestamp=(new Date()).getTime();com.pictet.apps.fnc.web.common.topmenu.firstLevelClick=function(e){if(menuOverLastTimestamp+500>(new Date()).getTime())
{if(e.stopPropagation!=null){e.stopPropagation();}else{e.cancelBubble=true;}}}
com.pictet.apps.fnc.web.common.topmenu.firstLevelOver=function(e){menuOverLastTimestamp=new Date().getTime();}
namespace("com.pictet.apps.fnc.web.common.layout");com.pictet.apps.fnc.web.common.layout.hideRightPanel=function(){$("#imgMinWidth").removeClass('imgMinWidthSmall').addClass('imgMinWidthLarge');$("#rightPanelContainer").removeClass('rightPanelSmall').addClass('rightPanelLarge');$("#rightPanelCellContent").removeClass('rightPanelCellContentSmall').addClass('rightPanelCellContentLarge');}
com.pictet.apps.fnc.web.common.layout.showRightPanel=function(){$("#imgMinWidth").addClass('imgMinWidthSmall').removeClass('imgMinWidthLarge');$("#rightPanelContainer").addClass('rightPanelSmall').removeClass('rightPanelLarge');$("#rightPanelCellContent").addClass('rightPanelCellContentSmall').removeClass('rightPanelCellContentLarge');}
com.pictet.apps.fnc.web.common.layout.openPopUpWindow=function(url){var height=550;var width=900;var leftPopUp=(screen.width-width)/2;var topPopUp=(screen.height-height)/2;var popUpWindow=window.open(url,'','height='+height+',width='+width+',left='+leftPopUp+',top='+topPopUp+',status=no,location=no,menubar=no,resizable=yes,scrollbars=yes');}
com.pictet.apps.fnc.web.common.layout.locatePopup=function(width,height){var popup=$("#popupBody");var myInnerWidth=document.documentElement.clientWidth;var myInnerHeight=document.documentElement.clientHeight;var effectiveWidth=width
-parseInt((popup.css("border-left-width")).replace("px",""),10)
-parseInt((popup.css("border-right-width")).replace("px",""),10)
-parseInt((popup.css("padding-left")).replace("px",""),10)
-parseInt((popup.css("padding-right")).replace("px",""),10);var effectiveHeight=height
-parseInt((popup.css("border-top-width")).replace("px",""),10)
-parseInt((popup.css("border-bottom-width")).replace("px",""),10)
-parseInt((popup.css("padding-top")).replace("px",""),10)
-parseInt((popup.css("padding-bottom")).replace("px",""),10);var vPosition=(myInnerHeight/2)-(effectiveHeight/2);var hPosition=(myInnerWidth/2)-(effectiveWidth/2);popup.css("margin-left",hPosition);popup.css("margin-top",vPosition);}
namespace("com.pictet.apps.fnc.web.common.disclaimer");com.pictet.apps.fnc.web.common.disclaimer.Disclaimer=function(displayIfUnchecked){com.pictet.apps.fnc.web.common.disclaimer.Disclaimer.superclass.constructor.call(this);this.displayIfUnchecked=displayIfUnchecked;this.init();this.componentStatus=[];this.messageLoaded=false;this.onAccept=new YAHOO.util.CustomEvent('onAccept');this.onRefuse=new YAHOO.util.CustomEvent('onRefuse');};YAHOO.lang.extend(com.pictet.apps.fnc.web.common.disclaimer.Disclaimer,com.pictet.apps.fnc.web.component.abstractcomponent.AbstractComponent);com.pictet.apps.fnc.web.common.disclaimer.Disclaimer.prototype.refuse=function(){disclaimerCheckbox.enable();disclaimerCheckbox.reset();YAHOO.util.Cookie.set('fnc.checkBoxStatus','');disclaimerAccept.disable();this.onRefuse.fire();};com.pictet.apps.fnc.web.common.disclaimer.Disclaimer.prototype.accept=function(){var obj=this;UserService.saveAcceptanceDateForUserProfile({callback:function(){YAHOO.util.Cookie.set('fnc.disclaimerHasOpen','',{path:"/"});obj.hide();$("#disclaimerAcceptBtn").css("display","none");$("#disclaimerRefuseBtn").css("display","none");$("#disclaimerOKBtn").css("display","block");disclaimerCheckbox.addClickedElement('disclaimerCheckboxText');disclaimerCheckbox.disable();obj.onAccept.fire();},errorHandler:function(errorString,exception){com.pictet.apps.fnc.web.common.disclaimer.Disclaimer.superclass.handleAjaxRemoteException(obj,errorString,exception)},textHtmlHandler:function(){com.pictet.apps.fnc.web.common.disclaimer.Disclaimer.superclass.handleAjaxSessionTimeout()}});};com.pictet.apps.fnc.web.common.disclaimer.Disclaimer.prototype.hide=function(){$("#disclaimerContainer").css("display","none");$("#PopupMask").css("display","none");YAHOO.util.Cookie.set('fnc.disclaimerHasOpen','',{path:"/"});};com.pictet.apps.fnc.web.common.disclaimer.Disclaimer.prototype.show=function(e,obj){var thisElement=$("#disclaimerContainer");thisElement.css("display","block");$("#PopupMask").css("display","block");window.scrollTo(0,0);var parentWidth=0;if(window.innerHeight!==undefined){parentWidth=window.innerWidth;}else{if(document.documentElement&&document.documentElement.clientWidth){parentWidth=document.documentElement.clientWidth;}else{parentWidth=document.body.clientWidth;}}
var vPosition=10;var hPosition=parentWidth/2-thisElement.width()/2;hPosition=hPosition<0?10:hPosition;thisElement.css("left",hPosition+"px");thisElement.css("top",vPosition+"px");YAHOO.util.Cookie.set('fnc.disclaimerHasOpen','true',{path:"/"});if(!this.messageLoaded){disclaimerMessage.loadMessage();}};com.pictet.apps.fnc.web.common.disclaimer.Disclaimer.prototype.toggleDisclaimer=function(e,obj){if(disclaimerCheckbox.isElementClicked('disclaimerCheckboxText')){YAHOO.util.Cookie.set('fnc.checkBoxStatus','checked');disclaimerAccept.enable();}else{YAHOO.util.Cookie.set('fnc.checkBoxStatus','');disclaimerAccept.disable();}};com.pictet.apps.fnc.web.common.disclaimer.Disclaimer.prototype.init=function(){disclaimerCheckbox.onValueChange.subscribe(this.toggleDisclaimer,this,true);if(this.displayIfUnchecked){this.show();}
if(disclaimerCheckbox.isElementClicked('disclaimerCheckboxText')){disclaimerAccept.enable();}else{disclaimerAccept.disable();}};com.pictet.apps.fnc.web.common.disclaimer.Disclaimer.prototype.printMessage=function(disclaimerPrintUrl,isNew){if(isNew){var insCode=investorCode.getValueAsStr();var instCountry=countryInstitutional.getValueAsStr();var pressCountry=countryPress.getValueAsStr();var retailCountry=countryRetail.getValueAsStr();var countryCode=instCountry+retailCountry+pressCountry;if(countryCode==""){instCountry=YAHOO.util.Cookie.get('fnc.countryInstitutional');pressCountry=YAHOO.util.Cookie.get('fnc.countryPress');retailCountry=YAHOO.util.Cookie.get('fnc.countryRetail');countryCode=instCountry+retailCountry+pressCountry;}
window.open(disclaimerPrintUrl
+"?insCode="
+insCode
+"&countryCode="
+countryCode);}else{var queryString='';if((this.curNavId!=null)&&(this.curNavId.length>0)){queryString="curNavId="+this.curNavId;if((this.fundId!=null)&&(this.fundId.length>0)){queryString=queryString+"&printFundId="+this.fundId;}}else{if((this.fundId!=null)&&(this.fundId.length>0)){queryString="printFundId="+this.fundId;}}
if(queryString.length==0){window.open(disclaimerPrintUrl);}else{window.open(disclaimerPrintUrl+"?"+queryString);}}};com.pictet.apps.fnc.web.common.disclaimer.Disclaimer.prototype.whenLoading=function(){if($("#headerRight").css("display")=="none"){this.componentStatus['headerRight']=false;}else{this.componentStatus['headerRight']=true;}
if(disclaimerCheckbox.isDisabled){this.componentStatus['disclaimerCheckbox']=false;}else{this.componentStatus['disclaimerCheckbox']=true;}
this.componentStatus['disclaimerAccept']=disclaimerAccept.isEnable;this.componentStatus['disclaimerOK']=disclaimerOK.isEnable;this.componentStatus['disclaimerRefuse']=disclaimerRefuse.isEnable;$("#headerRight").css("display","none");disclaimerCheckbox.disable();disclaimerAccept.disable();disclaimerOK.disable();disclaimerRefuse.disable();};com.pictet.apps.fnc.web.common.disclaimer.Disclaimer.prototype.afterLoaded=function(){this.messageLoaded=true;if(this.componentStatus['headerRight']){$("#headerRight").css("display","block");}
if(this.componentStatus['disclaimerCheckbox']){disclaimerCheckbox.enable();}
if(this.componentStatus['disclaimerAccept']){disclaimerAccept.enable();}
if(this.componentStatus['disclaimerOK']){disclaimerOK.enable();}
if(this.componentStatus['disclaimerRefuse']){disclaimerRefuse.enable();}
this.componentStatus=[];};namespace("com.pictet.apps.fnc.web.common.waitbar");com.pictet.apps.fnc.web.common.waitbar.Waitbar=function(iComponentId,iCssDesign){this.componentId=iComponentId;this.centered=false;this.cssDesign=iCssDesign;this.timeoutDisplay=null;this.timeoutValue=1000;};com.pictet.apps.fnc.web.common.waitbar.Waitbar.prototype.show=function(e,obj){window.clearTimeout(this.timeoutDisplay);this.timeoutDisplay=window.setTimeout(this.componentId+".displayWaitbar()",this.timeoutValue);};com.pictet.apps.fnc.web.common.waitbar.Waitbar.prototype.displayWaitbar=function(e,obj){window.clearTimeout(this.timeoutDisplay);var thisElement=$("#"+this.componentId);if(!this.centered){var thisParent=thisElement.parent();if(this.cssDesign!=""){thisParent=thisParent.parent();}
var paddingLeft=parseInt(thisElement.css("padding-left"),10);var vPosition=thisParent.height()/2-thisElement.height()/2-paddingLeft;var hPosition=thisParent.width()/2-thisElement.width()/2-paddingLeft;thisElement.css("margin-left",hPosition+"px");thisElement.css("margin-top",vPosition+"px");this.centered=true;}
thisElement.removeClass("waitBarHide");};com.pictet.apps.fnc.web.common.waitbar.Waitbar.prototype.hide=function(e,obj){$("#"+this.componentId).addClass("waitBarHide");window.clearTimeout(this.timeoutDisplay);};namespace("com.pictet.apps.fnc.web.common.glossary");com.pictet.apps.fnc.web.common.glossary.Glossary=function(glossaryTooltip,ajaxObject){com.pictet.apps.fnc.web.common.glossary.Glossary.superclass.constructor.call(this);this.glossaryTooltip=glossaryTooltip;this.ajaxObject=ajaxObject;}
YAHOO.lang.extend(com.pictet.apps.fnc.web.common.glossary.Glossary,com.pictet.apps.fnc.web.component.abstractcomponent.AbstractComponent);com.pictet.apps.fnc.web.common.glossary.Glossary.prototype.showGlossaryTooltip=function(glossaryPos,glossaryTooltip,glossaryTitle){var tooltipContent=this.glossaryTooltip.getToolTipContentWithTitle(glossaryTitle,'tt_body');this.glossaryTooltip.makeAndShowTooltipWithoutContent(glossaryPos);this.glossaryTooltip.updateToolTipContent(glossaryPos,tooltipContent+"<div class=\"glossaryContent\">"+glossaryTooltip+"</div></div>");};com.pictet.apps.fnc.web.common.glossary.Glossary.prototype.showGlossaryTooltipWithAjax=function(glossaryPos,glossaryKey,glossaryTitle){var iInstance=this;if(!this.glossaryTooltip.tooltipCache[glossaryPos]){var tooltipContent=this.glossaryTooltip.getToolTipContentWithTitle(glossaryTitle,'tt_body');var waitBarDiv=["<div class=\"waitBarWaitAnimation\"><jsp:text/></div>","<div style=\"clear:both;\"><jsp:text/></div>"];this.glossaryTooltip.makeAndShowTooltipWithoutContent(glossaryPos);this.glossaryTooltip.updateToolTipContent(glossaryPos,tooltipContent+"<div class=\"glossaryContent\">"+waitBarDiv.join('')+"</div></div>");var filter={};filter["messageKey"]=glossaryKey;this.ajaxObject.getMessage(filter,{callback:function(messageFromServer){iInstance.updateTooltip(glossaryPos,messageFromServer,glossaryTitle,iInstance);},errorHandler:function(errorString,exception){com.pictet.apps.fnc.web.common.glossary.Glossary.superclass.handleAjaxRemoteException(iInstance,errorString,exception)},textHtmlHandler:function(){com.pictet.apps.fnc.web.common.glossary.Glossary.superclass.handleAjaxSessionTimeout()}});}};com.pictet.apps.fnc.web.common.glossary.Glossary.prototype.updateTooltip=function(glossaryPos,tooltipMessage,glossaryTitle,iInstance){var tooltipContent=this.glossaryTooltip.getToolTipContentWithTitle(glossaryTitle,'tt_body');iInstance.glossaryTooltip.updateToolTipContent(glossaryPos,tooltipContent+"<div class=\"glossaryContent\">"+tooltipMessage+"</div></div>");};namespace("com.pictet.apps.fnc.web.component.actionMenu");com.pictet.apps.fnc.web.component.actionMenu.ActionMenu=function(iComponentId){com.pictet.apps.fnc.web.component.actionMenu.ActionMenu.superclass.constructor.call(this,iComponentId);this.childCpt=0;this.componentId=iComponentId;this.triggerElement=null;this.yuiMenu=null;this.tmpDefinitionArray=new Object();this.triggerDefinitionArray=new Object();this.timeoutValue=10000;};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.actionMenu.ActionMenu,com.pictet.apps.fnc.web.component.filteredcomponent.FilteredComponent);com.pictet.apps.fnc.web.component.actionMenu.ActionMenu.prototype.addTriggedElement=function(iId,iTrigger,iCssClass){if(iTrigger!=null){this.triggerDefinitionArray[iTrigger]=[];}
this.tmpDefinitionArray[iId]={trigger:iTrigger,cssClass:iCssClass};};com.pictet.apps.fnc.web.component.actionMenu.ActionMenu.prototype.addListTriggerItems=function(listItems){for(var i=0;i<listItems.length;i++){this.addTriggedElement(listItems[i][0],listItems[i][1],listItems[i][2]);}};com.pictet.apps.fnc.web.component.actionMenu.ActionMenu.prototype.getItemInMenu=function(key,menu){var items=menu.getItems();for(var i in items){if(items[i].id==key){return items[i];}}
var submenus=menu.getSubmenus();for(var i in menu.getSubmenus()){var returnedValue=this.getItemInMenu(key,submenus[i]);if(returnedValue!=null){return returnedValue;}}
return null;}
com.pictet.apps.fnc.web.component.actionMenu.ActionMenu.prototype.generateTriggedElements=function(){for(var key in this.tmpDefinitionArray){var currentItem=this.getItemInMenu(key,this.yuiMenu);if(currentItem!=null){var currentClass=this.tmpDefinitionArray[key].cssClass;var currentItemId=key;currentItem.cfg.setProperty("disabled",true);if(currentClass!="separator"&&this.tmpDefinitionArray[key].trigger!=null){$("#"+currentItemId).removeClass(currentClass).addClass(currentClass+"Disabled");var aDefinitionItem=new Object();aDefinitionItem.menuItem=currentItem;aDefinitionItem.cssClass=currentClass;aDefinitionItem.id=currentItemId;this.triggerDefinitionArray[this.tmpDefinitionArray[key].trigger].push(aDefinitionItem);}}else{alert("Action menu code error");}}};com.pictet.apps.fnc.web.component.actionMenu.ActionMenu.prototype.generate=function(){$("#"+this.componentId+" .yuimenu script").remove();this.yuiMenu=new YAHOO.widget.Menu(this.componentId+"_menu",{iframe:false,minscrollheight:300,showdelay:0,hidedelay:this.timeoutValue,lazyload:false,classname:"actionMenuMenu"});this.yuiMenu.render();this.yuiMenu.subscribe("hide",this.onHide,this,true);this.yuiMenu.subscribe("show",this.onShow,this,true);$("#"+this.componentId+"_menu").css("left","-1000px");this.generateTriggedElements();this.triggerElement.onSelectionChange.subscribe(this.triggerElementChange,this,true);};com.pictet.apps.fnc.web.component.actionMenu.ActionMenu.prototype.triggerElementChange=function(type,args,me){var selectedElement=args[0];var trigger=null;var triggerSize=null;if(selectedElement.category!=null){trigger=selectedElement.category;triggerSize=selectedElement.categorySize;}else if(selectedElement.id!=null){trigger=selectedElement.id;triggerSize=selectedElement.size;}
if(trigger!=null){if(this.triggerDefinitionArray[trigger]!=null){if(triggerSize==0){for(var i in this.triggerDefinitionArray[trigger]){var currentItem=this.triggerDefinitionArray[trigger][i];currentItem.menuItem.cfg.setProperty("disabled",true);$("#"+currentItem.id).removeClass(currentItem.cssClass).addClass(currentItem.cssClass+"Disabled");}}else{for(var i in this.triggerDefinitionArray[trigger]){var currentItem=this.triggerDefinitionArray[trigger][i];currentItem.menuItem.cfg.setProperty("disabled",false);$("#"+currentItem.id).removeClass(currentItem.cssClass+"Disabled").addClass(currentItem.cssClass);}}}}};com.pictet.apps.fnc.web.component.actionMenu.ActionMenu.prototype.onHide=function(){this.childCpt=this.childCpt-1;if(this.childCpt==0){$("#"+this.componentId+"_menu").css("display","none");$("#"+this.componentId).removeClass("actionMenuOpen");}};com.pictet.apps.fnc.web.component.actionMenu.ActionMenu.prototype.onShow=function(){if(this.childCpt==0){$("#"+this.componentId+"_menu").css("display","block");}
this.childCpt=this.childCpt+1;};com.pictet.apps.fnc.web.component.actionMenu.ActionMenu.prototype.closeMenu=function(){this.yuiMenu.hide();};com.pictet.apps.fnc.web.component.actionMenu.ActionMenu.prototype.openMenu=function(){$("#"+this.componentId).addClass("actionMenuOpen");this.yuiMenu.show();this.yuiMenu.cfg.setProperty("context",[this.componentId+"_ButtonRightArea","tr","br"]);};com.pictet.apps.fnc.web.component.actionMenu.ActionMenu.prototype.launchAction=function(jsFunction){jsFunction();};com.pictet.apps.fnc.web.component.actionMenu.ActionMenu.prototype.registerFilter=function(iFormInstance){this.triggerElement=iFormInstance;};namespace("com.pictet.apps.fnc.web.component.cluster");com.pictet.apps.fnc.web.component.Cluster=function(iComponentId,iDwrObject,iWidth,iHeight,iFundListId,iInitCluster,removeButtonTooltip,expandTooltip,collapseTooltip){com.pictet.apps.fnc.web.component.Cluster.superclass.constructor.call(this,iComponentId);this.dwrObject=iDwrObject;this.componentId=iComponentId;this.width=iWidth;this.iInitCluster=iInitCluster;this.removeButtonTooltip=removeButtonTooltip;this.expandTooltip=expandTooltip;this.collapseTooltip=collapseTooltip;this.categoryCategorySeparator="@::@";if(iHeight!=""){this.isSlidable=true;this.height=parseInt(iHeight,10);}else{this.isSlidable=false;this.height=0;}
this.fundListId=iFundListId;this.notSelectedFacetsMaxHeight=0;this.notSelectedFacetsListHeight=0;this.selectedFacetsHeight=0;this.yuiClusterTree=null;this.criteriaList={};this.onValueChange=new YAHOO.util.CustomEvent('onValueChange');this.onResetCluster=new YAHOO.util.CustomEvent('onResetCluster');this.presetFacets=null;this.value=null;};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.Cluster,com.pictet.apps.fnc.web.component.abstractcomponent.AbstractComponent);com.pictet.apps.fnc.web.component.Cluster.prototype.generate=function(){this.initCluster();};com.pictet.apps.fnc.web.component.Cluster.prototype.initCluster=function(){if(this.isSlidable==true){$("#"+this.componentId).height(this.height);$("#"+this.componentId+"_notSelectedFacets").css("overflow-y","auto");}
var notSelectedFacets=$("#"+this.componentId+"_notSelectedFacets");this.notSelectedFacetsPaddingTop=parseInt(notSelectedFacets.css("padding-top"),10);this.notSelectedFacetsPaddingBot=parseInt(notSelectedFacets.css("padding-bottom"),10);if(this.iInitCluster['selectedFacets']!=null&&this.iInitCluster['notSelectedFacets']!=null){var iInstance=this;com.pictet.apps.fnc.web.component.Cluster.buildCluster(this.iInitCluster,iInstance);}else{this.updateCluster([],true);}};com.pictet.apps.fnc.web.component.Cluster.prototype.addFacet=function(node){this.cleanDOM();this.criteriaList[node.data.key]=node.data.value;var updatedCriteriaList=[];var forFilterCriteriaList={};for(var ikey in this.criteriaList){updatedCriteriaList.push(this.criteriaList[ikey]);forFilterCriteriaList[ikey]=this.criteriaList[ikey];}
this.onValueChange.fire(this.value=forFilterCriteriaList);this.updateCluster(updatedCriteriaList,false);};com.pictet.apps.fnc.web.component.Cluster.prototype.removeFacet=function(inputKey,value,label){this.cleanDOM();var updatedCriteriaList=[];var forFilterCriteriaList={};var inputFacetKey=inputKey.substr(0,inputKey.indexOf("::"));var currentFacetKey;var criteriaFound=false;for(var currentKey in this.criteriaList){currentFacetKey=currentKey.substr(0,currentKey.indexOf("::"));if(currentFacetKey==inputFacetKey){if((inputKey!=currentKey)){if(criteriaFound==false){forFilterCriteriaList[currentKey]=this.criteriaList[currentKey];updatedCriteriaList.push(this.criteriaList[currentKey]);}}else{criteriaFound=true;}}else{forFilterCriteriaList[currentKey]=this.criteriaList[currentKey];updatedCriteriaList.push(this.criteriaList[currentKey]);}}
this.onValueChange.fire(this.value=forFilterCriteriaList);this.updateCluster(updatedCriteriaList,false);};com.pictet.apps.fnc.web.component.Cluster.prototype.removeAllFacets=function(usePreselectedFacets){this.cleanDOM();$("#"+this.componentId+"_resetArea").hide();$("#"+this.componentId+"_selectedFacetsList").hide();$("#"+this.componentId+"_selectedFacetsListEmpty").show();this.onResetCluster.fire();if(usePreselectedFacets&&this.presetFacets){this.onValueChange.fire(this.value=this.presetFacets);}else{this.onValueChange.fire(this.value={});}
this.updateCluster([],usePreselectedFacets);};com.pictet.apps.fnc.web.component.Cluster.prototype.updateCluster=function(updatedCriteriaList,isResetOrInit){var iInstance=this;var iReset=isResetOrInit;this.displayLoadingMessage();this.dwrObject.updateCluster(updatedCriteriaList,isResetOrInit,this.fundListId,{callback:function(dataFromServer){com.pictet.apps.fnc.web.component.Cluster.buildCluster(dataFromServer,iInstance);},errorHandler:function(errorString,exception){com.pictet.apps.fnc.web.component.Cluster.superclass.handleAjaxRemoteException(iInstance,errorString,exception);},textHtmlHandler:function(){com.pictet.apps.fnc.web.component.Cluster.superclass.handleAjaxSessionTimeout();}});};com.pictet.apps.fnc.web.component.Cluster.buildCluster=function(dataFromServer,iThis){iThis.criteriaList={};$("#"+iThis.componentId+"_notSelectedFacetsList").empty();$("#"+iThis.componentId+"_notSelectedFacetsList").show();var selectedFacets=dataFromServer['selectedFacets'];var notSelectedFacets=dataFromServer['notSelectedFacets'];if(selectedFacets.length>0){$("#"+iThis.componentId+"_selectedFacetsListEmpty").hide();$("#"+iThis.componentId+"_resetArea").show();$("#"+iThis.componentId+"_selectedFacetsList").show();}else{$("#"+iThis.componentId+"_resetArea").hide();$("#"+iThis.componentId+"_selectedFacetsList").hide();$("#"+iThis.componentId+"_selectedFacetsListEmpty").show();}
$("#"+iThis.componentId+"_selectedFacetsList").append(iThis.getSelectedFacetsHtml(selectedFacets));iThis.yuiClusterTree=new YAHOO.widget.TreeView(iThis.componentId+"_notSelectedFacetsList");for(var i=0;i<notSelectedFacets.length;i++){var myobj={label:notSelectedFacets[i].label+' ('+notSelectedFacets[i].nbrResults+')',key:notSelectedFacets[i].key,value:notSelectedFacets[i].value};var tmpNode=new YAHOO.widget.TextNode(myobj,iThis.yuiClusterTree.getRoot(),false);tmpNode.labelStyle="categoryNode";tmpNode.expanded=notSelectedFacets[i].expanded;iThis.buildChildrenNotSelected(notSelectedFacets[i],tmpNode);}
iThis.yuiClusterTree.draw();$("#"+iThis.componentId+"_notSelectedFacetsList > div.ygtvitem > div.ygtvchildren > div.ygtvitem > table").each((function(e){$(this).addClass('categoryNode');}));iThis.yuiClusterTree.subscribe("expandComplete",function(node){iThis.updateTitle();});iThis.yuiClusterTree.subscribe("collapseComplete",function(node){iThis.updateTitle();});iThis.updateTitle();iThis.yuiClusterTree.subscribe("labelClick",function(node){if(node.depth>0){iThis.addFacet(node);}});if(notSelectedFacets.length==0){$("#"+iThis.componentId+"_notSelectedFacets").hide();}else{$("#"+iThis.componentId+"_notSelectedFacets").show();}
if(iThis.isSlidable==true){iThis.yuiClusterTree.subscribe("expandComplete",function(node){iThis.initSlider();});iThis.yuiClusterTree.subscribe("collapseComplete",function(node){iThis.initSlider();});iThis.initSlider();}
if(!iThis.presetFacets){iThis.buildPresetFacets();}
iThis.hideLoadingMessage();};com.pictet.apps.fnc.web.component.Cluster.prototype.updateTitle=function(){var collapseTooltip=this.collapseTooltip;var expandTooltip=this.expandTooltip;$("#"+this.componentId+"_notSelectedFacetsList .ygtvtm").each((function(e){$(this).attr('title',collapseTooltip);}));$("#"+this.componentId+"_notSelectedFacetsList .ygtvtp").each((function(e){$(this).attr('title',expandTooltip);}));$("#"+this.componentId+"_notSelectedFacetsList .ygtvlm").each((function(e){$(this).attr('title',collapseTooltip);}));$("#"+this.componentId+"_notSelectedFacetsList .ygtvlp").each((function(e){$(this).attr('title',expandTooltip);}));}
com.pictet.apps.fnc.web.component.Cluster.prototype.getSelectedFacetsHtml=function(selectedFacets){var selectedFacetsCluster=["<ul id=\"",this.componentId,"_listOfCriteria\">"];var elementClass="criteriaTitleFirst";for(var j=0;j<selectedFacets.length;j++){if(selectedFacets[j].children!==null&&selectedFacets[j].children.length>0){selectedFacetsCluster.push("<li class=\"",elementClass,"\">",selectedFacets[j].label,"<ul>",this.buildChildrenSelected(selectedFacets[j].children),"</ul></li>");}else{selectedFacetsCluster.push("<li class=\"",elementClass,"\">",selectedFacets[j].label,"</li>");}
elementClass="criteriaTitle";}
selectedFacetsCluster.push("</ul>");return selectedFacetsCluster.join("");}
com.pictet.apps.fnc.web.component.Cluster.prototype.buildChildrenSelected=function(parentNodeObject){var myHtml=[];for(var k=0;k<parentNodeObject.length;k++){this.criteriaList[parentNodeObject[k].key]=parentNodeObject[k].value;if(parentNodeObject[k].children!==null&&parentNodeObject[k].children.length>0){myHtml=["<li><div class=\"criteria\"><div class=\"right\" title=\"",this.removeButtonTooltip,"\" onClick=\"",this.componentId,".removeFacet('",parentNodeObject[k].key,"', '",parentNodeObject[k].value,"', '",parentNodeObject[k].label,"')\"></div>","<div class=\"left\">",parentNodeObject[k].label,"</div></div>","<ul>",this.buildChildrenSelected(parentNodeObject[k].children),"</ul></li>"];}else{myHtml=["<li><div class=\"criteria\"><div class=\"right\" title=\"",this.removeButtonTooltip,"\" onClick=\"",this.componentId,".removeFacet('",parentNodeObject[k].key,"', '",parentNodeObject[k].value,"', '",parentNodeObject[k].label,"')\"></div>","<div class=\"left\">",parentNodeObject[k].label,"</div></div> </li>"];}}
return myHtml.join("");};com.pictet.apps.fnc.web.component.Cluster.prototype.buildChildrenNotSelected=function(parentNodeObject,parentNode){if(parentNodeObject.children!==null&&parentNodeObject.children.length>0){for(var i=0;i<parentNodeObject.children.length;i++){var myobj={label:parentNodeObject.children[i].label+' ('+parentNodeObject.children[i].nbrResults+')',key:parentNodeObject.children[i].key,value:parentNodeObject.children[i].value,href:"javascript:void(0);"};var tmpNode=new YAHOO.widget.TextNode(myobj,parentNode,false);this.buildChildrenNotSelected(parentNodeObject.children[i],tmpNode);}}};com.pictet.apps.fnc.web.component.Cluster.prototype.initSlider=function(){var notSelectedFacets=$("#"+this.componentId+"_notSelectedFacets");var notSelectedFacetsList=$("#"+this.componentId+"_notSelectedFacetsList");this.selectedFacetsHeight=$("#"+this.componentId+"_selectedFacets").height();this.notSelectedFacetsMaxHeight=this.height-this.selectedFacetsHeight-this.notSelectedFacetsPaddingTop-this.notSelectedFacetsPaddingBot-2;notSelectedFacets.height(this.notSelectedFacetsMaxHeight);this.notSelectedFacetsListHeight=notSelectedFacetsList.height();$("#"+this.componentId+"_notSelectedFacets").height(this.notSelectedFacetsMaxHeight);};com.pictet.apps.fnc.web.component.Cluster.prototype.onSelectedFacetsToggle=function(){if(this.isSlidable==true){this.initSlider();}};com.pictet.apps.fnc.web.component.Cluster.prototype.cleanDOM=function(){$("#"+this.componentId+"_selectedFacetsList").empty();$("#"+this.componentId+"_notSelectedFacetsList").hide();this.displayLoadingMessage();};com.pictet.apps.fnc.web.component.Cluster.prototype.displayLoadingMessage=function(){this.onWaitbarShow.fire();};com.pictet.apps.fnc.web.component.Cluster.prototype.hideLoadingMessage=function(){this.onWaitbarHide.fire();};com.pictet.apps.fnc.web.component.Cluster.prototype.buildPresetFacets=function(){this.presetFacets={};for(var ikey in this.criteriaList){this.presetFacets[ikey]=this.criteriaList[ikey];}}
com.pictet.apps.fnc.web.component.Cluster.prototype.getValueAsStr=function(){var strVal=[];for(var iKey in this.value){strVal.push(iKey);}
return strVal.join(this.categoryCategorySeparator);}
namespace("com.pictet.apps.fnc.web.component.contentContainer");com.pictet.apps.fnc.web.component.contentContainer.AsynchronousMessageContainer=function(iComponentId,iDwrObject,messageContainerId){com.pictet.apps.fnc.web.component.contentContainer.AsynchronousMessageContainer.superclass.constructor.call(this,iComponentId);this.componentId=iComponentId;this.dwrObject=iDwrObject;this.messageContainerId=messageContainerId;this.filters=[];this.filtersSubmittedValue=[];};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.contentContainer.AsynchronousMessageContainer,com.pictet.apps.fnc.web.component.filteredcomponent.FilteredComponent);com.pictet.apps.fnc.web.component.contentContainer.AsynchronousMessageContainer.prototype.registerFilter=function(iFormInstance,iKey,iTrigger){var aFilterDefinition=[];aFilterDefinition.key=iKey;aFilterDefinition.filter=iFormInstance;this.filters.push(aFilterDefinition);};com.pictet.apps.fnc.web.component.contentContainer.AsynchronousMessageContainer.prototype.applyFilter=function(){this.filtersSubmittedValue=[];var aFilterDefinition;for(var aIdx=0;aIdx<this.filters.length;aIdx++){aFilterDefinition=[];aFilterDefinition.key=this.filters[aIdx].key;aFilterDefinition.filterValue=this.filters[aIdx].filter.getValueAsStr();this.filtersSubmittedValue.push(aFilterDefinition);}};com.pictet.apps.fnc.web.component.contentContainer.AsynchronousMessageContainer.prototype.getFilters=function(){var oArray={};var aIdx;for(aIdx=0;aIdx<this.filtersSubmittedValue.length;aIdx++){oArray[this.filtersSubmittedValue[aIdx].key]=this.filtersSubmittedValue[aIdx].filterValue;}
return oArray;};com.pictet.apps.fnc.web.component.contentContainer.AsynchronousMessageContainer.prototype.loadMessage=function(){var iInstance=this;this.applyFilter();iInstance.onWaitbarShow.fire();iInstance.onAsynchronousCallStart.fire();this.dwrObject.getMessage(this.getFilters(),{callback:function(messageFromServer){iInstance.updateMessage(messageFromServer,iInstance);},errorHandler:function(errorString,exception){com.pictet.apps.fnc.web.component.contentContainer.AsynchronousMessageContainer.handleAjaxRemoteException(iInstance,errorString,exception)},textHtmlHandler:function(){com.pictet.apps.fnc.web.component.contentContainer.AsynchronousMessageContainer.superclass.handleAjaxSessionTimeout()}});}
com.pictet.apps.fnc.web.component.contentContainer.AsynchronousMessageContainer.prototype.updateMessage=function(message,iInstance){$("#"+iInstance.messageContainerId).html(message);iInstance.onWaitbarHide.fire();iInstance.onAsynchronousCallFinish.fire();}
namespace("com.pictet.apps.fnc.web.component.contentContainer");com.pictet.apps.fnc.web.component.contentContainer.HidableContainer=function(iComponentId,iDwrObject,iMyOverviewBlock,iAfterRemovePortletHandler,iDetailLayoutObject,iPlusTooltip,iMinusTooltip,iHidablePanelId){com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.superclass.constructor.call(this);this.componentId=iComponentId;this.dwrObject=iDwrObject;this.myOverviewBlock=iMyOverviewBlock;this.afterRemovePortletHandler=iAfterRemovePortletHandler;this.detailLayoutObject=iDetailLayoutObject;this.plusTooltip=iPlusTooltip;this.minusTooltip=iMinusTooltip;this.hidablePanelId=iHidablePanelId;this.onExpand=new YAHOO.util.CustomEvent("onExpand");this.onCollapse=new YAHOO.util.CustomEvent("onCollapse");this.onRemoved=new YAHOO.util.CustomEvent("onRemoved");this.state;this.reserveState;this.onHistoricDataReturn=new YAHOO.util.CustomEvent("onHistoricDataReturn");this.onHelpClick=new YAHOO.util.CustomEvent("onHelpClick");YAHOO.util.Event.addListener("about_"+this.componentId,"click",this.helpClick,this);};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.contentContainer.HidableContainer,com.pictet.apps.fnc.web.component.abstractcomponent.AbstractComponent);com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.prototype.toggle=function(){var iInstance=this;var plusMinusButton=document.getElementById("plusMinus_"+this.componentId);if(this.dwrObject!=null){if(plusMinusButton.className=="plusButton"){this.dwrObject.addPortlet(this.componentId,{callback:function(){com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.afterAddPortlet(iInstance)},errorHandler:function(errorString,exception){com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.superclass.handleAjaxRemoteException(iInstance,errorString,exception)},textHtmlHandler:function(){com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.superclass.handleAjaxSessionTimeout()}});}else{this.dwrObject.removePortlet(this.componentId,{callback:function(){com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.afterRemovePortlet(iInstance)},errorHandler:function(errorString,exception){com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.superclass.handleAjaxRemoteException(iInstance,errorString,exception)},textHtmlHandler:function(){com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.superclass.handleAjaxSessionTimeout()}});}}};com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.prototype.validateAndGetHistoryData=function(dwrObject,historicDate,blockId,dataId,currentFlowExecutionKey,isPortfolioDataBlock){this.onWaitbarShow.fire();var validatedCriteria={};validatedCriteria.historicDate=historicDate;var iInstance=this;dwrObject.validate(validatedCriteria,{callback:function(iDataFromServer){com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.getHistoricData(iDataFromServer,iInstance,dwrObject,historicDate,blockId,dataId,currentFlowExecutionKey,isPortfolioDataBlock);},errorHandler:function(errorString,exception){com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.superclass.handleAjaxRemoteException(errorString,exception)},textHtmlHandler:function(){com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.superclass.handleAjaxSessionTimeout()}});}
com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.getHistoricData=function(response,hidableObject,dwrObject,historicDate,blockId,dataId,currentFlowExecutionKey,isPortfolioDataBlock){var messages=hidableObject.getErrorMessage(response);eval(hidableObject.componentId+"SpecificHistoricDate.markInvalid()");hidableObject.onMessage.fire([]);if(messages.length>1){hidableObject.onMessage.fire(messages);hidableObject.onWaitbarHide.fire();}else{eval(hidableObject.componentId+"SpecificHistoricDate.markValid()");if(isPortfolioDataBlock){var criteria={};criteria.historicDate=historicDate;criteria.blockId=blockId;criteria.dataId=dataId;criteria.currentFlowExecutionKey=currentFlowExecutionKey;dwrObject.getHistoricData(criteria,{callback:function(iDataFromServer){com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.updateContent(hidableObject,iDataFromServer,historicDate);},errorHandler:function(errorString,exception){com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.superclass.handleAjaxRemoteException(hidableObject,errorString,exception)},textHtmlHandler:function(){com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.superclass.handleAjaxSessionTimeout()}});}else{document.getElementById(hidableObject.componentId+"historicDate").value=historicDate;document.getElementById(hidableObject.componentId+"changeHistoricDateForm").submit();}}}
com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.updateContent=function(hidableObject,iDataFromServer,requestedHistoricDate){var historicYear=iDataFromServer.historicYear;var historicMonth=iDataFromServer.historicMonth;var historicDay=iDataFromServer.historicDay;if(historicYear&&historicMonth&&historicDay){eval(hidableObject.componentId+"SpecificHistoricDate.updateValueSilently('"+historicYear+"','"+historicMonth+"','"+historicDay+"')");}else{eval(hidableObject.componentId+"SpecificHistoricDate.setValue('"+requestedHistoricDate+"')");}
$("#"+hidableObject.componentId+"_headerLine").css("background-color","#ECF1F6");hidableObject.onWaitbarHide.fire();hidableObject.onHistoricDataReturn.fire(iDataFromServer,hidableObject);}
com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.prototype.resetHistoricDate=function(){eval(this.componentId+"SpecificHistoricDate.resetToDefaultValueAndFireEvent()");$("#"+this.componentId+"_headerLine").css("background-color","#FFFFFF");}
com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.prototype.updateExpandState=function(){this.state='expand';}
com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.prototype.updateCollapseState=function(){this.state='collapse';}
com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.prototype.expandReserve=function(){if(this.state=='collapse'){this.reserveState='collapse';}}
com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.prototype.collapseRestore=function(type,args){var commitState=false;if(args.length>0){commitState=args[0];}
if(commitState==false&&this.reserveState=='collapse'){this.onCollapse.fire();}else{}
this.reserveState="";}
com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.afterAddPortlet=function(iThisHidableContainer){document.getElementById("plusMinus_"+iThisHidableContainer.componentId).className="minusButton";document.getElementById("plusMinus_"+iThisHidableContainer.componentId).title=iThisHidableContainer.minusTooltip;};com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.afterRemovePortlet=function(iThisHidableContainer){if(iThisHidableContainer.myOverviewBlock){iThisHidableContainer.onRemoved.fire();$("#"+iThisHidableContainer.componentId).remove();var cookieName="fnc.hP"+iThisHidableContainer.hidablePanelId;com.pictet.apps.fnc.web.component.hidablepanel.HidablePanel.cookieSetOpen(cookieName);iThisHidableContainer.afterRemovePortletHandler(iThisHidableContainer.detailLayoutObject);}
document.getElementById("plusMinus_"+iThisHidableContainer.componentId).className="plusButton";document.getElementById("plusMinus_"+iThisHidableContainer.componentId).title=iThisHidableContainer.plusTooltip;};com.pictet.apps.fnc.web.component.contentContainer.HidableContainer.prototype.helpClick=function(event,me){me.onHelpClick.fire();};namespace("com.pictet.apps.fnc.web.component.contentContainer");com.pictet.apps.fnc.web.component.contentContainer.Tooltip=function(){this.tooltipCache=[];};com.pictet.apps.fnc.web.component.contentContainer.Tooltip.prototype.makeAndShowTooltipWithoutContent=function(contextId){var tooltipGenerated=document.getElementById(contextId).getAttribute("tooltipgenerated");if(!tooltipGenerated){YAHOO.util.Event.addListener(contextId,"mouseout",com.pictet.apps.fnc.web.component.contentContainer.Tooltip.markMouseOut,contextId);var tooltip=new YAHOO.widget.Tooltip("toolTip_"+contextId,{context:contextId,showdelay:250,hidedelay:0,autodismissdelay:15000,x:1000,y:1000});document.getElementById(contextId).setAttribute("tooltipgenerated","yes");this.tooltipCache[contextId]=tooltip;this.waitUntilInitComplete(contextId);}}
com.pictet.apps.fnc.web.component.contentContainer.Tooltip.prototype.makeAndShowTooltipWithTitle=function(contextId,tooltipTitle,tooltipBody){var tooltipGenerated=document.getElementById(contextId).getAttribute("tooltipgenerated");if(!tooltipGenerated){YAHOO.util.Event.addListener(contextId,"mouseout",com.pictet.apps.fnc.web.component.contentContainer.Tooltip.markMouseOut,contextId);var tooltipContent=this.getToolTipContentWithTitle(tooltipTitle)+tooltipBody+"</div>";var tooltip=new YAHOO.widget.Tooltip("toolTip_"+contextId,{context:contextId,text:unescape(tooltipContent),showdelay:250,hidedelay:0,autodismissdelay:15000,x:1000,y:1000});document.getElementById(contextId).setAttribute("tooltipgenerated","yes");this.tooltipCache[contextId]=tooltip;this.waitUntilInitComplete(contextId);}}
com.pictet.apps.fnc.web.component.contentContainer.Tooltip.prototype.getToolTipContentWithTitle=function(tooltipTitle,tooltipCssClass){var result=[];result.push("<div id='tt_body' class='");if(tooltipCssClass){result.push(tooltipCssClass);}else{result.push("tt_body");}
result.push("'>");result.push("<div id='tt_title' class='tt_title'>",tooltipTitle,"</div>");return result.join("");}
com.pictet.apps.fnc.web.component.contentContainer.Tooltip.prototype.makeAndShowTooltip=function(contextId,tooltipBody,iZIndex){var tooltipGenerated=document.getElementById(contextId).getAttribute("tooltipgenerated");if(!tooltipGenerated){YAHOO.util.Event.addListener(contextId,"mouseout",com.pictet.apps.fnc.web.component.contentContainer.Tooltip.markMouseOut,contextId);var tooltipContent="<div id='tt_body' class='tt_body tt_bodyWithoutTitle'>"+tooltipBody+"</div>"
var tooltip=new YAHOO.widget.Tooltip("toolTip_"+contextId,{context:contextId,text:unescape(tooltipContent),showdelay:250,zIndex:iZIndex?iZIndex:null,hidedelay:0,autodismissdelay:15000});document.getElementById(contextId).setAttribute("tooltipgenerated","yes");this.tooltipCache[contextId]=tooltip;this.waitUntilInitComplete(contextId);}}
com.pictet.apps.fnc.web.component.contentContainer.Tooltip.prototype.waitUntilInitComplete=function(contextId){var _this=this;window.setTimeout(function(){_this.forceShowToolTip(contextId);},500);}
com.pictet.apps.fnc.web.component.contentContainer.Tooltip.prototype.forceShowToolTip=function(contextId){if(!this.mouseHasBeenOut(contextId)){var theContext=document.getElementById(contextId);if(theContext){var tooltipGenerated=theContext.getAttribute("tooltipgenerated");if(tooltipGenerated){if(this.tooltipCache[contextId].pageX&&this.tooltipCache[contextId].pageY){this.tooltipCache[contextId].onContextMouseOver(null,this.tooltipCache[contextId]);}else{this.waitUntilInitComplete(contextId);}}}}}
com.pictet.apps.fnc.web.component.contentContainer.Tooltip.markMouseOut=function(event,contextId){document.getElementById(contextId).setAttribute("mouseHasBeenOut","yes")}
com.pictet.apps.fnc.web.component.contentContainer.Tooltip.prototype.mouseHasBeenOut=function(contextId){var theContext=document.getElementById(contextId);if(theContext){return theContext.getAttribute("mouseHasBeenOut");}else{return null;}}
com.pictet.apps.fnc.web.component.contentContainer.Tooltip.prototype.updateToolTipContent=function(contextId,content){YAHOO.log("Content : "+content);this.tooltipCache[contextId].cfg.setProperty("text",content);}
com.pictet.apps.fnc.web.component.contentContainer.Tooltip.prototype.closeAllTooltips=function(){for(contextId in this.tooltipCache)
{this.tooltipCache[contextId].hide();}}
namespace("com.pictet.apps.fnc.web.component.contentContainer");com.pictet.apps.fnc.web.component.contentContainer.EmptyContainer=function(iComponentId){this.componentId=iComponentId;};com.pictet.apps.fnc.web.component.contentContainer.EmptyContainer.prototype.showEmpty=function(){$("#"+this.componentId+"_emptyClassHolder").addClass("showEmpty");};com.pictet.apps.fnc.web.component.contentContainer.EmptyContainer.prototype.showContent=function(){$("#"+this.componentId+"_emptyClassHolder").removeClass("showEmpty");};namespace("com.pictet.apps.fnc.web.component.contextMenu");com.pictet.apps.fnc.web.component.contextMenu.ContextMenu=function(iComponentId,iTriggerAlignment,iTriggerAlignmentOutOfViewPort,iCompoClass){this.componentId=iComponentId;this.triggerAlignment=iTriggerAlignment;this.triggerAlignmentOutOfViewPort=iTriggerAlignmentOutOfViewPort;this.lastTriggerId="";this.compoClass="contextMenu";if(iCompoClass!=null&&iCompoClass!==""){this.compoClass=iCompoClass;}
this.definitionArray=[];this.contextValues=[];this.title=null;this.yuiContextMenu=null;this.timeoutValue=1000;this.timeout=null;};com.pictet.apps.fnc.web.component.contextMenu.ContextMenu.prototype.addListItems=function(listItems){this.definitionArray=listItems;};com.pictet.apps.fnc.web.component.contextMenu.ContextMenu.prototype.generate=function(){if(this.triggerAlignmentOutOfViewPort==""){this.yuiContextMenu=new YAHOO.widget.ContextMenu(this.componentId+"_menu",{iframe:false,minscrollheight:300,showdelay:0,hidedelay:this.timeoutValue,lazyload:true,classname:this.compoClass});}else{this.yuiContextMenu=new YAHOO.widget.ContextMenu(this.componentId+"_menu",{iframe:false,minscrollheight:300,showdelay:0,constraintoviewport:false,hidedelay:this.timeoutValue,lazyload:true,classname:this.compoClass});}
this.yuiContextMenu.render();this.yuiContextMenu.clickEvent.unsubscribeAll();this.yuiContextMenu.clickEvent.subscribe(this.onContextMenuClick,this);this.yuiContextMenu.hideEvent.subscribe(this.onContextMenuHide,this);};com.pictet.apps.fnc.web.component.contextMenu.ContextMenu.prototype.hide=function(){this.yuiContextMenu.hide();}
com.pictet.apps.fnc.web.component.contextMenu.ContextMenu.prototype.onContextMenuHide=function(p_sType,p_aArgs,iThisContextMenu){$("#"+iThisContextMenu.lastTriggerId).removeClass("contextMenuButtonSelect");}
com.pictet.apps.fnc.web.component.contextMenu.ContextMenu.prototype.display=function(iTriggerId){this.lastTriggerId=iTriggerId;this.yuiContextMenu.show();if(this.triggerAlignment=="bl"){this.yuiContextMenu.cfg.setProperty("context",[iTriggerId,"tl","bl"]);}else if(this.triggerAlignment=="br"){this.yuiContextMenu.cfg.setProperty("context",[iTriggerId,"tr","br"]);}else{this.yuiContextMenu.cfg.setProperty("context",[iTriggerId,"tl","tl"]);}
if(this.triggerAlignmentOutOfViewPort!=""){var viewPortHeight=YAHOO.util.Dom.getViewportHeight()+this.getScrollY();if(this.menuHeightWhenOpen==null){this.menuHeightWhenOpen=$("#"+this.componentId+"_menu").height();}
var offsetWhenOpen=0;var triggerElement=document.getElementById(iTriggerId);if(triggerElement!=null){while(triggerElement!=null){offsetWhenOpen+=triggerElement.offsetTop;triggerElement=triggerElement.offsetParent;}
offsetWhenOpen+=$("#"+iTriggerId).height();}
if(viewPortHeight<offsetWhenOpen+this.menuHeightWhenOpen){if(this.triggerAlignmentOutOfViewPort=="tl"){this.yuiContextMenu.cfg.setProperty("context",[iTriggerId,"bl","tl"]);}else if(this.triggerAlignmentOutOfViewPort=="tr"){this.yuiContextMenu.cfg.setProperty("context",[iTriggerId,"br","tr"]);}else if(this.triggerAlignmentOutOfViewPort=="br"){this.yuiContextMenu.cfg.setProperty("context",[iTriggerId,"tr","br"]);}else if(this.triggerAlignmentOutOfViewPort=="bl"){this.yuiContextMenu.cfg.setProperty("context",[iTriggerId,"tl","bl"]);}}}
$("#"+iTriggerId).addClass("contextMenuButtonSelect");};com.pictet.apps.fnc.web.component.contextMenu.ContextMenu.prototype.getScrollY=function(){var scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;}
return scrOfY;};com.pictet.apps.fnc.web.component.contextMenu.ContextMenu.prototype.onContextMenuClick=function(p_sType,p_aArgs,iThisContextMenu){var oItem=p_aArgs[1];if(oItem){if(iThisContextMenu.definitionArray[oItem.index]!=null&&iThisContextMenu.definitionArray[oItem.index]["action"]!=""){var aCommand=iThisContextMenu.definitionArray[oItem.index]["action"];var aRegExp=new RegExp('getContextValue','g');aCommand=aCommand.replace(aRegExp,"iThisContextMenu.getContextValue");eval(aCommand);iThisContextMenu.yuiContextMenu.hide();iThisContextMenu.resetContextValues();}}};com.pictet.apps.fnc.web.component.contextMenu.ContextMenu.prototype.changeText=function(textId,newValue){$("#"+this.componentId+textId).html(newValue);};com.pictet.apps.fnc.web.component.contextMenu.ContextMenu.prototype.addContextValue=function(iKey,iValue){this.contextValues[iKey]=unescape(iValue);};com.pictet.apps.fnc.web.component.contextMenu.ContextMenu.prototype.resetContextValues=function(){this.contextValues=[];};com.pictet.apps.fnc.web.component.contextMenu.ContextMenu.prototype.getContextValue=function(iKey){return this.contextValues[iKey];};com.pictet.apps.fnc.web.component.contextMenu.ContextMenu.prototype.getContextValues=function(){return this.contextValues;};namespace("com.pictet.apps.fnc.web.component.publication");com.pictet.apps.fnc.web.component.publication.IconSelector=function(componentId,getDocumentUrl,iUnknownType,docIconTooltip){this.componentId=componentId;this.getDocumentUrl=getDocumentUrl;this.unknownType=iUnknownType;this.docIconTooltip=docIconTooltip;this.classSource={};this.classSource.UNKNOWN="unknownIcon";this.classSource.WORD="wordIcon";this.classSource.VIDEO="videoIcon";this.classSource.AUDIO="audioIcon";this.classSource.IMAGE="imageIcon";this.classSource.PDF="pdfIcon";};com.pictet.apps.fnc.web.component.publication.IconSelector.prototype.getOnClickToExternalResource=function(url,documentType,winWidth,winHeight){var leftPopUp=(screen.width-winWidth)/2;var topPopUp=(screen.height-winHeight)/2;var str=[];if(documentType=='VIDEO'||documentType=='AUDIO'||documentType=='IMAGE'){str.push('window.open(\''+url+'\',\'\', ');str.push('\'left='+leftPopUp+', top='+topPopUp+', width='+winWidth
+', height='+winHeight+' ,toolbar=0,resizable=1,scrollbars=1\');return false;');}else{str.push('location.replace(\''+url+'\')');}
return str.join('');}
com.pictet.apps.fnc.web.component.publication.IconSelector.prototype.getDocumentLink=function(documentId){var str=[];str.push(this.getDocumentUrl);str.push(documentId);return str.join('');}
com.pictet.apps.fnc.web.component.publication.IconSelector.prototype.getOnClickToDocument=function(documentId,documentType,winWidth,winHeight){return this.getOnClickToExternalResource(this.getDocumentLink(documentId),documentType,winWidth,winHeight);}
com.pictet.apps.fnc.web.component.publication.IconSelector.prototype.getDocumentIcon=function(documentId,documentType,winWidth,winHeight){var cssClass=this.classSource.UNKNOWN;if(documentType&&documentType!=this.unknownType){cssClass=this.classSource[documentType];}
var str=[];str.push('<div onclick="');str.push(this.getOnClickToDocument(documentId,documentType,winWidth,winHeight));str.push('" class="docIcon ');str.push(cssClass);str.push('" title="');str.push(this.docIconTooltip);str.push('"></div>');return str.join('');};com.pictet.apps.fnc.web.component.publication.IconSelector.prototype.generate=function(documentId,documentType,winWidth,winHeight){var documentIcon=this.getDocumentIcon(documentId,documentType,winWidth,winHeight);$("#"+this.componentId).html(documentIcon);};namespace("com.pictet.apps.fnc.web.component.dragable");var Dom=YAHOO.util.Dom;var Event=YAHOO.util.Event;var DDM=YAHOO.util.DragDropMgr;com.pictet.apps.fnc.web.component.dragable.DragableContainer=function(id,type,targetBeforeInserted,targetManger,modelAndViewId){com.pictet.apps.fnc.web.component.dragable.DragableContainer.superclass.constructor.call(this,id);this.isTarget=false;DDM.mode=YAHOO.util.DDM.INTERSECT;this.type=type;var lastX;var lastY;var direction;this.targetBeforeInserted=targetBeforeInserted;this.parentTarget;this.targetManger=targetManger;this.modelAndViewId=modelAndViewId;this.onDragStart=new YAHOO.util.CustomEvent("onDragStart");this.onDragEnd=new YAHOO.util.CustomEvent("onDragEnd");this.surrogate;this.dragObject;this.handler;this.positionChange=false;this.handlerColor="";this.viewPortTop=Dom.getDocumentScrollTop();this.spacing="";DDM.clickTimeThresh=100;};YAHOO.extend(com.pictet.apps.fnc.web.component.dragable.DragableContainer,YAHOO.util.DD);com.pictet.apps.fnc.web.component.dragable.DragableContainer.prototype.initProxy=function(){this.surrogate=document.getElementById(this.id+"_surrogate");this.dragObject=document.getElementById(this.id);}
com.pictet.apps.fnc.web.component.dragable.DragableContainer.prototype.startDrag=function(x,y){this.onDragStart.fire();var dragObjectCache=this.dragObject;var surrogateStyle=this.surrogate.style;var ddObjectStyle=dragObjectCache.style;this.spacing=ddObjectStyle.margin;ddObjectStyle.margin="0 0 0 0";var height=dragObjectCache.offsetHeight;var width=dragObjectCache.offsetWidth;var objHeight=height.toString()+"px";var objWidth=width.toString()+"px";surrogateStyle.display="block";surrogateStyle.height=objHeight;ddObjectStyle.height=objHeight;ddObjectStyle.width=objWidth;ddObjectStyle.position="absolute";ddObjectStyle.zIndex="1000";ddObjectStyle.opacity="0.7";this.positionChange=false;this.handler.style.backgroundColor="#EFE1E0";}
com.pictet.apps.fnc.web.component.dragable.DragableContainer.prototype.endDrag=function(e){this.surrogate.style.display="none";this.surrogate.parentNode.insertBefore(this.dragObject,this.surrogate);var ddObjectStyle=this.dragObject.style;ddObjectStyle.margin=this.spacing;ddObjectStyle.height="";ddObjectStyle.width="";ddObjectStyle.position="";ddObjectStyle.top="";ddObjectStyle.left="";ddObjectStyle.zIndex="";ddObjectStyle.opacity="1";this.handler.style.backgroundColor=this.handlerColor;this.onDragEnd.fire(this.positionChange);}
com.pictet.apps.fnc.web.component.dragable.DragableContainer.prototype.onDrag=function(e){var y=Event.getPageY(e);var x=Event.getPageX(e);var deltaX=x-this.lastX;var deltaY=y-this.lastY;if(Math.abs(deltaX)>Math.abs(deltaY)){if(deltaX>0){this.direction="RIGHT";}else{this.direction="LEFT";}}else{if(deltaY>0){this.direction="DOWN";}else{this.direction="UP";}}
this.lastY=y;this.lastX=x;}
com.pictet.apps.fnc.web.component.dragable.DragableContainer.prototype.onDragOver=function(e,intersectIdList){var intersectTargets=this.extractIntersectTargets(intersectIdList);var bestMatchedTarget;if(intersectTargets){bestMatchedTarget=this.targetManger.getBestMatchedTarget(this,intersectTargets);this.targetBeforeInserted=bestMatchedTarget;bestMatchedTarget.addDragDD(this);}}
com.pictet.apps.fnc.web.component.dragable.DragableContainer.prototype.getDirection=function(){return this.direction;}
com.pictet.apps.fnc.web.component.dragable.DragableContainer.prototype.extractIntersectTargets=function(ddArr){var result=[];for(idx in ddArr){if(ddArr[idx].isTarget){result.push(ddArr[idx]);}}
if(result.length==0){return null;}
return result;}
com.pictet.apps.fnc.web.component.dragable.DragableContainer.prototype.removeFromParentTarget=function(){this.parentTarget.removeChild(this);}
com.pictet.apps.fnc.web.component.dragable.DragableContainer.prototype.registerHandlerId=function(handlerId){var handler=document.getElementById(handlerId);if(handler){handler.style.cursor="move";this.handler=handler;YAHOO.util.Event.addListener(handlerId,"mouseover",this.highlight,this,true);YAHOO.util.Event.addListener(handlerId,"mouseout",this.unhighlight,this,true);}
this.setHandleElId(handlerId);this.addInvalidHandleType("input");this.addInvalidHandleClass("button");this.handlerColor=handler.style.backgroundColor;}
com.pictet.apps.fnc.web.component.dragable.DragableContainer.prototype.highlight=function(){this.handler.style.backgroundColor="#EFE1E0";}
com.pictet.apps.fnc.web.component.dragable.DragableContainer.prototype.unhighlight=function(){this.handler.style.backgroundColor=this.handlerColor;}
com.pictet.apps.fnc.web.component.dragable.DragableContainer.prototype.removed=function(){$("#"+this.id).remove();$("#"+this.id+"_surrogate").remove();}
com.pictet.apps.fnc.web.component.dragable.DragableContainer.prototype.autoScroll=function(x,y,h,w){if(this.scroll){var clientH=this.DDM.getClientHeight();var clientW=this.DDM.getClientWidth();var st=this.DDM.getScrollTop();var sl=this.DDM.getScrollLeft();var bot=h+y;var right=w+x;var toBot=(clientH+st-y-this.deltaY);var toRight=(clientW+sl-x-this.deltaX);var thresh=50;var scrAmt=30;if(h<thresh){h=thresh;}
if(bot>clientH&&toBot<h&&this.direction=='DOWN'){window.scrollTo(sl,st+scrAmt);}
if(st>0&&y-st<thresh&&this.direction=="UP"){window.scrollTo(sl,st-scrAmt);}
if(right>clientW&&toRight<thresh){window.scrollTo(sl+scrAmt,st);}
if(x<sl&&sl>0&&x-sl<thresh){window.scrollTo(sl-scrAmt,st);}}}
namespace("com.pictet.apps.fnc.web.component.dragable");var Dom=YAHOO.util.Dom;var Event=YAHOO.util.Event;var DDM=YAHOO.util.DragDropMgr;com.pictet.apps.fnc.web.component.dragable.DDtarget=function(id,type){com.pictet.apps.fnc.web.component.dragable.DDtarget.superclass.constructor.call(this,id);this.type=type;this.ddChildren=[];this.htmlElement=document.getElementById(id);};YAHOO.extend(com.pictet.apps.fnc.web.component.dragable.DDtarget,YAHOO.util.DDTarget);com.pictet.apps.fnc.web.component.dragable.DDtarget.prototype.addDragDD=function(newDD){var movingEl=newDD.dragObject;if(this.ddChildren.length>0){var movingTop=this.getTop(movingEl);var movingMiddPoint=movingTop+movingEl.offsetHeight/2;var nearestDD;var min=Number.MAX_VALUE;var childMiddPoint;var childEl;var distance;var minDestMidPoint;var childDD;var childRegion;for(var i=0;i<this.ddChildren.length;i++){childDD=this.ddChildren[i];if(childDD.id==newDD.id){childEl=this.ddChildren[i].surrogate;}else{childEl=this.ddChildren[i].dragObject;}
childMiddPoint=this.getTop(childEl)+childEl.offsetHeight/2;distance=Math.abs(childMiddPoint-movingMiddPoint);if(distance<min){nearestDD=this.ddChildren[i];min=distance;minDestMidPoint=childMiddPoint;}}
if(nearestDD&&nearestDD.id!=newDD.id){var insertDirection;if(newDD.direction=="UP"){if(movingTop<minDestMidPoint){insertDirection='ABOVE';}else if(newDD.parentTarget.id!=this.id){insertDirection='BELOW';}}else{if(movingTop+movingEl.offsetHeight>minDestMidPoint){insertDirection='BELOW';}else if(newDD.parentTarget.id!=this.id){insertDirection='ABOVE';}}
if(insertDirection=='ABOVE'){newDD.parentTarget.removeChild(newDD);this.insertChildBefore(nearestDD,newDD);}else if(insertDirection=='BELOW'){newDD.parentTarget.removeChild(newDD);this.insertChildAfter(nearestDD,newDD);}}}else{this.htmlElement.appendChild(newDD.surrogate);newDD.parentTarget.removeChild(newDD);this.addChild(newDD);}}
com.pictet.apps.fnc.web.component.dragable.DDtarget.prototype.addChild=function(childDD){childDD.parentTarget=this;childDD.positionChange=true;this.ddChildren.push(childDD);}
com.pictet.apps.fnc.web.component.dragable.DDtarget.prototype.insertChildBefore=function(destChild,newChild){$("#"+destChild.id).before(newChild.surrogate);newChild.parentTarget=this;newChild.positionChange=true;newDdChildren=[];for(var i=this.ddChildren.length-1;i>=0;i--){if(this.ddChildren[i].id==destChild.id){newDdChildren.push(this.ddChildren[i]);newDdChildren.push(newChild);}else{newDdChildren.push(this.ddChildren[i]);}}
this.ddChildren=newDdChildren;this.ddChildren.reverse();}
com.pictet.apps.fnc.web.component.dragable.DDtarget.prototype.insertChildAfter=function(destChild,newChild){$("#"+destChild.id).after(newChild.surrogate);newChild.parentTarget=this;newChild.positionChange=true;newDdChildren=[];for(var i=0;i<this.ddChildren.length;i++){if(this.ddChildren[i].id==destChild.id){newDdChildren.push(this.ddChildren[i]);newDdChildren.push(newChild);}else{newDdChildren.push(this.ddChildren[i]);}}
this.ddChildren=newDdChildren;}
com.pictet.apps.fnc.web.component.dragable.DDtarget.prototype.removeChild=function(childDD){for(var i=0;i<this.ddChildren.length;i++){if(this.ddChildren[i].id==childDD.id){this.ddChildren.splice(i,1);break;}}}
com.pictet.apps.fnc.web.component.dragable.DDtarget.prototype.getTop=function(htmlEl){var b=0;if(htmlEl.offsetParent){while(htmlEl.offsetParent){b+=htmlEl.offsetTop;htmlEl=htmlEl.offsetParent}}
else if(htmlEl.y){b=htmlEl.y}
return b}
namespace("com.pictet.apps.fnc.web.component.dragable");var Dom=YAHOO.util.Dom;var Event=YAHOO.util.Event;var DDM=YAHOO.util.DragDropMgr;com.pictet.apps.fnc.web.component.dragable.DDTargetManager=function(dwrObject){com.pictet.apps.fnc.web.component.dragable.DDTargetManager.superclass.constructor.call(this);this.dwrObject=dwrObject;this.targets=[];}
YAHOO.lang.extend(com.pictet.apps.fnc.web.component.dragable.DDTargetManager,com.pictet.apps.fnc.web.component.abstractcomponent.AbstractComponent);com.pictet.apps.fnc.web.component.dragable.DDTargetManager.prototype.saveLayout=function(type,args,managerObject){var layoutModified=false;if(args.length>0){layoutModified=args[0];}
if(layoutModified){managerObject.dwrObject.movePortlet(managerObject.getLayout(),{errorHandler:function(errorString,exception){com.pictet.apps.fnc.web.component.dragable.DDTargetManager.superclass.handleAjaxRemoteException(managerObject,errorString,exception)},textHtmlHandler:function(){com.pictet.apps.fnc.web.component.dragable.DDTargetManager.superclass.handleAjaxSessionTimeout()}});}}
com.pictet.apps.fnc.web.component.dragable.DDTargetManager.prototype.getLayout=function(){var target;var childList=[];var layout={};for(var i=0;i<this.targets.length;i++){target=this.targets[i];childList=[];for(var j=0;j<target.ddChildren.length;j++){childList.push(target.ddChildren[j].modelAndViewId);}
layout[target.id]=childList;}
return layout;}
com.pictet.apps.fnc.web.component.dragable.DDTargetManager.prototype.addTarget=function(target){this.targets.push(target);}
com.pictet.apps.fnc.web.component.dragable.DDTargetManager.prototype.getBestMatchedTarget=function(ddProxy,intersectTargetArr){var proxyRegion=Dom.getRegion(ddProxy.getDragEl());var targetsOnMovingDirection;if(ddProxy.getDirection()=="UP"){targetsOnMovingDirection=this.getTargetsOnDirection(ddProxy.targetBeforeInserted,intersectTargetArr,"TOP");}else if(ddProxy.getDirection()=="DOWN"){targetsOnMovingDirection=this.getTargetsOnDirection(ddProxy.targetBeforeInserted,intersectTargetArr,"BOTTOM");}else if(ddProxy.getDirection()=="LEFT"){targetsOnMovingDirection=this.getTargetsOnDirection(ddProxy.targetBeforeInserted,intersectTargetArr,"LEFT");}else if(ddProxy.getDirection()=="RIGHT"){targetsOnMovingDirection=this.getTargetsOnDirection(ddProxy.targetBeforeInserted,intersectTargetArr,"RIGHT");}
var intersectTargetAndProxy;var regionOfTarget;if(targetsOnMovingDirection){for(idx in targetsOnMovingDirection){regionOfTarget=DDM.getLocation(targetsOnMovingDirection[idx]);intersectTargetAndProxy=regionOfTarget.intersect(proxyRegion);if(!intersectTargetAndProxy){continue;}
if((ddProxy.getDirection()=="UP")||(ddProxy.getDirection()=="DOWN")){if((regionOfTarget.bottom-regionOfTarget.top)<(proxyRegion.bottom-proxyRegion.top)){if((intersectTargetAndProxy.bottom-intersectTargetAndProxy.top)>=((regionOfTarget.bottom-regionOfTarget.top)/2)){return targetsOnMovingDirection[idx];}}else{if((intersectTargetAndProxy.bottom-intersectTargetAndProxy.top)>=((proxyRegion.bottom-proxyRegion.top)/2)){return targetsOnMovingDirection[idx];}}}else if((ddProxy.getDirection()=="LEFT")||(ddProxy.getDirection()=="RIGHT")){if((regionOfTarget.right-regionOfTarget.left)<(proxyRegion.right-proxyRegion.left)){if((intersectTargetAndProxy.right-intersectTargetAndProxy.left)>=((regionOfTarget.right-regionOfTarget.left)/2)){return targetsOnMovingDirection[idx];}}else{if((intersectTargetAndProxy.right-intersectTargetAndProxy.left)>=((proxyRegion.right-proxyRegion.left)/2)){return targetsOnMovingDirection[idx];}}}}}
return ddProxy.targetBeforeInserted;}
com.pictet.apps.fnc.web.component.dragable.DDTargetManager.prototype.getTargetsOnDirection=function(baseTarget,targetArr,direction){if(!baseTarget||!targetArr){return null;}
var result=new Array();var baseTargetRegion=DDM.getLocation(baseTarget);var testTargetRegion;var nextTarget;for(idx in targetArr){nextTarget=targetArr[idx];if(nextTarget.type==baseTarget.type){testTargetRegion=DDM.getLocation(targetArr[idx]);if((direction=="TOP")&&this.isTopRegion(testTargetRegion,baseTargetRegion)){result.push(targetArr[idx]);}else if((direction=="BOTTOM")&&this.isBottomRegion(testTargetRegion,baseTargetRegion)){result.push(targetArr[idx]);}else if((direction=="LEFT")&&this.isLeftRegion(testTargetRegion,baseTargetRegion)){result.push(targetArr[idx]);}else if((direction=="RIGHT")&&this.isRightRegion(testTargetRegion,baseTargetRegion)){result.push(targetArr[idx]);}}}
if(result.length==0){return null;}
this.sortTargetsOnDirection(result,direction);return result;}
com.pictet.apps.fnc.web.component.dragable.DDTargetManager.prototype.sortTargetsOnDirection=function(targetArrToSort,direction){if(!targetArrToSort||(targetArrToSort.length==0)){return null;}
var region1;var region2;for(stIdx=0;stIdx<targetArrToSort.length-1;stIdx=stIdx+1){for(ndIdx=stIdx+1;ndIdx<targetArrToSort.length;ndIdx=ndIdx+1){region1=DDM.getLocation(targetArrToSort[stIdx]);region2=DDM.getLocation(targetArrToSort[ndIdx]);if((direction=="TOP")){if(this.isTopRegion(region1,region2)){this.swap2ElementsInArray(targetArrToSort,stIdx,ndIdx);}}else if((direction=="BOTTOM")){if(this.isBottomRegion(region1,region2)){this.swap2ElementsInArray(targetArrToSort,stIdx,ndIdx);}}else if((direction=="LEFT")){if(this.isLeftRegion(region1,region2)){this.swap2ElementsInArray(targetArrToSort,stIdx,ndIdx);}}else if((direction=="RIGHT")){if(this.isRightRegion(region1,region2)){this.swap2ElementsInArray(targetArrToSort,stIdx,ndIdx);}}}}}
com.pictet.apps.fnc.web.component.dragable.DDTargetManager.prototype.swap2ElementsInArray=function(arr,idx1,idx2){var tmp;tmp=arr[idx1];arr[idx1]=arr[idx2];arr[idx2]=tmp;}
com.pictet.apps.fnc.web.component.dragable.DDTargetManager.prototype.isTopRegion=function(baseRegion,testRegion){if(baseRegion.bottom<=testRegion.top){return true;}
return false;}
com.pictet.apps.fnc.web.component.dragable.DDTargetManager.prototype.isBottomRegion=function(baseRegion,testRegion){if(baseRegion.top>=testRegion.bottom){return true;}
return false;}
com.pictet.apps.fnc.web.component.dragable.DDTargetManager.prototype.isLeftRegion=function(baseRegion,testRegion){if(baseRegion.right<=testRegion.left){return true;}
return false;}
com.pictet.apps.fnc.web.component.dragable.DDTargetManager.prototype.isRightRegion=function(baseRegion,testRegion){if(baseRegion.left>=testRegion.right){return true;}
return false;}
namespace("com.pictet.apps.fnc.web.component.filterSection");com.pictet.apps.fnc.web.component.filterSection.FilterSection=function(iComponentId,iCollapseMessageMultiCriteria,iCollapseMessageSingleCriteria,iHidablePanel){com.pictet.apps.fnc.web.component.filterSection.FilterSection.superclass.constructor.call(this);this.collapseMessageMulti=iCollapseMessageMultiCriteria;this.collapseMessageSingle=iCollapseMessageSingleCriteria;this.componentId=iComponentId;this.hidablePanel=iHidablePanel;this.registeredFilters=[];this.onFilter=new YAHOO.util.CustomEvent("onFilter");this.onFilter.subscribe(this.hiddenFilterSection,this,true);};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.filterSection.FilterSection,com.pictet.apps.fnc.web.component.abstractcomponent.AbstractComponent);com.pictet.apps.fnc.web.component.filterSection.FilterSection.prototype.subscribeActions=function(){eval(this.componentId+"_hidablePanel.onExpand.subscribe(this.hideFilterSummary, this, true)");eval(this.componentId+"_hidablePanel.onCollapse.subscribe(this.displayFilterSummary, this, true)");};com.pictet.apps.fnc.web.component.filterSection.FilterSection.prototype.register=function(iAbstractFormInstance){this.registeredFilters.push(iAbstractFormInstance);};com.pictet.apps.fnc.web.component.filterSection.FilterSection.prototype.hideFilterSummary=function(){$("#"+this.componentId+"_summary").empty();};com.pictet.apps.fnc.web.component.filterSection.FilterSection.prototype.displayFilterSummary=function(){var aTextToDisplay="";var aCounter=0;for(aEl in this.registeredFilters){if(this.isNotEmpty(aEl)){aCounter++;if(aCounter>1){aTextToDisplay+=" , ";}
aTextToDisplay=aTextToDisplay+this.registeredFilters[aEl].description;}}
if(aCounter>1){aTextToDisplay=aTextToDisplay+" "+this.collapseMessageMulti;}else if(aCounter==1){aTextToDisplay=aTextToDisplay+" "+this.collapseMessageSingle;}
$("#"+this.componentId+"_summary").empty();$("#"+this.componentId+"_summary").append(aTextToDisplay);};com.pictet.apps.fnc.web.component.filterSection.FilterSection.prototype.hiddenFilterSection=function(){eval(this.componentId+"_hidablePanel.collapse()");};com.pictet.apps.fnc.web.component.filterSection.FilterSection.prototype.isNotEmpty=function(item){if(item!="indexOf"){if(this.registeredFilters[item].getValueAsStr()!=""){return true;}}
return false;}
com.pictet.apps.fnc.web.component.filterSection.FilterSection.prototype.hasRegisteredFilters=function(){var result=false;for(aEl in this.registeredFilters){if(this.isNotEmpty(aEl)){result=true;break;}}
return result;}
com.pictet.apps.fnc.web.component.filterSection.FilterSection.prototype.hasInvalidFilter=function(){var result=false;for(var i=0;i<this.registeredFilters.length;i++){var aFilter=this.registeredFilters[i];if(aFilter.isInvalid){result=true;break;}}
return result;}
com.pictet.apps.fnc.web.component.filterSection.FilterSection.prototype.getHidablePanel=function(){return this.hidablePanel;}
namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.AbstractForm=function(iComponentId,iWidth,iDisabled,iDescription){com.pictet.apps.fnc.web.component.forms.AbstractForm.superclass.constructor.call(this);this.componentId=iComponentId;this.width=iWidth;this.isDisabled=iDisabled;this.description=iDescription;this.onValueChange=new YAHOO.util.CustomEvent('onValueChange');};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.AbstractForm,com.pictet.apps.fnc.web.component.abstractcomponent.AbstractComponent);com.pictet.apps.fnc.web.component.forms.AbstractForm.prototype.setWidth=function(iWidth){this.width=iWidth;};com.pictet.apps.fnc.web.component.forms.AbstractForm.prototype.getType=function(){return"form";};com.pictet.apps.fnc.web.component.forms.AbstractForm.prototype.getDescription=function(){return this.description;};com.pictet.apps.fnc.web.component.forms.AbstractForm.prototype.generate=function(iHtmlContainerId){$("#"+iHtmlContainerId).append('<input name="'+this.componentId+'" id="'+this.componentId+'_internalValue" type="hidden" />');$("#"+this.componentId+'_internalValue').val(this.getValueAsStr());};com.pictet.apps.fnc.web.component.forms.AbstractForm.prototype.getValueAsStr=function(){alert("method getValueAsStr() unimplemented in AbstractForm subclass !");};com.pictet.apps.fnc.web.component.forms.AbstractForm.prototype.updateStatus=function(){$("#"+this.componentId+'_internalValue').val(this.getValueAsStr());this.onValueChange.fire(this);};com.pictet.apps.fnc.web.component.forms.AbstractForm.prototype.updateStatusAndNotFireOnChange=function(){$("#"+this.componentId+'_internalValue').val(this.getValueAsStr());};com.pictet.apps.fnc.web.component.forms.AbstractForm.prototype.reset=function(){alert("method reset() unimplemented in AbstractForm subclass !");};com.pictet.apps.fnc.web.component.forms.AbstractForm.prototype.isMultivalued=function(){return false;};com.pictet.apps.fnc.web.component.forms.AbstractForm.prototype.synchronise=function(iSynchroniseComponent){alert("method synchronise() unimplemented in AbstractForm subclass !");};namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.Form=function(componentId,urlLink){com.pictet.apps.fnc.web.component.forms.Form.superclass.constructor.call(this,componentId);this.componentId=componentId;this.urlLink=urlLink;this.formFields=[];};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.Form,com.pictet.apps.fnc.web.component.abstractcomponent.AbstractComponent);com.pictet.apps.fnc.web.component.forms.Form.prototype.addField=function(iField,iName){this.formFields.push({field:iField,name:(iName?iName:iField.componentId)});}
com.pictet.apps.fnc.web.component.forms.Form.prototype.removeField=function(field){var newFields=[];for(var i=0;i<this.formFields.length;i++){if(this.formFields[i].field!=field){newFields.push(this.formFields[i].field);}}
this.formFields=newFields;}
com.pictet.apps.fnc.web.component.forms.Form.prototype.removeAllField=function(){this.formFields=[];}
com.pictet.apps.fnc.web.component.forms.Form.prototype.getComponentByComponentId=function(iComponentId){for(var i=0;i<this.formFields.length;i++){if(this.formFields[i].field.componentId==iComponentId){return this.formFields[i].field;}}
return null;}
com.pictet.apps.fnc.web.component.forms.Form.prototype.getNameByNumber=function(i){if(0<=i&&i<this.formFields.length){return this.formFields[i].name;}else{return null;}}
com.pictet.apps.fnc.web.component.forms.Form.prototype.getComponentByNumber=function(i){if(0<=i&&i<this.formFields.length){return this.formFields[i].field;}else{return null;}}
com.pictet.apps.fnc.web.component.forms.Form.prototype.getComponentIdByNumber=function(i){if(0<=i&&i<this.formFields.length){return this.formFields[i].field.componentId;}else{return null;}}
com.pictet.apps.fnc.web.component.forms.Form.prototype.getNumberOfFields=function(){return this.formFields.length;}
com.pictet.apps.fnc.web.component.forms.Form.prototype.getUrlLink=function(){return this.urlLink;}
com.pictet.apps.fnc.web.component.forms.Form.prototype.submitForm=function(submitUrl){var realUrl=this.urlLink;if(submitUrl){realUrl=submitUrl;}
var hiddenFields=['<form method="POST" id="',this.componentId,'_hiddenForm" action="',realUrl,'">'];for(var i=0;i<this.formFields.length;i++){if(this.formFields[i].field.isMultivalued()){var items=this.formFields[i].field.getValue();for(var j=0;j<items.length;j++){hiddenFields.push('<input type="hidden" name="',this.formFields[i].name,'" value="',this.html2Entities(items[j]),'"/>');}}else{hiddenFields.push('<input type="hidden" name="',this.formFields[i].name,'" value="',this.html2Entities(this.formFields[i].field.getValueAsStr()),'"/>');}}
hiddenFields.push('</form>');$("#"+this.componentId).append(hiddenFields.join(""));$("#"+this.componentId+"_hiddenForm").submit();}
namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.AbstractListForm=function(iComponentId,iWidth,iDisabled,iDescription){com.pictet.apps.fnc.web.component.forms.AbstractListForm.superclass.constructor.call(this,iComponentId,iWidth,iDisabled,iDescription);this.definitionArray=[];this.selectedElementsArray=[];this.defaultId=null;};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.AbstractListForm,com.pictet.apps.fnc.web.component.forms.AbstractForm);com.pictet.apps.fnc.web.component.forms.AbstractListForm.prototype.escapeArray=function(array){var escapedArray=[];for(var i=0;i<array.length;i++){escapedArray.push(array[i].replace(/\\/g,"\\\\").replace(/,/g,"\\,"));}
return escapedArray;}
com.pictet.apps.fnc.web.component.forms.AbstractListForm.prototype.splitListBasedValues=function(value){var comaSeparator="@";var escapeSeparator="#";var i=0;while(value.indexOf(comaSeparator)>=0){comaSeparator+=i++;}
while(value.indexOf(escapeSeparator)>=0){escapeSeparator+=i++;}
var unEscapedvalue=value.replace(/\\\\/g,escapeSeparator).replace(/\\,/g,comaSeparator);var values=unEscapedvalue.split(",");var regExpComa=new RegExp(comaSeparator,"g");var regExpescape=new RegExp(escapeSeparator,"g");for(var i=0;i<values.length;i++){values[i]=values[i].replace(regExpComa,",").replace(regExpescape,"\\");}
return values;}
com.pictet.apps.fnc.web.component.forms.AbstractListForm.prototype.getValueAsStr=function(){return this.escapeArray(this.selectedElementsArray).join(",");}
com.pictet.apps.fnc.web.component.forms.AbstractListForm.prototype.getValue=function(){return this.selectedElementsArray;};com.pictet.apps.fnc.web.component.forms.AbstractListForm.prototype.getDisplayValueAsStr=function(){var aStr=[];for(var aIdx=0;aIdx<this.selectedElementsArray.length;aIdx++){for(var index=0;index<this.definitionArray.length;index++){if(this.definitionArray[index].id==this.selectedElementsArray[aIdx]){aStr.push(this.definitionArray[index].text);break;}}}
return aStr.join(",");}
com.pictet.apps.fnc.web.component.forms.AbstractListForm.prototype.addItem=function(iId,iText,iIsClicked,iType,iClass){this.definitionArray.push({id:iId,text:iText,type:iType,cssClass:iClass});if(iIsClicked){this.addClickedElement(iId);}};com.pictet.apps.fnc.web.component.forms.AbstractListForm.prototype.addListItems=function(listItems){this.definitionArray=this.definitionArray.concat(listItems);for(var i=0;i<listItems.length;i++){if(listItems[i].isClicked){this.addClickedElement(listItems[i].id);}}};com.pictet.apps.fnc.web.component.forms.AbstractListForm.prototype.removeItem=function(iId){for(var i=this.definitionArray.length-1;i>=0;i--){if(this.definitionArray[i].id==iId){this.definitionArray[i]=this.definitionArray[this.definitionArray.length-1];this.definitionArray.pop();break;}}}
com.pictet.apps.fnc.web.component.forms.AbstractListForm.prototype.addClickedElement=function(iId){this.selectedElementsArray.push(iId);};com.pictet.apps.fnc.web.component.forms.AbstractListForm.prototype.removeClickedElement=function(iId){for(var i=this.selectedElementsArray.length-1;i>=0;i--){if(this.selectedElementsArray[i]==iId){this.selectedElementsArray[i]=this.selectedElementsArray[this.selectedElementsArray.length-1];this.selectedElementsArray.pop();break;}}};com.pictet.apps.fnc.web.component.forms.AbstractListForm.prototype.isElementClicked=function(iId){for(var aIdx=this.selectedElementsArray.length-1;aIdx>=0;aIdx--){if(this.selectedElementsArray[aIdx]==iId){return true;}}
return false;};com.pictet.apps.fnc.web.component.forms.AbstractListForm.prototype.setDefaultSelected=function(iDefaultId){this.defaultId=iDefaultId;this.selectedElementsArray.push(iDefaultId);}
com.pictet.apps.fnc.web.component.forms.AbstractListForm.prototype.getType=function(){return"abstractList";};com.pictet.apps.fnc.web.component.forms.AbstractListForm.prototype.reset=function(){this.selectedElementsArray=[];if(this.defaultId!=null){this.selectedElementsArray.push(this.defaultId);}};com.pictet.apps.fnc.web.component.forms.AbstractListForm.prototype.invert=function(){alert("interface - this function has to be implemented in the subclasses");};namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.RadioField=function(iComponentId,iWidth,iDisabled,iDescription,iDefaultSelected)
{this.defaultSelected=iDefaultSelected;com.pictet.apps.fnc.web.component.forms.RadioField.superclass.constructor.call(this,iComponentId,iWidth,iDisabled,iDescription);};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.RadioField,com.pictet.apps.fnc.web.component.forms.AbstractListForm);com.pictet.apps.fnc.web.component.forms.RadioField.prototype.generate=function(iHtmlContainerId){com.pictet.apps.fnc.web.component.forms.RadioField.superclass.generate.call(this,iHtmlContainerId);if(this.selectedElementsArray.length==0&&this.defaultSelected){if(!this.isElementClicked(this.definitionArray[0].id)){this.selectedElementsArray.push(this.definitionArray[0].id);}}
var str=["<ul>"];var currentClass="radioLine";for(var aColumn=0;aColumn<this.definitionArray.length;aColumn++){currentClass="radioLine";if(this.isElementClicked(this.definitionArray[aColumn].id)){currentClass="radioLineSelected";}
str.push("<li class=\"",currentClass,"\" id=\"",this.componentId,"_",this.definitionArray[aColumn].id,"\" >",this.definitionArray[aColumn].text,"</li>");}
str.push("</ul>");$("#"+iHtmlContainerId).append(str.join(""));for(var aColumn=0;aColumn<this.definitionArray.length;aColumn++){YAHOO.util.Event.addListener(this.componentId+'_'+this.definitionArray[aColumn].id,"click",this.toggleStatus,aColumn,this);}};com.pictet.apps.fnc.web.component.forms.RadioField.prototype.toggleStatus=function(ev,index){if(!this.isDisabled){var lId=null;if(this.selectedElementsArray.length!=0){lId=this.selectedElementsArray[0];}
this.toggleStatusOfSelectedItem(this.definitionArray[index].id);if(lId!=this.selectedElementsArray[0]){this.updateStatus();}}};com.pictet.apps.fnc.web.component.forms.RadioField.prototype.toggleStatusOfSelectedItem=function(selectedItemId){var lId=null;if(this.selectedElementsArray.length!=0){lId=this.selectedElementsArray[0];}
if((this.selectedElementsArray.length==0)||(lId!=selectedItemId)){if(this.selectedElementsArray.length!=0){$("#"+this.componentId+'_'+lId+".radioLineSelected").removeClass("radioLineSelected").addClass("radioLine");}
this.selectedElementsArray=[selectedItemId];$("#"+this.componentId+'_'+selectedItemId+".radioLine").removeClass("radioLine").addClass("radioLineSelected");}};com.pictet.apps.fnc.web.component.forms.RadioField.prototype.setValue=function(value){this.uncheckSelectedItem();for(var i=0;i<this.definitionArray.length;i++){if(this.definitionArray[i].id==value){this.selectedElementsArray=[value];$("#"+this.componentId+'_'+value+".radioLine").removeClass("radioLine").addClass("radioLineSelected");this.updateStatusAndNotFireOnChange();}}}
com.pictet.apps.fnc.web.component.forms.RadioField.prototype.reset=function(){this.uncheckSelectedItem();if(this.defaultSelected){this.selectedElementsArray=[this.definitionArray[0].id];$("#"+this.componentId+'_'+this.selectedElementsArray[0].id+".radioLine").removeClass("radioLine").addClass("radioLineSelected");this.updateStatusAndNotFireOnChange();}}
com.pictet.apps.fnc.web.component.forms.RadioField.prototype.uncheckSelectedItem=function(){for(var aColumn=0;aColumn<this.definitionArray.length;aColumn++){if(this.isElementClicked(this.definitionArray[aColumn].id)){$("#"+this.componentId+'_'+this.definitionArray[aColumn].id+".radioLineSelected").removeClass("radioLineSelected").addClass("radioLine");}}
com.pictet.apps.fnc.web.component.forms.RadioField.superclass.reset.call(this);this.updateStatusAndNotFireOnChange();}
namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.AbstractCombobox=function(iComponentId,iWidth,iBodyWidth,iCssDesign,iMaxMenuHeight,iDisabled,iIsMultiselect,iDescription,rightAlign,iStartElementsHidden){com.pictet.apps.fnc.web.component.forms.AbstractCombobox.superclass.constructor.call(this,iComponentId,iWidth,iDisabled,iDescription);this.cssDesign=iCssDesign;this.bodyWidth=0;this.isMultiselect=iIsMultiselect;this.menuMaxHeightInPx=iMaxMenuHeight;this.startElementsHidden=iStartElementsHidden;this.menu=null;this.timeoutValue=1500;this.timeout=null;this.defaultText="Select...";this.selectedText="selected items";this.idSlider=this.componentId+"Slidebar";this.menuHeightInPx=0;this.slider=null;this.dimensionsFixed=false;this.rightAlign=rightAlign;this.currentMarginTop=0;this.menuIsOpen=false;this.onMenuClose=new YAHOO.util.CustomEvent('onMenuClose');this.defaultMarginTop=-1;this.textSelector=null;this.menuSelector=null;this.menuTableSelector=null;this.minimunWith=0;this.isInvalid=false;};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.AbstractCombobox,com.pictet.apps.fnc.web.component.forms.AbstractListForm);com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.setDefaultText=function(iDefaultText){this.defaultText=iDefaultText;};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.setSelectedText=function(iselectedText){this.selectedText=iselectedText;};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.generate=function(iHtmlContainerId){com.pictet.apps.fnc.web.component.forms.AbstractCombobox.superclass.generate.call(this,iHtmlContainerId);this.generateHtml(iHtmlContainerId);if(this.definitionArray.length==0){this.isDisabled=true;}
this.textSelector=$("#"+this.componentId+"_text");this.buttonSelector=$("#"+this.componentId+"_button");this.textContainerSelector=$("#"+this.componentId+"_textContainer");this.initComponent();this.menuSelector=$("#"+this.componentId+"_menu");this.menuTableSelector=$("#"+this.componentId+"_menu_body_table");};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.generateHtml=function(iHtmlContainerId){var aStr=[];if(this.cssDesign!='default'){aStr.push('<div class="',this.cssDesign,'">');}
aStr.push('<div class="pictetcombobox" id="',this.componentId,'">','<table class="firstLevelContainer" cellpadding="0" cellspacing="0"><tr><td class="textContainer" id="',this.componentId,'_textContainer">','<div class="text" id="',this.componentId,'_text"></div></td>','<td class="buttonContainer"><div class="button" id="',this.componentId,'_button"></div></td></tr></table>');if(this.cssDesign!='default'){aStr.push('</div>');}
$("#"+iHtmlContainerId).append(aStr.join(""));};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.initComponent=function(){YAHOO.util.Event.addListener(this.componentId+"_text","click",this.displayMenu,this,true);YAHOO.util.Event.addListener(this.componentId+"_button","click",this.displayMenu,this,true);YAHOO.widget.Overlay.windowResizeEvent.subscribe(this.closeMenu,this,true);YAHOO.util.Event.addListener(document,"click",this.onClickInDoc,this,true);if(this.isDisabled){this.buttonSelector.removeClass("button").addClass("buttonDisabled");this.textSelector.addClass("textDisabled");}
var aTextWidth=parseInt(this.width,10)-28;this.textSelector.width(aTextWidth+"px");this.textContainerSelector.width(aTextWidth+"px");this.refreshText();this.initMenu();};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.initMenu=function(){var aCssClass="combobox";if(this.isMultiselect){aCssClass="comboboxMultiselect";}
var menuGenerated=["<div id=\"",this.componentId,"_menu\" class=\"",aCssClass," hidden\"><div id=\"",this.componentId,"_menu_body\" class=\"comboboxBody\"><table id=\"",this.componentId,"_menu_body_table\" class=\"comboboxTable\" >"];if(!this.startElementsHidden){for(var aColumn=0;aColumn<this.definitionArray.length;aColumn++){if(this.definitionArray[aColumn].type=='separator'){menuGenerated.push("<tr><td class=\"separator\"><div>&#160;</div></td></tr>");}else if(this.definitionArray[aColumn].type=='header'){menuGenerated.push("<tr><td class=\"title\">",this.definitionArray[aColumn].text,"</td></tr>");}else{var extraCss=(this.isElementClicked(this.definitionArray[aColumn].id)?" checked":"");menuGenerated.push("<tr id=\"tr_",this.componentId,"_item_",aColumn,"\" ><td class=\"comboboxText ",extraCss,"\" id=\"",this.componentId,"_item_",aColumn,"\" onMouseover=\"$(this).addClass('contentOver');\" onMouseout=\"$(this).removeClass('contentOver');\" ><div class=\"innerCss ",this.definitionArray[aColumn].type," ",this.definitionArray[aColumn].cssClass,"\" title=\"",this.definitionArray[aColumn].title,"\">",this.definitionArray[aColumn].text,"</div></td></tr>");}
this.definitionArray[aColumn].isHidden=false;}}
menuGenerated.push("</table></div></div>");$("#"+this.componentId).append(menuGenerated.join(""));var aThisMenu=this;YAHOO.util.Event.addListener(this.componentId+"_menu","mouseover",this.onMouseOver,aThisMenu);YAHOO.util.Event.addListener(this.componentId+"_menu","mouseout",this.onMouseOut,aThisMenu);YAHOO.util.Event.addListener(this.componentId+"_button","mouseover",this.onMouseOver,aThisMenu);YAHOO.util.Event.addListener(this.componentId+"_button","mouseout",this.onMouseOut,aThisMenu);YAHOO.util.Event.addListener(this.componentId+"_text","mouseover",this.onMouseOver,aThisMenu);YAHOO.util.Event.addListener(this.componentId+"_text","mouseout",this.onMouseOut,aThisMenu);};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.closeMenu=function(){if(!this.menuIsOpen){return;}
this.menuIsOpen=false;window.clearTimeout(this.timeout);this.menuSelector.addClass("hidden");this.buttonSelector.removeClass("buttonClicked").addClass("button");this.onMenuClose.fire();};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.displayMenu=function(){if(this.isDisabled){return;}
if(this.menuIsOpen){this.closeMenu();return;}
this.menuIsOpen=true;var buttonSelectorRegion=YAHOO.util.Dom.getRegion(this.componentId+"_button");this.buttonSelector.removeClass("button").addClass("buttonClicked");if(this.rightAlign){this.menuSelector.css("left","0");}
this.menuSelector.removeClass("hidden");if(!this.dimensionsFixed){this.fixDimensions();}
var viewPortHeight=YAHOO.util.Dom.getViewportHeight()+this.getScrollY();var menuHeightWhenOpen=this.menuHeightInPx>this.menuMaxHeightInPx?this.menuMaxHeightInPx:this.menuHeightInPx;var offsetWhenOpen=0;elementid=document.getElementById(this.componentId+"_button");while(elementid!=null){offsetWhenOpen+=elementid.offsetTop;elementid=elementid.offsetParent;}
offsetWhenOpen+=menuHeightWhenOpen+19;if(viewPortHeight<offsetWhenOpen&&offsetWhenOpen-(2*menuHeightWhenOpen)-19>0){if(this.currentMarginTop!=-(menuHeightWhenOpen)-19){this.menuSelector.css("margin-top",-(menuHeightWhenOpen)-19);this.currentMarginTop=-(menuHeightWhenOpen)-19;}}else{if(this.currentMarginTop!=0){this.menuSelector.css("margin-top",this.defaultMarginTop);this.currentMarginTop=0;}}
if(this.rightAlign){var menuLeft=buttonSelectorRegion.right-this.menuSelector.width()
-parseInt(this.menuSelector.css("border-left-width"),10)
-parseInt(this.menuSelector.css("border-right-width"),10);this.menuSelector.css("left",menuLeft+"px");}};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.fixDimensions=function(){this.menuHeightInPx=this.menuSelector.height();var aSlideBarWidth=0;if(this.menuHeightInPx>this.menuMaxHeightInPx){this.menuSelector.height(this.menuMaxHeightInPx+"px");aSlideBarWidth=16;}
this.minimunWith=(this.textSelector.width()
+parseInt(this.textSelector.css("padding-left"),10)
+parseInt(this.textSelector.css("padding-right"),10)
-parseInt(this.menuSelector.css("border-left-width"),10)
+parseInt(this.textSelector.css("border-left-width"),10)
+parseInt(this.textSelector.css("border-right-width"),10));var contentWidth=this.menuTableSelector.width();if(this.minimunWith>contentWidth){this.menuTableSelector.width(this.minimunWith+"px");this.menuSelector.width((this.minimunWith+aSlideBarWidth)+"px");}else{this.menuSelector.width((contentWidth+aSlideBarWidth)+"px");}
this.dimensionsFixed=true;};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.displayAll=function(){menuGenerated=[];for(var aColumn=0;aColumn<this.definitionArray.length;aColumn++){this.definitionArray[aColumn].isHidden=false;if(this.definitionArray[aColumn].type=='separator'){menuGenerated.push("<tr><td class=\"separator\"><div>&#160;</div></td></tr>");}else if(this.definitionArray[aColumn].type=='header'){menuGenerated.push("<tr><td class=\"title\">",this.definitionArray[aColumn].text,"</td></tr>");}else{var extraCss=(this.isElementClicked(this.definitionArray[aColumn].id)?" checked":"");menuGenerated.push("<tr id=\"tr_",this.componentId,"_item_",aColumn,"\" ><td class=\"comboboxText ",extraCss,"\" id=\"",this.componentId,"_item_",aColumn,"\" onMouseover=\"$(this).addClass('contentOver');\" onMouseout=\"$(this).removeClass('contentOver');\" ><div class=\"innerCss ",this.definitionArray[aColumn].type," ",this.definitionArray[aColumn].cssClass,"\" title=\"",this.definitionArray[aColumn].title,"\">",this.definitionArray[aColumn].text,"</div></td></tr>");}}
this.menuTableSelector.empty().append(menuGenerated.join(""));this.dimensionsFixed=false;this.menuSelector.height("auto");if(this.isDisabled){this.enable();}};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.displayOnlyList=function(list){if(list===null||list===""){this.disable();return;}
if(this.isDisabled){this.enable();}
var listToDisplay=list.split(",");var foundId=false;var selectionChanged=false;menuGenerated=[];for(var aColumn=0;aColumn<this.definitionArray.length;aColumn++){for(var i=0;i<listToDisplay.length;i++){if(this.definitionArray[aColumn].id==listToDisplay[i]){foundId=true;listToDisplay[i]=listToDisplay[listToDisplay.length-1];listToDisplay.pop();break;}}
if(foundId){this.definitionArray[aColumn].isHidden=false;if(this.definitionArray[aColumn].type=='separator'){menuGenerated.push("<tr><td class=\"separator\"><div>&#160;</div></td></tr>");}else if(this.definitionArray[aColumn].type=='header'){menuGenerated.push("<tr><td class=\"title\">",this.definitionArray[aColumn].text,"</td></tr>");}else{var extraCss=(this.isElementClicked(this.definitionArray[aColumn].id)?" checked":"");menuGenerated.push("<tr id=\"tr_",this.componentId,"_item_",aColumn,"\" ><td class=\"comboboxText ",extraCss,"\" id=\"",this.componentId,"_item_",aColumn,"\" onMouseover=\"$(this).addClass('contentOver');\" onMouseout=\"$(this).removeClass('contentOver');\" ><div class=\"innerCss ",this.definitionArray[aColumn].type," ",this.definitionArray[aColumn].cssClass,"\" title=\"",this.definitionArray[aColumn].title,"\">",this.definitionArray[aColumn].text,"</div></td></tr>");}}else{this.definitionArray[aColumn].isHidden=true;if(this.isElementClicked(this.definitionArray[aColumn].id)){this.removeClickedElement(this.definitionArray[aColumn].id);selectionChanged=true;}}
foundId=false;}
this.menuTableSelector.empty().append(menuGenerated.join(""));if(selectionChanged){this.updateStatus();this.refreshText();}
this.dimensionsFixed=false;this.menuSelector.height("auto");};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.getType=function(){return"combobox";};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.getScrollY=function(){var scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;}
return scrOfY;};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.onMouseOver=function(e,iThisContextMenu)
{window.clearTimeout(iThisContextMenu.timeout);};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.onMouseOut=function(e,iThisContextMenu)
{window.clearTimeout(iThisContextMenu.timeout);iThisContextMenu.timeout=window.setTimeout(function(){iThisContextMenu.closeMenu()},iThisContextMenu.timeoutValue);};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.onClickInDoc=function(e)
{if(!this.menuIsOpen){return;}
var target=YAHOO.util.Event.getTarget(e);var isClickedOutside=true;while(target!=null){var targetString=""+target.id;if(targetString==this.componentId+"_menu"||targetString==this.componentId+"_text"||targetString==this.componentId+"_button"||targetString.indexOf(this.componentId+"_item_",0)==0){isClickedOutside=false;break;}else{target=target.parentNode;}}
if(isClickedOutside){this.closeMenu();}else{var targetString=""+target.id;if(targetString.indexOf(this.componentId+"_item_",0)==0){var stringStart=this.componentId+"_item_";var pos=targetString.substring(stringStart.length);var iThis=this;this.onMenuClick(pos);}}};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.onMenuClick=function(iSelected){alert("method onMenuClick() unimplemented in AbstractCombobox subclass !");};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.reset=function(){this.resetSelection();};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.resetSelection=function(){this.selectedElementsArray=[];$("#"+this.componentId+"_menu_body_table td.checked").removeClass("checked");this.setDisplayedText(this.defaultText);this.updateStatusAndNotFireOnChange();};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.resetToDefaultAndFireOnChange=function(){if(this.defaultId){this.reset();this.addClickedElement(this.defaultId);for(var aItem=0;aItem<this.definitionArray.length;aItem++){if(this.definitionArray[aItem].id==this.defaultId){$("#"+this.componentId+"_item_"+aItem).addClass("checked");break;}}
this.refreshText();this.updateStatus();}else{this.reset();}}
com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.refreshText=function(){var aNewText="";if(this.selectedElementsArray.length==1){for(aElement in this.definitionArray){if(this.isElementClicked(this.definitionArray[aElement].id)){aNewText=this.definitionArray[aElement].text;break;}}}
if(aNewText===""){aNewText=this.defaultText;}
this.setDisplayedText(aNewText);};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.setDisplayedText=function(iTxt){this.textSelector.html(iTxt);};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.disable=function(){if(!this.isDisabled){this.resetSelection();this.buttonSelector.removeClass("button").addClass("buttonDisabled");this.textSelector.addClass("textDisabled");this.isDisabled=true;}};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.enable=function(){if(this.isDisabled){this.buttonSelector.removeClass("buttonDisabled").addClass("button");this.textSelector.removeClass("textDisabled");this.isDisabled=false;}};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.markInvalid=function(){$("#"+this.componentId+"_container").addClass("invalid");this.isInvalid=true;};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.markValid=function(){$("#"+this.componentId+"_container").removeClass("invalid");this.isInvalid=false;};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.sort=function(isAsc){var instance=this;var sortOrder=isAsc;this.definitionArray.sort(function(a,b){var val=0;if(a.text>b.text){val=1;}else if(a.text<b.text){val=-1;}
val=val*sortOrder;return val;});this.initMenu();};com.pictet.apps.fnc.web.component.forms.AbstractCombobox.prototype.getSelectedElements=function(){return this.selectedElementsArray;};namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.Combobox=function(iComponentId,iWidth,iBodyWidth,iCssDesign,iMaxMenuHeight,iDisabled,iDescription,rightAlign,iStartElementsHidden){com.pictet.apps.fnc.web.component.forms.Combobox.superclass.constructor.call(this,iComponentId,iWidth,iBodyWidth,iCssDesign,iMaxMenuHeight,iDisabled,false,iDescription,rightAlign,iStartElementsHidden);};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.Combobox,com.pictet.apps.fnc.web.component.forms.AbstractCombobox);com.pictet.apps.fnc.web.component.forms.Combobox.prototype.onMenuClick=function(oItem){if(oItem!=null){var i=oItem;var aId=this.definitionArray[i].id;if(this.definitionArray[i].type=='header'||this.definitionArray[i].type=='separator'){}else{this.resetSelection();if(this.isElementClicked(aId)){}else{$("#"+this.componentId+"_item_"+i).addClass("checked");this.addClickedElement(aId);}
this.refreshText();this.closeMenu();this.updateStatus();}}};com.pictet.apps.fnc.web.component.forms.Combobox.prototype.synchronise=function(iSynchComponent){if(this.getType()==iSynchComponent.getType()){if(this.isDisabled!=iSynchComponent.isDisabled){if(this.isDisabled){this.enable();}else{this.disable();}}
var aId=iSynchComponent.getValueAsStr();this.resetSelection();if(this.isElementClicked(aId)){}else{for(var aItem=0;aItem<this.definitionArray.length;aItem++){if(this.definitionArray[aItem].id==aId){$("#"+this.componentId+"_item_"+aItem).addClass("checked");break;}}
this.addClickedElement(aId);}
this.refreshText();this.updateStatus();}};namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.FormComboboxDoubleMultiselect=function(iComponentId,iDescription,multiSelectList,selectedList){com.pictet.apps.fnc.web.component.forms.FormComboboxDoubleMultiselect.superclass.constructor.call(this,iComponentId,"",false,iDescription);this.componentId=iComponentId;this.selectedList=selectedList;this.multiSelectList=multiSelectList;this.description=iDescription;this.isHidden=true;this.onValueChange=new YAHOO.util.CustomEvent('onValueChange');};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.FormComboboxDoubleMultiselect,com.pictet.apps.fnc.web.component.forms.AbstractForm);com.pictet.apps.fnc.web.component.forms.FormComboboxDoubleMultiselect.prototype.init=function(){YAHOO.util.Event.addListener(this.componentId+"_textcontainer","click",this.textOrButtonClicked,this,true);YAHOO.util.Event.addListener(this.componentId+"_button","click",this.textOrButtonClicked,this,true);YAHOO.util.Event.addListener(document,"click",this.onClickInDoc,this,true);YAHOO.util.Event.addListener(this.componentId+"_doubleMultiselect_close","click",this.hideFormComboboxDoubleMultiselect,this,true);YAHOO.util.Event.addListener(this.componentId+"_doubleMultiselect_multiselectList_add","click",this.addButtonClicked,this,true);YAHOO.util.Event.addListener(this.componentId+"_doubleMultiselect_multiselectList_remove","click",this.removeButtonClicked,this,true);this.updateDisplayedText();}
com.pictet.apps.fnc.web.component.forms.FormComboboxDoubleMultiselect.prototype.textOrButtonClicked=function(){if(!this.isHidden){this.hideFormComboboxDoubleMultiselect();}else{this.showFormComboboxDoubleMultiselect();}}
com.pictet.apps.fnc.web.component.forms.FormComboboxDoubleMultiselect.prototype.addButtonClicked=function(){var selection=this.multiSelectList.removeSelection();this.selectedList.addSelection(selection);this.updateDisplayedText();}
com.pictet.apps.fnc.web.component.forms.FormComboboxDoubleMultiselect.prototype.removeButtonClicked=function(){var removedElementsArray=this.selectedList.removeSelection();this.multiSelectList.addSelection(removedElementsArray);this.updateDisplayedText();}
com.pictet.apps.fnc.web.component.forms.FormComboboxDoubleMultiselect.prototype.showFormComboboxDoubleMultiselect=function(){$("#"+this.componentId+"_menu").removeClass("hidden");$("#"+this.componentId+"_button").removeClass("CBbutton").addClass("CBbuttonClicked");this.isHidden=false;}
com.pictet.apps.fnc.web.component.forms.FormComboboxDoubleMultiselect.prototype.hideFormComboboxDoubleMultiselect=function(){$("#"+this.componentId+"_menu").addClass("hidden");$("#"+this.componentId+"_button").removeClass("CBbuttonClicked").addClass("CBbutton");this.updateDisplayedText();this.isHidden=true;}
com.pictet.apps.fnc.web.component.forms.FormComboboxDoubleMultiselect.prototype.updateDisplayedText=function(){var selectedArray=this.selectedList.definitionArray;if(selectedArray.length==1){this.setDisplayedText(selectedArray[0].text);}
else if(selectedArray.length>1){this.setDisplayedText(selectedArray.length+" "+this.labels['message']['selectedText']);}else if(selectedArray.length==0){this.setDisplayedText(this.labels['message']['select']);}}
com.pictet.apps.fnc.web.component.forms.FormComboboxDoubleMultiselect.prototype.onClickInDoc=function(e){var target=YAHOO.util.Event.getTarget(e);var isClickedOutside=true;while(target!=null){if(target.id==this.componentId+"_menu"||target.id==this.componentId+"_text"||target.id==this.componentId+"_textcontainer"||target.id==this.componentId+"_button"){isClickedOutside=false;break;}else{target=target.parentNode;}}
if(isClickedOutside&&!this.isHidden){this.hideFormComboboxDoubleMultiselect();}}
com.pictet.apps.fnc.web.component.forms.FormComboboxDoubleMultiselect.prototype.onMouseOver=function(e,iThisContextMenu){}
com.pictet.apps.fnc.web.component.forms.FormComboboxDoubleMultiselect.prototype.setDisplayedText=function(iTxt){$("#"+this.componentId+"_text").empty();$("#"+this.componentId+"_text").append(iTxt);}
com.pictet.apps.fnc.web.component.forms.FormComboboxDoubleMultiselect.prototype.reset=function(){this.setDisplayedText(this.labels['message']['select']);this.selectedList.selectAll();var removedElementsArray=this.selectedList.removeSelection();this.multiSelectList.addSelection(removedElementsArray);}
com.pictet.apps.fnc.web.component.forms.FormComboboxDoubleMultiselect.prototype.getValueAsStr=function(){return this.selectedList.getValueAsStr();}
namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.MultiselectCombobox=function(iComponentId,iWidth,iBodyWidth,iCssDesign,iMaxMenuHeight,iDisabled,iDescription,rightAlign,iStartElementsHidden,iIsInsideTable){com.pictet.apps.fnc.web.component.forms.MultiselectCombobox.superclass.constructor.call(this,iComponentId,iWidth,iBodyWidth,iCssDesign,iMaxMenuHeight,iDisabled,true,iDescription,rightAlign,iStartElementsHidden);this.isSelectAllItemPresent=false;this.updateStatusTimeout=null;this.updateStatusTimeoutValue=1500;this.isInsideTable=iIsInsideTable;this.canSelectAllBeClickable=false;this.nbOfDisplayedElements=0;};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.MultiselectCombobox,com.pictet.apps.fnc.web.component.forms.AbstractCombobox);com.pictet.apps.fnc.web.component.forms.MultiselectCombobox.prototype.generate=function(iHtmlContainerId){com.pictet.apps.fnc.web.component.forms.MultiselectCombobox.superclass.generate.call(this,iHtmlContainerId);this.checkToSelectAll();if(this.isInsideTable&&this.isSelectAllItemPresent&&!this.canSelectAllBeClickable){$("#"+this.componentId+"_item_0").addClass("notClickable");}}
com.pictet.apps.fnc.web.component.forms.MultiselectCombobox.prototype.onMenuClick=function(oItem){if(oItem!=null){var i=oItem;var aId=this.definitionArray[i].id;if(aId!="selectAll"){if(this.isInsideTable&&this.nbOfDisplayedElements==1){return;}
if(this.isElementClicked(aId)){$("#"+this.componentId+"_item_"+i).removeClass("checked");this.removeClickedElement(aId);if(this.isSelectAllItemPresent){this.unclickSelectAll();}}
else{$("#"+this.componentId+"_item_"+i).addClass("checked");this.addClickedElement(aId);this.checkToSelectAll();}
if(this.isInsideTable&&this.isSelectAllItemPresent){this.canSelectAllBeClickable=true;$("#"+this.componentId+"_item_0.notClickable").removeClass("notClickable");}}
else{if(this.isInsideTable&&!this.canSelectAllBeClickable){return;}
if(this.isElementClicked(aId)){this.resetSelection();}
else{this.selectAll();}}
this.refreshText();$("#"+this.componentId+'_internalValue').val(this.getValueAsStr());window.clearTimeout(this.updateStatusTimeout);this.updateStatusTimeout=window.setTimeout(this.componentId+".tryUpdateStatus()",this.updateStatusTimeoutValue);}};com.pictet.apps.fnc.web.component.forms.MultiselectCombobox.prototype.tryUpdateStatus=function(){this.updateStatus();};com.pictet.apps.fnc.web.component.forms.MultiselectCombobox.prototype.unclickSelectAll=function(){if(this.isElementClicked("selectAll")){$("#"+this.componentId+"_item_0.checked").removeClass("checked");this.removeClickedElement("selectAll");}};com.pictet.apps.fnc.web.component.forms.MultiselectCombobox.prototype.selectAll=function(){this.selectedElementsArray=[];for(var aColumn=0;aColumn<this.definitionArray.length;aColumn++){if(!this.definitionArray[aColumn].isHidden){this.addClickedElement(this.definitionArray[aColumn].id);}}
$("#"+this.componentId+"_menu td").addClass("checked");};com.pictet.apps.fnc.web.component.forms.MultiselectCombobox.prototype.areAllSelected=function(){for(var aColumn=0;aColumn<this.definitionArray.length;aColumn++){if(!this.definitionArray[aColumn].isHidden&&!this.isElementClicked(this.definitionArray[aColumn].id)&&this.definitionArray[aColumn].id!="selectAll"){return false;}}
if(this.definitionArray.length==0||(this.definitionArray.length==1&&this.isSelectAllItemPresent)){return false;}
return true;};com.pictet.apps.fnc.web.component.forms.MultiselectCombobox.prototype.addSelectAllItem=function(iText,iIsClicked){var aItemDefinition=[];aItemDefinition.id="selectAll";aItemDefinition.text=iText;this.definitionArray.push(aItemDefinition);if(iIsClicked){this.addClickedElement(aItemDefinition.id);}
this.isSelectAllItemPresent=true;};com.pictet.apps.fnc.web.component.forms.MultiselectCombobox.prototype.refreshText=function(){var aNewText="";if(this.selectedElementsArray.length==1){for(aElement in this.definitionArray){if(this.isElementClicked(this.definitionArray[aElement].id)){aNewText=this.definitionArray[aElement].text;break;}}}
else if(this.selectedElementsArray.length>1){var aElementNb=this.selectedElementsArray.length;if(this.isElementClicked("selectAll")){aElementNb-=1;}
aNewText=[aElementNb," ",this.selectedText].join("");}
if(aNewText===""){aNewText=this.defaultText;}
this.setDisplayedText(aNewText);};com.pictet.apps.fnc.web.component.forms.MultiselectCombobox.prototype.checkToSelectAll=function(){if(this.isSelectAllItemPresent&&this.areAllSelected()){this.addClickedElement("selectAll");$("#"+this.componentId+"_menu td").addClass("checked");}};com.pictet.apps.fnc.web.component.forms.MultiselectCombobox.prototype.displayOnlyList=function(list){if(this.isSelectAllItemPresent&&list.length!=0){list="selectAll,"+list;}
com.pictet.apps.fnc.web.component.forms.MultiselectCombobox.superclass.displayOnlyList.call(this,list);if(this.isSelectAllItemPresent&&list.length!=0){this.checkToSelectAll();}
if(this.isInsideTable&&this.isSelectAllItemPresent){this.canSelectAllBeClickable=false;var elements=list.split(",");this.nbOfDisplayedElements=elements.length-1;if(this.nbOfDisplayedElements==1){$("#"+this.componentId+" td").addClass("notClickable");}else{$("#"+this.componentId+" .notClickable").removeClass("notClickable");}
$("#"+this.componentId+"_item_0").addClass("notClickable");}}
com.pictet.apps.fnc.web.component.forms.MultiselectCombobox.prototype.closeMenu=function(){com.pictet.apps.fnc.web.component.forms.MultiselectCombobox.superclass.closeMenu.call(this);if(this.isInsideTable&&this.isSelectAllItemPresent&&this.selectedElementsArray.length==0&&this.canSelectAllBeClickable){this.canSelectAllBeClickable=false;$("#"+this.componentId+"_item_0").addClass("notClickable");}}
namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.TabField=function(iComponentId,iWidth,iDisabled,iDescription){com.pictet.apps.fnc.web.component.forms.TabField.superclass.constructor.call(this,iComponentId,iWidth,iDisabled,iDescription);this.displayLeftSeparator=false;this.displayRightSeparator=false;this.displayElementNb=0;};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.TabField,com.pictet.apps.fnc.web.component.forms.AbstractListForm);com.pictet.apps.fnc.web.component.forms.TabField.prototype.setDisplayLeftSeparator=function(iBoolean){this.displayLeftSeparator=iBoolean;}
com.pictet.apps.fnc.web.component.forms.TabField.prototype.setDisplayRightSeparator=function(iBoolean){this.displayRightSeparator=iBoolean;}
com.pictet.apps.fnc.web.component.forms.TabField.prototype.generate=function(iHtmlContainerId){com.pictet.apps.fnc.web.component.forms.TabField.superclass.generate.call(this,iHtmlContainerId);this.displayElementNb=this.definitionArray.length;var str='<div class="tabField" id="'+this.componentId+'">';str+='  <ul>';str+='   <li class="separator" id="'+this.componentId+'_tabFieldSeparator_0">&#160;</li>';var aSeparatorCounter=0;var aSelectedIndex=-1;for(i in this.definitionArray){if(this.definitionArray[i]['id']==this.selectedElementsArray[0]){aSelectedIndex=i;}
aSeparatorCounter++;if(this.definitionArray[i]['type']=='hidden'){str+='  <li class="tabItemHidden" id="'+this.componentId+'_'+this.definitionArray[i]['id']+'">'+this.definitionArray[i]['text']+'</li>';}else{str+='  <li class="tabItem" id="'+this.componentId+'_'+this.definitionArray[i]['id']+'">'+this.definitionArray[i]['text']+'</li>';}
str+='  <li class="separator" id="'+this.componentId+'_tabFieldSeparator_'+aSeparatorCounter+'">&#160;</li>';}
str+='  </ul>';str+=' </div>';$("#"+iHtmlContainerId).append(str);for(i in this.definitionArray){var aSelectedElement=[];aSelectedElement["id"]=this.definitionArray[i]['id'];aSelectedElement["index"]=i;YAHOO.util.Event.addListener(this.componentId+'_'+this.definitionArray[i]['id'],"click",this.onMenuClick,aSelectedElement,this,true);YAHOO.util.Event.addListener(this.componentId+'_'+this.definitionArray[i]['id'],"mouseover",this.onMouseOver,aSelectedElement,this,true);YAHOO.util.Event.addListener(this.componentId+'_'+this.definitionArray[i]['id'],"mouseout",this.onMouseOut,aSelectedElement,this,true);}
if(aSelectedIndex!=-1){$("#"+this.componentId+"_tabFieldSeparator_"+aSelectedIndex).removeClass("separator").addClass("separatorLeft");var aSelectedRightSeparatorIndex=parseFloat(aSelectedIndex)+1;$("#"+this.componentId+"_tabFieldSeparator_"+aSelectedRightSeparatorIndex).removeClass("separator").addClass("separatorRight");if(aSelectedIndex!=(this.definitionArray.length-1)&&!this.displayRightSeparator){$("#"+this.componentId+"_tabFieldSeparator_"+aSeparatorCounter).removeClass("separator").addClass("separatorHidden");}
if(aSelectedIndex!=0&&!this.displayLeftSeparator){$("#"+this.componentId+"_tabFieldSeparator_0").removeClass("separator").addClass("separatorHidden");}
$("#"+this.componentId+'_'+this.selectedElementsArray[0]).removeClass("tabItem").addClass("tabItemSelected");}else{if(!this.displayLeftSeparator){$("#"+this.componentId+"_tabFieldSeparator_0").removeClass("separator").addClass("separatorHidden");}
if(!this.displayRightSeparator){$("#"+this.componentId+"_tabFieldSeparator_"+aSeparatorCounter).removeClass("separator").addClass("separatorHidden");}}};com.pictet.apps.fnc.web.component.forms.TabField.prototype.displayItemsByListOfCbx=function(cbxList){this.displayElementNb=0;this.unHideAllItems();var aSeparatorCounter=0;var aSelectedIndex=-1;var isPreSelectElementDisplay=false;for(var i=0;i<cbxList.length;i++){aSeparatorCounter++;if(cbxList[i].type=='hidden'){this.hideAnItem(i,aSeparatorCounter);}else{this.displayElementNb++;if(this.selectedElementsArray[0]==cbxList[i].id){isPreSelectElementDisplay=true;aSelectedIndex=i;}}}
if(isPreSelectElementDisplay){$("#"+this.componentId+"_tabFieldSeparator_"+aSelectedIndex+".separator").removeClass("separator").addClass("separatorLeft");var aSelectedRightSeparatorIndex=parseFloat(aSelectedIndex)+1;$("#"+this.componentId+"_tabFieldSeparator_"+aSelectedRightSeparatorIndex).removeClass("separator").addClass("separatorRight");$("#"+this.componentId+'_'+this.selectedElementsArray[0]).removeClass("tabItem").addClass("tabItemSelected");}
if(aSelectedIndex!=(this.displayElementNb-1)&&!this.displayRightSeparator){$("#"+this.componentId+"_tabFieldSeparator_"+this.displayElementNb).removeClass("separator").addClass("separatorHidden");}
if(aSelectedIndex!=0&&!this.displayLeftSeparator){$("#"+this.componentId+"_tabFieldSeparator_0").removeClass("separator").addClass("separatorHidden");}}
com.pictet.apps.fnc.web.component.forms.TabField.prototype.unHideAllItems=function(){var aOldSelected=this.selectedElementsArray[0];$("#"+this.componentId+" .separatorLeft").removeClass("separatorLeft").addClass("separator");$("#"+this.componentId+'_'+aOldSelected).removeClass("tabItemSelected").addClass("tabItem");$("#"+this.componentId+" .separatorRight").removeClass("separatorRight").addClass("separator");$("#"+this.componentId+"_tabFieldSeparator_0.separatorHidden").removeClass("separatorHidden").addClass("separator");$("#"+this.componentId+"_tabFieldSeparator_"+(this.displayElementNb)+".separatorHidden").removeClass("separatorHidden").addClass("separator");var aSeparatorCounter=0;for(var i=0;i<this.definitionArray.length;i++){aSeparatorCounter++;this.unHideAnItem(i,aSeparatorCounter);}}
com.pictet.apps.fnc.web.component.forms.TabField.prototype.hideAnItem=function(i,aSeparatorCounter){$("#"+this.componentId+"_"+this.definitionArray[i]['id']+".tabItem").removeClass("tabItem").addClass("tabItemHidden");$("#"+this.componentId+"_tabFieldSeparator_"+aSeparatorCounter+".separator").removeClass("separator").addClass("separatorHidden");}
com.pictet.apps.fnc.web.component.forms.TabField.prototype.unHideAnItem=function(i,aSeparatorCounter){$("#"+this.componentId+"_"+this.definitionArray[i]['id']+".tabItemHidden").removeClass("tabItemHidden").addClass("tabItem");$("#"+this.componentId+"_tabFieldSeparator_"+aSeparatorCounter+".separatorHidden").removeClass("separatorHidden").addClass("separator");}
com.pictet.apps.fnc.web.component.forms.TabField.prototype.locking=function(){for(i in this.definitionArray){YAHOO.util.Event.removeListener(this.componentId+'_'+this.definitionArray[i]['id'],"click",this.onMenuClick);YAHOO.util.Event.removeListener(this.componentId+'_'+this.definitionArray[i]['id'],"mouseover",this.onMouseOver);YAHOO.util.Event.removeListener(this.componentId+'_'+this.definitionArray[i]['id'],"mouseout",this.onMouseOut);}}
com.pictet.apps.fnc.web.component.forms.TabField.prototype.unLocking=function(){for(i in this.definitionArray){var aSelectedElement=[];aSelectedElement["id"]=this.definitionArray[i]['id'];aSelectedElement["index"]=i;YAHOO.util.Event.addListener(this.componentId+'_'+this.definitionArray[i]['id'],"click",this.onMenuClick,aSelectedElement,this,true);YAHOO.util.Event.addListener(this.componentId+'_'+this.definitionArray[i]['id'],"mouseover",this.onMouseOver,aSelectedElement,this,true);YAHOO.util.Event.addListener(this.componentId+'_'+this.definitionArray[i]['id'],"mouseout",this.onMouseOut,aSelectedElement,this,true);}}
com.pictet.apps.fnc.web.component.forms.TabField.prototype.onMouseOver=function(event,iSelectedElement){$("#"+this.componentId+"_"+iSelectedElement["id"]+".tabItemSelected").removeClass("tabItemSelected").addClass("tabItemSelectedHighlighted");$("#"+this.componentId+"_"+iSelectedElement["id"]+".tabItem").removeClass("tabItem").addClass("tabItemHighlighted");}
com.pictet.apps.fnc.web.component.forms.TabField.prototype.onMouseOut=function(event,iSelectedElement){$("#"+this.componentId+"_"+iSelectedElement["id"]+".tabItemSelectedHighlighted").removeClass("tabItemSelectedHighlighted").addClass("tabItemSelected");$("#"+this.componentId+"_"+iSelectedElement["id"]+".tabItemHighlighted").removeClass("tabItemHighlighted").addClass("tabItem");}
com.pictet.apps.fnc.web.component.forms.TabField.prototype.onMenuClick=function(event,iSelectedElement){if(iSelectedElement["id"]!=this.selectedElementsArray[0]){var aOldSelected=this.selectedElementsArray[0];this.selectedElementsArray.pop();$("#"+this.componentId+" .separatorLeft").removeClass("separatorLeft").addClass("separator");$("#"+this.componentId+'_'+aOldSelected).removeClass("tabItemSelected").addClass("tabItem");$("#"+this.componentId+" .separatorRight").removeClass("separatorRight").addClass("separator");$("#"+this.componentId+"_tabFieldSeparator_0.separatorHidden").removeClass("separatorHidden").addClass("separator");$("#"+this.componentId+"_tabFieldSeparator_"+(this.displayElementNb)+".separatorHidden").removeClass("separatorHidden").addClass("separator");this.selectedElementsArray[0]=iSelectedElement["id"];aSeparatorCounter=iSelectedElement["index"];$("#"+this.componentId+"_tabFieldSeparator_"+aSeparatorCounter+".separator").removeClass("separator").addClass("separatorLeft");aSeparatorCounter++;$("#"+this.componentId+"_"+iSelectedElement["id"]).removeClass("tabItem").addClass("tabItemSelected");$("#"+this.componentId+"_tabFieldSeparator_"+aSeparatorCounter+".separator").removeClass("separator").addClass("separatorRight");if(iSelectedElement["index"]!=(this.displayElementNb-1)&&!this.displayRightSeparator){$("#"+this.componentId+"_tabFieldSeparator_"+this.displayElementNb+".separator").removeClass("separator").addClass("separatorHidden");}
if(iSelectedElement["index"]!=0&&!this.displayLeftSeparator){$("#"+this.componentId+"_tabFieldSeparator_0.separator").removeClass("separator").addClass("separatorHidden");}
this.updateStatus();}};com.pictet.apps.fnc.web.component.forms.TabField.prototype.reset=function(){}
namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.EditableTabField=function(iComponentId,iEditable){this.componentId=iComponentId;this.editable=iEditable;this.internalValue="";this.isEditing=false;this.onFinishEditing=new YAHOO.util.CustomEvent("onFinishEditing");this.previousValue;this.toolTipComponent;this.toolTip;};com.pictet.apps.fnc.web.component.forms.EditableTabField.prototype.init=function(){$("#"+this.componentId+"Editor").width($("#"+this.componentId+"Ruler").width()+13);$("#"+this.componentId+"Container").width($("#"+this.componentId+"Container").width()+16);if(this.editable){YAHOO.util.Event.addListener(this.componentId+"SelectedTab","mouseover",this.activeEdit,this,true);YAHOO.util.Event.addListener(this.componentId+"SelectedTab","mouseout",this.inActiveEdit,this,true);YAHOO.util.Event.addListener(this.componentId+"Editor","click",this.startEdit,this,true);YAHOO.util.Event.addListener(this.componentId+"Editor","blur",this.endEdit,this,true);YAHOO.util.Event.addListener(this.componentId+"Editor","keyup",this.doEdit,this,true);}}
com.pictet.apps.fnc.web.component.forms.EditableTabField.prototype.activeEdit=function(){$("#"+this.componentId+"Editor").addClass("activeEdit");if(this.toolTipComponent){this.toolTipComponent.makeAndShowTooltip(this.componentId+"Editor",this.toolTip);}}
com.pictet.apps.fnc.web.component.forms.EditableTabField.prototype.startEdit=function(){var editor=$("#"+this.componentId+"Editor");var container=$("#"+this.componentId+"Container");if(this.isEditing==false){this.isEditing=true;editor.attr("readonly","");editor.select();}
editor.focus();}
com.pictet.apps.fnc.web.component.forms.EditableTabField.prototype.doEdit=function(){var ruler=$("#"+this.componentId+"Ruler");var editor=$("#"+this.componentId+"Editor");var container=$("#"+this.componentId+"Container");this.internalValue=editor.val();ruler.text(this.internalValue);editor.width(ruler.width()+13);container.width(ruler.width()+16);}
com.pictet.apps.fnc.web.component.forms.EditableTabField.prototype.endEdit=function(){if(this.isEditing==true){this.isEditing=false;var editor=$("#"+this.componentId+"Editor");var container=$("#"+this.componentId+"Container");var newValue=editor.val();if(!newValue||newValue==''){editor.attr('value',this.previousValue);this.internalValue=this.previousValue;var ruler=$("#"+this.componentId+"Ruler");ruler.text(this.internalValue);editor.width(ruler.width()+13);container.width(ruler.width()+16);}else if(this.previousValue!=newValue){this.previousValue=newValue;this.onFinishEditing.fire();}
editor.removeClass("activeEdit");editor.attr("readonly","true");}}
com.pictet.apps.fnc.web.component.forms.EditableTabField.prototype.inActiveEdit=function(){if(this.isEditing==false){$("#"+this.componentId+"Editor").removeClass("activeEdit");}}
com.pictet.apps.fnc.web.component.forms.EditableTabField.prototype.setInternalValue=function(value){this.internalValue=value;}
com.pictet.apps.fnc.web.component.forms.EditableTabField.prototype.getValueAsStr=function(){return this.internalValue;}
com.pictet.apps.fnc.web.component.forms.EditableTabField.prototype.setPreviousValue=function(value){this.previousValue=value;}
com.pictet.apps.fnc.web.component.forms.EditableTabField.prototype.setToolTipComponent=function(value){this.toolTipComponent=value;}
com.pictet.apps.fnc.web.component.forms.EditableTabField.prototype.setToolTip=function(value){this.toolTip=value;}
com.pictet.apps.fnc.web.component.forms.EditableTabField.prototype.focus=function(){this.startEdit();return true;}
com.pictet.apps.fnc.web.component.forms.EditableTabField.prototype.markInvalid=function(){}
com.pictet.apps.fnc.web.component.forms.EditableTabField.prototype.isMultivalued=function(){return false;};namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.EditableTabFieldItem=function(iComponentId,iParentId,iFundsSetId,iErrorMessage,iIsError){this.componentId=iComponentId;this.parentId=iParentId;this.fundsSetId=iFundsSetId;this.errorMessage=iErrorMessage;this.isError=iIsError;};com.pictet.apps.fnc.web.component.forms.EditableTabFieldItem.prototype.editFundsSet=function(){fundsSetIdTextField.setValue(this.fundsSetId);fundsListForm.submitForm(fundsListForm.getUrlLink()+"&_eventId=showFS");};com.pictet.apps.fnc.web.component.forms.EditableTabFieldItem.prototype.confirmChanged=function(messageFirerComponentId){if(this.isError=='false'){if(fundsListDetailFundsSet.iDataChanged==true){fundsListDetailFundsSet.showPopup();YAHOO.util.Event.addListener("confirmLeave_btnYES","click",function(e,obj){fundsListDetailFundsSet.hidePopup();obj.editFundsSet();},this,true);YAHOO.util.Event.addListener("confirmLeave_btnYESRightArea","click",function(e,obj){fundsListDetailFundsSet.hidePopup();obj.editFundsSet();},this,true);}else{this.editFundsSet();}}else{var messages=[];messageFirerComponentId.onMessage.fire(messages);messages[0]=new com.pictet.apps.fnc.web.component.Message(this.errorMessage,"error");messageFirerComponentId.onMessage.fire(messages);}};com.pictet.apps.fnc.web.component.forms.EditableTabFieldItem.prototype.deleteFundsSet=function(){fundsSetIdTextField.setValue(this.fundsSetId);fundsListForm.submitForm(fundsListForm.getUrlLink()+"&_eventId=deleteFS");};com.pictet.apps.fnc.web.component.forms.EditableTabFieldItem.prototype.getValueAsStr=function(){return $("#"+this.parentId+"Editor").val();};com.pictet.apps.fnc.web.component.forms.EditableTabFieldItem.prototype.markInvalid=function(){$("#"+this.componentId).addClass("invalid");};com.pictet.apps.fnc.web.component.forms.EditableTabFieldItem.prototype.markValid=function(){$("#"+this.componentId+".invalid").removeClass("invalid");};com.pictet.apps.fnc.web.component.forms.EditableTabFieldItem.prototype.focus=function(){return false;};com.pictet.apps.fnc.web.component.forms.EditableTabFieldItem.prototype.isMultivalued=function(){return false;};namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList=function(iComponentId,iWidth,iMaxListHeight,iDisabled,iIsMultiselect,iDescription,iHasCheckBox){com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.superclass.constructor.call(this,iComponentId,iWidth,iDisabled,iDescription);this.isMultiselect=iIsMultiselect;this.listMaxHeightInPx=iMaxListHeight;this.hasCheckbox=iHasCheckBox;this.listHeightInPx=0;this.idSlider=this.componentId+"_Slidebar";this.slider=null;this.lastSelectedItem=null;this.containerY=0;this.elementFromDomId={};this.separatorsDefinition={};this.onAllSelected=new YAHOO.util.CustomEvent('onAllSelected');};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList,com.pictet.apps.fnc.web.component.forms.AbstractListForm);com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.generate=function(){YAHOO.util.Event.addListener(this.componentId+"_msList","click",this.onClickInDoc,this,true);$("#"+this.componentId+"_msList").disableTextSelect();this.containerY=YAHOO.util.Dom.getXY(this.componentId+"_msListContainer")[1];};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.addItem=function(iId,iDomId,iText,iIsSelected,iParentSeparator,iIsHighlighted,iLinkedItems,isHeaderItem){var aItemDefinition={id:iId,text:iText,highlighted:iIsHighlighted,isRemoved:iIsSelected,parentSeparator:iParentSeparator,linkedItems:iLinkedItems,domId:iDomId};this.definitionArray.push(aItemDefinition);this.elementFromDomId[iDomId]=aItemDefinition;if(this.separatorsDefinition[iParentSeparator]==null){this.separatorsDefinition[iParentSeparator]=[];}
this.separatorsDefinition[iParentSeparator].push(aItemDefinition);};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.generateListItem=function(itemId,itemText,selected,highlighted,isFixedItem){return["<li class=\"",isFixedItem?"listElementFixed":"listElement"," ",selected?"selected":""," ",highlighted?"highlighted":"","\" id=\"",itemId,"\">",itemText,"</li>"].join("");};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.onClickInDoc=function(e){var target=YAHOO.util.Event.getTarget(e);var isClickedOutside=true;while(target!=null){var targetString=""+target.id;if(targetString.indexOf(this.componentId+"_item_",0)==0){isClickedOutside=false;break;}else{target=target.parentNode;}}
if(!isClickedOutside){var targetString=""+target.id;if(targetString.indexOf(this.componentId+"_item_",0)==0){this.onListClick(e,target);}}};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.onListClick=function(e,element){var definitionElement=this.getElementFromDomId(element.id);if(e.ctrlKey&&this.isMultiselect){if(!this.isElementClicked(definitionElement)){this.selectEl(element);}else{this.unselectEl(element);}}else if(e.shiftKey&&this.isMultiselect){var noItemYetSelected=this.selectedElementsArray.length==0;if(!this.hasCheckbox){this.emptySelection();}
if(noItemYetSelected){this.selectEl(element);}else{this.selectMultipleEl(this.lastSelectedItem,element);}}else{if(!this.hasCheckbox){this.emptySelection();}
if(!this.isElementClicked(definitionElement)){this.selectEl(element);}else{if(!this.hasCheckbox){this.selectEl(element);}else{this.unselectEl(element);}}}
this.updateStatus();this.onAllSelected.fire({isAllSelected:this.areAllSelected()});};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.areAllSelected=function(){var count=0;for(var i=0;i<this.definitionArray.length;i++){if(!this.definitionArray[i].isRemoved){count++;}}
if(count==0){return 0;}
return(count==this.selectedElementsArray.length?1:-1);};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.slideOnStepUp=function(iStep){var step=iStep!=null?iStep:10;var container=document.getElementById(this.componentId+"_msListContainer");var offsetC=container.scrollTop;if(offsetC==0){return false;}
container.scrollTop=(offsetC-step);return true;}
com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.slideOnStepDown=function(iStep){var step=iStep!=null?iStep:10;var container=document.getElementById(this.componentId+"_msListContainer");var offsetC=container.scrollTop;container.scrollTop=(offsetC+step);return container.scrollTop!=offsetC;}
com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.selectEl=function(el){if(YAHOO.util.Dom.hasClass(el,'highlighted')){$(el).addClass("selectedHighlighted");}
$(el).addClass("selected");this.addClickedElement(this.getElementFromDomId(el.id));this.lastSelectedItem=el;};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.unselectEl=function(el){$(el).removeClass("selected");$(el).removeClass("selectedHighlighted");this.removeClickedElement(this.getElementFromDomId(el.id));this.lastSelectedItem=el;};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.getElementFromDomId=function(domId){if(this.elementFromDomId[domId]!=null){return this.elementFromDomId[domId];}else{return null;}};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.getElementIndexFromDomId=function(domId){for(var index=0;index<this.definitionArray.length;index++){if(this.definitionArray[index].domId==domId){return index;}}
return null;};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.selectAll=function(){$("#"+this.componentId+"_msListContent li:visible:not(.separator)").addClass("selected");for(var i=0;i<this.definitionArray.length;i++){if(!this.definitionArray[i].isRemoved&&!this.isElementClicked(this.definitionArray[i])){this.addClickedElement(this.definitionArray[i]);}}
this.onAllSelected.fire({isAllSelected:1});};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.deselectAll=function(){this.emptySelection();this.onAllSelected.fire({isAllSelected:-1});this.lastSelectedItem=null;};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.emptySelection=function(){if(this.selectedElementsArray.length>50){$("#"+this.componentId+"_msListContent li").removeClass("selected");$("#"+this.componentId+"_msListContent li").removeClass("selectedHighlighted");}else{for(var i=0;i<this.selectedElementsArray.length;i++){$("#"+this.selectedElementsArray[i].domId).removeClass("selected");$("#"+this.selectedElementsArray[i].domId).removeClass("selectedHighlighted");}}
this.reset();};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.emptyList=function(){$("#"+this.componentId+"_msListContent *").remove();this.definitionArray=[];this.selectedElementsArray=[];this.onAllSelected.fire({isAllSelected:this.areAllSelected()});this.updateStatus();};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.selectMultipleEl=function(previousItem,currentItem){if(previousItem==currentItem){return;}
var indexFirst=this.getElementIndexFromDomId(previousItem.id);var indexLast=this.getElementIndexFromDomId(currentItem.id);if(indexFirst>indexLast){var tmp=indexFirst;indexFirst=indexLast;indexLast=tmp;}
for(var i=indexLast;i>=indexFirst;i--){if(!this.definitionArray[i].isRemoved&&!this.isElementClicked(this.definitionArray[i])){if(YAHOO.util.Dom.hasClass(this.definitionArray[i].domId,'highlighted')){$("#"+this.definitionArray[i].domId).addClass("selectedHighlighted");}
$("#"+this.definitionArray[i].domId).addClass("selected");this.addClickedElement(this.definitionArray[i]);}}};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.toggle=function(src,el){var element=document.getElementById(el);var expandTooltip=this.labels['label']['separatorExpandTooltip'];var collapseTooltip=this.labels['label']['separatorCollapseTooltip'];if(YAHOO.util.Dom.hasClass(element,'hidden')){$(src).removeClass("separatorCollapse").addClass("separatorExpand");$(src).attr("title",collapseTooltip);$("#"+el).removeClass("hidden");}else{$(src).removeClass("separatorExpand").addClass("separatorCollapse");$(src).attr("title",expandTooltip);$("#"+el).addClass("hidden");}};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.addHighlight=function(id){$("#"+id).addClass("highlighted");};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.removeHighlight=function(id){$("#"+id).removeClass("highlighted");};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.getType=function(){return"multiselectList";};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.getSelectedElements=function(){return this.selectedElementsArray;};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.invert=function(){if(this.selectedElementsArray.length==0){this.selectAll();return;}
if(this.areAllSelected()==true){this.deselectAll();return;}
for(var i=0;i<this.definitionArray.length;i++){if(!this.definitionArray[i].isRemoved&&!this.isElementClicked(this.definitionArray[i])){if(YAHOO.util.Dom.hasClass(this.definitionArray[i].domId,'highlighted')){$("#"+this.definitionArray[i].domId).addClass("selectedHighlighted");}
$("#"+this.definitionArray[i].domId).addClass("selected");this.addClickedElement(this.definitionArray[i]);}else if(!this.definitionArray[i].isRemoved){$("#"+this.definitionArray[i].domId).removeClass("selected");$("#"+this.definitionArray[i].domId).removeClass("selectedHighlighted");this.removeClickedElement(this.definitionArray[i]);}}};namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.MultiselectList=function(iComponentId,iWidth,iMaxListHeight,iDisabled,iIsMultiselect,iDescription,iHasCheckbox){com.pictet.apps.fnc.web.component.forms.MultiselectList.superclass.constructor.call(this,iComponentId,iWidth,iMaxListHeight,iDisabled,iIsMultiselect,iDescription,iHasCheckbox);this.filter=null;};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.MultiselectList,com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList);com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.generate=function(){com.pictet.apps.fnc.web.component.forms.MultiselectList.superclass.generate.call(this);this.updateAllSeparatorDisplay();};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.addItem=function(iId,iDomId,iText,iIsSelected,iParentSeparator,iIsHighlighted,iLinkedItems,isHeaderItem,iFilterText){com.pictet.apps.fnc.web.component.forms.MultiselectList.superclass.addItem.call(this,iId,iDomId,iText,iIsSelected,iParentSeparator,iIsHighlighted,iLinkedItems,isHeaderItem);this.definitionArray[this.definitionArray.length-1].isHidden=false;this.definitionArray[this.definitionArray.length-1].filterText=iFilterText;};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.addListItems=function(listItems){for(var i=0;i<listItems.length;i++){this.addItem(listItems[i][0],listItems[i][1],listItems[i][2],listItems[i][3],listItems[i][4],listItems[i][5],listItems[i][6],listItems[i][7],listItems[i][8]);}};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.filterList=function(){var nbNonHidden=0;var value=this.filter.getValueAsStr().replace(/^\s\s*/,'').replace(/\s\s*$/,'').toLowerCase();if(value.length===0){for(var i=0;i<this.definitionArray.length;i++){this.definitionArray[i].isHidden=false;if(!this.definitionArray[i].isRemoved){$("#"+this.definitionArray[i].domId).removeClass('hidden');nbNonHidden++;}}}else{value=value.replace(/\s+|%+/g,"*");var wildCardWords=value.split("*");for(var i=0;i<this.definitionArray.length;i++){if(!this.definitionArray[i].isRemoved){if(this.repectWildCard(this.definitionArray[i].filterText,wildCardWords)){if(this.definitionArray[i].isHidden){$("#"+this.definitionArray[i].domId).removeClass('hidden');}
this.definitionArray[i].isHidden=false;nbNonHidden++;}else{if(!this.definitionArray[i].isHidden){$("#"+this.definitionArray[i].domId).addClass('hidden');}
this.definitionArray[i].isHidden=true;}}else{this.definitionArray[i].isHidden=!this.repectWildCard(this.definitionArray[i].filterText,wildCardWords);}}}
if(nbNonHidden==0){$("#"+this.componentId+"_NoResultsMessage").removeClass('hidden');this.onAllSelected.fire({isAllSelected:0});}else{$("#"+this.componentId+"_NoResultsMessage").addClass('hidden');this.onAllSelected.fire({isAllSelected:this.areAllSelected()});}
this.updateAllSeparatorDisplay();this.updateAllSeparator();};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.repectWildCard=function(text,wildCardWords){for(var i=0;i<wildCardWords.length;i++){if(text.toLowerCase().indexOf(wildCardWords[i])==-1){return false;}}
return true;};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.resetFilter=function(){this.filter.reset();this.filterList();};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.updateAllSeparatorDisplay=function(){for(var separatorId in this.separatorsDefinition){if(separatorId!="rootElement"){var displaySeparator=false;for(var i=0;i<this.separatorsDefinition[separatorId].length;i++){if(!(this.separatorsDefinition[separatorId][i].isHidden||this.separatorsDefinition[separatorId][i].isRemoved)){displaySeparator=true;break;}}
if(displaySeparator){$("#"+separatorId).removeClass("hidden");}else{$("#"+separatorId).addClass("hidden");}}}};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.updateSeparatorDisplay=function(separatorId){if(separatorId!="rootElement"){var displaySeparator=false;for(var i=0;i<this.separatorsDefinition[separatorId].length;i++){if(!this.separatorsDefinition[separatorId][i].isRemoved&&!this.separatorsDefinition[separatorId][i].isHidden){displaySeparator=true;break;}}
if(displaySeparator){$("#"+separatorId).removeClass("hidden");}else{$("#"+separatorId).addClass("hidden");}}};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.updateAllSeparator=function(){for(var separatorId in this.separatorsDefinition){this.updateSeparatorSelectAllDisplay(separatorId);}};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.updateSeparatorSelectAllDisplay=function(separatorId){if(separatorId!="rootElement"){var separatorAllSelected=true;for(var i=0;i<this.separatorsDefinition[separatorId].length;i++){if(!this.separatorsDefinition[separatorId][i].isRemoved&&!this.separatorsDefinition[separatorId][i].isHidden&&!this.isElementClicked(this.separatorsDefinition[separatorId][i])){separatorAllSelected=false;break;}}
if(separatorAllSelected){$("#"+separatorId+"_select").addClass("selected");}else{$("#"+separatorId+"_select").removeClass("selected");}}};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.updateStatus=function(){this.onValueChange.fire(this);};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.addSelection=function(srcSelectedElementsArray){var separatorsToUpdate={};for(var aElement=0;aElement<srcSelectedElementsArray.length;aElement++){for(var index=0;index<this.definitionArray.length;index++){if(this.definitionArray[index].id==srcSelectedElementsArray[aElement].id){if(!this.definitionArray[index].isHidden){$("#"+this.definitionArray[index].domId).removeClass('hidden');separatorsToUpdate[this.definitionArray[index].parentSeparator]=true;}
this.definitionArray[index].isRemoved=false;}}}
for(var id in separatorsToUpdate){this.updateSeparatorDisplay(id);this.updateSeparatorSelectAllDisplay(id);}
var nbNonHidden=0;for(var index=0;index<this.definitionArray.length;index++){if(!this.definitionArray[index].isHidden&&!this.definitionArray[index].isRemoved){nbNonHidden++;}}
if(nbNonHidden==0){$("#"+this.componentId+"_NoResultsMessage").removeClass('hidden');this.onAllSelected.fire({isAllSelected:0});}else{$("#"+this.componentId+"_NoResultsMessage").addClass('hidden');this.onAllSelected.fire({isAllSelected:this.areAllSelected()});}};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.removeSelection=function(){var removedItemsArray=[];var separatorsToUpdate={};$("#"+this.componentId+"_msListContent li.selected").removeClass('selected').addClass('hidden');for(var aId=0;aId<this.selectedElementsArray.length;aId++){this.selectedElementsArray[aId].isRemoved=true;removedItemsArray.push({id:this.selectedElementsArray[aId].id,text:this.selectedElementsArray[aId].text,linkedItems:this.selectedElementsArray[aId].linkedItems});separatorsToUpdate[this.selectedElementsArray[aId].parentSeparator]=true;}
this.selectedElementsArray=[];for(var id in separatorsToUpdate){this.updateSeparatorDisplay(id);}
var nbNonHidden=0;for(var index=0;index<this.definitionArray.length;index++){if(!this.definitionArray[index].isHidden&&!this.definitionArray[index].isRemoved){nbNonHidden++;}}
if(nbNonHidden==0){$("#"+this.componentId+"_NoResultsMessage").removeClass('hidden');this.onAllSelected.fire({isAllSelected:0});}else{$("#"+this.componentId+"_NoResultsMessage").addClass('hidden');this.onAllSelected.fire({isAllSelected:this.areAllSelected()});}
return removedItemsArray;};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.selectEl=function(el){com.pictet.apps.fnc.web.component.forms.MultiselectList.superclass.selectEl.call(this,el);var element=this.getElementFromDomId(el.id);var linkedElements=this.getLinkedElements(element);if(linkedElements.length>0){for(var id=0;id<linkedElements.length;id++){for(index in this.definitionArray){if(this.definitionArray[index].id==linkedElements[id]){if(!this.isElementClicked(this.definitionArray[index])&&!this.definitionArray[index].isRemoved){$("#"+this.definitionArray[index].domId).addClass("selected");this.addClickedElement(this.definitionArray[index]);}}}}}
this.updateSeparatorSelectAllDisplay(element.parentSeparator);};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.unselectEl=function(el){com.pictet.apps.fnc.web.component.forms.MultiselectList.superclass.unselectEl.call(this,el);this.updateSeparatorSelectAllDisplay(this.getElementFromDomId(el.id).parentSeparator);};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.selectMultipleEl=function(previousItem,currentItem){if(previousItem==currentItem){return;}
var indexFirst=this.getElementIndexFromDomId(previousItem.id);var indexLast=this.getElementIndexFromDomId(currentItem.id);var separatorsToUpdate={};if(indexFirst>indexLast){var tmp=indexFirst;indexFirst=indexLast;indexLast=tmp;}
for(var i=indexLast;i>=indexFirst;i--){if(!this.definitionArray[i].isHidden&&!this.definitionArray[i].isRemoved&&!this.isElementClicked(this.definitionArray[i])){if(YAHOO.util.Dom.hasClass(this.definitionArray[i].domId,'highlighted')){$("#"+this.definitionArray[i].domId).addClass("selectedHighlighted");}
$("#"+this.definitionArray[i].domId).addClass("selected");separatorsToUpdate[this.definitionArray[i].parentSeparator]=true;this.addClickedElement(this.definitionArray[i]);}}
for(var id in separatorsToUpdate){this.updateSeparatorSelectAllDisplay(id);}};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.selectAllChildren=function(el){var instance=this;var parentLiSelect=$("#"+el+"_select");if(YAHOO.util.Dom.hasClass(el+"_select",'selected')){parentLiSelect.removeClass("selected");var separatorChildren=this.separatorsDefinition[el];for(var i=0;i<this.separatorsDefinition[el].length;i++){if(!this.separatorsDefinition[el][i].isRemoved&&!this.separatorsDefinition[el][i].isHidden){this.removeClickedElement(this.separatorsDefinition[el][i]);$("#"+this.separatorsDefinition[el][i].domId).removeClass("selected");}}}else{parentLiSelect.addClass("selected");var separatorChildren=this.separatorsDefinition[el];for(var i=0;i<this.separatorsDefinition[el].length;i++){if(!this.separatorsDefinition[el][i].isRemoved&&!this.separatorsDefinition[el][i].isHidden&&!this.isElementClicked(this.separatorsDefinition[el][i])){this.addClickedElement(this.separatorsDefinition[el][i]);$("#"+this.separatorsDefinition[el][i].domId).addClass("selected");}}}
this.onAllSelected.fire({isAllSelected:this.areAllSelected()});};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.getLinkedElements=function(element){if(element==null||element.linkedItems==""){return[];}
return element.linkedItems.split(",");};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.registerFilter=function(iFormInstance,iKey,iTrigger){this.filter=iFormInstance;this.filter.timeoutValue=300;this.filter.onValueChange.subscribe(this.filterList,this,true);};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.hideElementById=function(elementId){var separatorsToUpdate={};for(var index=0;index<this.definitionArray.length;index++){if(this.definitionArray[index].id==elementId){if(this.definitionArray[index].isRemoved){return;}
$("#"+this.definitionArray[index].domId).addClass('hidden');this.definitionArray[index].isRemoved=true;this.definitionArray[index].isHidden=true;separatorsToUpdate[this.definitionArray[index].parentSeparator]=true;}}
this.onAllSelected.fire({isAllSelected:this.areAllSelected()});for(var id in separatorsToUpdate){this.updateSeparatorDisplay(id);}};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.displayElementById=function(elementId){var separatorsToUpdate={};for(var index=0;index<this.definitionArray.length;index++){if(this.definitionArray[index].id==elementId){if(!this.definitionArray[index].isRemoved){return;}
$("#"+this.definitionArray[index].domId).removeClass('hidden');this.definitionArray[index].isRemoved=false;this.definitionArray[index].isHidden=false;separatorsToUpdate[this.definitionArray[index].parentSeparator]=true;}}
for(var id in separatorsToUpdate){this.updateSeparatorDisplay(id);this.updateSeparatorSelectAllDisplay(id);}
this.onAllSelected.fire({isAllSelected:this.areAllSelected()});};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.deselectAll=function(){$("#"+this.componentId+"_msListContent li:visible:not(.separator)").removeClass("selected").removeClass("selectedHighlighted");var newSelectedElements=[];for(var i=0;i<this.selectedElementsArray.length;i++){if(this.selectedElementsArray[i].isHidden&&!this.selectedElementsArray[i].isRemoved){newSelectedElements.push(this.selectedElementsArray[i]);}}
this.selectedElementsArray=newSelectedElements;this.onAllSelected.fire({isAllSelected:-1});this.lastSelectedItem=null;};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.selectAll=function(){$("#"+this.componentId+"_msListContent li:visible:not(.separator)").addClass("selected");for(var i=0;i<this.definitionArray.length;i++){if(!this.definitionArray[i].isHidden&&!this.definitionArray[i].isRemoved&&!this.isElementClicked(this.definitionArray[i])){this.addClickedElement(this.definitionArray[i]);}}
this.onAllSelected.fire({isAllSelected:1});};com.pictet.apps.fnc.web.component.forms.MultiselectList.prototype.areAllSelected=function(){var count=0;for(var i=0;i<this.definitionArray.length;i++){if(!this.definitionArray[i].isRemoved&&!this.definitionArray[i].isHidden){if(!this.isElementClicked(this.definitionArray[i])){return-1;}
count++;}}
return(count==0?0:1);};namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.SelectionList=function(iComponentId,iWidth,iMaxListHeight,iDisabled,iIsMultiselect,iDescription,iHasDD,iDDLimitation){com.pictet.apps.fnc.web.component.forms.SelectionList.superclass.constructor.call(this,iComponentId,iWidth,iMaxListHeight,iDisabled,iIsMultiselect,iDescription,false);this.SORT_NONE=0;this.SORT_ASC=1;this.SORT_DESC=2;this.SORT_CUSTOM=3;this.incrementDomId=0;this.hasDD=iHasDD;this.onOrderChange=new YAHOO.util.CustomEvent('onOrderChange');this.lastOrderChange="";this.headerItemsdefinitionArray=[];this.footerItemsdefinitionArray=[];this.multivaluedActivated=false;if(iDDLimitation){this.maxDragAndDropItemsNb=400;}else{this.maxDragAndDropItemsNb=-1;}};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.SelectionList,com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList);com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.addItem=function(iId,iDomId,iText,iIsSelected,iParentSeparator,iIsHighlighted,iLinkedItems,isHeaderItem){if(isHeaderItem===""){com.pictet.apps.fnc.web.component.forms.SelectionList.superclass.addItem.call(this,iId,iDomId,iText,iIsSelected,iParentSeparator,iIsHighlighted,iLinkedItems,false);this.definitionArray[this.definitionArray.length-1].originalOrder=this.definitionArray.length;this.definitionArray[this.definitionArray.length-1].customOrder=this.definitionArray.length;}else if(isHeaderItem==="header"){this.headerItemsdefinitionArray.push({id:iId,text:iText,domId:iDomId});}else if(isHeaderItem==="footer"){this.footerItemsdefinitionArray.push({id:iId,text:iText,domId:iDomId});}
this.incrementDomId++;};com.pictet.apps.fnc.web.component.forms.AbstractMultiselectList.prototype.addListItems=function(listItems){YAHOO.log("start add list items");for(var i=0;i<listItems.length;i++){this.addItem(listItems[i][0],listItems[i][1],listItems[i][2],listItems[i][3],listItems[i][4],listItems[i][5],listItems[i][6],listItems[i][7]);}
YAHOO.log("end add list items");};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.generate=function(){YAHOO.log("start generate");com.pictet.apps.fnc.web.component.forms.SelectionList.superclass.generate.call(this);if(this.hasDD&&(this.maxDragAndDropItemsNb==-1||this.definitionArray.length<=this.maxDragAndDropItemsNb)){this.initListDD();}
YAHOO.log("end generate");};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.addHeaderItem=function(iId,iText){this.addFixedItem(iId,iText,this.headerItemsdefinitionArray,true);};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.addHeaderItems=function(iList){this.addFixedItems(iList,this.headerItemsdefinitionArray,true);};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.addFooterItem=function(iId,iText){this.addFixedItem(iId,iText,this.footerItemsdefinitionArray,false);};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.addFooterItems=function(iList){this.addFixedItems(iList,this.footerItemsdefinitionArray,false);};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.addFixedItem=function(iId,iText,definitionArray,isTop){var iDomId=this.componentId+"_itemFixed_"+this.incrementDomId;this.incrementDomId++;if(isTop){$("#"+this.componentId+"_msListContent").prepend(this.generateListItem(iDomId,iText,"","",true));definitionArray.unshift({id:iId,text:iText,domId:iDomId});}else{$("#"+this.componentId+"_msListContent").append(this.generateListItem(iDomId,iText,"","",true));definitionArray.push({id:iId,text:iText,domId:iDomId});}};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.addFixedItems=function(iList,definitionArray,isTop){var toBeGenereted=[];for(var i=0;i<iList.length;i++){var iDomId=this.componentId+"_itemFixed_"+this.incrementDomId;this.incrementDomId++;definitionArray.push({id:iList[i].id,text:iList[i].text,domId:iDomId});toBeGenereted.push(this.generateListItem(iDomId,iList[i].text,"","",true));}
if(isTop){$("#"+this.componentId+"_msListContent").prepend(toBeGenereted.join(""));}else{$("#"+this.componentId+"_msListContent").append(toBeGenereted.join(""));}};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.removeHeaderItems=function(){this.removeElementsFromDom(this.headerItemsdefinitionArray);this.headerItemsdefinitionArray=[];};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.removeFooterItems=function(){this.removeElementsFromDom(this.footerItemsdefinitionArray);this.footerItemsdefinitionArray=[];};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.removeElementsFromDom=function(iList){for(var i=0;i<iList.length;i++){$("#"+iList[i].domId).remove();}};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.initListDD=function(){$("#"+this.componentId+"_msListContent").addClass("ddlist");new YAHOO.util.DDTarget(this.componentId+"_msListContent");for(var i=0;i<this.definitionArray.length;i++){new com.pictet.apps.fnc.web.component.forms.DDList(this.definitionArray[i].domId,this);}};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.moveUp=function(){var instance=this;$("#"+this.componentId+"_msListContent li.selected").each((function(e){var $curr=$(this).prev();if($curr.length!==0&&YAHOO.util.Dom.hasClass($curr.attr('id'),'selected')===false&&YAHOO.util.Dom.hasClass($curr.attr('id'),'listElementFixed')===false){$(this).insertBefore($curr);instance.insertElementBefore(this.id,$curr.attr('id'));}}));if(this.lastOrderChange!="Custom"){this.onOrderChange.fire("Custom");this.lastOrderChange="Custom";}};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.moveDown=function(el){var instance=this;var arr=jQuery.makeArray($("#"+this.componentId+"_msListContent li.selected"));arr.reverse();$(arr).each((function(e){var $curr=$(this).next();if($curr.length!==0&&YAHOO.util.Dom.hasClass($curr.attr('id'),'selected')===false&&YAHOO.util.Dom.hasClass($curr.attr('id'),'listElementFixed')===false){$(this).insertAfter($curr);instance.insertElementAfter(this.id,$curr.attr('id'));}}));if(this.lastOrderChange!="Custom"){this.onOrderChange.fire("Custom");this.lastOrderChange="Custom";}};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.getValueAsStr=function(){return this.getAllItems().join(",");};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.getValue=function(){return this.getAllItems();};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.getAllItems=function(){var tmpArray=[];for(var index=0;index<this.headerItemsdefinitionArray.length;index++){tmpArray.push(this.headerItemsdefinitionArray[index].id);}
for(var index=0;index<this.definitionArray.length;index++){tmpArray.push(this.definitionArray[index].id);}
for(var index=0;index<this.footerItemsdefinitionArray.length;index++){tmpArray.push(this.footerItemsdefinitionArray[index].id);}
return tmpArray;}
com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.addSelection=function(srcSelectedElementsArray){this.removeElementsFromDom(this.footerItemsdefinitionArray);var htmlToGenerate=[];var domIdsToGenerate=[];for(var aElement=0;aElement<srcSelectedElementsArray.length;aElement++){srcSelectedElementsArray[aElement];if(!this.isExistedItem(srcSelectedElementsArray[aElement].id)){srcSelectedElementsArray[aElement].domId=this.componentId+"_item_"+this.incrementDomId;htmlToGenerate.push(this.generateListItem(srcSelectedElementsArray[aElement].domId,srcSelectedElementsArray[aElement].text,"","",false));this.addItem(srcSelectedElementsArray[aElement].id,srcSelectedElementsArray[aElement].domId,srcSelectedElementsArray[aElement].text,false,"rootElement",false,srcSelectedElementsArray[aElement].linkedItems,"");domIdsToGenerate.push(srcSelectedElementsArray[aElement].domId);}}
for(var i=0;i<this.footerItemsdefinitionArray.length;i++){htmlToGenerate.push(this.generateListItem(this.footerItemsdefinitionArray[i].domId,this.footerItemsdefinitionArray[i].text,"","",true));}
$("#"+this.componentId+"_msListContent").append(htmlToGenerate.join(""));this.generateDD(domIdsToGenerate);this.onAllSelected.fire({isAllSelected:this.areAllSelected()});this.updateStatus();};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.generateDD=function(domIds){if(this.hasDD){for(var i=0;i<domIds.length;i++){new com.pictet.apps.fnc.web.component.forms.DDList(domIds[i],this);}}};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.removeSelection=function(){var removedElementsArray=[];var aTmpArray=[];$("#"+this.componentId+"_msListContent .selected").remove();for(var i=0;i<this.selectedElementsArray.length;i++){removedElementsArray.push({id:this.selectedElementsArray[i].id});}
for(var index=0;index<this.definitionArray.length;index++){var flag=true;for(var el=0;el<this.selectedElementsArray.length;el++){if(this.definitionArray[index].domId==this.selectedElementsArray[el].domId){flag=false;}}
if(flag){aTmpArray.push(this.definitionArray[index]);}}
if(removedElementsArray.length>0){this.definitionArray=aTmpArray;}
this.selectedElementsArray=[];this.onAllSelected.fire({isAllSelected:this.areAllSelected()});this.updateStatus();return removedElementsArray;};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.sort=function(order){var sortOrder=order;YAHOO.log(sortOrder);var compare=function(a,b){if(a>b){return 1;}else if(a<b){return-1;}else{return 0;}}
if(order==this.SORT_NONE){this.definitionArray.sort(function(a,b){return compare(a.originalOrder,b.originalOrder);});}else if(order==this.SORT_ASC){this.definitionArray.sort(function(a,b){return compare(a.text.toLowerCase(),b.text.toLowerCase());});}else if(order==this.SORT_DESC){this.definitionArray.sort(function(a,b){return-compare(a.text.toLowerCase(),b.text.toLowerCase());});}else if(order==this.SORT_CUSTOM){this.definitionArray.sort(function(a,b){return compare(a.customOrder,b.customOrder);});}
this.refreshList();if(order==1){if(this.lastOrderChange!="Asc"){this.onOrderChange.fire("Asc");this.lastOrderChange="Asc";}}else if(order==-1){if(this.lastOrderChange!="Desc"){this.onOrderChange.fire("Desc");this.lastOrderChange="Desc";}}else if(order==0){if(this.lastOrderChange!="none"){this.onOrderChange.fire("none");this.lastOrderChange="none";}}};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.refreshList=function(){$("#"+this.componentId+"_msListContent").empty();var listGenerated=[];for(var i=0;i<this.headerItemsdefinitionArray.length;i++){listGenerated.push(this.generateListItem(this.headerItemsdefinitionArray[i].domId,this.headerItemsdefinitionArray[i].text,"","",true));}
for(var j=0;j<this.definitionArray.length;j++){listGenerated.push(this.generateListItem(this.definitionArray[j].domId,this.definitionArray[j].text,this.definitionArray[j].selected,this.definitionArray[j].highlighted,false));if(this.hasDD&&(this.maxDragAndDropItemsNb==-1||this.definitionArray.length<=this.maxDragAndDropItemsNb)){new com.pictet.apps.fnc.web.component.forms.DDList(this.definitionArray[j].domId,this);}}
for(var i=0;i<this.footerItemsdefinitionArray.length;i++){listGenerated.push(this.generateListItem(this.footerItemsdefinitionArray[i].domId,this.footerItemsdefinitionArray[i].text,"","",true));}
$("#"+this.componentId+"_msListContent").append(listGenerated.join(""));};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.removeHeaderItemById=function(itemId){for(var index=0;index<this.definitionArray.length;index++){if(this.definitionArray[index].domId.indexOf(this.componentId+"_itemFixed_")!=-1&&this.definitionArray[index].id==itemId){this.selectedElementsArray.push(this.definitionArray[index]);$("#"+this.definitionArray[index].domId).addClass("selected");}}};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.removeItemById=function(itemId){for(var index=0;index<this.definitionArray.length;index++){if(this.definitionArray[index].domId.indexOf(this.componentId+"_item_")!=-1&&this.definitionArray[index].id==itemId){this.selectedElementsArray.push(this.definitionArray[index]);$("#"+this.definitionArray[index].domId).addClass("selected");}}};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.isExistedItem=function(itemId){for(var index=0;index<this.definitionArray.length;index++){if(this.definitionArray[index].id==itemId){return true;}}
return false;};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.insertElementBefore=function(srcDomId,destDomId){var srcIndex=this.getElementIndexFromDomId(srcDomId);var destIndex=this.getElementIndexFromDomId(destDomId);if(destIndex-1==srcIndex){return false;}
var newDefinition=[];var itemToInsert=this.definitionArray[srcIndex];for(var i=0;i<this.definitionArray.length;i++){if(i==destIndex){newDefinition.push(itemToInsert);}
if(i!=srcIndex){newDefinition.push(this.definitionArray[i]);}}
for(var i=0;i<newDefinition.length;i++){newDefinition[i].customOrder=i+1;}
this.definitionArray=newDefinition;return true;};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.insertElementAfter=function(srcDomId,destDomId){var srcIndex=this.getElementIndexFromDomId(srcDomId);var destIndex=this.getElementIndexFromDomId(destDomId);if(destIndex+1==srcIndex){return false;}
var newDefinition=[];var itemToInsert=this.definitionArray[srcIndex];for(var i=0;i<this.definitionArray.length;i++){if(i!=srcIndex){newDefinition.push(this.definitionArray[i]);}
if(i==destIndex){newDefinition.push(itemToInsert);}}
for(var i=0;i<newDefinition.length;i++){newDefinition[i].customOrder=i+1;}
this.definitionArray=newDefinition;return true;};com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.isMultivalued=function(){return this.multivaluedActivated;}
com.pictet.apps.fnc.web.component.forms.DDList=function(id,instance,sGroup,config){com.pictet.apps.fnc.web.component.forms.DDList.superclass.constructor.call(this,id,sGroup,config);this.goingUp=false;this.oldGoingUp=false;this.outOfViewPort=false;this.lastY=0;this.instanceOfList=instance;this.currentOverEl=null;this.timeOutContinousScroll=null;};YAHOO.extend(com.pictet.apps.fnc.web.component.forms.DDList,YAHOO.util.DDProxy);com.pictet.apps.fnc.web.component.forms.DDList.prototype.startDrag=function(x,y){var clickEl=this.getEl();var dragEl=this.getDragEl()
$(dragEl).html($(clickEl).html());YAHOO.util.Dom.setStyle(clickEl,"display","none");YAHOO.util.Dom.setStyle(dragEl,"background-color",YAHOO.util.Dom.getStyle(clickEl,"background-color"));YAHOO.util.Dom.setStyle(dragEl,"opacity",0.75);YAHOO.util.Dom.setStyle(dragEl,"padding","2px");YAHOO.util.Dom.setStyle(dragEl,"border-width","1px");YAHOO.util.DragDropMgr.refreshCache();}
com.pictet.apps.fnc.web.component.forms.DDList.prototype.endDrag=function(e){if(this.timeOutContinousScroll!=null){window.clearTimeout(this.timeOutContinousScroll);this.timeOutContinousScroll=null;}
var srcElement=this.getEl();if(this.currentOverEl!=null){YAHOO.util.Dom.setStyle(this.currentOverEl,"border-top","");YAHOO.util.Dom.setStyle(this.currentOverEl,"border-bottom","");if(this.goingUp){if(this.instanceOfList.insertElementBefore(srcElement.id,this.currentOverEl.id)){this.currentOverEl.parentNode.insertBefore(srcElement,this.currentOverEl);}}else{if(this.instanceOfList.insertElementAfter(srcElement.id,this.currentOverEl.id)){this.currentOverEl.parentNode.insertBefore(srcElement,this.currentOverEl.nextSibling);}}}
YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");YAHOO.util.Dom.setStyle(srcElement,"display","");if(this.instanceOfList.lastOrderChange!="Custom"){this.instanceOfList.onOrderChange.fire("Custom");this.instanceOfList.lastOrderChange="Custom";}
this.goingUp=false;this.oldGoingUp=false;this.outOfViewPort=false;this.lastY=0;this.currentOverEl=null;}
com.pictet.apps.fnc.web.component.forms.DDList.prototype.onDrag=function(e){var y=YAHOO.util.Event.getPageY(e);if(y<this.lastY){this.goingUp=true;}else if(y>this.lastY){this.goingUp=false;}
if(y!=this.lastY){if(y<=(this.instanceOfList.containerY)){this.continousScroll("up",this.instanceOfList.containerY-y);}else if(y>=(this.instanceOfList.containerY+this.instanceOfList.listMaxHeightInPx)){this.continousScroll("down",y-(this.instanceOfList.containerY+this.instanceOfList.listMaxHeightInPx));}else{if(this.timeOutContinousScroll!=null){window.clearTimeout(this.timeOutContinousScroll);this.timeOutContinousScroll=null;YAHOO.util.DragDropMgr.refreshCache();}}}
this.outOfViewPort=(y<=(this.instanceOfList.containerY)||y>=(this.instanceOfList.containerY+this.instanceOfList.listMaxHeightInPx));this.lastY=y;}
com.pictet.apps.fnc.web.component.forms.DDList.prototype.continousScroll=function(dir,step){window.clearTimeout(this.timeOutContinousScroll);var hasScroll=false;if(dir=="up"){hasScroll=this.instanceOfList.slideOnStepUp(step);}else{hasScroll=this.instanceOfList.slideOnStepDown(step);}
if(hasScroll){var instance=this;this.timeOutContinousScroll=window.setTimeout(function(){instance.continousScroll(dir,step);},10);}}
com.pictet.apps.fnc.web.component.forms.DDList.prototype.onDragOver=function(e,id){var instance=this;if(id.indexOf(this.instanceOfList.componentId+"_item_",0)==0&&!this.outOfViewPort){var srcEl=this.getEl();if(this.currentOverEl==null||this.currentOverEl.id!=id||this.goingUp!=this.oldGoingUp){var destEl=document.getElementById(id);var p=destEl.parentNode;if(this.currentOverEl!=null){this.oldGoingUp?YAHOO.util.Dom.setStyle(this.currentOverEl,"border-top",""):YAHOO.util.Dom.setStyle(this.currentOverEl,"border-bottom","");}
this.goingUp?YAHOO.util.Dom.setStyle(destEl,"border-top","2px solid #990000"):YAHOO.util.Dom.setStyle(destEl,"border-bottom","2px solid #990000");this.currentOverEl=destEl;this.oldGoingUp=this.goingUp;}}}
com.pictet.apps.fnc.web.component.forms.SelectionList.prototype.markInvalid=function(){$("#"+this.componentId+"_msListContainer").addClass("invalid");};namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.CheckBox=function(iComponentId,iWidth,iDisabled,iDescription,iDefaultSelected,iAutoResize){this.defaultSelected=iDefaultSelected;this.autoResize=iAutoResize;com.pictet.apps.fnc.web.component.forms.CheckBox.superclass.constructor.call(this,iComponentId,iWidth,iDisabled,iDescription);};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.CheckBox,com.pictet.apps.fnc.web.component.forms.AbstractListForm);com.pictet.apps.fnc.web.component.forms.CheckBox.prototype.generate=function(iHtmlContainerId){com.pictet.apps.fnc.web.component.forms.CheckBox.superclass.generate.call(this,iHtmlContainerId);if(this.selectedElementsArray.length==0&&this.defaultSelected){this.selectedElementsArray.push(this.definitionArray[0].id);}
var str=["<ul>"];var aClass="";for(var aColumn=0;aColumn<this.definitionArray.length;aColumn++){aClass="";if(this.isElementClicked(this.definitionArray[aColumn].id)){aClass=" checked";}
if(this.autoResize){str.push("<li style=\"min-width:0px; padding-right:5px;\" class=\"checkboxLine",aClass,"\" id=\"",this.componentId,"_",this.definitionArray[aColumn].id,"\">",this.definitionArray[aColumn].text,"</li>");}else{str.push("<li style=\"width:",this.width,"px;\" class=\"checkboxLine",aClass,"\" id=\"",this.componentId,"_",this.definitionArray[aColumn].id,"\">",this.definitionArray[aColumn].text,"</li>");}}
str.push("</ul>");$("#"+iHtmlContainerId).append(str.join(""));for(var aColumn=0;aColumn<this.definitionArray.length;aColumn++){YAHOO.util.Event.addListener(this.componentId+'_'+this.definitionArray[aColumn].id,"click",this.toggleStatus,aColumn,this);}};com.pictet.apps.fnc.web.component.forms.CheckBox.prototype.toggleStatus=function(ev,index){this.changeStatus(this.definitionArray[index].id);};com.pictet.apps.fnc.web.component.forms.CheckBox.prototype.changeStatus=function(itemId){if(!this.isDisabled){if(this.isElementClicked(itemId)){this.removeClickedElement(itemId);$("#"+this.componentId+'_'+itemId).removeClass("checked");}else{this.addClickedElement(itemId);$("#"+this.componentId+'_'+itemId).addClass("checked");}
this.updateStatus();}};com.pictet.apps.fnc.web.component.forms.CheckBox.prototype.setValue=function(value){this.reset();if(value&&value!=""){this.changeStatus(value);}}
com.pictet.apps.fnc.web.component.forms.CheckBox.prototype.reset=function(){for(var aColumn=0;aColumn<this.definitionArray.length;aColumn++){if(this.isElementClicked(this.definitionArray[aColumn].id)){$("#"+this.componentId+'_'+this.definitionArray[aColumn].id).removeClass("checked");}}
com.pictet.apps.fnc.web.component.forms.CheckBox.superclass.reset.call(this);this.updateStatusAndNotFireOnChange();}
com.pictet.apps.fnc.web.component.forms.CheckBox.prototype.enable=function(){this.isDisabled=false;}
com.pictet.apps.fnc.web.component.forms.CheckBox.prototype.disable=function(){this.isDisabled=true;}
namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.FormAsynchronousCombobox=function(iComponentId,defaultText,iDescription){com.pictet.apps.fnc.web.component.forms.FormAsynchronousCombobox.superclass.constructor.call(this,iComponentId,"",false,iDescription);this.componentId=iComponentId;this.comboboxDataTableId;this.timeoutValue=2000;this.timeout=null;this.firstTimeLoad=true;this.internalValue={};this.defaultText=defaultText;this.description=iDescription;this.onValueChange=new YAHOO.util.CustomEvent('onValueChange');};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.FormAsynchronousCombobox,com.pictet.apps.fnc.web.component.forms.AbstractForm);com.pictet.apps.fnc.web.component.forms.FormAsynchronousCombobox.prototype.setTable=function(iComboboxDataTableId){this.comboboxDataTableId=iComboboxDataTableId;}
com.pictet.apps.fnc.web.component.forms.FormAsynchronousCombobox.prototype.init=function(){YAHOO.util.Event.addListener(this.componentId+"_text","click",this.showFormAsynchronousCombobox,this,true);YAHOO.util.Event.addListener(this.componentId+"_button","click",this.showFormAsynchronousCombobox,this,true);YAHOO.util.Event.addListener(document,"click",this.onClickInDoc,this,true);var aThisContextMenu=this;if(this.internalValue.id){this.setDisplayedText(this.internalValue.text);}else{this.setDisplayedText(this.defaultText);}}
com.pictet.apps.fnc.web.component.forms.FormAsynchronousCombobox.prototype.showFormAsynchronousCombobox=function(){$("#"+this.componentId+"_menu").removeClass("hidden");$("#"+this.componentId+"_button").removeClass("CBbutton").addClass("CBbuttonClicked");if(this.firstTimeLoad){this.comboboxDataTableId.generate();this.firstTimeLoad=false;}}
com.pictet.apps.fnc.web.component.forms.FormAsynchronousCombobox.prototype.hideFormAsynchronousCombobox=function(){$("#"+this.componentId+"_menu").addClass("hidden");$("#"+this.componentId+"_button").removeClass("CBbuttonClicked").addClass("CBbutton");if(this.internalValue.id||this.internalValue.text){this.setDisplayedText(this.internalValue.text);}}
com.pictet.apps.fnc.web.component.forms.FormAsynchronousCombobox.prototype.onClickInDoc=function(e){var target=YAHOO.util.Event.getTarget(e);var isClickedOutside=true;while(target!=null){if(target.id==this.componentId+"_menu"||target.id==this.componentId+"_text"||target.id==this.componentId+"_button"){isClickedOutside=false;break;}else{target=target.parentNode;}}
if(isClickedOutside){this.hideFormAsynchronousCombobox();}}
com.pictet.apps.fnc.web.component.forms.FormAsynchronousCombobox.prototype.onMouseOver=function(e,iThisContextMenu){window.clearTimeout(iThisContextMenu.timeout);}
com.pictet.apps.fnc.web.component.forms.FormAsynchronousCombobox.prototype.handleElementSelect=function(elementId,elementText){this.internalValue.id=elementId;this.internalValue.text=elementText;this.onValueChange.fire();this.hideFormAsynchronousCombobox();}
com.pictet.apps.fnc.web.component.forms.FormAsynchronousCombobox.prototype.setDisplayedText=function(iTxt){this.updateFormsValue();$("#"+this.componentId+"_text").empty();$("#"+this.componentId+"_text").append(iTxt);}
com.pictet.apps.fnc.web.component.forms.FormAsynchronousCombobox.prototype.getValueAsStr=function(){if(this.internalValue.id){return this.internalValue.id;}else{return"";}}
com.pictet.apps.fnc.web.component.forms.FormAsynchronousCombobox.prototype.reset=function(){this.internalValue={};this.setDisplayedText(this.defaultText);}
com.pictet.apps.fnc.web.component.forms.FormAsynchronousCombobox.prototype.setSelectedItem=function(selectedItem){this.internalValue=selectedItem;}
com.pictet.apps.fnc.web.component.forms.FormAsynchronousCombobox.prototype.updateFormsValue=function(){if(this.internalValue.id){$("#"+this.componentId+"Id").val(this.internalValue.id);$("#"+this.componentId+"Text").val(this.internalValue.text);}else{$("#"+this.componentId+"Id").val("");$("#"+this.componentId+"Text").val("");}}
namespace("com.pictet.apps.fnc.web.component.contentContainer");com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider=function(iComponentId,iWidth,iHeight,iDisplayedSize,iTotalSize,iIncStep,iIsBoundWithList,iDisabled,iParent,iDescription){com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.superclass.constructor.call(this,iComponentId,iWidth,iDisabled,iDescription);this.height=iHeight;this.isBoundWithList=iIsBoundWithList;this.displayedSize=iDisplayedSize;this.totalSize=iTotalSize;this.incStep=iIncStep;this.sliderOffset=0;this.positionInList=0;this.sliderYuiInstance=null;this.sliderButtonTimeout=null;this.htmlContainerId=null;this.parentComponentId=iParent;this.isLocked=false;this.sliderHeight=0;this.sliderRange=0;this.sliderThumbHeight=0;this.sliderThumbMinHeight=6;this.sliderButtonTimeoutStartValue=200;this.sliderButtonTimeoutValue=30;this.idButtonUp=iComponentId+"ButtonUp";this.idButtonDown=iComponentId+"ButtonDown";this.idSlider=iComponentId+"Slider";this.idSliderThumb=iComponentId+"SliderThumb";this.toolTipTimeOut=null;};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider,com.pictet.apps.fnc.web.component.forms.AbstractForm);com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.generate=function(iHtmlContainerId){this.htmlContainerId=iHtmlContainerId;com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.superclass.generate.call(this,iHtmlContainerId);this.generateHtml(iHtmlContainerId);var aButtonHeight=$("#"+this.idButtonUp).height();this.sliderHeight=this.height-2*aButtonHeight;$("#"+this.idSlider).height(this.sliderHeight+"px");var iThis=this;YAHOO.util.Event.addListener(this.idSlider,"mouseover",this.updateSliderTooltip,this,true);YAHOO.util.Event.addListener(this.idSliderThumb,"mouseover",this.updateSliderTooltip,this,true);this.generateJs();};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.reInitComponent=function(iTotalSize,iDisplayedSize,iIncStep,iSliderHeight){this.sliderOffset=0;this.positionInList=0;this.totalSize=iTotalSize;if(iIncStep){this.incStep=iIncStep;}
if(iDisplayedSize){this.displayedSize=iDisplayedSize;}
if(iSliderHeight!=null&&iSliderHeight!=0){this.sliderHeight=iSliderHeight-(this.height-this.sliderHeight);this.height=iSliderHeight;$("#"+this.idSlider).height(this.sliderHeight+"px");}
if(this.sliderYuiInstance!=null){$("#"+this.idButtonUp+".buttonUpNotActive").removeClass("buttonUpNotActive").addClass("buttonUp");$("#"+this.idButtonDown+".buttonDownNotActive").removeClass("buttonDownNotActive").addClass("buttonDown");$("#"+this.idSlider+".sliderNotActive").removeClass("sliderNotActive").addClass("slider");$("#"+this.idSliderThumb+".sliderThumb").removeClass("sliderThumb").addClass("sliderThumbHidden");this.reset();this.sliderYuiInstance.unsubscribe("change",this.refreshInternalValue,this);this.sliderYuiInstance.thumb.unreg();this.sliderYuiInstance.unreg();delete this.sliderYuiInstance;YAHOO.util.Event.removeListener(this.idButtonUp,"click");YAHOO.util.Event.removeListener(this.idButtonUp,"mousedown");YAHOO.util.Event.removeListener(this.idButtonUp,"mouseup");YAHOO.util.Event.removeListener(this.idButtonUp,"mouseout");YAHOO.util.Event.removeListener(this.idButtonDown,"click");YAHOO.util.Event.removeListener(this.idButtonDown,"mousedown");YAHOO.util.Event.removeListener(this.idButtonDown,"mouseup");YAHOO.util.Event.removeListener(this.idButtonDown,"mouseout");}
this.generateJs();this.updateStatus();this.updateSliderTooltip();};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.generateHtml=function(iHtmlContainerId){var aStr=['<div class="slidebar" id="',this.componentId,'">',' <div class="buttonUpNotActive" id="',this.idButtonUp,'"></div>',' <div class="slider" id="',this.idSlider,'">','  <div class="sliderThumbHidden" id="',this.idSliderThumb,'">','   <div class="top">&nbsp;</div>','   <div class="bottom" id="',this.idSliderThumb,'_bottom">&nbsp;</div>','  </div>',' </div>',' <div class="buttonDownNotActive" id="',this.idButtonDown,'"></div>','</div>'];$("#"+iHtmlContainerId).append(aStr.join(""));};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.generateJs=function(){this.removeMouseScroll();if(this.totalSize>this.displayedSize){$("#"+this.idButtonUp+".buttonUpNotActive").removeClass("buttonUpNotActive").addClass("buttonUp");$("#"+this.idButtonDown+".buttonDownNotActive").removeClass("buttonDownNotActive").addClass("buttonDown");$("#"+this.idSlider+".sliderNotActive").removeClass("sliderNotActive").addClass("slider");$("#"+this.idSliderThumb+".sliderThumbHidden").removeClass("sliderThumbHidden").addClass("sliderThumb");this.sliderThumbHeight=Math.max(Math.round(this.sliderHeight*this.displayedSize/this.totalSize),this.sliderThumbMinHeight);this.sliderRange=this.sliderHeight-this.sliderThumbHeight;$("#"+this.idSliderThumb).height(this.sliderThumbHeight+"px");$("#"+this.idSliderThumb).css("top","0px");var topCss=this.sliderThumbHeight-8;$("#"+this.idSliderThumb+"_bottom").css("top",topCss+"px");this.sliderYuiInstance=YAHOO.widget.Slider.getVertSlider(this.idSlider,this.idSliderThumb,0,this.sliderRange);this.sliderYuiInstance.animate=false;this.sliderYuiInstance.enableKeys=false;this.sliderYuiInstance.subscribe("change",this.refreshInternalValue,this,true);var instance=this;YAHOO.util.Event.addListener(this.idButtonUp,"click",this.buttonUpClick,this,true);YAHOO.util.Event.addListener(this.idButtonUp,"mousedown",this.buttonUpMouseDown,this,true);YAHOO.util.Event.addListener(this.idButtonUp,"mouseup",this.buttonUpMouseUp,this,true);YAHOO.util.Event.addListener(this.idButtonUp,"mouseout",this.buttonUpMouseUp,this,true);YAHOO.util.Event.addListener(this.idButtonDown,"click",this.buttonDownClick,this,true);YAHOO.util.Event.addListener(this.idButtonDown,"mousedown",this.buttonDownMouseDown,this,true);YAHOO.util.Event.addListener(this.idButtonDown,"mouseup",this.buttonDownMouseUp,this,true);YAHOO.util.Event.addListener(this.idButtonDown,"mouseout",this.buttonDownMouseUp,this,true);this.addMouseScroll();}else{$("#"+this.idButtonUp+".buttonUp").removeClass("buttonUp").addClass("buttonUpNotActive");$("#"+this.idButtonDown+".buttonDown").removeClass("buttonDown").addClass("buttonDownNotActive");$("#"+this.idSlider+".slider").removeClass("slider").addClass("sliderNotActive");$("#"+this.idSliderThumb+".sliderThumb").removeClass("sliderThumb").addClass("sliderThumbHidden");}};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.buttonUpClick=function(){this.slideOnStepUp();};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.buttonUpMouseDown=function(){$("#"+this.idButtonUp).removeClass("buttonUp").addClass("buttonUpClicked");window.clearTimeout(this.sliderButtonTimeout);var instance=this;this.sliderButtonTimeout=window.setTimeout(function(){instance.slideContinuously("up");},this.sliderButtonTimeoutStartValue);};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.buttonUpMouseUp=function(){window.clearTimeout(this.sliderButtonTimeout);$("#"+this.idButtonUp).removeClass("buttonUpClicked").addClass("buttonUp");};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.buttonDownClick=function(){this.slideOnStepDown();};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.buttonDownMouseDown=function(){$("#"+this.idButtonDown).removeClass("buttonDown").addClass("buttonDownClicked");window.clearTimeout(this.sliderButtonTimeout);var instance=this;this.sliderButtonTimeout=window.setTimeout(function(){instance.slideContinuously("down");},this.sliderButtonTimeoutStartValue);};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.buttonDownMouseUp=function(){window.clearTimeout(this.sliderButtonTimeout);$("#"+this.idButtonDown).removeClass("buttonDownClicked").addClass("buttonDown");};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.lock=function(){if(this.sliderYuiInstance!=null){this.sliderYuiInstance.lock();this.removeMouseScroll();}
this.isLocked=true;$("#"+this.idSliderThumb+".sliderThumb").removeClass("sliderThumb").addClass("sliderThumbHidden");};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.unlock=function(){if(this.sliderYuiInstance!=null){this.sliderYuiInstance.unlock();this.addMouseScroll();}
this.isLocked=false;if(this.totalSize>this.displayedSize){$("#"+this.idSliderThumb+".sliderThumbHidden").removeClass("sliderThumbHidden").addClass("sliderThumb");}};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.updateSliderTooltip=function(iSliderPos){if(this.isBoundWithList){var aLastDisplayedElement=this.getSliderPosition(1)-1+this.displayedSize;$("#"+this.idSliderThumb).attr("title","elements "+(this.getSliderPosition(1))+" to "+aLastDisplayedElement+" in "+this.totalSize);$("#"+this.idSlider).attr("title",this.totalSize+" elements in this list");}};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.getSliderPosition=function(iFromIdx)
{return this.totalSize!=0?(this.positionInList+iFromIdx):0;};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.setSliderPosition=function(iSliderPos){this.positionInList=iSliderPos;this.sliderOffset=iSliderPos*this.sliderHeight/this.totalSize/this.sliderRange;this.sliderYuiInstance.setValue(Math.round(iSliderPos*this.sliderHeight/this.totalSize),false,false,true);this.updateStatus();};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.getYuiSliderPosition=function(){var yuiSlider=this.sliderYuiInstance.getValue();var iMin=yuiSlider<this.sliderRange?yuiSlider:this.sliderRange;return 0>iMin?0:iMin;};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.slideOnStepUp=function(){var newPosition=this.positionInList-this.incStep;this.setSliderPosition(0>newPosition?0:newPosition);};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.slideOnStepDown=function(){var maxScrollablePosition=this.totalSize-this.displayedSize;var newPosition=this.positionInList+this.incStep;this.setSliderPosition(maxScrollablePosition<newPosition?maxScrollablePosition:newPosition);};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.addMouseScroll=function(){var iThis=this;$("#"+this.parentComponentId).mousewheel(function(event,delta){if(delta){if(Math.round(delta)==0){if(delta<0){iThis.slideScroll(iThis.incStep*2);}else{iThis.slideScroll(iThis.incStep*(-2));}}else{iThis.slideScroll(Math.round(delta)*iThis.incStep*2);}}
return false;});};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.removeMouseScroll=function(){$("#"+this.parentComponentId).unmousewheel();};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.slideScroll=function(customIncStep){var maxScrollablePosition=this.totalSize-this.displayedSize;var newPosition=this.positionInList-customIncStep;var iMin=maxScrollablePosition<newPosition?maxScrollablePosition:newPosition;this.setSliderPosition(0>iMin?0:iMin);};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.slideContinuously=function(iDirection){var instance=this;if(iDirection=="up"){this.slideOnStepUp();this.sliderButtonTimeout=window.setTimeout(function(){instance.slideContinuously("up");},this.sliderButtonTimeoutValue);}else if(iDirection=="down"){this.slideOnStepDown();this.sliderButtonTimeout=window.setTimeout(function(){instance.slideContinuously("down");},this.sliderButtonTimeoutValue);}};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.refreshInternalValue=function(){this.sliderOffset=this.getYuiSliderPosition()/this.sliderRange;this.positionInList=Math.round((this.totalSize-this.displayedSize)*this.sliderOffset);this.updateStatus();};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.getValueAsStr=function(){return this.sliderOffset;};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.reset=function(){if(this.isLocked)
{this.sliderYuiInstance.unlock();this.setSliderPosition(0);this.sliderYuiInstance.lock();}else{this.setSliderPosition(0);}};com.pictet.apps.fnc.web.component.contentContainer.VerticalSlider.prototype.getType=function(){return"verticalSlider";};namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.AbstractTextField=function(iComponentId,iWidth,iDisabled,iDescription){com.pictet.apps.fnc.web.component.forms.AbstractTextField.superclass.constructor.call(this,iComponentId,iWidth,iDisabled,iDescription);this.value="";this.timeoutValue=1000;this.timeout=null;};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.AbstractTextField,com.pictet.apps.fnc.web.component.forms.AbstractForm);com.pictet.apps.fnc.web.component.forms.AbstractTextField.prototype.setValue=function(iValue){this.value=''+iValue;};com.pictet.apps.fnc.web.component.forms.AbstractTextField.prototype.updateDisplayValue=function(){alert("method updateDisplayValue() unimplemented in AbstractTextField subclass !");};com.pictet.apps.fnc.web.component.forms.AbstractTextField.prototype.changeInternalValue=function(){window.clearTimeout(this.timeout);if(this.value!=$("#"+this.componentId+"_internalValue").val()){this.value=$("#"+this.componentId+"_internalValue").val();this.updateStatus();}};com.pictet.apps.fnc.web.component.forms.AbstractTextField.prototype.forceChangeInternalValue=function(){this.changeInternalValue();};com.pictet.apps.fnc.web.component.forms.AbstractTextField.prototype.keyDownAction=function(e){var key=0;if(window.event){key=e.keyCode;}else{key=e.which;}
window.clearTimeout(this.timeout);switch(key){case 13:this.changeInternalValue();break;default:this.timeout=window.setTimeout(this.componentId+".changeInternalValue()",this.timeoutValue);break;}
return key;};com.pictet.apps.fnc.web.component.forms.AbstractTextField.prototype.getValueAsStr=function(){return this.value;};com.pictet.apps.fnc.web.component.forms.AbstractTextField.prototype.reset=function(){this.setValue("");$("#"+this.componentId+"_internalValue").val(this.value);}
com.pictet.apps.fnc.web.component.forms.AbstractTextField.prototype.getType=function(){return"abstracttextfield";}
com.pictet.apps.fnc.web.component.forms.AbstractTextField.prototype.focus=function(){try{this.setFocus();return true;}catch(error){return false;}};namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.TextField=function(iComponentId,iWidth,iDisabled,iMaxSize,iDescription){this.maxInputSize=iMaxSize;com.pictet.apps.fnc.web.component.forms.TextField.superclass.constructor.call(this,iComponentId,iWidth,iDisabled,iDescription);this.onEnter=new YAHOO.util.CustomEvent('onEnter');};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.TextField,com.pictet.apps.fnc.web.component.forms.AbstractTextField);com.pictet.apps.fnc.web.component.forms.TextField.prototype.generate=function(iHtmlContainerId){this.internalGenerate(iHtmlContainerId,"textfield","text");};com.pictet.apps.fnc.web.component.forms.TextField.prototype.setFocus=function(){$("#"+this.componentId+"_internalValue").focus();};com.pictet.apps.fnc.web.component.forms.TextField.prototype.internalGenerate=function(iHtmlContainerId,iCssClass,iInputType){var aDisabledStr="";var inputClass="";if(this.isDisabled){aDisabledStr=' disabled="true" ';inputClass=" disabled";}
var border=2;var padding=4;var aStr=['<div class="',iCssClass,'" id="',this.componentId,'">','<input name="',this.componentId,'" id="',this.componentId,'_internalValue" type="',iInputType,'" class="text ',inputClass,'" ',aDisabledStr,' style="width:',(this.width-border-padding),'px;" maxlength="',this.maxInputSize,'" >','</div>'].join("");$("#"+iHtmlContainerId).append(aStr);$("#"+this.componentId+"_internalValue").val(this.value);YAHOO.util.Event.addListener(this.componentId+"_internalValue","change",this.changeInternalValue,this,true);YAHOO.util.Event.addListener(this.componentId+"_internalValue","keydown",this.keyDownAction,this,true);YAHOO.util.Event.addListener(this.componentId+"_internalValue","blur",this.changeInternalValue,this,true);};com.pictet.apps.fnc.web.component.forms.TextField.prototype.keyDownAction=function(e){var key=com.pictet.apps.fnc.web.component.forms.TextField.superclass.keyDownAction.call(this,e);if(key==13){this.onEnter.fire();}
return key;};com.pictet.apps.fnc.web.component.forms.TextField.prototype.getType=function(){return"textfield";}
com.pictet.apps.fnc.web.component.forms.TextField.prototype.updateValue=function(){this.changeInternalValue();};com.pictet.apps.fnc.web.component.forms.TextField.prototype.enable=function(){$("#"+this.componentId+"_internalValue").removeClass("disable").removeAttr("disabled");};com.pictet.apps.fnc.web.component.forms.TextField.prototype.disable=function(){$("#"+this.componentId+"_internalValue").addClass("disable").attr("disabled","true");};com.pictet.apps.fnc.web.component.forms.TextField.prototype.markInvalid=function(){$("#"+this.componentId+"_internalValue").addClass("invalid");};com.pictet.apps.fnc.web.component.forms.TextField.prototype.markValid=function(){$("#"+this.componentId+"_internalValue.invalid").removeClass("invalid");};com.pictet.apps.fnc.web.component.forms.TextField.prototype.selectText=function(){$("#"+this.componentId+"_internalValue").select();};namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.HiddenField=function(iComponentId,iValue,iDescription){com.pictet.apps.fnc.web.component.forms.HiddenField.superclass.constructor.call(this,iComponentId,0,false,iDescription);this.value=iValue;this.onEnter=new YAHOO.util.CustomEvent('onEnter');};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.HiddenField,com.pictet.apps.fnc.web.component.forms.AbstractForm);com.pictet.apps.fnc.web.component.forms.HiddenField.prototype.generate=function(){};com.pictet.apps.fnc.web.component.forms.HiddenField.prototype.getType=function(){return"hiddenfield";}
com.pictet.apps.fnc.web.component.forms.HiddenField.prototype.setValue=function(iValue){this.value=iValue;};com.pictet.apps.fnc.web.component.forms.HiddenField.prototype.getValueAsStr=function(){return this.value;};com.pictet.apps.fnc.web.component.forms.HiddenField.prototype.reset=function(){this.setValue("");}
namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.DateField=function(iComponentId,iWidth,iDisabled,iDescription,iHighlightDates,iFieldsConfig,iHighlightDatesOnly,iJsValidate){com.pictet.apps.fnc.web.component.forms.DateField.superclass.constructor.call(this,iComponentId,iWidth,iDisabled,iDescription);this.yuiCalendarOverlay=null;this.yuiCalendar=null;this.moveCalendarRight=false;this.highlightDates=iHighlightDates;this.highlightDatesOnly=iHighlightDatesOnly;this.jsValidate=iJsValidate;this.defaultValue="";this.minDate=new Date(1980,0,1);this.initI18n(iFieldsConfig);};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.DateField,com.pictet.apps.fnc.web.component.forms.AbstractTextField);com.pictet.apps.fnc.web.component.forms.DateField.prototype.initI18n=function(iFieldsConfig){this.dayPosition=iFieldsConfig[0];this.monthPosition=iFieldsConfig[1];this.yearPosition=iFieldsConfig[2];this.dateDelimiter=iFieldsConfig[3];this.dateRangeDelimiter=iFieldsConfig[4];this.dateFormat=iFieldsConfig[5];}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.disable=function(){this.isDisabled=true;$("#"+this.componentId).removeClass("datefieldDisabled");$("#"+this.componentId).removeClass("datefield");$("#"+this.componentId).addClass("datefieldDisabled");$("#"+this.componentId+"_guiValue")[0].disabled=true;}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.enable=function(){this.isDisabled=false;$("#"+this.componentId).removeClass("datefieldDisabled");$("#"+this.componentId).removeClass("datefield");$("#"+this.componentId).addClass("datefield");$("#"+this.componentId+"_guiValue")[0].disabled=false;$("#"+this.componentId).width(this.width);$("#"+this.componentId+"_calendarContainer").hide();}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.generate=function(iHtmlContainerId){com.pictet.apps.fnc.web.component.forms.DateField.superclass.generate.call(this,iHtmlContainerId);var aClassName="datefield";if(this.isDisabled){aClassName="datefieldDisabled";}
var buttonTooltip=this.labels['label']['buttonTooltip'];var aStr=['<div class="',aClassName,'" id="',this.componentId,'">','    <input id="',this.componentId,'_guiValue" class="text',((this.value=="")?" dateFormat":""),'" type="text" value="',(this.value=="")?this.dateFormat:this.convertFromI18NToLocal(this.value),'" ',this.isDisabled?' disabled="true" ':'',(this.highlightDatesOnly&&this.highlightDates&&this.highlightDates.length>0)?'readonly="readonly"':'','>','    <div id="',this.componentId,'_button" title="',buttonTooltip,'" class="button"></div>','    <div id="',this.componentId,'_calendarOverlay"  class="calendarOverlay">','        <div id="',this.componentId,'_calendarContainer"  class="calendarContainer"></div>','    </div><div style="clear:both"></div></div>'];$("#"+iHtmlContainerId).append(aStr.join(""));var border=4;var padding=4;var buttonWidth=parseInt($("#"+this.componentId+"_button").css("width"),10);buttonWidth=buttonWidth?buttonWidth:20;var aTextWidth=this.width-buttonWidth-border-padding;$("#"+this.componentId+"_guiValue").width(aTextWidth+"px");YAHOO.util.Event.addListener(this.componentId+"_guiValue","focus",this.selectInput,this,true);YAHOO.util.Event.addListener(this.componentId+"_guiValue","blur",this.putFormat,this,true);YAHOO.util.Event.addListener(this.componentId+"_guiValue","change",this.changeInternalValue,this,true);YAHOO.util.Event.addListener(this.componentId+"_guiValue","keydown",this.keyDownAction,this,true);YAHOO.util.Event.addListener(this.componentId+"_button","click",this.displayCalendar,this,true);};com.pictet.apps.fnc.web.component.forms.DateField.prototype.initYuiCalendar=function(){if(this.yuiCalendar==null){this.yuiCalendarOverlay=new YAHOO.widget.Overlay(this.componentId+"_calendarOverlay",{context:[this.componentId+"_button","tl","tr"],visible:false,zIndex:3});this.yuiCalendarOverlay.render();var navConfig={strings:{month:this.labels['label']['chooseMonth'],year:this.labels['label']['enterYear'],submit:this.labels['label']['ok'],cancel:this.labels['label']['cancel'],invalidYear:this.labels['label']['invalideDate']},monthFormat:YAHOO.widget.Calendar.LONG,initialFocus:"year"};this.yuiCalendar=new YAHOO.widget.Calendar(this.componentId+"_calendar",this.componentId+"_calendarContainer",{navigator:navConfig,START_WEEKDAY:1});this.yuiCalendar.cfg.setProperty("WEEKDAYS_SHORT",this.labels['label']['shortNameWeeks']);this.yuiCalendar.cfg.setProperty("MONTHS_LONG",this.labels['label']['fullNameMonths']);this.yuiCalendar.cfg.setProperty("MDY_DAY_POSITION",this.dayPosition);this.yuiCalendar.cfg.setProperty("MDY_MONTH_POSITION",this.monthPosition);this.yuiCalendar.cfg.setProperty("MDY_YEAR_POSITION",this.yearPosition);this.yuiCalendar.cfg.setProperty("DATE_FIELD_DELIMITER",this.dateDelimiter);this.yuiCalendar.cfg.setProperty("DATE_RANGE_DELIMITER",this.dateRangeDelimiter);this.yuiCalendar.selectEvent.subscribe(this.handleSelect,this,true);if(this.highlightDates&&this.highlightDates.length>0){if(this.highlightDatesOnly){this.yuiCalendar.addWeekdayRenderer(1,this.yuiCalendar.renderBodyCellRestricted);this.yuiCalendar.addWeekdayRenderer(2,this.yuiCalendar.renderBodyCellRestricted);this.yuiCalendar.addWeekdayRenderer(3,this.yuiCalendar.renderBodyCellRestricted);this.yuiCalendar.addWeekdayRenderer(4,this.yuiCalendar.renderBodyCellRestricted);this.yuiCalendar.addWeekdayRenderer(5,this.yuiCalendar.renderBodyCellRestricted);this.yuiCalendar.addWeekdayRenderer(6,this.yuiCalendar.renderBodyCellRestricted);this.yuiCalendar.addWeekdayRenderer(7,this.yuiCalendar.renderBodyCellRestricted);var instance=this;for(var i=0;i<this.highlightDates.length;i++){this.yuiCalendar.addRenderer(this.convertFromI18NToLocal(this.highlightDates[i]),function(workingDate,cell){return instance.DayGenFunction(workingDate,cell);});}}else{for(var i=0;i<this.highlightDates.length;i++){this.yuiCalendar.addRenderer(this.convertFromI18NToLocal(this.highlightDates[i]),this.yuiCalendar.renderCellStyleHighlight1);}}}else{this.yuiCalendar.cfg.setProperty("minDate",this.minDate);}
this.yuiCalendar.render();var aStr="<div id='"+this.componentId+"_closeCalendar' class='closeCalendar'>"+this.labels['label']['close']+"</div>";$("#"+this.componentId+"_calendarOverlay").append(aStr);YAHOO.util.Event.addListener(this.componentId+"_closeCalendar","click",this.hideCalendar,this,true);YAHOO.util.Event.addListener(document,"click",this.onClickInDoc,this,true);YAHOO.util.Event.addListener(window,"resize",this.hideCalendar,this,true);}};com.pictet.apps.fnc.web.component.forms.DateField.prototype.DayGenFunction=function(workingDate,cell){this.yuiCalendar.renderCellStyleHighlight1(workingDate,cell);this.yuiCalendar.styleCellDefault(workingDate,cell);this.yuiCalendar.renderCellDefault(workingDate,cell);return YAHOO.widget.Calendar.STOP_RENDER;};com.pictet.apps.fnc.web.component.forms.DateField.prototype.onClickInDoc=function(e){var target=YAHOO.util.Event.getTarget(e);var isClickedOutside=true;while(target!=null){if(target.id==this.componentId+"_calendarContainer"||target.id==this.componentId+"_button"){isClickedOutside=false;break;}else{target=target.parentNode;}}
if(isClickedOutside)
this.hideCalendar();}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.refreshCalendarPos=function(){if(this.moveCalendarRight){this.yuiCalendarOverlay.cfg.setProperty("context",[this.componentId+"_guiValue","tl","bl"]);}else{this.yuiCalendarOverlay.cfg.setProperty("context",[this.componentId+"_button","tr","br"]);}};com.pictet.apps.fnc.web.component.forms.DateField.prototype.displayCalendar=function(){if(this.yuiCalendar==null){this.initYuiCalendar();}
if(this.checkDateFormat($("#"+this.componentId+"_guiValue").val())){this.selectDate($("#"+this.componentId+"_guiValue").val());}else{this.yuiCalendar.clear();}
this.refreshCalendarPos();this.yuiCalendarOverlay.show();this.yuiCalendar.show();}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.checkDateFormat=function(date){var aRetVal=true;var dateRegExpString=[];dateRegExpString[this.dayPosition-1]="([0-3]?[0-9]{1})";dateRegExpString[this.monthPosition-1]="([0-1]?[0-9]{1})";dateRegExpString[this.yearPosition-1]="([0-9]{1,4})";var reg=new RegExp("^"+dateRegExpString.join(this.escapeForRegExp(this.dateDelimiter))+"$","g");aRetVal=reg.test(date);return aRetVal;};com.pictet.apps.fnc.web.component.forms.DateField.prototype.isCommunicationFormat=function(date){var reg=new RegExp("^([0-9]{4})-([0-1]?[0-9]{1})-([0-3]?[0-9]{1})$","g");aRetVal=reg.test(date);return aRetVal;}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.selectDate=function(date)
{this.yuiCalendar.select(date);if(this.yuiCalendar.getSelectedDates().length==0){this.yuiCalendar.clear();return;}
var firstDate=this.yuiCalendar.getSelectedDates()[0];var selectedPage="";if(this.yearPosition<this.monthPosition){selectedPage=firstDate.getFullYear()+this.dateDelimiter+(firstDate.getMonth()+1);}else{selectedPage=(firstDate.getMonth()+1)+this.dateDelimiter+firstDate.getFullYear();}
this.yuiCalendar.cfg.setProperty("pagedate",selectedPage);this.yuiCalendar.render();};com.pictet.apps.fnc.web.component.forms.DateField.prototype.hideCalendar=function(){this.yuiCalendarOverlay.hide();}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.padd=function(iStr,iPaddingChar,iLength){var oStr=iStr;if(iStr.length<iLength){for(j=1;j<iLength;j++){oStr=iPaddingChar+oStr;}}
return oStr;}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.handleSelect=function(type,args,obj){var dates=args[0];var date=dates[0];var year=date[0];var month=date[1];var day=date[2];$("#"+this.componentId+"_guiValue").removeClass("dateFormat");this.updateValue(year,month,day);this.hideCalendar();}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.updateValue=function(year,month,day){if(year&&month&&day){var stringDate=[];stringDate[this.yearPosition-1]=year;stringDate[this.monthPosition-1]=month<10?"0"+month:month;stringDate[this.dayPosition-1]=day<10?"0"+day:day;var aDate=stringDate.join(this.dateDelimiter);$("#"+this.componentId+"_guiValue").val(aDate);}else{$("#"+this.componentId+"_guiValue").val("");}
this.changeInternalValue();}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.updateValueSilently=function(year,month,day){if(year&&month&&day){var stringDate=[];stringDate[this.yearPosition-1]=year;stringDate[this.monthPosition-1]=month<10?"0"+month:month;stringDate[this.dayPosition-1]=day<10?"0"+day:day;var aDate=stringDate.join(this.dateDelimiter);$("#"+this.componentId+"_guiValue").val(aDate);}else{$("#"+this.componentId+"_guiValue").val("");}
this.changeInternalValueSilently();}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.changeInternalValueSilently=function(){window.clearTimeout(this.timeout);var newValue=this.convertFromLocalToI18N($("#"+this.componentId+"_guiValue").val());if(!this.testTwoIsoDates(this.value,newValue)){this.value=newValue;$("#"+this.componentId+'_internalValue').val(this.getValueAsStr());}};com.pictet.apps.fnc.web.component.forms.DateField.prototype.changeInternalValue=function(){window.clearTimeout(this.timeout);var userValue=$("#"+this.componentId+"_guiValue").val();if(this.jsValidate){if(this.checkDateFormat(userValue)){this.markValid();}else{this.markInvalid();}}
var newValue=this.convertFromLocalToI18N(userValue);if(this.value!=newValue&&!this.testTwoIsoDates(this.value,newValue)){this.value=newValue;this.updateStatus();}};com.pictet.apps.fnc.web.component.forms.DateField.prototype.selectInput=function(){if($("#"+this.componentId+"_guiValue").val()==this.dateFormat){$("#"+this.componentId+"_guiValue").val("");this.value="";$("#"+this.componentId+"_guiValue").removeClass("dateFormat");}else{document.getElementById(this.componentId+"_guiValue").select();}};com.pictet.apps.fnc.web.component.forms.DateField.prototype.putFormat=function(){var domValueAccessor=$("#"+this.componentId+"_guiValue");if(domValueAccessor.val()==""){domValueAccessor.val(this.dateFormat);domValueAccessor.addClass("dateFormat");}};com.pictet.apps.fnc.web.component.forms.DateField.prototype.testTwoIsoDates=function(date1,date2){var dateSplited1=date1.split("-");var dateSplited2=date2.split("-");return!(parseInt(dateSplited1[0],10)!=parseInt(dateSplited2[0],10)||parseInt(dateSplited1[1],10)!=parseInt(dateSplited2[1],10)||parseInt(dateSplited1[2],10)!=parseInt(dateSplited2[2],10));};com.pictet.apps.fnc.web.component.forms.DateField.prototype.convertFromLocalToI18N=function(date){if(this.checkDateFormat(date)){var dateSplited=date.split(this.dateDelimiter);var returnDate=[];returnDate[0]=parseInt(dateSplited[this.yearPosition-1],10);returnDate[1]=parseInt(dateSplited[this.monthPosition-1],10);returnDate[2]=parseInt(dateSplited[this.dayPosition-1],10);return returnDate.join("-");}else{if(date==""||date==this.dateFormat){return"";}else{return date;}}};com.pictet.apps.fnc.web.component.forms.DateField.prototype.convertFromJsToI18N=function(date){var str=[];if(date!=null){str.push(date.getFullYear());str.push("-");if(date.getMonth()<9){str.push("0");}
str.push(date.getMonth()+1);str.push("-");if(date.getDate()<10){str.push("0");}
str.push(date.getDate());return str.join("");}else{return"";}}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.convertFromI18NToLocal=function(date){if(!this.isCommunicationFormat(date)){return date;}
var dateSplited=date.split("-");var returnDate=[];returnDate[this.yearPosition-1]=dateSplited[0];var month=parseInt(dateSplited[1],10);returnDate[this.monthPosition-1]=month<10?"0"+month:""+month;var day=parseInt(dateSplited[2],10);returnDate[this.dayPosition-1]=day<10?"0"+day:""+day;return returnDate.join(this.dateDelimiter);};com.pictet.apps.fnc.web.component.forms.DateField.prototype.escapeForRegExp=function(literal){var regExpSpecials="\\.$[](){}^?*+-";if(regExpSpecials.indexOf(literal)!=-1){return"\\"+literal;}
return literal;};com.pictet.apps.fnc.web.component.forms.DateField.prototype.reset=function(){com.pictet.apps.fnc.web.component.forms.DateField.superclass.reset.call(this);$("#"+this.componentId+"_guiValue").val(this.value);this.putFormat();this.markValid();}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.resetAndFireEvent=function(){this.reset();this.onValueChange.fire(this);}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.setValue=function(iValue){this.value=this.convertFromLocalToI18N(iValue);};com.pictet.apps.fnc.web.component.forms.DateField.prototype.getType=function(){return"datefield";}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.markInvalid=function(){$("#"+this.componentId+"_guiValue").addClass("invalid");}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.markValid=function(){$("#"+this.componentId+"_guiValue.invalid").removeClass("invalid");}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.moveCalendarToRight=function(){this.moveCalendarRight=true;}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.updateDisplayValue=function(){$("#"+this.componentId+"_guiValue").val(this.convertFromI18NToLocal(this.value));}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.setFocus=function(){$("#"+this.componentId+"_guiValue").focus();}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.setDefaultValue=function(iValue){this.defaultValue=iValue;}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.resetToDefaultValueAndFireEvent=function(){this.value=this.defaultValue;$("#"+this.componentId+"_internalValue").val(this.value);this.onValueChange.fire(this);}
com.pictet.apps.fnc.web.component.forms.DateField.prototype.synchronise=function(iSynchComponent){if(this.getType()==iSynchComponent.getType()){if(this.isDisabled!=iSynchComponent.isDisabled){if(this.isDisabled){this.enable();}else{this.disable();}}
var value=iSynchComponent.getValueAsStr();this.value=value;this.updateDisplayValue();$("#"+this.componentId+"_internalValue").val(this.value);this.onValueChange.fire(this);}};namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.PasswordField=function(iComponentId,iWidth,iDisabled,iDescription){com.pictet.apps.fnc.web.component.forms.PasswordField.superclass.constructor.call(this,iComponentId,iWidth,iDisabled,iDescription);};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.PasswordField,com.pictet.apps.fnc.web.component.forms.TextField);com.pictet.apps.fnc.web.component.forms.PasswordField.prototype.generate=function(iHtmlContainerId){this.internalGenerate(iHtmlContainerId,"passwordfield","password");};com.pictet.apps.fnc.web.component.forms.PasswordField.prototype.getType=function(){return"passwordfield";}
namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.Autocomplete=function(iComponentId,iDwrObject,iNbFields,iMaxResultsDisplayed,iForceSelection,iDefaultTextValue,iDefaultIdValue,iInputWidth,iHeaderText,iFooterText){com.pictet.apps.fnc.web.component.forms.Autocomplete.superclass.constructor.call(this,iComponentId);this.dwrObject=iDwrObject;this.componentId=iComponentId;this.myAutoComp={};this.maxResultsDisplayed=iMaxResultsDisplayed;this.forceSelection=iForceSelection;this.nbFields=iNbFields;this.value="";this.separatorChar=";";this.defaultTextValue=iDefaultTextValue;this.value=iDefaultIdValue;this.inputWidth=iInputWidth;this.headerText=iHeaderText;this.footerText=iFooterText;this.currentAjaxCall="";this.delayToRequest=500;this.minRequestLength=3;this.timeoutToRequest=null;this.selectedValue=null;this.onEnter=new YAHOO.util.CustomEvent('onEnter');};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.Autocomplete,com.pictet.apps.fnc.web.component.forms.AbstractForm);com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.sendQuery=function()
{$("#"+this.componentId+"AutoCompletePanel .yui-ac-content").css("display","none");};com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.escapeHtml=function(sHtml){if(sHtml){sHtml+="";return sHtml.replace(/&/g,"&#38;").replace(/</g,"&#60;").replace(/>/g,"&#62;");}
return"";}
com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.generate=function(iHtmlContainerId){com.pictet.apps.fnc.web.component.forms.Autocomplete.superclass.generate.call(this,this.componentId);this.generateHtml(iHtmlContainerId);if(this.value!=""){$("#"+this.componentId+"_internalValue").val(this.value);}
var iThisAutocomplete=this;this.ds=new YAHOO.util.FunctionDataSource();this.ds.responseType=YAHOO.util.DataSourceBase.TYPE_JSARRAY;this.ds.responseSchema={fields:["id","value"]};this.ds.makeConnection=function(oRequest,oCallback,oCaller){var userValue=decodeURIComponent(oRequest);var tId=new Date().getTime();var dsInstance=this;if(iThisAutocomplete.timeoutToRequest!=null){window.clearTimeout(iThisAutocomplete.timeoutToRequest);}
if(userValue.length>=iThisAutocomplete.minRequestLength){iThisAutocomplete.currentAjaxCall=tId;iThisAutocomplete.timeoutToRequest=window.setTimeout(function(){if(userValue&&userValue.length>0){iThisAutocomplete.addLoadingInfo();iThisAutocomplete.dwrObject.suggestEntries(userValue,{callback:function(response){if(tId==iThisAutocomplete.currentAjaxCall){dsInstance.handleResponse(userValue,response.entries,oCallback,oCaller,tId);if(response.exhaustive){$("#"+iThisAutocomplete.componentId+"AutocompleteFooter").hide();}else{$("#"+iThisAutocomplete.componentId+"AutocompleteFooter").show();}}
iThisAutocomplete.clearLoadingInfo();},errorHandler:function(errorString,exception){com.pictet.apps.fnc.web.component.forms.Autocomplete.superclass.handleAjaxRemoteException(iThisAutocomplete,errorString,exception);iThisAutocomplete.clearLoadingInfo();}});}},iThisAutocomplete.delayToRequest);}else{iThisAutocomplete.currentAjaxCall="noRequest";}
return iThisAutocomplete.currentAjaxCall;}
this.myAutoComp=new YAHOO.widget.AutoComplete(this.componentId+"Input1",this.componentId+"AutoCompletePanel",this.ds,{animSpeed:(0.1),animVert:false,maxResultsDisplayed:this.maxResultsDisplayed,forceSelection:this.forceSelection});this.myAutoComp.resultTypeList=false;this.myAutoComp.setHeader(this.headerText);this.myAutoComp.setFooter('<div id="'+this.componentId+'AutocompleteFooter">'+this.footerText+'</div>');this.myAutoComp.dataRequestEvent.subscribe(this.sendQuery,this,true)
this.myAutoComp.formatResult=function(oResultData,sQuery,sResultMatch){var escapedData=iThisAutocomplete.escapeHtml(oResultData.value);return iThisAutocomplete.boldOccurence(escapedData,sQuery);};this.myAutoComp.itemSelectEvent.subscribe(this.itemSelectHandler,this,true);this.myAutoComp.selectionEnforceEvent.subscribe(this.selectionEnforceEvent,this,true);};com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.generateHtml=function(iHtmlContainerId){var aStr=[];aStr.push('<input type="text" id="',this.componentId,'Input1','"  value="',this.defaultTextValue,'"  class="autocompleteInput1','" style="width:',this.inputWidth,'px" />');YAHOO.util.Event.addListener(this.componentId+"Input1","keyup",this.keyEvent,this,true);$("#"+iHtmlContainerId).append(aStr.join(""));};com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.addLoadingInfo=function(){$("#"+this.componentId+"Container").addClass("loading");}
com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.clearLoadingInfo=function(){$("#"+this.componentId+"Container").removeClass("loading");}
com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.setValue=function(defaultTextValue,defaultIdValue){$("#"+this.componentId+"Input1").val(defaultTextValue);$("#"+this.componentId+"_internalValue").val(defaultIdValue);this.onValueChange.fire();};com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.selectionEnforceEvent=function(){var inputValue=document.getElementById(this.componentId+"_internalValue").value;this.clearInput();if(inputValue!=""){this.onValueChange.fire();}};com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.keyEvent=function(e){if(this.forceSelection&&document.getElementById(this.componentId+"Input1").value==""){this.selectionEnforceEvent();}else{}
var key=0;if(window.event){key=e.keyCode;}else{key=e.which;}
if(key==13){if(document.getElementById(this.componentId+"_internalValue").value!=""){YAHOO.log("Enter entered");this.onEnter.fire();}}};com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.itemSelectHandler=function(sType,aArgs){var aData=aArgs[2];$("#"+this.componentId+"Input1").val(aData.value);$("#"+this.componentId+"_internalValue").val(aData.id);this.onValueChange.fire();};com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.clearInput=function(){$("#"+this.componentId+"_internalValue").val("");};com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.getValueAsStr=function(){var internalVal=$("#"+this.componentId+"_internalValue").val();if(internalVal==""&&!this.forceSelection){internalVal=$("#"+this.componentId+"Input1").val();}
return internalVal;};com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.boldOccurence=function(data,query){var sQuery=query.replace(/[.*+?|()\\[\\]{}\\\\]/g,"\\$&");var str=data;str=str.replace(new RegExp("("+sQuery+")","gi"),"<span style=\"font-weight: bold\">$1</span>");return str;}
com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.setAutocompleteContentWidth=function(){var inputStartOffset=YAHOO.util.Dom.getRegion(this.componentId+"Input1").left;var inputEndOffset=YAHOO.util.Dom.getRegion(this.componentId+"Input"+this.nbFields).left;var inputEndWidth=$("#"+this.componentId+"Input"+this.nbFields).width();var autocompleteWidth=inputEndOffset-inputStartOffset+inputEndWidth;$("#"+this.componentId+"Container .yui-ac-content ul").width(autocompleteWidth);}
com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.reset=function(){for(j=1;j<=this.nbFields;j++){$("#"+this.componentId+'Input'+j).val("");}
$("#"+this.componentId+"_internalValue").val("");};com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.setFocus=function(){$("#"+this.componentId+"Input1").focus();};com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.focus=function(){try{this.setFocus();return true;}catch(error){return false;}};com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.markInvalid=function(){for(var j=1;j<=this.nbFields;j++){$("#"+this.componentId+"Input"+j).addClass("invalid");}}
com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.markValid=function(){for(var j=1;j<=this.nbFields;j++){$("#"+this.componentId+"Input"+j+".invalid").removeClass("invalid");}}
com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.enable=function(){$("#"+this.componentId+"Input1").removeClass("disable").removeAttr("disabled");};com.pictet.apps.fnc.web.component.forms.Autocomplete.prototype.disable=function(){$("#"+this.componentId+"Input1").addClass("disable").attr("disabled","true");};namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.TextAreaField=function(iComponentId,iWidth,iRowNb,iDisabled,iDescription){com.pictet.apps.fnc.web.component.forms.TextAreaField.superclass.constructor.call(this,iComponentId,iWidth,iDisabled,iDescription);this.rowNb=iRowNb;}
YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.TextAreaField,com.pictet.apps.fnc.web.component.forms.TextField);com.pictet.apps.fnc.web.component.forms.TextAreaField.prototype.generate=function(iHtmlContainerId){this.internalGenerate(iHtmlContainerId,"textareafield");}
com.pictet.apps.fnc.web.component.forms.TextAreaField.prototype.internalGenerate=function(iHtmlContainer,iCssClass){var aDisabledStr="";var aClassName=iCssClass;if(this.isDisabled){aDisabledStr=' disabled="true" ';aClassName=iCssClass+" disabled";}
var buf=['<div class="',aClassName,'" id="',this.componentId,'">'];buf.push(['<textarea class="textarea" cols="20" rows="',this.rowNb,'" name="',this.componentId,'" id="',this.componentId,'_internalValue"',aDisabledStr,'style="width:',this.width,'px; overflow: auto">'].join(''));buf.push('</textarea>');buf.push('</div>');$("#"+iHtmlContainer).append(buf.join(''));$("#"+this.componentId+"_internalValue").text(this.value);YAHOO.util.Event.addListener(this.componentId+"_internalValue","change",this.changeInternalValue,this,true);YAHOO.util.Event.addListener(this.componentId+"_internalValue","keydown",this.keyDownAction,this,true);}
com.pictet.apps.fnc.web.component.forms.TextAreaField.prototype.getType=function(){return"textareafield";}
com.pictet.apps.fnc.web.component.forms.TextAreaField.prototype.markInvalid=function(){$("#"+this.componentId+"_internalValue").addClass("invalid");}
com.pictet.apps.fnc.web.component.forms.TextAreaField.prototype.markValid=function(){$("#"+this.componentId+"_internalValue.invalid").removeClass("invalid");}
namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.TextFieldWithHelp=function(iComponentId,iWidth,iDisabled,iDescription,helpText){com.pictet.apps.fnc.web.component.forms.TextFieldWithHelp.superclass.constructor.call(this,iComponentId,iWidth,iDisabled,iDescription);this.helpText=helpText;};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.forms.TextFieldWithHelp,com.pictet.apps.fnc.web.component.forms.AbstractTextField);com.pictet.apps.fnc.web.component.forms.TextFieldWithHelp.prototype.generate=function(iHtmlContainerId){com.pictet.apps.fnc.web.component.forms.TextFieldWithHelp.superclass.generate.call(this,iHtmlContainerId);this.displayGenerate(iHtmlContainerId,"textfield","text");};com.pictet.apps.fnc.web.component.forms.TextFieldWithHelp.prototype.setFocus=function(){$("#"+this.componentId+"_displayValue").focus();};com.pictet.apps.fnc.web.component.forms.TextFieldWithHelp.prototype.displayGenerate=function(iHtmlContainerId,iCssClass,iInputType){var aDisabledStr="";var aClassName=iCssClass;if(this.isDisabled){aDisabledStr=' disabled="true" ';aClassName=iCssClass+"Disabled";}
var border=2;var padding=4;var aStr='<div class="'+aClassName+'" id="'+this.componentId+'">';aStr+='  <input id="'+this.componentId+'_displayValue" type="'+iInputType+'" class="text" '+aDisabledStr+' style="width:'+(this.width-border-padding)+'px;">';aStr+='</div>';$("#"+iHtmlContainerId).append(aStr);$("#"+this.componentId+"_internalValue").val(this.value);if(this.value==""&&this.helpText!=""){this.displayHelp();}else{this.helpDisplayed=false;$("#"+this.componentId+"_displayValue").val(this.value);}
YAHOO.util.Event.addListener(this.componentId+"_displayValue","change",this.changeValue,this,true);YAHOO.util.Event.addListener(this.componentId+"_displayValue","keydown",this.keyDownAction,this,true);YAHOO.util.Event.addListener(this.componentId+"_displayValue","keyup",this.changeValue,this,true);YAHOO.util.Event.addListener(this.componentId+"_displayValue","focus",this.getFocus,this,true);YAHOO.util.Event.addListener(this.componentId+"_displayValue","blur",this.loseFocus,this,true);};com.pictet.apps.fnc.web.component.forms.TextFieldWithHelp.prototype.changeValue=function(){if(this.helpDisplayed==false){$("#"+this.componentId+"_internalValue").val($("#"+this.componentId+"_displayValue").val());}}
com.pictet.apps.fnc.web.component.forms.TextFieldWithHelp.prototype.getType=function(){return"textfieldwithhelp";}
com.pictet.apps.fnc.web.component.forms.TextFieldWithHelp.prototype.getFocus=function(){if(this.helpDisplayed==true){this.hideHelp();}}
com.pictet.apps.fnc.web.component.forms.TextFieldWithHelp.prototype.loseFocus=function(){if(($("#"+this.componentId+"_displayValue").val()=="")&&this.helpText!=""){this.displayHelp();}}
com.pictet.apps.fnc.web.component.forms.TextFieldWithHelp.prototype.updateValue=function(){this.changeInternalValue();}
com.pictet.apps.fnc.web.component.forms.TextFieldWithHelp.prototype.displayHelp=function(){$("#"+this.componentId+"_displayValue").val(this.helpText);$("#"+this.componentId+"_internalValue").val("");this.value="";$("#"+this.componentId+"_displayValue").addClass("help");this.helpDisplayed=true;}
com.pictet.apps.fnc.web.component.forms.TextFieldWithHelp.prototype.hideHelp=function(){$("#"+this.componentId+"_displayValue").val("");$("#"+this.componentId+"_displayValue.help").removeClass("help");this.helpDisplayed=false;}
com.pictet.apps.fnc.web.component.forms.TextFieldWithHelp.prototype.markInvalid=function(){$("#"+this.componentId+"_displayValue").addClass("invalid");}
com.pictet.apps.fnc.web.component.forms.TextFieldWithHelp.prototype.markValid=function(){$("#"+this.componentId+"_displayValue.invalid").removeClass("invalid");}
namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.Button=function(componentId,urlLink,widthInPixel,inactiveAfterClick,iAutoresize,iDisabled){this.componentId=componentId;this.urlLink=urlLink;this.onClick=new YAHOO.util.CustomEvent('onClick');this.onMessage=new YAHOO.util.CustomEvent("onMessage");this.onTechnicalMessage=new YAHOO.util.CustomEvent("onTechnicalMessage");this.isEnable=!iDisabled;this.isActive=true;this.widthInPixel=widthInPixel;this.inactiveAfterClick=inactiveAfterClick;YAHOO.util.Event.addListener(this.componentId+"Container","click",this.doClick,this,true);if(!iAutoresize){this.evaluateWidth();}};com.pictet.apps.fnc.web.component.forms.Button.prototype.doClick=function(e,iThis){if(this.isActive&&this.isEnable){if(this.inactiveAfterClick=="true"){this.inactivate();}
this.onClick.fire();if(this.urlLink!=""){window.location.href=this.urlLink;}}};com.pictet.apps.fnc.web.component.forms.Button.prototype.setUrlLink=function(urlLink){this.urlLink=urlLink;};com.pictet.apps.fnc.web.component.forms.Button.prototype.enable=function(){if(!this.isEnable){$("#"+this.componentId+"Container").removeClass("disable");this.isEnable=true;}};com.pictet.apps.fnc.web.component.forms.Button.prototype.disable=function(){if(this.isEnable){$("#"+this.componentId+"Container").addClass("disable");this.isEnable=false;}};com.pictet.apps.fnc.web.component.forms.Button.prototype.inactivate=function(){if(this.isActive){this.isActive=false;}};com.pictet.apps.fnc.web.component.forms.Button.prototype.activate=function(){if(!this.isActive){this.isActive=true;}};com.pictet.apps.fnc.web.component.forms.Button.prototype.evaluateWidth=function(){var buttonBody=$("#"+this.componentId+"Button");var buttonRightArea=$("#"+this.componentId+"RightArea");var effectiveWidth=this.widthInPixel;if(buttonBody.css("border-left-width")!="medium"){effectiveWidth=effectiveWidth
-parseInt((buttonBody.css("border-left-width")).replace("px",""),10);}
if(buttonBody.css("border-right-width")!="medium"){effectiveWidth=effectiveWidth
-parseInt((buttonBody.css("border-right-width")).replace("px",""),10);}
if(buttonBody.css("padding-left")!="medium"){effectiveWidth=effectiveWidth
-parseInt((buttonBody.css("padding-left")).replace("px",""),10);}
if(buttonBody.css("padding-right")!="medium"){effectiveWidth=effectiveWidth
-parseInt((buttonBody.css("padding-right")).replace("px",""),10);}
if(buttonRightArea.css("border-left-width")!="medium"){effectiveWidth=effectiveWidth
-parseInt((buttonRightArea.css("border-left-width")).replace("px",""),10);}
if(buttonRightArea.css("border-right-width")!="medium"){effectiveWidth=effectiveWidth
-parseInt((buttonRightArea.css("border-right-width")).replace("px",""),10);}
if(buttonRightArea.css("padding-left")!="medium"){effectiveWidth=effectiveWidth
-parseInt((buttonRightArea.css("padding-left")).replace("px",""),10);}
if(buttonRightArea.css("padding-right")!="medium"){effectiveWidth=effectiveWidth
-parseInt((buttonRightArea.css("padding-right")).replace("px",""),10);}
if(buttonRightArea.css("width")!="medium"){effectiveWidth=effectiveWidth
-parseInt((buttonRightArea.css("width")).replace("px",""),10);}
buttonBody.css("width",effectiveWidth.toString()+"px");};namespace("com.pictet.apps.fnc.web.component.forms");com.pictet.apps.fnc.web.component.forms.ButtonPopup=function(componentId,iType,iButton,iPopup,iOkAction,iCancelAction){this.componentId=componentId;this.popup=iPopup;this.onClick=new YAHOO.util.CustomEvent('onClick');iButton.onClick.subscribe(this.popupShow,this,true);var instance=this;if(iType=="alert"){iOkAction.onClick.subscribe(this.popupHide,this,true);}
if(iType=="confirm"){iCancelAction.onClick.subscribe(this.popupHide,this,true);iOkAction.onClick.subscribe(this.acceptAction,this,true);}
if(iType=="inputField"){iCancelAction.onClick.subscribe(this.cancelInputField,this,true);iOkAction.onClick.subscribe(this.doSendAction,this,true);}};com.pictet.apps.fnc.web.component.forms.ButtonPopup.prototype.popupShow=function(){this.popup.show();};com.pictet.apps.fnc.web.component.forms.ButtonPopup.prototype.popupHide=function(){this.popup.hide();};com.pictet.apps.fnc.web.component.forms.ButtonPopup.prototype.acceptAction=function(){this.popupHide();this.onClick.fire();};com.pictet.apps.fnc.web.component.forms.ButtonPopup.prototype.doSendAction=function(){this.popupHide();var val=$("#"+this.componentId+"_input").val();this.onClick.fire(val);$("#"+this.componentId+"_input").val('');};com.pictet.apps.fnc.web.component.forms.ButtonPopup.prototype.cancelInputField=function(){this.popupHide();$("#"+this.componentId+"_input").val('');};namespace("com.pictet.apps.fnc.web.component.hidablepanel");com.pictet.apps.fnc.web.component.hidablepanel.HidablePanel=function(id,collapseTooltip,expandTooltip){this.id=id;this.collapseTooltip=collapseTooltip;this.expandTooltip=expandTooltip;this.onHide=new YAHOO.util.CustomEvent('onHide');this.onShow=new YAHOO.util.CustomEvent('onShow');this.onExpand=new YAHOO.util.CustomEvent("onExpand");this.onCollapse=new YAHOO.util.CustomEvent("onCollapse");this.module;this.cookieName="fnc.hP"+this.id;};com.pictet.apps.fnc.web.component.hidablepanel.HidablePanel.prototype.init=function(printMode){var button=document.getElementById("hidablePanelButton"+this.id);var buttonName="hidablePanelButton"+this.id;var contentName="hidablePanelContent"+this.id;this.module=new YAHOO.widget.Module(contentName);this.module.hidablePanel=this;YAHOO.util.Event.addListener(buttonName,"click",this.toggle,this.module,true);YAHOO.util.Event.addListener(buttonName,"mouseover",this.over,this.module,true);YAHOO.util.Event.addListener(buttonName,"mouseout",this.out,this.module,true);if(com.pictet.apps.fnc.web.component.hidablepanel.HidablePanel.cookieIsClosed(this.cookieName)){if(printMode){this.module.cfg.setProperty("visible",true);button.title=this.collapseTooltip;this.onExpand.fire();}else{this.module.cfg.setProperty("visible",false);button.title=this.expandTooltip;this.onCollapse.fire();}}else{this.module.cfg.setProperty("visible",true);button.title=this.collapseTooltip;this.onExpand.fire();}};com.pictet.apps.fnc.web.component.hidablepanel.HidablePanel.prototype.toggle=function(e,obj){var button=document.getElementById("hidablePanelButton"+obj.hidablePanel.id);if(button.className.substring(button.className.length-5,button.className.length)=="Hover"){button.className=button.className.substring(0,button.className.length-5);}
if(obj.cfg.getProperty("visible")){com.pictet.apps.fnc.web.component.hidablepanel.HidablePanel.cookieSetClosed(obj.hidablePanel.cookieName);button.className=button.className.substring(0,button.className.length-4)+"Up";button.title=obj.hidablePanel.expandTooltip;obj.hide();obj.hidablePanel.onHide.fire();obj.hidablePanel.onCollapse.fire();}else{com.pictet.apps.fnc.web.component.hidablepanel.HidablePanel.cookieSetOpen(obj.hidablePanel.cookieName);button.className=button.className.substring(0,button.className.length-2)+"Down";button.title=obj.hidablePanel.collapseTooltip;obj.show();obj.hidablePanel.onShow.fire();obj.hidablePanel.onExpand.fire();}};com.pictet.apps.fnc.web.component.hidablepanel.HidablePanel.prototype.expand=function(){if(!this.module.cfg.getProperty("visible")){var button=document.getElementById("hidablePanelButton"+this.id);if(button.className.substring(button.className.length-5,button.className.length)=="Hover"){button.className=button.className.substring(0,button.className.length-5);}
com.pictet.apps.fnc.web.component.hidablepanel.HidablePanel.cookieSetOpen(this.cookieName);button.className=button.className.substring(0,button.className.length-2)+"Down";button.title=this.collapseTooltip;this.module.show();this.onExpand.fire();}}
com.pictet.apps.fnc.web.component.hidablepanel.HidablePanel.prototype.collapse=function(){if(this.module.cfg.getProperty("visible")){var button=document.getElementById("hidablePanelButton"+this.id);if(button.className.substring(button.className.length-5,button.className.length)=="Hover"){button.className=button.className.substring(0,button.className.length-5);}
com.pictet.apps.fnc.web.component.hidablepanel.HidablePanel.cookieSetClosed(this.cookieName);button.className=button.className.substring(0,button.className.length-4)+"Up";button.title=this.expandTooltip;this.module.hide();this.onCollapse.fire();}}
com.pictet.apps.fnc.web.component.hidablepanel.HidablePanel.prototype.over=function(e,obj){var button=document.getElementById("hidablePanelButton"+obj.hidablePanel.id);button.className=button.className+"Hover";};com.pictet.apps.fnc.web.component.hidablepanel.HidablePanel.prototype.out=function(e,obj){var button=document.getElementById("hidablePanelButton"+obj.hidablePanel.id);if(button.className.substring(button.className.length-5,button.className.length)=="Hover"){button.className=button.className.substring(0,button.className.length-5);}}
com.pictet.apps.fnc.web.component.hidablepanel.HidablePanel.prototype.isHide=function(){if(document.cookie&&document.cookie!==''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=cookies[i].trim();}}};com.pictet.apps.fnc.web.component.hidablepanel.HidablePanel.cookieIsClosed=function(cookieName){var myCookie=YAHOO.util.Cookie.get("fnc.hidablePannelPersistance");if(myCookie==null){return false;}
return myCookie.indexOf(cookieName)!=-1;}
com.pictet.apps.fnc.web.component.hidablepanel.HidablePanel.cookieSetClosed=function(cookieName){if(!com.pictet.apps.fnc.web.component.hidablepanel.HidablePanel.cookieIsClosed(cookieName)){var myCookie=YAHOO.util.Cookie.get("fnc.hidablePannelPersistance");if(myCookie==null){myCookie=cookieName;}else{myCookie+=cookieName;}
YAHOO.util.Cookie.set("fnc.hidablePannelPersistance",myCookie);}}
com.pictet.apps.fnc.web.component.hidablepanel.HidablePanel.cookieSetOpen=function(cookieName){if(com.pictet.apps.fnc.web.component.hidablepanel.HidablePanel.cookieIsClosed(cookieName)){var myCookie=YAHOO.util.Cookie.get("fnc.hidablePannelPersistance");if(myCookie!=null){myCookie=myCookie.replace(new RegExp(cookieName),"");YAHOO.util.Cookie.set("fnc.hidablePannelPersistance",myCookie)}}}
namespace("com.pictet.apps.fnc.web.component.message");com.pictet.apps.fnc.web.component.Message=function(iMessageContent,iMessageClass)
{this.messageContent=iMessageContent;this.messageClass=iMessageClass.toLowerCase();};com.pictet.apps.fnc.web.component.Message=function(iMessageContent,iMessageClass,iTopMessage,iBottomMessage){this.messageContent=iMessageContent;this.messageClass=iMessageClass.toLowerCase();this.topMessage=iTopMessage;this.bottomMessage=iBottomMessage;};namespace("com.pictet.apps.fnc.web.component.messages");com.pictet.apps.fnc.web.component.messages.MessagesPane=function(iComponentId,iTechnicalMessage){this.componentId=iComponentId;this.technicalMessage=iTechnicalMessage;this.shownErrorMessages=[];this.shownWarningMessages=[];this.shownInfoMessages=[];this.messageFromClientHasShown=false;};com.pictet.apps.fnc.web.component.messages.MessagesPane.prototype.showControllerMessage=function(messages){this.showMessage(messages);this.messageFromClientHasShown=false;}
com.pictet.apps.fnc.web.component.messages.MessagesPane.prototype.showMessage=function(messages){if(messages){if(messages.length==0){if(this.messageFromClientHasShown){this.removeMessages();}}else{$("#messagePane"+this.componentId+"Container").addClass("containerHide");this.messageFromClientHasShown=true;var success=true;$("#errorMessagePane"+this.componentId+"Header").empty();$("#errorMessagePane"+this.componentId+"Footer").empty();$("#warningMessagePane"+this.componentId+"Header").empty();$("#warningMessagePane"+this.componentId+"Footer").empty();$("#infoMessagePane"+this.componentId+"Header").empty();$("#infoMessagePane"+this.componentId+"Footer").empty();var existTopErrorMsg=false;var existBottomErrorMsg=false;var existTopBottomErrorMsg=false;var existTopWarnMsg=false;var existBottomWarnMsg=false;var existTopBottomWarnMsg=false;var existTopInfoMsg=false;var existBottomInfoMsg=false;var existTopBottomInfoMsg=false;for(var i=0;i<messages.length;i+=1){var message=messages[i];switch(message.messageClass){case"error":this.addMessage(message.messageContent,"error");if(message.topMessage){if(!existTopErrorMsg){$("#errorMessagePane"+this.componentId+"Header").append(message.topMessage);existTopErrorMsg=true;}}
if(message.bottomMessage){if(!existBottomErrorMsg){$("#errorMessagePane"+this.componentId+"Footer").append(message.bottomMessage);existBottomErrorMsg=true;}}
if(existTopErrorMsg&&existBottomErrorMsg){existTopBottomErrorMsg=true;}
break;case"warning":this.addMessage(message.messageContent,"warning");if(message.topMessage){if(!existTopWarnMsg){$("#warningMessagePane"+this.componentId+"Header").append(message.topMessage);existTopWarnMsg=true;}}
if(message.bottomMessage){if(!existBottomWarnMsg){$("#warningMessagePane"+this.componentId+"Footer").append(message.bottomMessage);existBottomWarnMsg=true;}}
if(existTopWarnMsg&&existBottomWarnMsg){existTopBottomWarnMsg=true;}
break;case"info":this.addMessage(message.messageContent,"info");if(message.topMessage){if(!existTopInfoMsg){$("#infoMessagePane"+this.componentId+"Header").append(message.topMessage);existTopInfoMsg=true;}}
if(message.bottomMessage){if(!existBottomInfoMsg){$("#infoMessagePane"+this.componentId+"Footer").append(message.bottomMessage);existBottomInfoMsg=true;}}
if(existTopInfoMsg&&existBottomInfoMsg){existTopBottomInfoMsg=true;}
break;default:success=false;}}
if(success){if(this.shownErrorMessages.length>0){$("#errorMessagePane"+this.componentId+"Container").removeClass("containerHide");}
if(this.shownWarningMessages.length>0){$("#warningMessagePane"+this.componentId+"Container").removeClass("containerHide");}
if(this.shownInfoMessages.length>0){$("#infoMessagePane"+this.componentId+"Container").removeClass("containerHide");}
if((this.shownErrorMessages.length>0)||(this.shownWarningMessages.length>0)||(this.shownInfoMessages.length>0)){$("#messagePane"+this.componentId+"Container").removeClass("containerHide");}}
if(!existTopBottomErrorMsg&&this.shownErrorMessages.length==1){$("#errorMessagePane"+this.componentId).addClass("simple");}
if(!existTopBottomWarnMsg&&this.shownWarningMessages.length==1){$("#warningMessagePane"+this.componentId).addClass("simple");}
if(!existTopBottomInfoMsg&&this.shownInfoMessages.length==1){$("#infoMessagePane"+this.componentId).addClass("simple");}}}};com.pictet.apps.fnc.web.component.messages.MessagesPane.prototype.isShownMessage=function(iMessageContent,iMessageClass){switch(iMessageClass){case"error":for(var i=0;i<this.shownErrorMessages.length;i++){if(iMessageContent==this.shownErrorMessages[i]){return true;}}
return false;case"warning":for(var i=0;i<this.shownWarningMessages.length;i++){if(iMessageContent==this.shownWarningMessages[i]){return true;}}
return false;case"info":for(var i=0;i<this.shownInfoMessages.length;i++){if(iMessageContent==this.shownInfoMessages[i]){return true;}}
return false;}};com.pictet.apps.fnc.web.component.messages.MessagesPane.prototype.rememberShownMessage=function(iMessageContent,iMessageClass){switch(iMessageClass){case"error":this.shownErrorMessages[this.shownErrorMessages.length]=iMessageContent;break;case"warning":this.shownWarningMessages[this.shownWarningMessages.length]=iMessageContent;break;case"info":this.shownInfoMessages[this.shownInfoMessages.length]=iMessageContent;break;}};com.pictet.apps.fnc.web.component.messages.MessagesPane.prototype.addMessage=function(iMessageContent,iMessageClass){if(!this.isShownMessage(iMessageContent,iMessageClass)&&iMessageContent){var strMessageBody="<li>"+iMessageContent+"</li>";$(strMessageBody).appendTo("#"+iMessageClass+"MessagePane"+this.componentId);this.rememberShownMessage(iMessageContent,iMessageClass);}};com.pictet.apps.fnc.web.component.messages.MessagesPane.prototype.removeMessages=function(){this.closeMessage("errorMessagePane"+this.componentId,"error");this.closeMessage("warningMessagePane"+this.componentId,"warning");this.closeMessage("infoMessagePane"+this.componentId,"info");};com.pictet.apps.fnc.web.component.messages.MessagesPane.prototype.closeMessage=function(iMessageId,messageClass){var messagePaneParent=$("#"+iMessageId);if(messagePaneParent){switch(messageClass){case"error":this.shownErrorMessages=[];break;case"warning":this.shownWarningMessages=[];break;case"info":this.shownInfoMessages=[];break;}
$("#"+iMessageId).empty();$("#"+iMessageId+"Container").addClass("containerHide");if(!((this.shownErrorMessages.length>0)||(this.shownWarningMessages.length>0)||(this.shownInfoMessages.length>0))){$("#messagePane"+this.componentId+"Container").addClass("containerHide");}
$("#"+iMessageId+"Header").empty();$("#"+iMessageId+"Footer").empty();}};com.pictet.apps.fnc.web.component.messages.MessagesPane.prototype.showTechnicalMessage=function(stackTrace)
{var messages=[];if(stackTrace){$("#errorMessagePane"+this.componentId+"displayStackTrace").css("display","block");YAHOO.util.Event.purgeElement("errorMessagePane"+this.componentId+"displayStackTrace");YAHOO.util.Event.addListener("errorMessagePane"+this.componentId+"displayStackTrace","click",this.showStacktracePopup,stackTrace,false);}
messages[0]=new com.pictet.apps.fnc.web.component.Message(this.technicalMessage,"error");this.showMessage(messages);};com.pictet.apps.fnc.web.component.messages.MessagesPane.prototype.showStacktracePopup=function(e,stackTrace){var stacktracePopup=window.open('','','resizable=1,scrollbars=1,height=600,width=900');stacktracePopup.document.write('<html><head><title>Stacktrace</title></head>');stacktracePopup.document.write('<body>');stacktracePopup.document.write('<pre><code>');stacktracePopup.document.write(stackTrace);stacktracePopup.document.write('</code></pre>');stacktracePopup.document.write('</body></html>');stacktracePopup.document.close();};namespace("com.pictet.apps.fnc.web.component.filterSection");com.pictet.apps.fnc.web.component.filterSection.PeriodChooser=function(outerComponentId,iDwrValidatorObject){com.pictet.apps.fnc.web.component.filterSection.PeriodChooser.superclass.constructor.call(this);this.outerComponentId=outerComponentId;this.dwrValidatorObject=iDwrValidatorObject;this.fromDateFilterKey="fromDate";this.toDateFilterKey="toDate";this.periodFilterKey="period";this.onValidationError=new YAHOO.util.CustomEvent("onValidationError");};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.filterSection.PeriodChooser,com.pictet.apps.fnc.web.component.filterSection.FilterSection);com.pictet.apps.fnc.web.component.filterSection.PeriodChooser.prototype.validateAndExecute=function(doContinue){var iInstance=this;this.onAsynchronousCallStart.fire();this.dwrValidatorObject.validate(this.getFilters(),{callback:function(iDataFromServer){com.pictet.apps.fnc.web.component.filterSection.PeriodChooser.afterValidate(iDataFromServer,iInstance,doContinue)},errorHandler:function(errorString,exception){com.pictet.apps.fnc.web.component.filterSection.PeriodChooser.handleAjaxRemoteException(iInstance,errorString,exception)},textHtmlHandler:function(){com.pictet.apps.fnc.web.component.filterSection.PeriodChooser.superclass.handleAjaxSessionTimeout()}});}
com.pictet.apps.fnc.web.component.filterSection.PeriodChooser.afterValidate=function(response,iThisPeriodChooser,doContinue){var messages=iThisPeriodChooser.getErrorMessage(response);iThisPeriodChooser.markInvalidFields(response);iThisPeriodChooser.onMessage.fire([]);if(response["swapDateFlag"]!=null){var tempDate=iThisPeriodChooser.registeredFilters[0].getValueAsStr();iThisPeriodChooser.registeredFilters[0].setValue(iThisPeriodChooser.registeredFilters[1].getValueAsStr());iThisPeriodChooser.registeredFilters[1].setValue(tempDate);iThisPeriodChooser.registeredFilters[0].updateDisplayValue();iThisPeriodChooser.registeredFilters[1].updateDisplayValue();eval(doContinue);}else{if(messages.length>1){iThisPeriodChooser.onMessage.fire(messages);iThisPeriodChooser.onValidationError.fire();}else{eval(doContinue);}}}
com.pictet.apps.fnc.web.component.filterSection.PeriodChooser.handleAjaxRemoteException=function(iInstance,errorString,exception){iInstance.onValidationError.fire();com.pictet.apps.fnc.web.component.filterSection.PeriodChooser.superclass.handleAjaxRemoteException(iInstance,errorString,exception)}
com.pictet.apps.fnc.web.component.filterSection.PeriodChooser.prototype.finishAsynchronousCall=function(){this.onAsynchronousCallFinish.fire();}
com.pictet.apps.fnc.web.component.filterSection.PeriodChooser.prototype.markInvalidFields=function(errorFields){var isSetFocus=false;if(errorFields[this.fromDateFilterKey]!=null){this.registeredFilters[0].markInvalid();if(this.registeredFilters[0].focus()){isSetFocus=true;}}else{this.registeredFilters[0].markValid();}
if(errorFields[this.toDateFilterKey]!=null){this.registeredFilters[1].markInvalid();if(!isSetFocus&&this.registeredFilters[1].focus()){isSetFocus=true;}}else{this.registeredFilters[1].markValid();}
if(errorFields[this.fromDateFilterKey]!=null||errorFields[this.toDateFilterKey]!=null){$("#periodLabel").css("color","#990000");}else{$("#periodLabel").css("color","#000000");}}
com.pictet.apps.fnc.web.component.filterSection.PeriodChooser.prototype.getFilters=function(){var filters={};filters[this.fromDateFilterKey]=this.registeredFilters[0].getValueAsStr();filters[this.toDateFilterKey]=this.registeredFilters[1].getValueAsStr();filters[this.periodFilterKey]=this.registeredFilters[2].getValueAsStr();return filters;}
var tddPCHSpecificDateLabel;var tddPCHSelectedPeriodLabel;com.pictet.apps.fnc.web.component.filterSection.PeriodChooser.prototype.handleDatePeriodPanel=function(firstLoad,specificDateLabel,selectedPeriodLabel,doContinue){tddPCHSpecificDateLabel=specificDateLabel;tddPCHSelectedPeriodLabel=selectedPeriodLabel;if(specificDateLabel==selectedPeriodLabel){this.registeredFilters[0].enable();this.registeredFilters[1].enable();this.registeredFilters[0].focus();}else{this.registeredFilters[0].disable();this.registeredFilters[1].disable();if(!(firstLoad===true)){this.validateAndExecute(doContinue);}}}
namespace("com.pictet.apps.fnc.web.component.popup");com.pictet.apps.fnc.web.component.popup.PopupBox=function(iId,iWidth,iTitle){this.componentId=iId;this.width=iWidth;this.title=iTitle;this.popup=null;this.onShow=new YAHOO.util.CustomEvent('onShow');this.onHide=new YAHOO.util.CustomEvent('onHide');};com.pictet.apps.fnc.web.component.popup.PopupBox.prototype.generate=function(){if(this.title!=""){YAHOO.util.Event.addListener(this.componentId+"_closeIcon","click",this.hide,this,true);}};com.pictet.apps.fnc.web.component.popup.PopupBox.prototype.hide=function(){$("#"+this.componentId).css("left","").css("top","").addClass("popupboxhidden");$("#PopupMask").css("display","none");this.onHide.fire();};com.pictet.apps.fnc.web.component.popup.PopupBox.prototype.show=function(){var thisElement=$("#"+this.componentId);thisElement.removeClass("popupboxhidden");$("#PopupMask").css("display","block");var parentHeight=0;var parentWidth=0;if(window.innerHeight!==undefined){parentWidth=window.innerWidth;parentHeight=window.innerHeight;}else{if(document.documentElement&&document.documentElement.clientHeight){parentWidth=document.documentElement.clientWidth;parentHeight=document.documentElement.clientHeight;}else{parentWidth=document.body.clientWidth;parentHeight=document.body.clientHeight;}}
var vPosition=parentHeight/2-thisElement.height()/2;var hPosition=parentWidth/2-this.width/2;thisElement.css("left",hPosition+"px");thisElement.css("top",vPosition+"px");this.onShow.fire();};namespace("com.pictet.apps.fnc.web.component.popupConfirmation.PopupBox");com.pictet.apps.fnc.web.component.popupConfirmation.PopupBox=function(componentId){this.componentId=componentId;this.onClick=new YAHOO.util.CustomEvent('onClick');};com.pictet.apps.fnc.web.component.popupConfirmation.PopupBox.prototype.doAccept=function(e,obj){this.launchAction();this.onClick.fire();};com.pictet.apps.fnc.web.component.popupConfirmation.PopupBox.prototype.doSendInput=function(val){this.launchActionWithParam(val);this.onClick.fire(val);};com.pictet.apps.fnc.web.component.popupConfirmation.PopupBox.prototype.show=function(jsInstance,action){this.popupRef.show();this.jsInstance=jsInstance;this.action=action;};com.pictet.apps.fnc.web.component.popupConfirmation.PopupBox.prototype.launchAction=function(){this.jsInstance.launchAction(this.action);};com.pictet.apps.fnc.web.component.popupConfirmation.PopupBox.prototype.launchActionWithParam=function(val){this.jsInstance.launchAction(this.action(val));};com.pictet.apps.fnc.web.component.popupConfirmation.PopupBox.prototype.setPopup=function(popupRef){this.popupRef=popupRef;};namespace("com.pictet.apps.fnc.web.component.tab");com.pictet.apps.fnc.web.component.Tab=function(){com.pictet.apps.fnc.web.component.forms.AbstractForm.superclass.constructor.call(this);};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.Tab,com.pictet.apps.fnc.web.component.abstractcomponent.AbstractComponent);namespace("com.pictet.apps.fnc.web.component.table");com.pictet.apps.fnc.web.component.table.DataTable=function(iComponentId,iDwrObject,iDwrValidatorObject,iLstSize,iLineHeight,iIncStep,iOverBehavior,iDefaultSelectionFlag,iLoadElementsOnce,iCopyboxSensitive,iFilterLineDisplay,iInitElementsJson,iFixHeadingRowsHeight){com.pictet.apps.fnc.web.component.table.DataTable.superclass.constructor.call(this,iComponentId);this.componentId=iComponentId;this.lstSize=iLstSize;this.dwrObject=iDwrObject;this.dwrValidatorObject=iDwrValidatorObject;this.lineHeight=iLineHeight;this.realLineHeight=0;this.defaultSelectionFlag=iDefaultSelectionFlag;this.loadElementsOnce=iLoadElementsOnce;this.copyboxSensitive=iCopyboxSensitive;this.initElementsJson=iInitElementsJson;this.fixHeadingRowsHeight=iFixHeadingRowsHeight;this.tooltip=null;this.hasOverBehavior=iOverBehavior;this.DefaultSelectedColumn;this.slider=null;this.sliderIncStep=iIncStep;this.cacheCursor=0;this.fullLstSize=0;this.globalFullLstSize=0;this.lstBeginPosition=0;this.oldLstBeginPosition=0;this.unformattedCache=[];this.cache=[];this.selectedIds={};this.isResultExhaustive=false;this.displayFilterLine=false;this.isFilterLineDisplayedAtLoad=iFilterLineDisplay;this.isLoading=true;this.currentAjaxCallName="";this.haveHorizontalSlideBar=false;this.columnDefinitions=[];this.reservedcolumnDefinitions=[];this.cellFormatters=[];this.idContent=iComponentId+"Content";this.idFirstLine=iComponentId+"FirstLine";this.idPaging=iComponentId+"Paging";this.idSlider=iComponentId+"Slider";this.idHorizontalSlide="horizontalSlideLine";this.columnFilters=[];this.externalFilters=[];this.externalFiltersSubmittedValue=[];this.fundListFilterKey="fundList";this.sortSettings=[null,null,null];this.slideWindowColumns=[];this.slideWindowColumnsExtend=[];this.slideWindowPosition=0;this.fromColumnIndex=0;this.slideableColumnDisplayedNb=0;this.slideableColumnWidth=[];this.fixColumnsWidth=0;this.sliderWidth=0;this.slideableColumnNb=0;this.fixedColumnNb=0;this.sliderHeight=0;this.firstSlideableColumn=null;this.firstSlideableColumnId=0;this.tableWidth=null;this.windowSize=document.body.clientWidth;this.eventTimer=null;this.onListSizeChange=new YAHOO.util.CustomEvent("onListSizeChange");this.onSelectionChange=new YAHOO.util.CustomEvent("onSelectionChange");this.onNewRequest=new YAHOO.util.CustomEvent("onNewRequest");this.isNewRequest=true;this.onInternalFilter=new YAHOO.util.CustomEvent("onInternalFilter");this.isInternalFilter=false;this.wichInternalFilter=null;this.moreInfoPopup=null;this.filterWithFocus=null;this.timerProcessDots=null;this.haveAutomaticDots=false;};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.table.DataTable,com.pictet.apps.fnc.web.component.filteredcomponent.FilteredComponent);com.pictet.apps.fnc.web.component.table.DataTable.prototype.setTooltip=function(tooltip){this.tooltip=tooltip;};com.pictet.apps.fnc.web.component.table.DataTable.prototype.registerCellFormatter=function(iCellId,iJsFunctionName){this.cellFormatters[iCellId]=iJsFunctionName;};com.pictet.apps.fnc.web.component.table.DataTable.prototype.registerAllCellFormatters=function(cellFormattersObject){this.cellFormatters=cellFormattersObject;};com.pictet.apps.fnc.web.component.table.DataTable.prototype.addColumn=function(iKey,iTitle,iWidth,iClass,iSortable,iSlideable,iHidden,iAutomaticDots,iSelectable,iSelectCategory,iDesignDiv){var aColumnDefinition={key:iKey,title:iTitle,width:parseInt(iWidth,10),className:iClass,sortable:iSortable,selectable:iSelectable,automaticDots:iAutomaticDots,selectCategory:iSelectCategory,designDiv:iDesignDiv=='true'};if(iAutomaticDots){this.haveAutomaticDots=true;}
if(iSelectable!=null&&iSelectable!=""){this.selectedIds[iSelectable]={};if(iSelectCategory!=null&&iSelectCategory!=""){this.selectedIds[iSelectable].selectCategory=iSelectCategory;}else{this.selectedIds[iSelectable].selectCategory=null;}
this.selectedIds[iSelectable].selectMaxSize=0;this.selectedIds[iSelectable].selectLength=0;this.selectedIds[iSelectable].selectData=[];}
aColumnDefinition.hidden=true;if(iHidden!="true"){aColumnDefinition.hidden=false;aColumnDefinition.slideable=false;if(iSlideable=="true"){aColumnDefinition.slideable=true;this.slideableColumnNb++;}else{this.fixedColumnNb++;}
this.columnDefinitions.push(aColumnDefinition);}
this.reservedcolumnDefinitions.push(aColumnDefinition);};com.pictet.apps.fnc.web.component.table.DataTable.prototype.generate=function(iSetFocus){this.updateTableColumnDimentions();this.initColumnSlide();this.addSlideableColumnsInFirstLine();this.addFiltersToTable(iSetFocus);this.displaySlideableColumnsInHeadersLine();this.constructTable();this.initSlider();this.applyExternalFilter();this.initTable();YAHOO.util.Event.addListener(window,"resize",this.resizeWindow,this,true);YAHOO.util.Event.addListener(this.componentId+"_popupClose","click",this.closeDetailHiddenFilterPopup,this,true);YAHOO.util.Event.addListener(this.componentId+"_resetAndClose","click",this.resetAndCloseDetailHiddenFilterPopup,this,true);if(this.copyboxSensitive&&typeof(Copybox)!="undefined"){Copybox.onShow.subscribe(this.openCopyBox,this,true);Copybox.onHide.subscribe(this.closeCopyBox,this,true);}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.setMoreInfoPopup=function(popupObject){this.moreInfoPopup=popupObject;}
com.pictet.apps.fnc.web.component.table.DataTable.prototype.showDetailHiddenFilterPopup=function(message){$("#"+this.componentId+"_hiddenFilterContent").empty();$("#"+this.componentId+"_hiddenFilterContent").append(message);this.moreInfoPopup.show();}
com.pictet.apps.fnc.web.component.table.DataTable.prototype.closeDetailHiddenFilterPopup=function(){this.moreInfoPopup.hide();};com.pictet.apps.fnc.web.component.table.DataTable.prototype.resetAndCloseDetailHiddenFilterPopup=function(){this.resetInternalFiltersAndReloadElement();this.moreInfoPopup.hide();};com.pictet.apps.fnc.web.component.table.DataTable.getScrollerWidth=function(){var sBarWidth=0;var scr=null;var inn=null;var regExpTest=/MSIE (\d+\.\d+);/;if(regExpTest.test(navigator.userAgent)){scr=document.createElement('form');scr.style.position='absolute';scr.style.top='-1000px';scr.style.left='-1000px';inn=document.createElement('textarea');inn.setAttribute('id','ta');scr.appendChild(inn);document.getElementsByTagName("body")[0].appendChild(scr);var tarea=inn;tarea.wrap='off';sBarWidth=tarea.offsetHeight;tarea.wrap='soft';sBarWidth-=tarea.offsetHeight;}else{var wNoScroll=0;var wScroll=0;scr=document.createElement('div');scr.style.position='absolute';scr.style.top='-1000px';scr.style.left='-1000px';scr.style.width='100px';scr.style.height='50px';scr.style.overflow='hidden';inn=document.createElement('div');inn.style.width='100%';inn.style.height='200px';scr.appendChild(inn);document.body.appendChild(scr);wNoScroll=inn.offsetWidth;scr.style.overflow='auto';wScroll=inn.offsetWidth;sBarWidth=(wNoScroll-wScroll);}
document.body.removeChild(document.body.lastChild);return sBarWidth;}
com.pictet.apps.fnc.web.component.table.DataTable.prototype.updateTableColumnDimentions=function(){for(var aColumn=0;aColumn<this.columnDefinitions.length;aColumn++){var columnDomEl=$("#"+this.getColumnId(this.columnDefinitions[aColumn].key)+"_title");var aPaddingLeft=parseInt(columnDomEl.css("padding-left"),10);var aPaddingRight=parseInt(columnDomEl.css("padding-right"),10);var aBorderLeft=1;var aBorderRight=1;var aContentWidth=this.columnDefinitions[aColumn].width-(aPaddingLeft+aPaddingRight+aBorderLeft+aBorderRight);columnDomEl.attr("width",aContentWidth);}
var scrollWidth=com.pictet.apps.fnc.web.component.table.DataTable.getScrollerWidth();scrollWidth=scrollWidth&&scrollWidth>0?scrollWidth+1:18;$("#"+this.componentId+" tr.title th.empty").width(scrollWidth+1);$("#"+this.componentId+"_pagingCell").width(scrollWidth+1);$("#"+this.componentId+"_div_vscroll").width(scrollWidth);this.getTableWidth();if(this.fixHeadingRowsHeight){var header=$("#"+this.componentId+" tr.title th.hidden").addClass("notVisible").removeClass("hidden");header.height($("#"+this.componentId+" tr.title").height()).removeClass("notVisible").addClass("hidden");}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getColumnId=function(iColumnKey){return["column_",this.componentId,"_",iColumnKey].join("");};com.pictet.apps.fnc.web.component.table.DataTable.prototype.addSlideableColumnsInFirstLine=function(){var content="";for(var aColumn=0;aColumn<this.columnDefinitions.length;aColumn++){if(this.columnDefinitions[aColumn].slideable){content+="<td class='"+this.getColumnId(this.columnDefinitions[aColumn].key)+" hidden' id='"+this.getColumnId(this.columnDefinitions[aColumn].key)+"_firstline' ></td>";}
var columnTitleText=document.getElementById(this.getColumnId(this.columnDefinitions[aColumn].key)+"_title_text");var columnTitle=$("#"+this.getColumnId(this.columnDefinitions[aColumn].key)+"_title");if(this.columnDefinitions[aColumn].slideable){columnTitle.removeClass("hidden");}
if(this.columnDefinitions[aColumn].slideable){columnTitle.addClass("hidden");}}
$("#"+this.componentId+"_columnBuffer").before(content);};com.pictet.apps.fnc.web.component.table.DataTable.prototype.haveSlideableColumns=function(){return(this.slideableColumnNb>0);};com.pictet.apps.fnc.web.component.table.DataTable.prototype.containsHiddenSlideableColumns=function(){return(this.haveSlideableColumns())&&(this.slideWindowColumns.length>1);};com.pictet.apps.fnc.web.component.table.DataTable.prototype.displaySlideableColumnsInHeadersLine=function(){for(var aColumn=this.fromColumnIndex;aColumn<this.fromColumnIndex+this.slideableColumnDisplayedNb;aColumn++){$(document.getElementById(this.getColumnId(this.columnDefinitions[aColumn].key)+"_title")).removeClass("hidden");if(this.columnFilters.length>0){$(document.getElementById(this.getColumnId(this.columnDefinitions[aColumn].key)+"_filter")).removeClass("hidden");}
$(document.getElementById(this.getColumnId(this.columnDefinitions[aColumn].key)+"_firstline")).removeClass("hidden");}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.displaySlideableColumns=function(){for(var aColumn=0;aColumn<this.columnDefinitions.length;aColumn++){if(this.columnDefinitions[aColumn].slideable){if(this.isColumnHidden(aColumn)){$("#"+this.getColumnId(this.columnDefinitions[aColumn].key+"_title")).addClass("hidden");if(this.columnFilters.length>0){$("#"+this.getColumnId(this.columnDefinitions[aColumn].key+"_filter")).addClass("hidden");}
$("#"+this.getColumnId(this.columnDefinitions[aColumn].key+"_firstline")).addClass("hidden");}else{$("#"+this.getColumnId(this.columnDefinitions[aColumn].key+"_title")).removeClass("hidden");if(this.columnFilters.length>0){$("#"+this.getColumnId(this.columnDefinitions[aColumn].key+"_filter")).removeClass("hidden");}
$("#"+this.getColumnId(this.columnDefinitions[aColumn].key+"_firstline")).removeClass("hidden");}}}
this.refreshTable();this.refreshStatusBox();};com.pictet.apps.fnc.web.component.table.DataTable.prototype.hideCurrentColumns=function(){for(var aColumn=this.fromColumnIndex;aColumn<this.fromColumnIndex+this.slideableColumnDisplayedNb;aColumn++){if(this.columnDefinitions[aColumn].slideable){$("#"+this.getColumnId(this.columnDefinitions[aColumn].key+"_title")).addClass("hidden");if(this.columnFilters.length>0){$("#"+this.getColumnId(this.columnDefinitions[aColumn].key+"_filter")).addClass("hidden");}
$("#"+this.getColumnId(this.columnDefinitions[aColumn].key+"_firstline")).addClass("hidden");}}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.displayCurrentColumns=function(){for(var aColumn=this.fromColumnIndex;aColumn<this.fromColumnIndex+this.slideableColumnDisplayedNb;aColumn++){if(this.columnDefinitions[aColumn].slideable){$("#"+this.getColumnId(this.columnDefinitions[aColumn].key+"_title")).removeClass("hidden");if(this.columnFilters.length>0){$("#"+this.getColumnId(this.columnDefinitions[aColumn].key+"_filter")).removeClass("hidden");}
$("#"+this.getColumnId(this.columnDefinitions[aColumn].key+"_firstline")).removeClass("hidden");}}
this.refreshTable();this.refreshStatusBox();};com.pictet.apps.fnc.web.component.table.DataTable.prototype.changeDisplayedSlideableColumns=function(iNewPosition){if(this.slideWindowPosition!=iNewPosition){if(this.haveHorizontalSlideBar){this.removeLine(this.idHorizontalSlide);this.haveHorizontalSlideBar=false;}
this.hideCurrentColumns();this.slideWindowPosition=iNewPosition;this.fromColumnIndex=this.slideWindowColumns[this.slideWindowPosition].startIndex;this.slideableColumnDisplayedNb=this.slideWindowColumns[this.slideWindowPosition].numberOfColumns;this.displayCurrentColumns();if(this.containsHiddenSlideableColumns()&&!this.haveHorizontalSlideBar){$("#"+this.idContent).append(this.getHorizontalSlideBar());this.haveHorizontalSlideBar=true;}
if(this.slideWindowPosition==0){$("#"+this.componentId+"_viewPreviousColumn").addClass("hidden");$("#"+this.componentId+"_viewNextColumn").removeClass("hidden");}else if(this.slideWindowPosition==this.slideWindowColumns.length-1){$("#"+this.componentId+"_viewNextColumn").addClass("hidden");$("#"+this.componentId+"_viewPreviousColumn").removeClass("hidden");}else{$("#"+this.componentId+"_viewNextColumn").removeClass("hidden");$("#"+this.componentId+"_viewPreviousColumn").removeClass("hidden");}}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.viewNextColumn=function(){this.changeDisplayedSlideableColumns(Math.min(this.slideWindowColumns.length-1,this.slideWindowPosition+1));};com.pictet.apps.fnc.web.component.table.DataTable.prototype.viewPreviousColumn=function(){this.changeDisplayedSlideableColumns(Math.max(0,this.slideWindowPosition-1));};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getTableWidth=function(){if(this.tableWidth==null){var table=$("#"+this.componentId+"Table");table.addClass("hidden");this.tableWidth=$("#"+this.componentId).width();table.removeClass("hidden");}
return this.tableWidth;}
com.pictet.apps.fnc.web.component.table.DataTable.prototype.openCopyBox=function(){this.tableWidth=this.tableWidth-230;this.refreshColumnNb();}
com.pictet.apps.fnc.web.component.table.DataTable.prototype.closeCopyBox=function(){this.tableWidth=this.tableWidth+230;this.refreshColumnNb();}
com.pictet.apps.fnc.web.component.table.DataTable.prototype.resizeWindow=function(){window.clearTimeout(this.eventTimer);var instance=this;this.eventTimer=window.setTimeout(function(){instance.windowResizeJob();},20);}
com.pictet.apps.fnc.web.component.table.DataTable.prototype.windowResizeJob=function(){var windowWidth=0;if(window.innerHeight!==undefined){windowWidth=window.innerWidth;}else{if(document.documentElement&&document.documentElement.clientHeight){windowWidth=document.documentElement.clientWidth;}else{windowWidth=document.body.clientWidth;}}
if(this.windowSize!=windowWidth){this.windowSize=windowWidth;this.tableWidth=null;this.getTableWidth();this.refreshColumnNb();}}
com.pictet.apps.fnc.web.component.table.DataTable.prototype.updateSlideableColumnNbToDisplay=function(){if(this.haveSlideableColumns()){var aTotalAvailableWidth=this.getTableWidth();var aAvailableWidthForSlideableColumns=aTotalAvailableWidth-this.sliderWidth-this.fixColumnsWidth;var slideIndex=0;var newSlideIndex=this.firstSlideableColumnId;var widthSum=this.slideableColumnWidth[0]+1;var windowColNb=1;this.slideWindowColumns=[];for(var i=1;i<this.slideableColumnWidth.length;i++){widthSum+=this.slideableColumnWidth[i]+1;if(widthSum<=aAvailableWidthForSlideableColumns){windowColNb++;}else{var beanDef=[];beanDef.numberOfColumns=windowColNb;beanDef.startIndex=newSlideIndex;this.slideWindowColumns.push(beanDef);newSlideIndex=this.firstSlideableColumnId+i;windowColNb=1;widthSum=this.slideableColumnWidth[i]+1;}}
if(this.slideWindowColumns.length==0){var beanDef=[];beanDef.numberOfColumns=this.slideableColumnWidth.length;beanDef.startIndex=newSlideIndex;this.slideWindowColumns.push(beanDef);}else{windowColNb=1;widthSum=this.slideableColumnWidth[this.slideableColumnWidth.length-1]+1;for(var i=this.slideableColumnWidth.length-2;i>=0;i--){widthSum+=this.slideableColumnWidth[i]+1;if(widthSum<=aAvailableWidthForSlideableColumns){windowColNb++;}else{var beanDef=[];beanDef.numberOfColumns=windowColNb;beanDef.startIndex=this.firstSlideableColumnId+i+1;this.slideWindowColumns.push(beanDef);break;}}}
this.slideWindowPosition=0;this.fromColumnIndex=this.slideWindowColumns[this.slideWindowPosition].startIndex;this.slideableColumnDisplayedNb=this.slideWindowColumns[this.slideWindowPosition].numberOfColumns;}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.isColumnHidden=function(iColumnKey){return(this.columnDefinitions[iColumnKey].slideable&&!(iColumnKey>=this.fromColumnIndex&&iColumnKey<(this.fromColumnIndex+this.slideableColumnDisplayedNb)));};com.pictet.apps.fnc.web.component.table.DataTable.prototype.initColumnSlide=function(){if(this.haveSlideableColumns()){this.sliderWidth=16;this.fixColumnsWidth=0;for(var aColumn=0;aColumn<this.columnDefinitions.length;aColumn++){if(this.columnDefinitions[aColumn].slideable){this.slideableColumnWidth.push(this.columnDefinitions[aColumn].width);if(this.firstSlideableColumn==null){this.firstSlideableColumn=this.columnDefinitions[aColumn];this.firstSlideableColumnId=aColumn;}}else{this.fixColumnsWidth+=this.columnDefinitions[aColumn].width;}}
this.updateSlideableColumnNbToDisplay();}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.refreshColumnNb=function(){if(this.haveSlideableColumns()){if(this.haveHorizontalSlideBar){this.removeLine(this.idHorizontalSlide);this.haveHorizontalSlideBar=false;}
this.hideCurrentColumns();this.updateSlideableColumnNbToDisplay();this.displayCurrentColumns();if(this.containsHiddenSlideableColumns()&&!this.haveHorizontalSlideBar){$("#"+this.idContent).append(this.getHorizontalSlideBar());this.haveHorizontalSlideBar=true;}}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getColumnParam=function(iKey){for(var aColumn=0;aColumn<this.reservedcolumnDefinitions.length;aColumn++){if(this.reservedcolumnDefinitions[aColumn].key==iKey){return this.reservedcolumnDefinitions[aColumn];}}
return null;};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getHorizontalSlideBar=function(){var toReturn=['<tr id="',this.componentId,'_',this.idHorizontalSlide,'" class="lineHorizontalSlider">','<td colspan="',this.fixedColumnNb,'">&nbsp;</td>','<td colspan="',(this.slideWindowColumns[this.slideWindowPosition].numberOfColumns+1),'" class="horizontalSlider" >','<div id="',this.componentId,'_viewNextColumn" onclick="',this.componentId,'.viewNextColumn();">','<div class="nextColumn button" style="float:right;" title="',this.labels['label']['nextTooltip'],'"></div><div style="float:right;padding:2px;" class="button" >&nbsp</div>','</div>','<div id="',this.componentId,'_viewPreviousColumn" onclick="',this.componentId,'.viewPreviousColumn();" class="hidden">','<div class="previousColumn button" style="float:left;" title="',this.labels['label']['previousTooltip'],'"></div><div style="padding:2px;float:left;" class="button" >&nbsp</div>','</div>','</td>','<td class="empty">&nbsp;</td></tr>'];return toReturn.join("");};com.pictet.apps.fnc.web.component.table.DataTable.prototype.registerFilter=function(iFormInstance,iKey,iTrigger){if(iTrigger=="onChange"){this.addColumnFilter(iKey,iFormInstance);}else{this.addExternalFilter(iKey,iFormInstance);}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.addColumnFilter=function(iKey,iFilter){var aFilterDefinition=[];aFilterDefinition.key=iKey;aFilterDefinition.filter=iFilter;this.columnFilters.push(aFilterDefinition);var aThisDataTable=this;iFilter.onValueChange.subscribe(this.handleFilterValueChange,aThisDataTable,true);};com.pictet.apps.fnc.web.component.table.DataTable.prototype.handleFilterValueChange=function(type,args,me){var filterObject=args[0];var dateValue;me.isInternalFilter=true;if(filterObject){if(filterObject.getType()=='textfield'){me.resetTableAndReloadElements();}else if(filterObject.getType()=='datefield'){dateValue=filterObject.getValueAsStr();me.resetTableAndReloadElements();}else{me.resetTableAndReloadElements();}}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.addExternalFilter=function(iKey,iFilter){var aFilterDefinition=[];aFilterDefinition.key=iKey;aFilterDefinition.filter=iFilter;this.externalFilters.push(aFilterDefinition);};com.pictet.apps.fnc.web.component.table.DataTable.prototype.applyExternalFilter=function(){this.externalFiltersSubmittedValue=[];var aFilterDefinition;for(var aIdx=0;aIdx<this.externalFilters.length;aIdx++){aFilterDefinition=[];aFilterDefinition.key=this.externalFilters[aIdx].key;aFilterDefinition.filterValue=this.externalFilters[aIdx].filter.getValueAsStr();this.externalFiltersSubmittedValue.push(aFilterDefinition);}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getFilters=function(){var oArray={};var aIdx;for(aIdx=0;aIdx<this.columnFilters.length;aIdx++){oArray[this.columnFilters[aIdx].key]=this.columnFilters[aIdx].filter.getValueAsStr();}
for(aIdx=0;aIdx<this.externalFiltersSubmittedValue.length;aIdx++){oArray[this.externalFiltersSubmittedValue[aIdx].key]=this.externalFiltersSubmittedValue[aIdx].filterValue;}
return oArray;};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getExternalFilters=function(){var oArray={};var aIdx;for(aIdx=0;aIdx<this.externalFiltersSubmittedValue.length;aIdx++){oArray[this.externalFiltersSubmittedValue[aIdx].key]=this.externalFiltersSubmittedValue[aIdx].filterValue;}
return oArray;};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getInternalFilters=function(){var oArray={};var aIdx;for(aIdx=0;aIdx<this.columnFilters.length;aIdx++){oArray[this.columnFilters[aIdx].key]={}
oArray[this.columnFilters[aIdx].key]["type"]=this.columnFilters[aIdx].filter.getType();oArray[this.columnFilters[aIdx].key]["values"]=this.columnFilters[aIdx].filter.getValueAsStr();}
return oArray;};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getDynamicFilters=function(){if(!this.isNewRequest){return[];}
var oArray=[];var aIdx;for(aIdx=0;aIdx<this.columnFilters.length;aIdx++){if(this.columnFilters[aIdx].filter.getType()=="combobox"){oArray.push(this.columnFilters[aIdx].key);}}
return oArray;};com.pictet.apps.fnc.web.component.table.DataTable.prototype.resetExternalFiltersAndReloadElement=function(){this.resetExternalFilters();this.resetSort();this.resetTableAndReloadElements();this.onNewRequest.fire({size:0});this.isNewRequest=true;this.resetSelection();};com.pictet.apps.fnc.web.component.table.DataTable.prototype.resetExternalFilters=function(){for(var aIdx=0;aIdx<this.externalFilters.length;aIdx++){if(this.externalFilters[aIdx].key!=this.fundListFilterKey){this.externalFilters[aIdx].filter.reset();}}
this.resetInternalFilters();this.applyExternalFilter();};com.pictet.apps.fnc.web.component.table.DataTable.prototype.resetInternalFiltersAndReloadElement=function(){if(this.wichInternalFilter!=null){this.onInternalFilter.fire(null);}
this.resetInternalFilters();this.resetSort();this.resetTableAndReloadElements();};com.pictet.apps.fnc.web.component.table.DataTable.prototype.resetTextFilter=function(){alert("rest");};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getWichInternalFilter=function(){return this.wichInternalFilter;};com.pictet.apps.fnc.web.component.table.DataTable.prototype.resetInternalFilters=function(){for(var aIdx=0;aIdx<this.columnFilters.length;aIdx++){this.columnFilters[aIdx].filter.reset();}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.applyExternalFiltersAndReloadTable=function(){this.resetInternalFilters();this.applyExternalFilter();this.onNewRequest.fire({size:0});this.isNewRequest=true;this.resetSelection();this.resetTableAndReloadElements();};com.pictet.apps.fnc.web.component.table.DataTable.prototype.resetSelectionAndRefreshTable=function(){this.onNewRequest.fire({size:0});this.isNewRequest=true;this.resetSelection();this.resetTableAndReloadElements();};com.pictet.apps.fnc.web.component.table.DataTable.prototype.resetSelectionAndRedisplayTable=function(){this.resetSelectionAndUpdateCache();this.refreshTable();};com.pictet.apps.fnc.web.component.table.DataTable.prototype.addFiltersToTable=function(iSetFocus){if(this.columnFilters.length>0){var hiddenClass="";if(!this.isFilterLineDisplayedAtLoad){hiddenClass="hidden";}
var aFilterLine=['<tr class="filter ',hiddenClass,'">'];var aColumn;var aClass;var extraContent;for(aColumn=0;aColumn<this.columnDefinitions.length;aColumn++){if(this.columnDefinitions[aColumn].slideable){aClass='hidden';}else{aClass='';}
if(this.columnDefinitions[aColumn].selectable!=null&&this.columnDefinitions[aColumn].selectable!=""){extraContent=this.getSelectAllCell(this.columnDefinitions[aColumn].key,this.columnDefinitions[aColumn].selectable);}else{extraContent='';}
aFilterLine.push('<th class="',this.getColumnId(this.columnDefinitions[aColumn].key),' ',aClass,'" id="',this.getColumnId(this.columnDefinitions[aColumn].key),'_filter" >',extraContent,'</th>');}
aFilterLine.push('<th class="columnBuffer"></th><th class="empty"><div id="',this.componentId,'_filterRefresh" class="refreshButton" title="',this.labels['label']['refresh'],'"/></th></tr>');$("#"+this.componentId+" tr.title").after(aFilterLine.join(""));var aPaddingLeft=parseInt($("#"+this.componentId+" tr.filter th").css("padding-left"),10);var aPaddingRight=parseInt($("#"+this.componentId+" tr.filter th").css("padding-right"),10);for(var aFilterIdx=0;aFilterIdx<this.columnFilters.length;aFilterIdx++){aColumn=this.getColumnParam(this.columnFilters[aFilterIdx].key);this.columnFilters[aFilterIdx].filter.setWidth(aColumn.width-aPaddingRight-aPaddingLeft-2);this.columnFilters[aFilterIdx].filter.generate(this.getColumnId(aColumn.key)+"_filter");if(iSetFocus!=null&&iSetFocus&&this.columnFilters[aFilterIdx].filter.getType()=="textfield"&&this.filterWithFocus==null){this.filterWithFocus=this.columnFilters[aFilterIdx].filter;}
if(this.columnFilters[aFilterIdx].filter.getType()=="textfield"){YAHOO.util.Event.addListener(this.columnFilters[aFilterIdx].filter.componentId+"_internalValue","click",this.columnFilters[aFilterIdx].filter.selectText,this.columnFilters[aFilterIdx].filter,true);}}
YAHOO.util.Event.addListener(this.componentId+"_filterRefresh","click",this.resetInternalFiltersAndReloadElement,this,true);}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getHiddenFilters=function(){var returnContent=[];for(var aColumn=0;aColumn<this.columnDefinitions.length;aColumn++){for(var aFilterCol=0;aFilterCol<this.columnFilters.length;aFilterCol++){if(this.isColumnHidden(aColumn)&&this.columnFilters[aFilterCol].key==this.columnDefinitions[aColumn].key&&this.columnFilters[aFilterCol].filter.getValueAsStr()!=""){returnContent.push('<li class="hiddenFilterContentItem">');if(this.columnFilters[aFilterCol].filter.getType()=="combobox"){returnContent.push(" <b>",this.columnDefinitions[aColumn].title,"</b>: ",this.columnFilters[aFilterCol].filter.getDisplayValueAsStr());}else{returnContent.push(" <b>",this.columnDefinitions[aColumn].title,"</b>: ",this.columnFilters[aFilterCol].filter.getValueAsStr());}
returnContent.push('</li>');}}}
for(var aColumn=0;aColumn<this.reservedcolumnDefinitions.length;aColumn++){for(var aFilterCol=0;aFilterCol<this.columnFilters.length;aFilterCol++){if(this.reservedcolumnDefinitions[aColumn].hidden&&this.columnFilters[aFilterCol].key==this.reservedcolumnDefinitions[aColumn].key&&this.columnFilters[aFilterCol].filter.getValueAsStr()!=""){returnContent.push('<li class="hiddenFilterContentItem">');if(this.columnFilters[aFilterCol].filter.getType()=="combobox"){returnContent.push(" <b>",this.reservedcolumnDefinitions[aColumn].title,"</b>: ",this.columnFilters[aFilterCol].filter.getDisplayValueAsStr());}else{returnContent.push(" <b>",this.reservedcolumnDefinitions[aColumn].title,"</b>: ",this.columnFilters[aFilterCol].filter.getValueAsStr());}
returnContent.push('</li>');}}}
if(returnContent.length>0){return["<ul> ",returnContent.join(""),"</ul>"].join("");}else{return returnContent.join("");}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getHiddenSortings=function(){if(this.sortSettings[0]==null){return"";}
var returnContent=[];var cachedLabels={};cachedLabels["ASC"]=this.labels['message']['ascendantOrder'];cachedLabels["DESC"]=this.labels['message']['descendantOrder'];for(var aColumn=0;aColumn<this.columnDefinitions.length;aColumn++){if(this.isColumnHidden(aColumn)){for(var aSort=0;aSort<this.sortSettings.length;aSort++){if(this.sortSettings[aSort]==null){break;}
if(this.sortSettings[aSort].colName==this.columnDefinitions[aColumn].key){returnContent.push([" <b>",this.columnDefinitions[aColumn].title,"</b> ",cachedLabels[this.sortSettings[aSort].dir]].join(""));}}}}
for(var aColumn=0;aColumn<this.reservedcolumnDefinitions.length;aColumn++){if(this.reservedcolumnDefinitions[aColumn].hidden){for(var aSort=0;aSort<this.sortSettings.length;aSort++){if(this.sortSettings[aSort]==null){break;}
if(this.sortSettings[aSort].colName==this.reservedcolumnDefinitions[aColumn].key){returnContent.push([" <b>",this.reservedcolumnDefinitions[aColumn].title,"</b> ",cachedLabels[this.sortSettings[aSort].dir]].join(""));}}}}
return returnContent.join(", ");};com.pictet.apps.fnc.web.component.table.DataTable.prototype.showDetailHiddenFilterAndSorting=function(){var hiddenFilter=this.getHiddenFilters();var hiddenSorter=this.getHiddenSortings();var message=[];if(hiddenFilter!=""){message.push(this.labels['message']['popupHiddenFilterTitle']);message.push(hiddenFilter,"<br/>");if(hiddenSorter!=""){message.push(this.labels['message']['andSorted']," ",hiddenSorter);}}else if(hiddenSorter!=""){message.push(this.labels['message']['popupHiddenSortingIntro']);message.push(this.labels['message']['sorted']," ",hiddenSorter);}
this.showDetailHiddenFilterPopup(message.join(""))};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getElementsOfColumn=function(columnId){var toReturn=[];for(var i=0;i<this.unformattedCache.length;i++){toReturn.push(this.unformattedCache[i][columnId]);}
return toReturn;};com.pictet.apps.fnc.web.component.table.DataTable.prototype.addToCache=function(iLst,iStartIndex){this.formatResultsToCache(iLst,iStartIndex);for(var aColumn=0;aColumn<this.columnDefinitions.length;aColumn++){if(this.columnDefinitions[aColumn].selectable!=null&&this.columnDefinitions[aColumn].selectable!="")
{for(var i=0;i<iLst.length;i++){if(this.isSelectable(iLst[i][this.columnDefinitions[aColumn].selectable])){this.selectedIds[this.columnDefinitions[aColumn].selectable].selectMaxSize++;}
if(this.isNewRequest&&iLst[i][this.columnDefinitions[aColumn].key]!=null&&this.defaultSelectionFlag!=""&&iLst[i][this.columnDefinitions[aColumn].key]==this.defaultSelectionFlag){this.DefaultSelectedColumn=this.columnDefinitions[aColumn].selectable;this.selectedIds[this.columnDefinitions[aColumn].selectable].selectData.push(iLst[i][this.columnDefinitions[aColumn].selectable]);}}}}
for(var aColumn=0;aColumn<this.columnDefinitions.length;aColumn++){if(this.columnDefinitions[aColumn].selectable!=null&&this.columnDefinitions[aColumn].selectable!="")
{$("#"+this.componentId+"_select_All_"+this.columnDefinitions[aColumn].key).removeClass("columnSelected").removeClass("columnDisabled").addClass("columnNotSelected");for(var j=0;j<this.selectedIds[this.columnDefinitions[aColumn].selectable].selectData.length;j++)
{for(var i=0;i<iLst.length;i++){if(this.selectedIds[this.columnDefinitions[aColumn].selectable].selectData[j]==this.unformattedCache[iStartIndex+i][this.columnDefinitions[aColumn].selectable])
{this.cache[iStartIndex+i][this.columnDefinitions[aColumn].key]=this.cache[iStartIndex+i][this.columnDefinitions[aColumn].key].replace(/columnNotSelected/,"columnSelected");this.selectedIds[this.columnDefinitions[aColumn].selectable].selectLength++;break;}}}
if(this.selectedIds[this.columnDefinitions[aColumn].selectable].selectMaxSize!=0){if(this.selectedIds[this.columnDefinitions[aColumn].selectable].selectLength==this.selectedIds[this.columnDefinitions[aColumn].selectable].selectMaxSize&&this.selectedIds[this.columnDefinitions[aColumn].selectable].selectMaxSize!=0)
{$("#"+this.componentId+"_select_All_"+this.columnDefinitions[aColumn].key).removeClass("columnNotSelected").addClass("columnSelected");}}else{$("#"+this.componentId+"_select_All_"+this.columnDefinitions[aColumn].key).removeClass("columnNotSelected").addClass("columnDisabled");}}}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.formatResultsToCache=function(iLst,iStartIndex){for(var i=0;i<iLst.length;i++){this.cache[iStartIndex+i]={};this.unformattedCache[iStartIndex+i]=iLst[i];}
for(var aColumn=0;aColumn<this.columnDefinitions.length;aColumn++){if(this.columnDefinitions[aColumn].selectable!=null&&this.columnDefinitions[aColumn].selectable!=""){if(typeof(this.cellFormatters[this.columnDefinitions[aColumn].key])!="undefined"){var cachedString1=['<div class="checkBox" onClick="',this.componentId,'.selectCell(\''].join("");var cachedString2=['\',\'',this.columnDefinitions[aColumn].key,'\',\'',this.columnDefinitions[aColumn].selectable,'\');" >&nbsp;</div>'].join("")
var cachedString3='<div id="select_';var cachedString4=[this.columnDefinitions[aColumn].key,'Container" class="columnNotSelected">'].join("");var cachedString5='</div>';for(var i=0;i<iLst.length;i++){this.cache[iStartIndex+i][this.columnDefinitions[aColumn].key]=[cachedString3,i+iStartIndex,cachedString4,this.cellFormatters[this.columnDefinitions[aColumn].key].formatter(iLst[i][this.columnDefinitions[aColumn].key],iLst[i],i+iStartIndex,[cachedString1,i+iStartIndex,cachedString2].join(""),this.cellFormatters[this.columnDefinitions[aColumn].key].properties),cachedString5].join("");}}else{var cachedString='<div id="select_';var cachedString2=[this.columnDefinitions[aColumn].key,'Container" class="columnNotSelected"><div class="checkBox" onClick="',this.componentId,'.selectCell(\''].join('');var cachedString3=['\',\'',this.columnDefinitions[aColumn].key,'\',\'',this.columnDefinitions[aColumn].selectable,'\');" >&nbsp;</div></div>'].join('');for(var i=0;i<iLst.length;i++){this.cache[iStartIndex+i][this.columnDefinitions[aColumn].key]=[cachedString,i+iStartIndex,cachedString2,i+iStartIndex,cachedString3].join('');}}}else if(this.columnDefinitions[aColumn].automaticDots){var cachedString="<table width=\"100%\" class=\"dotsFormatter\" id=\""+this.columnDefinitions[aColumn].key+"_dotsFormatter";var cachedString1="\" style=\"table-layout: fixed;\" onmouseover=\""+this.componentId+"Tooltip.makeAndShowTooltip('"+this.columnDefinitions[aColumn].key+"_dotsFormatter"
var cachedString2="', '";var cachedString3="')\"><tr><td><div class=\"heightControl\" id=\""+this.columnDefinitions[aColumn].key+"_dotdotHeightControl";var cachedString4="\"><div class=\"dotdotText\" id=\""+this.columnDefinitions[aColumn].key+"_dotdotText";var cachedString5="\" >";var cachedString6="</div></div></td><td class=\"dotdot\" id=\""+this.columnDefinitions[aColumn].key+"_dotdot";var cachedString7="\" width=\"16px\" style=\"display:none;\"><div class=\"dotdotImg\">...</div></td></tr></table>";if(typeof(this.cellFormatters[this.columnDefinitions[aColumn].key])!="undefined"){for(var i=0;i<iLst.length;i++){this.cache[iStartIndex+i][this.columnDefinitions[aColumn].key]=this.cellFormatters[this.columnDefinitions[aColumn].key].formatter(iLst[i][this.columnDefinitions[aColumn].key],iLst[i],i+iStartIndex,[cachedString,i+iStartIndex,cachedString1,i+iStartIndex,cachedString2,escape(iLst[i][this.columnDefinitions[aColumn].key]),cachedString3,i+iStartIndex,cachedString4,i+iStartIndex,cachedString5,iLst[i][this.columnDefinitions[aColumn].key],cachedString6,i+iStartIndex,cachedString7].join(""),this.cellFormatters[this.columnDefinitions[aColumn].key].properties);}}else{for(var i=0;i<iLst.length;i++){this.cache[iStartIndex+i][this.columnDefinitions[aColumn].key]=[cachedString,i+iStartIndex,cachedString1,i+iStartIndex,cachedString2,escape(iLst[i][this.columnDefinitions[aColumn].key]),cachedString3,i+iStartIndex,cachedString4,i+iStartIndex,cachedString5,iLst[i][this.columnDefinitions[aColumn].key],cachedString6,i+iStartIndex,cachedString7].join("");}}}else{if(typeof(this.cellFormatters[this.columnDefinitions[aColumn].key])!="undefined"){for(var i=0;i<iLst.length;i++){this.cache[iStartIndex+i][this.columnDefinitions[aColumn].key]=this.cellFormatters[this.columnDefinitions[aColumn].key].formatter(iLst[i][this.columnDefinitions[aColumn].key],iLst[i],i+iStartIndex,iLst[i][this.columnDefinitions[aColumn].key],this.cellFormatters[this.columnDefinitions[aColumn].key].properties);}}else{for(var i=0;i<iLst.length;i++){this.cache[iStartIndex+i][this.columnDefinitions[aColumn].key]=iLst[i][this.columnDefinitions[aColumn].key];}}}}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.modifyCachedCell=function(newContent,lineId,columnKey){this.unformattedCache[lineId][columnKey]=newContent;if(typeof(this.cellFormatters[columnKey])!="undefined"){this.cache[lineId][columnKey]=this.cellFormatters[columnKey].formatter(newContent,this.unformattedCache[lineId],lineId,null,this.cellFormatters[columnKey].properties);}else{this.cache[lineId][columnKey]=newContent;}}
com.pictet.apps.fnc.web.component.table.DataTable.prototype.dataExists=function(data,columnKey){if(typeof(columnKey)!="undefined"){for(var i=0;i<this.unformattedCache.length;i++){if(this.unformattedCache[i][columnKey]==data){return true;}}}else{for(var i=0;i<this.unformattedCache.length;i++){for(var columnId in this.unformattedCache[i]){if(this.unformattedCache[i][columnId]==data){return true;}}}}
return false;};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getSelectableCell=function(lineId,columnId,selectId)
{return['<div class="checkBox" onClick="',this.componentId,'.selectCell(\'',lineId,'\',\'',columnId,'\',\'',selectId,'\');" >&nbsp;</div>'].join("");};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getSelectAllCell=function(columnId,selectId)
{return['<div class="columnNotSelected" id="',this.componentId,'_select_All_',columnId,'" onClick="',this.componentId,'.selectAllCells(\'',columnId,'\',\'',selectId,'\');" >&nbsp;</div>'].join("");};com.pictet.apps.fnc.web.component.table.DataTable.prototype.isSelectable=function(cellContent)
{return cellContent!==null&&cellContent!==""&&cellContent!=="-";};com.pictet.apps.fnc.web.component.table.DataTable.prototype.removeFromSelection=function(selectId,cellContent)
{for(var i=this.selectedIds[selectId].selectData.length-1;i>=0;i--){if(this.selectedIds[selectId].selectData[i]==cellContent){this.selectedIds[selectId].selectData[i]=this.selectedIds[selectId].selectData[this.selectedIds[selectId].selectData.length-1];this.selectedIds[selectId].selectData.pop();this.selectedIds[selectId].selectLength--;break;}}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.selectCell=function(lineId,columnId,selectId)
{if(this.cache[lineId][columnId].indexOf("columnSelected")!=-1){this.cache[lineId][columnId]=this.cache[lineId][columnId].replace(/columnSelected/,"columnNotSelected");$("#select_"+lineId+columnId+"Container").removeClass("columnSelected").addClass("columnNotSelected");this.removeFromSelection(selectId,this.unformattedCache[lineId][selectId]);if(this.selectedIds[selectId].selectLength!=this.selectedIds[selectId].selectMaxSize)
{$("#"+this.componentId+"_select_All_"+columnId).removeClass("columnSelected").addClass("columnNotSelected");}}else{this.cache[lineId][columnId]=this.cache[lineId][columnId].replace(/columnNotSelected/,"columnSelected");$("#select_"+lineId+columnId+"Container").removeClass("columnNotSelected").addClass("columnSelected");this.selectedIds[selectId].selectData.push(this.unformattedCache[lineId][selectId]);this.selectedIds[selectId].selectLength++;if(this.selectedIds[selectId].selectLength==this.selectedIds[selectId].selectMaxSize)
{$("#"+this.componentId+"_select_All_"+columnId).removeClass("columnNotSelected").addClass("columnSelected");}}
this.fireSelectionEvent(selectId);};com.pictet.apps.fnc.web.component.table.DataTable.prototype.selectAllCells=function(columnId,selectId)
{if(this.selectedIds[selectId].selectMaxSize!=0){if(this.selectedIds[selectId].selectLength==this.selectedIds[selectId].selectMaxSize){this.deselectAll(columnId,selectId);}else{$("#"+this.componentId+"_select_All_"+columnId).removeClass("columnNotSelected").addClass("columnSelected");$("#"+this.componentId+" tbody td."+this.getColumnId(columnId)+" .columnNotSelected").removeClass("columnNotSelected").addClass("columnSelected");for(var i=0;i<this.unformattedCache.length;i++){if(this.isSelectable(this.unformattedCache[i][selectId])&&this.cache[i][columnId].indexOf("columnSelected")==-1){this.selectedIds[selectId].selectData.push(this.unformattedCache[i][selectId]);this.cache[i][columnId]=this.cache[i][columnId].replace(/columnNotSelected/,"columnSelected");}}
this.selectedIds[selectId].selectLength=this.selectedIds[selectId].selectMaxSize;}
this.fireSelectionEvent(selectId);}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.deselectAll=function(columnId,selectId)
{$("#"+this.componentId+"_select_All_"+columnId).removeClass("columnSelected").addClass("columnNotSelected");$("#"+this.componentId+" tbody td."+this.getColumnId(columnId)+" .columnSelected").removeClass("columnSelected").addClass("columnNotSelected");for(var i=0;i<this.unformattedCache.length;i++){if(this.isSelectable(this.unformattedCache[i][selectId])&&this.cache[i][columnId].indexOf("columnSelected")!=-1){this.removeFromSelection(selectId,this.unformattedCache[i][selectId]);this.cache[i][columnId]=this.cache[i][columnId].replace(/columnSelected/,"columnNotSelected");}}
this.selectedIds[selectId].selectLength=0;};com.pictet.apps.fnc.web.component.table.DataTable.prototype.invertSelection=function(columnId)
{var selectId;for(var aColumn=0;aColumn<this.columnDefinitions.length;aColumn++){if(this.columnDefinitions[aColumn].key==columnId){selectId=this.columnDefinitions[aColumn].selectable;break;}}
if(this.selectedIds[selectId].selectLength==this.selectedIds[selectId].selectMaxSize||this.selectedIds[selectId].selectLength==0){this.selectAllCells(columnId,selectId);return;}
for(var i=0;i<this.unformattedCache.length;i++){if(this.isSelectable(this.unformattedCache[i][selectId])){if(this.cache[i][columnId].indexOf("columnSelected")!=-1){this.removeFromSelection(selectId,this.unformattedCache[i][selectId]);this.cache[i][columnId]=this.cache[i][columnId].replace(/columnSelected/,"columnNotSelected");}else{this.selectedIds[selectId].selectData.push(this.unformattedCache[i][selectId]);this.selectedIds[selectId].selectLength++;this.cache[i][columnId]=this.cache[i][columnId].replace(/columnNotSelected/,"columnSelected");}}}
var alreadySelected=$("#"+this.componentId+" tbody td."+this.getColumnId(columnId)+" .columnSelected");$("#"+this.componentId+" tbody td."+this.getColumnId(columnId)+" .columnNotSelected").removeClass("columnNotSelected").addClass("columnSelected");alreadySelected.removeClass("columnSelected").addClass("columnNotSelected");this.fireSelectionEvent(selectId);};com.pictet.apps.fnc.web.component.table.DataTable.prototype.fireSelectionEvent=function(selectId)
{if(!selectId){return;}
if(this.selectedIds[selectId].selectCategory==null){this.onSelectionChange.fire({id:selectId,size:this.selectedIds[selectId].selectData.length})}else{var categorySize=0;for(var id in this.selectedIds){if(this.selectedIds[id].selectCategory==this.selectedIds[selectId].selectCategory){categorySize+=this.selectedIds[id].selectData.length;}}
this.onSelectionChange.fire({category:this.selectedIds[selectId].selectCategory,categorySize:categorySize,id:selectId,size:this.selectedIds[selectId].selectData.length})}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.resetSelection=function()
{for(var selected in this.selectedIds)
{this.selectedIds[selected].selectData=null;this.selectedIds[selected].selectData=[];this.selectedIds[selected].selectMaxSize=0;this.selectedIds[selected].selectLength=0}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.resetSelectionAndUpdateCache=function()
{for(var i=0;i<this.columnDefinitions.length;i++){if(this.columnDefinitions[i].selectable!==null&&this.columnDefinitions[i].selectable!==""){this.deselectAll(this.columnDefinitions[i].key,this.columnDefinitions[i].selectable);}}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.resetCurrentSelection=function()
{for(var selected in this.selectedIds)
{this.selectedIds[selected].selectLength=0;this.selectedIds[selected].selectMaxSize=0;}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getColumnSelection=function(column)
{return this.selectedIds[column].selectData;};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getLineSelection=function(column)
{var result=[];for(var i=0;i<this.selectedIds[column].selectData.length;i++){for(var j=0;j<this.unformattedCache.length;j++){if(this.unformattedCache[j][column]==this.selectedIds[column].selectData[i]){result.push(this.unformattedCache[j]);break;}}}
return result;};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getColumnSelectionAsStr=function(column)
{return this.selectedIds[column].selectData.join(",");};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getCategorySelection=function(category)
{var strResult=[];for(var id in this.selectedIds){if(this.selectedIds[id].selectCategory==category){if(this.selectedIds[id].selectData.length!=0)
{strResult=strResult.concat(this.selectedIds[id].selectData);}}}
return strResult;};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getCategorySelectionAsStr=function(category)
{var strResult=[];for(var id in this.selectedIds){if(this.selectedIds[id].selectCategory==category){if(this.selectedIds[id].selectData.length!=0)
{strResult.push(this.selectedIds[id].selectData.join(","));}}}
return strResult.join(",");};com.pictet.apps.fnc.web.component.table.DataTable.prototype.initSlider=function(){if(this.slider==null){this.slider=true;this.sliderHeight=parseInt($("#"+this.componentId+"_pagingCell").height(),10);$("#"+this.componentId+"_div_vscroll").height(this.sliderHeight);this.realLineHeight=Math.ceil(this.sliderHeight/this.lstSize);if(this.lstSize<this.fullLstSize){$("#"+this.componentId+"_vscroll").height(this.fullLstSize*this.realLineHeight);}else{$("#"+this.componentId+"_vscroll").height(0);}
var instance=this;document.getElementById(this.componentId+"_div_vscroll").onscroll=function(){window.setTimeout(function(){instance.sliderChangeAction();},0);return true;};this.addMouseScroll();}else{if(this.lstSize<this.fullLstSize){$("#"+this.componentId+"_vscroll").height(this.fullLstSize*this.realLineHeight);}else{$("#"+this.componentId+"_vscroll").height(0);}}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.addMouseScroll=function(){var iThis=this;$("#"+this.componentId+" tbody").mousewheel(function(event,delta){if(delta){var currentScroll=document.getElementById(iThis.componentId+"_div_vscroll").scrollTop;if(Math.round(delta)==0){if(delta<0){document.getElementById(iThis.componentId+"_div_vscroll").scrollTop=currentScroll+iThis.lineHeight*2;}else{document.getElementById(iThis.componentId+"_div_vscroll").scrollTop=currentScroll-iThis.lineHeight*2;}}else{document.getElementById(iThis.componentId+"_div_vscroll").scrollTop=currentScroll-iThis.lineHeight*Math.round(delta)*2;}
iThis.sliderChangeAction();}
return false;});};com.pictet.apps.fnc.web.component.table.DataTable.prototype.removeMouseScroll=function(){$("#"+this.parentComponentId).unmousewheel();};com.pictet.apps.fnc.web.component.table.DataTable.prototype.sliderChangeAction=function(){var scrollIndex=document.getElementById(this.componentId+"_div_vscroll").scrollTop;var scrollCalc=(scrollIndex-scrollIndex%this.realLineHeight)/this.realLineHeight;if(this.lstBeginPosition!=scrollCalc){this.oldLstBeginPosition=this.lstBeginPosition;this.lstBeginPosition=scrollCalc;this.refreshTable();if(typeof(tooltip)!="undefined"){tooltip.closeAllTooltips();}
this.tooltip.closeAllTooltips();}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.sliderChangeAction2_old=function(){if(navigator.appName=="Microsoft Internet Explorer"){var instance=this;window.setTimeout(function(){instance.sliderChangeAction();},0);}else{this.sliderChangeAction();}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.sliderChangeAction_old=function(){if(this.lstBeginPosition!=this.slider.getSliderPosition(0)){this.oldLstBeginPosition=this.lstBeginPosition;this.lstBeginPosition=this.slider.getSliderPosition(0);this.refreshTable();if(typeof(tooltip)!="undefined"){tooltip.closeAllTooltips();}}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.iniTitleListener=function(iCellId,iColumnKey){var aClickArgs=[];aClickArgs.cellId=iCellId;aClickArgs.columnKey=iColumnKey;YAHOO.util.Event.addListener(iCellId,"click",this.titleCellClick,aClickArgs,this);YAHOO.util.Event.addListener(iCellId,"mouseover",com.pictet.apps.fnc.web.component.table.DataTable.titleCellMouseOver,iCellId);YAHOO.util.Event.addListener(iCellId,"mouseout",com.pictet.apps.fnc.web.component.table.DataTable.titleCellMouseOut,iCellId);};com.pictet.apps.fnc.web.component.table.DataTable.prototype.removeTitleListener=function(iCellId,iColumnKey){YAHOO.util.Event.removeListener(iCellId,"click");YAHOO.util.Event.removeListener(iCellId,"mouseover");YAHOO.util.Event.removeListener(iCellId,"mouseout");};com.pictet.apps.fnc.web.component.table.DataTable.prototype.hideFilterRow=function(){$("#"+this.componentId+" tr.filter").addClass("hidden");};com.pictet.apps.fnc.web.component.table.DataTable.prototype.titleCellClick=function(e,iArgs){this.sort(iArgs.columnKey);};com.pictet.apps.fnc.web.component.table.DataTable.titleCellMouseOver=function(e,iCellId){$("#"+iCellId).addClass("mouseover");};com.pictet.apps.fnc.web.component.table.DataTable.titleCellMouseOut=function(e,iCellId){$("#"+iCellId).removeClass("mouseover");};com.pictet.apps.fnc.web.component.table.DataTable.prototype.formateLine=function(lineId,iId,iLineContent){var aClass="even";if(lineId%2==1){aClass="odd";}
var returnContent=["<tr id='",this.componentId,"_",lineId,"' class='",aClass," ",this.componentId,"_dataTableLines'>"];for(var aColumn=0;aColumn<this.fixedColumnNb;aColumn++){returnContent.push("<td class='",this.columnDefinitions[aColumn].className," ",this.getColumnId(this.columnDefinitions[aColumn].key)," ' height='",this.lineHeight,"px' >");if(this.columnDefinitions[aColumn].designDiv){returnContent.push("<div class='",this.columnDefinitions[aColumn].className,"'>");}
returnContent.push(iLineContent[this.columnDefinitions[aColumn].key]);if(this.columnDefinitions[aColumn].designDiv){returnContent.push("</div>");}
returnContent.push("</td>");}
for(var aColumn=this.fromColumnIndex;aColumn<this.fromColumnIndex+this.slideableColumnDisplayedNb;aColumn++){returnContent.push("<td class='",this.columnDefinitions[aColumn].className," ",this.getColumnId(this.columnDefinitions[aColumn].key)," ' height='",this.lineHeight,"px' >");if(this.columnDefinitions[aColumn].designDiv){returnContent.push("<div class='",this.columnDefinitions[aColumn].className,"'>");}
returnContent.push(iLineContent[this.columnDefinitions[aColumn].key]);if(this.columnDefinitions[aColumn].designDiv){returnContent.push("</div>");}
returnContent.push("</td>");}
returnContent.push("<td class='columnBuffer'>&nbsp;</td></tr>");return returnContent.join("");};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getEmptyLineContent=function()
{var tmpString=[];var nbVisibleColumns=this.fixedColumnNb+this.slideableColumnDisplayedNb;for(var i=0;i<nbVisibleColumns;i++){tmpString.push("<td class=\"emptyLine\" height=\"");tmpString.push(this.lineHeight);if(this.cacheCursor!=this.fullLstSize){tmpString.push("px\" >",i==0?this.labels['message']['waitForFunds']:"...","&nbsp;</td>");}else{tmpString.push("px\" >&nbsp;</td>");}}
tmpString.push("<td class=\"columnBuffer\">&nbsp;</td>");return tmpString.join("");};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getEmptyLine=function(iId){var aClass="even "+this.componentId+"_dataTableLines";if(iId%2==1){aClass="odd "+this.componentId+"_dataTableLines";}
return["<tr id='",this.componentId,"_",iId,"' class='",aClass,"'>",this.getEmptyLineContent(),"</tr>"].join("");};com.pictet.apps.fnc.web.component.table.DataTable.prototype.getEmptyTableMessage=function(iId){var nbColumnsDisplayed=this.fixedColumnNb+this.slideableColumnDisplayedNb+1;return["<tr id='",this.componentId,"_0' class='",this.componentId+"_dataTableLines'><td height='",this.lineHeight,"' class='emptyMessage' colspan='",nbColumnsDisplayed,"'>",this.labels['warning']['emptyMessage'],"</td></tr>"].join("");};com.pictet.apps.fnc.web.component.table.DataTable.prototype.removeLine=function(iId){$("#"+this.componentId+"_"+iId).remove();};com.pictet.apps.fnc.web.component.table.DataTable.prototype.refreshTable=function()
{$("tr."+this.componentId+"_dataTableLines").remove();var contentToAdd=[];if(this.cache!==null&&this.cache.length>0){for(var j=0;j<this.lstSize;j++){if(this.lstBeginPosition+j<this.cache.length){contentToAdd.push(this.formateLine(j,this.lstBeginPosition+j,this.cache[this.lstBeginPosition+j]));}else{contentToAdd.push(this.getEmptyLine(j));}}}else{contentToAdd.push(this.getEmptyTableMessage());for(var j=1;j<this.lstSize;j++){contentToAdd.push(this.getEmptyLine(j));}}
$("#"+this.idFirstLine).after(contentToAdd.join(""));if(this.hasOverBehavior){var regExpTest=/MSIE (\d+\.\d+);/;if(regExpTest.test(navigator.userAgent)){var ieversion=new Number(RegExp.$1)
if(ieversion<7){$("#"+this.componentId+" tbody tr."+this.componentId+"_dataTableLines").mouseover(function(){this.className+=' hover';}).mouseout(function(){this.className=this.className.replace(/\bhover\b/,'');});}}}
if(this.haveAutomaticDots){var instance=this;if(this.timerProcessDots!=null){window.clearTimeout(this.timerProcessDots);}
this.timerProcessDots=window.setTimeout(function(){instance.dotsJob();},150);}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.dotsJob=function(){window.clearTimeout(this.timerProcessDots);if(this.cache!==null&&this.cache.length>0){for(var aColumn=0;aColumn<this.fixedColumnNb;aColumn++){if(this.columnDefinitions[aColumn].automaticDots){for(var j=0;j<this.lstSize;j++){if(this.lstBeginPosition+j<this.cache.length){var dotText=document.getElementById(this.columnDefinitions[aColumn].key+"_dotdotText"+(this.lstBeginPosition+j));var dotControl=document.getElementById(this.columnDefinitions[aColumn].key+"_dotdotHeightControl"+(this.lstBeginPosition+j));if(dotText.scrollWidth>dotControl.offsetWidth||dotText.scrollHeight>dotControl.offsetHeight){document.getElementById(this.columnDefinitions[aColumn].key+"_dotdot"+(this.lstBeginPosition+j)).style.display="";}else{document.getElementById(this.columnDefinitions[aColumn].key+"_dotsFormatter"+(this.lstBeginPosition+j)).onmouseover=null;}}}}}
for(var aColumn=this.fromColumnIndex;aColumn<this.fromColumnIndex+this.slideableColumnDisplayedNb;aColumn++){if(this.columnDefinitions[aColumn].automaticDots){for(var j=0;j<this.lstSize;j++){if(this.lstBeginPosition+j<this.cache.length){var dotText=document.getElementById(this.columnDefinitions[aColumn].key+"_dotdotText"+(this.lstBeginPosition+j));var dotControl=document.getElementById(this.columnDefinitions[aColumn].key+"_dotdotHeightControl"+(this.lstBeginPosition+j));if(dotText.scrollWidth>dotControl.offsetWidth||dotText.scrollHeight>dotControl.offsetHeight){document.getElementById(this.columnDefinitions[aColumn].key+"_dotdot"+(this.lstBeginPosition+j)).style.display="";}else{document.getElementById(this.columnDefinitions[aColumn].key+"_dotsFormatter"+(this.lstBeginPosition+j)).onmouseover=null;}}}}}}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.cleanTableContent=function()
{var aLine=this.getEmptyLineContent();for(var i=0;i<this.lstSize;i++){var line=$("#"+this.componentId+"_"+i);line.empty();line.append(aLine);}
aLine=line=i=null;};com.pictet.apps.fnc.web.component.table.DataTable.prototype.constructTable=function(){var contentToAdd="";for(var j=0;j<this.lstSize;j++){contentToAdd+=this.getEmptyLine(j);}
$("#"+this.idFirstLine).after(contentToAdd);if(this.containsHiddenSlideableColumns()&&!this.haveHorizontalSlideBar){$("#"+this.idContent).append(this.getHorizontalSlideBar());this.haveHorizontalSlideBar=true;}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.enableSorting=function(){for(var i=0;i<this.columnDefinitions.length;i++){if(this.columnDefinitions[i].sortable=="true"&&this.columnDefinitions[i].hidden!="true"){this.iniTitleListener("column_"+this.componentId+"_"+this.columnDefinitions[i].key+"_title",this.columnDefinitions[i].key)
$("#column_"+this.componentId+"_"+this.columnDefinitions[i].key+"_title_sortIndicator").addClass("notSorted");}}
var columTooltip=null;for(var aSort=0;aSort<this.sortSettings.length;aSort++){if(this.sortSettings[aSort]!=null){columTooltip=$("#"+this.getColumnId(this.sortSettings[aSort].colName)+"_title_sortIndicator");columTooltip.addClass("sorted"+this.sortSettings[aSort].dir+(aSort+1))
if(this.sortSettings[aSort].dir=="ASC"){columTooltip.attr("title",this.labels['label']['ASC']);}else if(this.sortSettings[aSort].dir=="DESC"){columTooltip.attr("title",this.labels['label']['DESC']);}else{columTooltip.attr("title",this.labels['label']['nosort']);}}else{break;}}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.disableSorting=function(){for(var aSort=0;aSort<this.sortSettings.length;aSort++){if(this.sortSettings[aSort]!=null){$("#"+this.getColumnId(this.sortSettings[aSort].colName)+"_title_sortIndicator").removeClass("sorted"+this.sortSettings[aSort].dir+(aSort+1)).attr("title","");}else{break;}}
for(var i=0;i<this.columnDefinitions.length;i++){if(this.columnDefinitions[i].sortable=="true"&&this.columnDefinitions[i].hidden!="true"){this.removeTitleListener("column_"+this.componentId+"_"+this.columnDefinitions[i].key+"_title",this.columnDefinitions[i].key)
$("#column_"+this.componentId+"_"+this.columnDefinitions[i].key+"_title_sortIndicator").removeClass("notSorted");}}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.toggleExhaustive=function(serverResultExhaustive,serverDisplayFirstLine){if(serverResultExhaustive!=this.isResultExhaustive){if(this.isResultExhaustive){this.disableSorting();}else{this.enableSorting();if(this.filterWithFocus!=null){this.filterWithFocus.focus();this.filterWithFocus=null;}}
this.isResultExhaustive=serverResultExhaustive;}
if(serverDisplayFirstLine!=this.displayFilterLine){if(this.displayFilterLine){$("#"+this.componentId+" tr.filter").addClass("hidden");}else{$("#"+this.componentId+" tr.filter").removeClass("hidden");}
this.displayFilterLine=serverDisplayFirstLine;}
if(this.isFilterLineDisplayedAtLoad!=null&&this.isFilterLineDisplayedAtLoad&&!this.displayFilterLine){$("#"+this.componentId+" tr.filter").addClass("hidden");this.isFilterLineDisplayedAtLoad=null;}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.refreshStatusBox=function(){var messages=[];if(!this.isResultExhaustive){messages.push(new com.pictet.apps.fnc.web.component.Message(this.labels['warning']['notResultExhaustedMessage'],"info"));}
this.onMessage.fire([]);if(messages.length!=0){this.onMessage.fire(messages);}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.displayLoadingMessage=function(){this.onWaitbarShow.fire();};com.pictet.apps.fnc.web.component.table.DataTable.prototype.hideLoadingMessage=function(){this.onWaitbarHide.fire();};com.pictet.apps.fnc.web.component.table.DataTable.prototype.performAjaxCall=function(iAjaxCallName){this.currentAjaxCallName=iAjaxCallName;};com.pictet.apps.fnc.web.component.table.DataTable.prototype.clearAjaxCall=function(){this.currentAjaxCallName="";};com.pictet.apps.fnc.web.component.table.DataTable.prototype.isAjaxCallActive=function(iAjaxCallName){return(this.currentAjaxCallName==iAjaxCallName);};com.pictet.apps.fnc.web.component.table.DataTable.prototype.resetSort=function(){for(var aSort=0;aSort<this.sortSettings.length;aSort++){if(this.sortSettings[aSort]!=null){this.changeTitleDisplayForSort("#"+this.getColumnId(this.sortSettings[aSort].colName)+"_title_sortIndicator","notSorted");this.sortSettings[aSort]=null;}else{break;}}}
com.pictet.apps.fnc.web.component.table.DataTable.prototype.getNextSortDir=function(iDir){return iDir=="ASC"?"DESC":(iDir=="DESC"?"":"ASC");};com.pictet.apps.fnc.web.component.table.DataTable.prototype.changeTitleDisplayForSort=function(iColId,iNewClass){var columTitle=$(iColId);columTitle.removeClass("notSorted");for(var i=0;i<this.sortSettings.length;i++){columTitle.removeClass("sortedASC"+(i+1));columTitle.removeClass("sortedDESC"+(i+1));}
if(iNewClass.indexOf("ASC")>=0){columTitle.attr("title",this.labels['label']['ASC']);}else if(iNewClass.indexOf("DESC")>=0){columTitle.attr("title",this.labels['label']['DESC']);}else{columTitle.attr("title",this.labels['label']['nosort']);}
columTitle.addClass(iNewClass);};com.pictet.apps.fnc.web.component.table.DataTable.prototype.sort=function(iColumn){var pos=null;var sortSize=this.sortSettings.length;for(var i=0;i<sortSize;i++){if(this.sortSettings[i]==null){break;}
if(this.sortSettings[i].colName==iColumn){pos=i;break;}}
if(pos==null){var lastSortDef;for(lastSortDef=0;lastSortDef<sortSize&&this.sortSettings[lastSortDef]!=null;lastSortDef++);if(lastSortDef==sortSize){$("#"+this.getColumnId(this.sortSettings[sortSize-1].colName)+"_title_sortIndicator").removeClass("sortedASC"+sortSize).removeClass("sortedDESC"+sortSize).addClass("notSorted");$("#"+this.getColumnId(iColumn)+"_title_sortIndicator").addClass("sortedASC"+sortSize).attr("title",this.labels['label']['ASC']);this.sortSettings[sortSize-1]={colName:iColumn,dir:"ASC"};}else{this.changeTitleDisplayForSort("#"+this.getColumnId(iColumn)+"_title_sortIndicator","sortedASC"+(lastSortDef+1));this.sortSettings[lastSortDef]={colName:iColumn,dir:"ASC"};}}else{if(this.getNextSortDir(this.sortSettings[pos].dir)==""){this.changeTitleDisplayForSort("#"+this.getColumnId(this.sortSettings[pos].colName)+"_title_sortIndicator","notSorted");for(var i=pos;i<sortSize-1;i++){this.sortSettings[i]=this.sortSettings[i+1];if(this.sortSettings[i]!=null){this.changeTitleDisplayForSort("#"+this.getColumnId(this.sortSettings[i].colName)+"_title_sortIndicator","sorted"+this.sortSettings[i].dir+(i+1));}else{break;}}
this.sortSettings[sortSize-1]=null;}else{var saveDir=this.sortSettings[pos].dir;this.sortSettings[pos].dir=this.getNextSortDir(this.sortSettings[pos].dir);$("#"+this.getColumnId(this.sortSettings[pos].colName)+"_title_sortIndicator").removeClass("sorted"+saveDir+""+(pos+1)).addClass("sorted"+this.sortSettings[pos].dir+""+(pos+1)).attr("title",this.labels['label'][this.sortSettings[pos].dir]);}}
this.resetTableAndReloadElements();};com.pictet.apps.fnc.web.component.table.DataTable.prototype.reLoadSorting=function(iSortSettings){this.resetSort();for(var aSort=0;aSort<iSortSettings.length;aSort++){this.changeTitleDisplayForSort("#"+this.getColumnId(iSortSettings[aSort].colName)+"_title_sortIndicator","sorted"+iSortSettings[aSort].dir+(aSort+1));this.sortSettings[aSort]=iSortSettings[aSort];}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.updateInternalFilters=function(filterValues){for(var filterKey in filterValues){for(var aFilter=0;aFilter<this.columnFilters.length;aFilter++){if(this.columnFilters[aFilter].filter.getType()=="combobox"&&this.columnFilters[aFilter].key==filterKey){this.columnFilters[aFilter].filter.displayOnlyList(filterValues[filterKey]);break;}}}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.resetInternalElements=function(){for(var aFilter=0;aFilter<this.columnFilters.length;aFilter++){if(this.columnFilters[aFilter].filter.getType()=="combobox"){this.columnFilters[aFilter].filter.closeMenu();}}
this.resetCurrentSelection();};com.pictet.apps.fnc.web.component.table.DataTable.prototype.initTable=function(){if(this.initElementsJson['response']==null){this.loadElements();this.displayLoadingMessage();}else{this.performAjaxCall("initialisation of the table");com.pictet.apps.fnc.web.component.table.DataTable.handleLoadElements(this.initElementsJson,this,"initialisation of the table");}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.resetTable=function(){this.fullLstSize=0;this.lstBeginPosition=0;this.oldLstBeginPosition=0;this.cache=null;this.cacheCursor=0;this.initSlider();this.resetInternalElements();this.cleanTableContent();};com.pictet.apps.fnc.web.component.table.DataTable.prototype.resetTableAndReloadElements=function(){this.resetTable();this.displayLoadingMessage();this.loadElements();if(this.isInternalFilter){var inlineFilters=this.getInternalFilters();this.wichInternalFilter=inlineFilters;var areAllNull=true;for(var aFilter in inlineFilters){if(inlineFilters[aFilter]!=""){areAllNull=false;break;}}
if(areAllNull){this.wichInternalFilter=null;this.onInternalFilter.fire(null);this.isInternalFilter=false;}}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.loadElements=function(){this.isLoading=true;var timestamp=new Date().getTime();this.onAsynchronousCallStart.fire();var iInstance=this;this.performAjaxCall(timestamp);if(this.dwrValidatorObject!=null){this.dwrValidatorObject.validate(this.getFilters(),{callback:function(iDataFromServer){com.pictet.apps.fnc.web.component.table.DataTable.afterValidate(iDataFromServer,iInstance,timestamp)},errorHandler:function(errorString,exception){com.pictet.apps.fnc.web.component.table.DataTable.superclass.handleAjaxRemoteException(iInstance,errorString,exception)
iInstance.resetTable();},textHtmlHandler:function(){com.pictet.apps.fnc.web.component.table.DataTable.superclass.handleAjaxSessionTimeout()}});}else{var toSize=this.lstSize-1;if(this.loadElementsOnce){toSize=0;}
this.dwrObject.getSortedElements(0,toSize,this.sortSettings,this.getExternalFilters(),this.getInternalFilters(),this.getDynamicFilters(),{callback:function(iDataFromServer){com.pictet.apps.fnc.web.component.table.DataTable.handleLoadElements(iDataFromServer,iInstance,timestamp)},errorHandler:function(errorString,exception){com.pictet.apps.fnc.web.component.table.DataTable.superclass.handleAjaxRemoteException(iInstance,errorString,exception)
iInstance.resetTable();},textHtmlHandler:function(){com.pictet.apps.fnc.web.component.table.DataTable.superclass.handleAjaxSessionTimeout()}});}};com.pictet.apps.fnc.web.component.table.DataTable.handleLoadElements=function(response,iThisDataTable,timestamp){if(iThisDataTable.isAjaxCallActive(timestamp)){iThisDataTable.fullLstSize=response["totalSize"];iThisDataTable.globalFullLstSize=response["globalSize"];iThisDataTable.onListSizeChange.fire({size:iThisDataTable.fullLstSize});iThisDataTable.toggleExhaustive(response["resultExhaustive"],response["displayFilterLine"]);if(iThisDataTable.isNewRequest){iThisDataTable.updateInternalFilters(response["filtersUpdate"]);}
iThisDataTable.cacheCursor=0;iThisDataTable.lstBeginPosition=0;iThisDataTable.oldLstBeginPosition=0;iThisDataTable.unformattedCache=null;iThisDataTable.unformattedCache=[];iThisDataTable.cache=null;iThisDataTable.cache=[];iThisDataTable.addToCache(response["response"],0);iThisDataTable.cacheCursor=iThisDataTable.cache.length;iThisDataTable.refreshTable();iThisDataTable.hideLoadingMessage();iThisDataTable.refreshStatusBox();iThisDataTable.preloadNextElements(timestamp);iThisDataTable.isLoading=false;$("#"+iThisDataTable.idPaging).css("visibility","");iThisDataTable.initSlider();}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.preloadNextElements=function(timestamp){if(this.fullLstSize>this.cacheCursor&&this.isAjaxCallActive(timestamp)){var iInstance=this;this.dwrObject.getSortedElements(this.cacheCursor,this.fullLstSize-1,this.sortSettings,this.getExternalFilters(),this.getInternalFilters(),this.getDynamicFilters(),{callback:function(iDataFromServer){com.pictet.apps.fnc.web.component.table.DataTable.handlePreloadNextElements(iDataFromServer,iInstance,timestamp)},errorHandler:function(errorString,exception){com.pictet.apps.fnc.web.component.table.DataTable.superclass.handleAjaxRemoteException(iInstance,errorString,exception);iInstance.resetTable();},textHtmlHandler:function(){com.pictet.apps.fnc.web.component.table.DataTable.superclass.handleAjaxSessionTimeout()}});}else{if(this.isNewRequest){this.onNewRequest.fire({size:this.globalFullLstSize});if(this.defaultSelectionFlag!=""){this.fireSelectionEvent(this.DefaultSelectedColumn);}
this.isNewRequest=false;}
if(this.isInternalFilter){this.onInternalFilter.fire(this.wichInternalFilter);this.isInternalFilter=false;}
this.onAsynchronousCallFinish.fire();}};com.pictet.apps.fnc.web.component.table.DataTable.handlePreloadNextElements=function(response,iThisDataTable,timestamp){if(iThisDataTable.isAjaxCallActive(timestamp)){iThisDataTable.addToCache(response["response"],iThisDataTable.cacheCursor);iThisDataTable.cacheCursor+=response["response"].length;iThisDataTable.refreshTable();if(iThisDataTable.isNewRequest){iThisDataTable.onNewRequest.fire({size:iThisDataTable.globalFullLstSize});if(iThisDataTable.defaultSelectionFlag!=""){iThisDataTable.fireSelectionEvent(iThisDataTable.DefaultSelectedColumn);}
iThisDataTable.isNewRequest=false;}
if(iThisDataTable.isInternalFilter){iThisDataTable.onInternalFilter.fire(iThisDataTable.wichInternalFilter);iThisDataTable.isInternalFilter=false;}
iThisDataTable.onAsynchronousCallFinish.fire();}};com.pictet.apps.fnc.web.component.table.DataTable.afterValidate=function(response,iThisDataTable,timestamp){var messages=iThisDataTable.getErrorMessage(response);iThisDataTable.markInvalidFields(response);iThisDataTable.onMessage.fire([]);if(messages.length>1){iThisDataTable.onMessage.fire(messages);iThisDataTable.hideLoadingMessage();iThisDataTable.onAsynchronousCallFinish.fire();iThisDataTable.isNewRequest=false;iThisDataTable.onListSizeChange.fire({size:0});}else{var toSize=iThisDataTable.lstSize-1;if(iThisDataTable.loadElementsOnce){toSize=0;}
iThisDataTable.dwrObject.getSortedElements(0,toSize,iThisDataTable.sortSettings,iThisDataTable.getExternalFilters(),iThisDataTable.getInternalFilters(),iThisDataTable.getDynamicFilters(),{callback:function(iDataFromServer){com.pictet.apps.fnc.web.component.table.DataTable.handleLoadElements(iDataFromServer,iThisDataTable,timestamp)},errorHandler:function(errorString,exception){com.pictet.apps.fnc.web.component.table.DataTable.superclass.handleAjaxRemoteException(iThisDataTable,errorString,exception);iThisDataTable.resetTable();},textHtmlHandler:function(){com.pictet.apps.fnc.web.component.table.DataTable.superclass.handleAjaxSessionTimeout()}});}};com.pictet.apps.fnc.web.component.table.DataTable.prototype.markInvalidFields=function(errorFields){for(var j=0;j<this.columnFilters.length;j++){if(errorFields[this.columnFilters[j].key]!=null){this.columnFilters[j].filter.markInvalid();}else if(this.columnFilters[j].filter.markValid){this.columnFilters[j].filter.markValid();}}
for(var j=0;j<this.externalFilters.length;j++){if(errorFields[this.externalFilters[j].key]!=null){this.externalFilters[j].filter.markInvalid();$("#"+this.externalFilters[j].filter.componentId+"Label").css("color","#9A0000");}else if(this.externalFilters[j].filter.markValid){this.externalFilters[j].filter.markValid();$("#"+this.externalFilters[j].filter.componentId+"Label").css("color","#000");}}};namespace("com.pictet.apps.fnc.web.component.table.formatters");com.pictet.apps.fnc.web.component.table.formatters.fundList_fundNameFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){var aStr="";if(propertiesObject.fundDetailUrl){var fundId=iBeanAsAssociativeArray[propertiesObject.mispfFundId];var fundName=escape(iBeanAsAssociativeArray[propertiesObject.fundName]);var contextMenuTooltip=propertiesObject.contextMenuTooltip;var fundNameCompartment=iBeanAsAssociativeArray[propertiesObject.fundNameCompartment];var fundNameUmbrella=iBeanAsAssociativeArray[propertiesObject.fundNameUmbrella];aStr=["<div class='fundNameText'>","<a class='fundNameText' href='",propertiesObject.fundDetailUrl,"&fundId=",fundId,"&fundName=",fundName,"'>",iUnformattedCellContent,"</a>","</div>","<div class='contextMenuButton' title=\"",contextMenuTooltip,"\" id='img_",fundId,"'","onclick='contextMenuId.addContextValue(\"name\", \"",fundName,"\");","contextMenuId.addContextValue(\"id\", \"",fundId,"\");","contextMenuId.display(\"img_",fundId,"\");'","onContextMenu='contextMenuId.addContextValue(\"name\", \"",fundName,"\");","contextMenuId.addContextValue(\"id\", \"",fundId,"\");","contextMenuId.display(\"img_",fundId,"\");","return false'/>","</div>"];if(iBeanAsAssociativeArray[propertiesObject.mispfAwards].length>0){var awardTooltip=propertiesObject.awardTooltip;aStr.push("<div class='fundAwards' onclick='$(\"#fundId\").attr(\"value\", \"",fundId,"\"); ","$(\"#fundNameCompartment\").attr(\"value\", \"",fundNameCompartment,"\"); ","$(\"#fundNameUmbrella\").attr(\"value\", \"",fundNameUmbrella,"\"); ","$(\"#awardListForm\").submit();' title=\"",awardTooltip,"\"></div>");}}else{aStr=["<div class='fundNameText'>",iUnformattedCellContent,"</div>"];}
if(propertiesObject.benchInfo){aStr.push("<div class='benchText'>",iBeanAsAssociativeArray[propertiesObject.benchInfo],"</div>");}
return aStr.join("");};com.pictet.apps.fnc.web.component.table.formatters.fundList_benchInfo=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){if(propertiesObject.benchInfo){if(preformattedContent==""){return"";}
return["<div>",preformattedContent,"</div><div class='benchText'>",iBeanAsAssociativeArray[propertiesObject.benchInfo],"</div>"].join("");}
return preformattedContent;};com.pictet.apps.fnc.web.component.table.formatters.fundList_fundNameLinkFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){var aStr;if(propertiesObject.fundDetailUrl){aStr=["<div class='fundNameText'>","<a class='fundNameText' href='",propertiesObject.fundDetailUrl,"&fundId=",iBeanAsAssociativeArray[propertiesObject.mispfFundId],"&fundName=",escape(iBeanAsAssociativeArray[propertiesObject.fundName]),"'>",iUnformattedCellContent,"</a>","</div>"];}else{aStr=["<div class='fundNameText'>",iUnformattedCellContent,"</div>"];}
if(propertiesObject.benchInfo){aStr.push("<div class='benchText'>",iBeanAsAssociativeArray[propertiesObject.benchInfo],"</div>");}
return aStr.join("");};com.pictet.apps.fnc.web.component.table.formatters.basketList_fileNameFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){var basketDocId=iBeanAsAssociativeArray[propertiesObject.fncBasketDocId];var basketMimeType=iBeanAsAssociativeArray[propertiesObject.fncBasketMimeType];return["<table width=\"100%\" style=\"table-layout:fixed;\"><tr><td class=\"pubNameStructure\" width=\"23px\">",docIconSelector.getDocumentIcon(basketDocId,basketMimeType),"</td>","<td class=\"pubNameStructure\"><div class=\"nameText\" onclick=\"",docIconSelector.getOnClickToDocument(basketDocId,basketMimeType),"\">",preformattedContent,"</div></td></tr></table>"].join("");};com.pictet.apps.fnc.web.component.table.formatters.myfundCenter_popuplistViewNameFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){var listViewId=iBeanAsAssociativeArray[propertiesObject.fnclistViewId];var listViewName=iBeanAsAssociativeArray[propertiesObject.fnclistViewName];var isDefaultlistView=iBeanAsAssociativeArray[propertiesObject.fncDefaultlistView];var iThis=propertiesObject.linkedObject;var standardIconTooltip=propertiesObject.standardIconTooltip;listViewId=listViewId.substring(0,listViewId.indexOf(iThis.separatorIdVersion));divId=["funds",iThis.listOrViewName,"_",listViewId].join("");var divContainerId=propertiesObject.fnclistViewName+"_dotdotText"+lineNumber;var tooltipHtml="<div class='defaultIcon' title=\""+standardIconTooltip+"\"></div>"
return["<div class='listAndViewName' style='color: black; cursor: pointer;' onclick='allFund",iThis.listOrViewName,"Object.onSelect(\"",propertiesObject.fnclistViewName,"\",","\"",escape(listViewName),"\",\"",listViewId,"\")'>",isDefaultlistView?tooltipHtml:"","<div id=\"",divContainerId,"\" class=\"nameText\" onmouseover='allFund",iThis.listOrViewName,"Object.onMouseOver(\"",divContainerId,"\")' onmouseout='allFund",iThis.listOrViewName,"Object.onMouseOut(\"",divContainerId,"\")'>",preformattedContent,"</div></div>"].join("");};com.pictet.apps.fnc.web.component.table.formatters.myfundCenter_exportNameFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){var exportId=iBeanAsAssociativeArray[propertiesObject.fncExportId];var exportName=iBeanAsAssociativeArray[propertiesObject.fncExportName];var exportTooltip=iBeanAsAssociativeArray[propertiesObject.fncExportNameTooltip];var exportType=escape(iBeanAsAssociativeArray[propertiesObject.fncExportType]);var contextMenuTooltip=propertiesObject.contextMenuTooltip;var iThis=propertiesObject.linkedObject;var contextMenu=exportType==iThis.exportTypes['tracker']?"trackerContextMenu":"contextMenuId";return["<table width=\"100%\" style=\"table-layout:fixed;\"><tr><td class=\"exportName\" style=\"border:0px;margin:0px;padding:0px;\">",preformattedContent,"</td><td style=\"border:0px;margin:0px;padding:0px;\" width=\"12px\"><div class='contextMenuButton' title=\"",contextMenuTooltip,"\" id='img_",exportId,"' onclick='",contextMenu,".addContextValue(\"name\",\"",exportId,"\"); ",contextMenu,".addContextValue(\"id\",\"",exportId,"\"); ",contextMenu,".addContextValue(\"exportType\",\"",exportType,"\"); ",contextMenu,".display(\"img_",exportId,"\");'","onContextMenu='",contextMenu,".addContextValue(\"name\", \"",exportId,"\"); ",contextMenu,".addContextValue(\"id\",\"",exportId,"\"); ",contextMenu,".addContextValue(\"exportType\",\"",exportType,"\"); ",contextMenu,".display(\"img_",exportId,"\"); return false'/></div></td></tr></table>"].join("");};com.pictet.apps.fnc.web.component.table.formatters.myfundCenter_exportStateFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){var exportId=iBeanAsAssociativeArray[propertiesObject.exportId];var exportState=iBeanAsAssociativeArray[propertiesObject.exportState];var latestExecution=iBeanAsAssociativeArray[propertiesObject.latestExecution];var errorStateTooltip=iBeanAsAssociativeArray[propertiesObject.errorStateTooltip];var iThis=propertiesObject.linkedObject;var getExcelUrl=propertiesObject.urlConstant;var ownerStr=iThis.getExportOwnerId();var exIdVer=exportId.split(iThis.idVersionSeparator);if(exportState==iThis.exportStates['cancel']||exportState==iThis.exportStates['none']){return exportState;}else if(exportState==iThis.exportStates['inProgress']){return"<table width=\"100%\" style=\"border:0px;\"><tr><td style=\"white-space:nowrap;border:0px;padding-right:10px;\">"+exportState+"</td><td style=\"border:0px;width:100%;\"><div class='inProgress'></div></td></tr></table>";}else if(exportState==iThis.exportStates['ready']){return["<div class='readyState' style='float: left; color: #4A82BB; cursor: pointer' onclick='document.location.href = \"",getExcelUrl,"?navId=",iThis.navId,"&exportId=",exIdVer[0],"&exportOwnerId=",ownerStr,"\"'>",exportState,"</div>","<div class='latestExecutionDate' style='float: right; color: #B8B8B8;'>(",latestExecution,")</div>"].join("");}else if(exportState==iThis.exportStates['error']){var aStr=["<div class='latestExecutionError'>"];if(errorStateTooltip){aStr.push("<div id='exportState_",exportId,"' onmouseover=\"tooltip.makeAndShowTooltip('exportState_",exportId,"', '",escape(errorStateTooltip),"')\">",exportState,"</div>");}else{aStr.push(exportState);}
aStr.push("</div><div class='errorIcon' style='float: right; margin-right: 5px;'><jsp:text/></div>");return aStr.join("");}
return"";};com.pictet.apps.fnc.web.component.table.formatters.myfundCenter_ListAndViewNameFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){var viewId=iBeanAsAssociativeArray[propertiesObject.fncId];var isDefault=iBeanAsAssociativeArray[propertiesObject.fncDefault];var defaultTooltip=propertiesObject.defaultTooltip;var contextMenuTooltip=propertiesObject.contextMenuTooltip;var defaultIconHtml="";if(isDefault){defaultIconHtml="<div class='defaultIcon' title=\""+defaultTooltip+"\"></div>";}
return["<div class='listAndViewName'><div class='contextMenuButton' title=\"",contextMenuTooltip,"\" id='img_",viewId,"' onclick='contextMenuId.addContextValue(\"name\",\"",viewId,"\"); contextMenuId.addContextValue(\"id\",\"",viewId,"\"); contextMenuId.display(\"img_",viewId,"\");'","onContextMenu='contextMenuId.addContextValue(\"name\", \"",viewId,"\"); contextMenuId.addContextValue(\"id\",\"",viewId,"\"); contextMenuId.display(\"img_",viewId,"\"); return false'/></div>",defaultIconHtml,"<div class=\"nameText\">",preformattedContent,"</div></div>"].join("");};com.pictet.apps.fnc.web.component.table.formatters.myfundCenter_defaultViewFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){var defaultViewId=iBeanAsAssociativeArray[propertiesObject.fncDefaultViewId];var fundListId=iBeanAsAssociativeArray[propertiesObject.fncListId];var divId=["defaultView_",lineNumber].join("");return["<div class=\"defaultViewCBContainer\" id=\"div_",divId,"\"><div onclick='defaultViewCb.addContextValue(\"lineId\", ",lineNumber,");","defaultViewCb.addContextValue(\"containerId\", \"div_",divId,"\");","defaultViewCb.addContextValue(\"viewId\", \"",defaultViewId,"\");","defaultViewCb.addContextValue(\"fundListId\", \"",fundListId,"\");","defaultViewCb.display(\"div_",divId,"\");'","onContextMenu='defaultViewCb.addContextValue(\"lineId\", ",lineNumber,");","defaultViewCb.addContextValue(\"containerId\", \"div_",divId,"\");","defaultViewCb.addContextValue(\"viewId\", \"",defaultViewId,"\");","defaultViewCb.addContextValue(\"fundListId\", \"",fundListId,"\");","defaultViewCb.display(\"div_",divId,"\");","return false;'/>","<div class='contextMenuButton' id='img_",divId,"'/>","</div>","<div id='text_",divId,"' class='inlinecomboText'>",preformattedContent,"</div></div></div>"].join("");}
com.pictet.apps.fnc.web.component.table.formatters.myfundCenter_subscriberId=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){if(!iBeanAsAssociativeArray[propertiesObject.isInternal]){return preformattedContent;}
return"";};com.pictet.apps.fnc.web.component.table.formatters.myfundCenter_subscriberName=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){if(!iBeanAsAssociativeArray[propertiesObject.isInternal]){var subscribtionId=iBeanAsAssociativeArray[propertiesObject.idColname];var firstName=iBeanAsAssociativeArray[propertiesObject.firstNameColname];var lastName=iBeanAsAssociativeArray[propertiesObject.lastNameColname];var email=iBeanAsAssociativeArray[propertiesObject.emailColname];var company=iBeanAsAssociativeArray[propertiesObject.companyColname];return["<div class='subscriberName'><div class='contextMenuButton' title=\"",propertiesObject.contextMenuTooltip,"\" id='img_",subscribtionId,"' onclick='contextMenuId.addContextValue(\"id\",\"",subscribtionId,"\"); contextMenuId.addContextValue(\"firstName\",\"",firstName,"\"); contextMenuId.addContextValue(\"lastName\",\"",lastName,"\"); contextMenuId.addContextValue(\"email\",\"",email,"\"); contextMenuId.addContextValue(\"company\",\"",company,"\"); contextMenuId.display(\"img_",subscribtionId,"\");'","onContextMenu='contextMenuId.addContextValue(\"id\",\"",subscribtionId,"\"); contextMenuId.addContextValue(\"firstName\",\"",firstName,"\"); contextMenuId.addContextValue(\"lastName\",\"",lastName,"\"); contextMenuId.addContextValue(\"email\",\"",email,"\"); contextMenuId.addContextValue(\"company\",\"",company,"\"); contextMenuId.display(\"img_",subscribtionId,"\"); return false'/></div>","<div class=\"nameText\">",preformattedContent,"</div></div>"].join("");}else{iBeanAsAssociativeArray[propertiesObject.idColname]="-";return["<div class=\"nameText\" >",preformattedContent,"</div><div class='blockedIcon' title=\"",propertiesObject.blockedTooltip,"\"></div>"].join("");}};com.pictet.apps.fnc.web.component.table.formatters.awardList_awardProviderFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){return["<table width=\"100%\" style=\"table-layout:fixed;\"><tr><td style=\"border:0px;margin:0px;padding:0px;overflow-x:hidden;overflow-y:hidden;\" width=\"43px\"><img src=\"",iBeanAsAssociativeArray[propertiesObject.providerImageAttributeName],"\" /></td><td style=\"border:0px;margin:0px;padding:0px;\">",preformattedContent,"</td></tr></table>"].join("");}
com.pictet.apps.fnc.web.component.table.formatters.publicationList_publicationIconFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){if(iUnformattedCellContent!=null){var seperator=com.pictet.apps.fnc.web.component.basket.Basket.getInstance().paramSepIdAndType;var arrTemp=iUnformattedCellContent.split(seperator);var docId=arrTemp[0];return publicationSelector.getPublicationIcon(docId,iBeanAsAssociativeArray[propertiesObject.pubFormat][propertiesObject.pubLang],"","",preformattedContent,propertiesObject.multimediaWidth,propertiesObject.multimediaHeight);}
return"-";};com.pictet.apps.fnc.web.component.table.formatters.subscriptionPublicationsFileNameFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){var basketDocId=iBeanAsAssociativeArray[propertiesObject.fncBasketDocId];if(basketDocId!=null&&basketDocId!=""){return com.pictet.apps.fnc.web.component.table.formatters.basketList_fileNameFormatter(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject);}
return["<div class=\"noLink\" id=\"",propertiesObject.fncBasketDocId,"_tooltip_",lineNumber,"\" onmouseover=\"tooltip.makeAndShowTooltip('",propertiesObject.fncBasketDocId,"_tooltip_",lineNumber,"', '",escape(propertiesObject.noDocumentLabel),"')\">",preformattedContent,"</div>"].join("");};com.pictet.apps.fnc.web.component.table.formatters.fundDetailCombo_fundNameFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){if(iBeanAsAssociativeArray[propertiesObject.fncId]==propertiesObject.selectedId){return["<div class=\"selected\"><a href='javascript:",propertiesObject.componentId,"_hideCombobox()' >",iUnformattedCellContent,"</a></div>"].join("");}else{return["<a href='",propertiesObject.switchUrl,"&fundId=",iBeanAsAssociativeArray[propertiesObject.fncId],"&fundName=",escape(iBeanAsAssociativeArray[propertiesObject.fundName]),"&isMyOverviewPage=",propertiesObject.myOverviewPage,"' onClick='",propertiesObject.componentId,"_hideCombobox()' >",iUnformattedCellContent,"</a>"].join("");}};com.pictet.apps.fnc.web.component.table.formatters.fundDetailCombo_newsNameFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){if(iBeanAsAssociativeArray[propertiesObject.fncId]==propertiesObject.selectedId){return["<div class=\"selected\"><table width=\"100%\" id=\"",propertiesObject.fncDispName,"_dotsFormatter",lineNumber,"\" class=\"dotsFormatter\" style=\"table-layout: fixed;\" onmouseover=\"comboboxDataTableIdTooltip.makeAndShowTooltip('",propertiesObject.fncDispName,"_dotsFormatter",lineNumber,"', '",escape(iUnformattedCellContent),"',101)\"><tr><td><div class=\"heightControl\" id=\"",propertiesObject.fncDispName,"_dotdotHeightControl",lineNumber,"\"><div class=\"dotdotText\" id=\"",propertiesObject.fncDispName,"_dotdotText",lineNumber,"\">","<a href='javascript:",propertiesObject.componentId,"_hideCombobox()' >",iUnformattedCellContent,"</a>","</div></div></td><td class=\"dotdot\" style=\"display:none\" id=\"",propertiesObject.fncDispName,"_dotdot",lineNumber,"\" width=\"16px\" ><div class=\"dotdotImg\">...</div></td></tr></table></div>"].join("");}else{return["<table width=\"100%\" id=\"",propertiesObject.fncDispName,"_dotsFormatter",lineNumber,"\" class=\"dotsFormatter\" style=\"table-layout: fixed;\" onmouseover=\"comboboxDataTableIdTooltip.makeAndShowTooltip('",propertiesObject.fncDispName,"_dotsFormatter",lineNumber,"', '",escape(iUnformattedCellContent),"',101)\"><tr><td><div class=\"heightControl\" id=\"",propertiesObject.fncDispName,"_dotdotHeightControl",lineNumber,"\"><div class=\"dotdotText\" id=\"",propertiesObject.fncDispName,"_dotdotText",lineNumber,"\">","<a href='",propertiesObject.switchUrl,"&newsId=",iBeanAsAssociativeArray[propertiesObject.fncId],"&navId=",propertiesObject.navId,"&archievedNews=",propertiesObject.archivedNewsParam,"' onClick='",propertiesObject.componentId,"_hideCombobox()' >",iUnformattedCellContent,"</a>","</div></div></td><td class=\"dotdot\" style=\"display:none\" id=\"",propertiesObject.fncDispName,"_dotdot",lineNumber,"\" width=\"16px\" ><div class=\"dotdotImg\">...</div></td></tr></table>"].join("");}};com.pictet.apps.fnc.web.component.table.formatters.asynchCombobox_itemLabelFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){aStr=[];if(iBeanAsAssociativeArray[propertiesObject.selectedId]=='true'){var selectedItem={};selectedItem.id=iBeanAsAssociativeArray[propertiesObject.attrId];selectedItem.text=iUnformattedCellContent;propertiesObject.component.setSelectedItem(selectedItem);}
return["<a  href='javascript:handleSelect(\"",iBeanAsAssociativeArray[propertiesObject.attrId],"\",\"",iUnformattedCellContent,"\"\)' ><div style=\"height:",propertiesObject.lineHeight,"px\">",iUnformattedCellContent,"</div></a>"].join("");};com.pictet.apps.fnc.web.component.table.formatters.fundDetail_publicationNameFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){var documentTypeCode=escape(iBeanAsAssociativeArray[propertiesObject.fncPublicationDocumentType]);var documentType=escape(iBeanAsAssociativeArray[propertiesObject.dispPublicationDocumentType]);var techniqueId=iBeanAsAssociativeArray[propertiesObject.dispPublicationTechniqueId];return["<div class=\"contextMenuButton\" id=\"img_pub_",techniqueId,"\" onclick=\"showMenu('",documentTypeCode,"','",documentType,"','",techniqueId,"')\" onContextMenu=\"showMenu('",documentTypeCode,"','",documentType,"','",techniqueId,"')\"></div><a href=\"",propertiesObject.publicationListUrl,documentTypeCode,"\" >",iUnformattedCellContent,"</a>"].join('');};com.pictet.apps.fnc.web.component.table.formatters.newsList_newsTitleFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){return["<table width=\"100%\" id=\"",propertiesObject.fncDispName,"_dotsFormatter",lineNumber,"\" class=\"dotsFormatter\" style=\"table-layout: fixed;\" onmouseover=\"tooltip.makeAndShowTooltip('",propertiesObject.fncDispName,"_dotsFormatter",lineNumber,"', '",escape(iUnformattedCellContent),"',101)\"><tr><td><div class=\"heightControl\" id=\"",propertiesObject.fncDispName,"_dotdotHeightControl",lineNumber,"\"><div class=\"dotdotText\" id=\"",propertiesObject.fncDispName,"_dotdotText",lineNumber,"\">","<a style='color:#990000;' href='",propertiesObject.newsDetailUrl,"&newsId="+iBeanAsAssociativeArray[propertiesObject.fncNewsId],propertiesObject.mode=='collapsed'?"&archievedNews=true":"","' >",iUnformattedCellContent,"</a>","</div></div></td><td class=\"dotdot\" style=\"display:none\" id=\"",propertiesObject.fncDispName,"_dotdot",lineNumber,"\" width=\"16px\" ><div class=\"dotdotImg\">...</div></td></tr></table>"].join("");}
com.pictet.apps.fnc.web.component.table.formatters.myfundcenterFundsSetTag_fundNameFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){nbOfHiddenSelectedFunds=iBeanAsAssociativeArray[propertiesObject.fncDispHiddenSelected];if(isNaN(nbOfHiddenSelectedFunds)){nbOfHiddenSelectedFunds=0;}
return iUnformattedCellContent;};com.pictet.apps.fnc.web.component.table.formatters.myfundCenterSubscriptionList_nameFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,properties){var id=iBeanAsAssociativeArray[properties.id];var name=iBeanAsAssociativeArray[properties.name];var tooltip=iBeanAsAssociativeArray[properties.tooltip];var contextMenuTooltip=properties.contextMenuTooltip;var object=properties.object;var contextMenu="contextMenuId";if(properties.isPf&&iBeanAsAssociativeArray[properties.isOwnSubscriptionId]=="false"){contextMenu="changeOwnerPfContextMenu";}
return["<table width=\"100%\" style=\"table-layout:fixed;\"><tr><td class=\"subscriptionName\" style=\"border:0px;margin:0px;padding:0px;\">",preformattedContent,"</td><td style=\"border:0px;margin:0px;padding:0px;\" width=\"12px\"><div class='contextMenuButton' title=\"",tooltip,"\" id='img_",id,"' onclick='",contextMenu,".addContextValue(\"name\",\"",id,"\"); ",contextMenu,".addContextValue(\"id\",\"",id,"\"); ",contextMenu,".display(\"img_",id,"\");'","onContextMenu='",contextMenu,".addContextValue(\"name\", \"",id,"\"); ",contextMenu,".addContextValue(\"id\",\"",id,"\"); ",contextMenu,".display(\"img_",id,"\"); return false'/></div></td></tr></table>"].join("");};com.pictet.apps.fnc.web.component.table.formatters.myfundCenterSimulationList_nameFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,properties){var id=iBeanAsAssociativeArray[properties.id];var simulationObject=properties.simulationObject;var linkedName=["<a style=\"color:#990000;\" href=\"",properties.link,"&id=",simulationObject.getId(id),"&tab=analysis\">",iUnformattedCellContent,"</a>"].join("");var nameContent=linkedName;if(properties.hasAutoDots){nameContent=["<table width=\"100%\" id=\"",properties.colName,"_dotsFormatter",lineNumber,"\" class=\"dotsFormatter\" style=\"table-layout: fixed;\" onmouseover=\"tooltip.makeAndShowTooltip('",properties.colName,"_dotsFormatter",lineNumber,"', '",escape(iUnformattedCellContent),"',101)\"><tr><td><div class=\"heightControl\" id=\"",properties.colName,"_dotdotHeightControl",lineNumber,"\"><div class=\"dotdotText\" id=\"",properties.colName,"_dotdotText",lineNumber,"\">",linkedName,"</div></div></td><td class=\"dotdot\" style=\"display:none\" id=\"",properties.colName,"_dotdot",lineNumber,"\" width=\"16px\" ><div class=\"dotdotImg\" style=\"color:#990000;\">...</div></td></tr></table>"].join("")}
return["<table width=\"100%\" style=\"table-layout:fixed;\"><tr><td class=\"simulationName\" style=\"border:0px;margin:0px;padding:0px;\">",nameContent,"</td><td style=\"border:0px;margin:0px;padding:0px;\" width=\"12px\"><div class='contextMenuButton' title=\"",properties.contextMenuTooltip,"\" id='img_",id,"' onclick='contextMenuId.addContextValue(\"name\",\"",id,"\"); contextMenuId.addContextValue(\"id\",\"",id,"\"); contextMenuId.display(\"img_",id,"\");'","onContextMenu='contextMenuId.addContextValue(\"name\", \"",id,"\"); contextMenuId.addContextValue(\"id\",\"",id,"\"); contextMenuId.display(\"img_",id,"\"); return false'/></div></td></tr></table>"].join("");};com.pictet.apps.fnc.web.component.table.formatters.multiValuedCellFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){if(iBeanAsAssociativeArray[propertiesObject.dispTooltipKey]){return["<div onmouseover=\"tooltip.makeAndShowTooltip('",propertiesObject.colName,"_dotsFormatter",lineNumber,"', '",escape(iBeanAsAssociativeArray[propertiesObject.dispTooltipKey]),"')\"><table width=\"100%\" id=\"",propertiesObject.colName,"_dotsFormatter",lineNumber,"\" class=\"dotsFormatter\" style=\"table-layout: fixed;\" ><tr><td><div class=\"heightControl\" id=\"",propertiesObject.colName,"_dotdotHeightControl",lineNumber,"\"><div class=\"dotdotText\" id=\"",propertiesObject.colName,"_dotdotText",lineNumber,"\">",iUnformattedCellContent,"</div></div></td><td class=\"dotdot\" id=\"",propertiesObject.colName,"_dotdot",lineNumber,"\" width=\"16px\"><div class=\"dotdotImg\">...</div></td></tr></table></div>"].join("");}
return preformattedContent;}
com.pictet.apps.fnc.web.component.table.formatters.tooltipCellFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,propertiesObject){var aStr;var divId=[propertiesObject.prefix,iBeanAsAssociativeArray[propertiesObject.cellId]].join("");if(typeof(propertiesObject.cssStyle)!="undefined"){aStr=["<div style='",propertiesObject.cssStyle,"'"];}else if(typeof(propertiesObject.cssClass)!="undefined"){aStr=["<div class='",propertiesObject.cssClass,"'"];}else{aStr=["<div"];}
var tooltipValue=iBeanAsAssociativeArray[propertiesObject.tooltipKeyValue];if(tooltipValue){aStr.push(" id='",divId,"' onmouseover=\"",propertiesObject.tooltipId,".makeAndShowTooltip('",divId,"', '",escape(tooltipValue),"')\"");}
aStr.push(">",iUnformattedCellContent,"</div>");return aStr.join("");};com.pictet.apps.fnc.web.component.table.publicationIconFormatter=function(documentId,documentFormat,cellContent,winWidth,winHeight){return publicationSelector.getPublicationIcon(documentId,documentFormat,"","",cellContent,winWidth,winHeight);}
com.pictet.apps.fnc.web.component.table.formatters.selectableNameFormatter=function(iUnformattedCellContent,iBeanAsAssociativeArray,lineNumber,preformattedContent,properties){return["<div onClick=\"",properties.componentId,".selectCell('",lineNumber,"','",properties.selectId,"','",properties.selectId,"');\">",preformattedContent,"</div>"].join("");}
namespace("com.pictet.apps.fnc.web.component.table");com.pictet.apps.fnc.web.component.table.customHandler=function(pluralSelectionLabel,singleSelectionLabel,tableId,selectedItemCount,componentId){com.pictet.apps.fnc.web.component.table.changeLabel(pluralSelectionLabel,singleSelectionLabel,tableId,selectedItemCount,componentId);}
com.pictet.apps.fnc.web.component.table.sizeHandled=function(pluralSelectionLabel,singleSelectionLabel,tableId,selectedItemCount){com.pictet.apps.fnc.web.component.table.changeLabel(pluralSelectionLabel,singleSelectionLabel,tableId,selectedItemCount,"sizeCount");}
com.pictet.apps.fnc.web.component.table.selectAllHandler=function(pluralSelectionLabel,singleSelectionLabel,tableId,selectedItemCount){com.pictet.apps.fnc.web.component.table.changeLabel(pluralSelectionLabel,singleSelectionLabel,tableId,selectedItemCount,"selectedCount");}
com.pictet.apps.fnc.web.component.table.resetTableSelection=function(tableId){$("#selectedCount"+tableId).text("");}
com.pictet.apps.fnc.web.component.table.changeLabel=function(pluralSelectionLabel,singleSelectionLabel,tableId,selectedItemCount,componentId){if(selectedItemCount){if(selectedItemCount>1){$("#"+componentId+tableId).html(pluralSelectionLabel.replace('{0}',["<b>",selectedItemCount,"</b>"].join("")));}else if(selectedItemCount==1){$("#"+componentId+tableId).html(singleSelectionLabel.replace('{0}',["<b>",selectedItemCount,"</b>"].join("")));}else if(selectedItemCount==0){$("#"+componentId+tableId).html("");}}else{$("#"+componentId+tableId).text("");}}
namespace("com.pictet.apps.fnc.web.component.table");com.pictet.apps.fnc.web.component.table.headerCombobox=function(iComponentId,iComponentKey,iTable,iTableKey){com.pictet.apps.fnc.web.component.table.headerCombobox.superclass.constructor.call(this);this.componentId=iComponentId;this.componentKey=iComponentKey;this.table=iTable;this.tableKey=iTableKey;this.menu=null;this.selectedId="";this.selectedText="";this.displayText="";this.textWidth=0;};YAHOO.lang.extend(com.pictet.apps.fnc.web.component.table.headerCombobox,com.pictet.apps.fnc.web.component.abstractcomponent.AbstractComponent);com.pictet.apps.fnc.web.component.table.headerCombobox.prototype.setSelected=function(id,text){this.selectedId=id;this.selectedText=text;};com.pictet.apps.fnc.web.component.table.headerCombobox.prototype.generate=function(iContextMenu){this.menu=iContextMenu;var aStr=["<div id=\"",this.componentId,"\" class=\"headerInlineCombo\" ><div class=\"contextMenuButton\" id=\"img_",this.componentId,"\" ></div>","<div id=\"div_",this.componentId,"\" class=\"inlinecomboText\">",this.selectedText,"</div></div>"];var instance=this;$("#column_"+this.table.componentId+"_"+this.tableKey+"_title_text").append(aStr.join("")).click(function(e){instance.menu.display("img_"+instance.componentId);return false;});var widthFound=100;for(var aColumn=0;aColumn<this.table.columnDefinitions.length;aColumn++){if(this.table.columnDefinitions[aColumn].key==this.tableKey){widthFound=this.table.columnDefinitions[aColumn].width;}}
this.textWidth=widthFound-17-1-5-35;$("#div_"+this.componentId).width(this.textWidth);var hiddenTitles=$("#"+this.table.componentId+" tr.title th.hidden").removeClass("hidden").addClass("notVisible");$("#"+this.table.componentId+" tr.title th").height($("#"+this.table.componentId+" tr.title").height());hiddenTitles.addClass("hidden").removeClass("notVisible");this.formatAndAddText();};com.pictet.apps.fnc.web.component.table.headerCombobox.prototype.itemClicked=function(id,text){this.selectedId=id;this.selectedText=text;this.formatAndAddText();var added=false;for(var aIdx=0;aIdx<this.table.externalFiltersSubmittedValue.length;aIdx++){if(this.table.externalFiltersSubmittedValue[aIdx].key==this.componentKey){this.table.externalFiltersSubmittedValue[aIdx].filterValue=id;added=true;break;}}
if(!added){this.table.externalFiltersSubmittedValue.push({key:this.componentKey,filterValue:id});}
this.table.resetTableAndReloadElements();};com.pictet.apps.fnc.web.component.table.headerCombobox.prototype.formatAndAddText=function(){var text=this.selectedText;if(text.length*7>this.textWidth){var len=(this.textWidth-21)/7;text=text.substr(0,len)+"...";}
$("#div_"+this.componentId).text(text).attr("title",this.selectedText);}
com.pictet.apps.fnc.web.component.table.headerCombobox.prototype.getType=function(){return"headerCombobox";};com.pictet.apps.fnc.web.component.table.headerCombobox.prototype.getValueAsStr=function(){return this.selectedId;};