function IFactorPanelsHandler(A){this.stormCenter=A;this.overlayManager=new YAHOO.widget.OverlayManager();this.panelDefinition=null}IFactorPanelsHandler.configPanelsDefinition=[];IFactorPanelsHandler.prototype.loadPanelsConfiguration=function(){var B;this.panelDefinition=new Object();for(B=0;B<IFactorPanelsHandler.configPanelsDefinition.length;B++){var A=IFactorPanelsHandler.configPanelsDefinition[B];this.panelDefinition[A.panel_name]=A}};IFactorPanelsHandler.prototype.showPanel=function(F,D){var G=this.panelDefinition[F];if(G==null){alert("Panel not defined!");return }var J=false;var B=this.overlayManager.find(F);if(B==null){var L=new Object();var A;for(A in G){var C=G[A];if(A=="panel_name"||A=="header"||A=="footer"||A=="body"||A=="panel_reload_event"){continue}else{if(A=="x"||A=="y"){if(this.valueIsTypeOf(C,"String")){C=this[C](G)}}else{if(A=="xy"){if(this.valueIsTypeOf(C,"String")){C=this[C](G)}}}}if(C!=null){L[A]=C}}this.setDefaultValues(L);B=new YAHOO.widget.Panel(F,L);B.hideEvent.subscribe(function(){window.document.getElementById(F).style.display="none"});B.render();this.overlayManager.register([B]);J=true}if(D!=null){if(YAHOO.util.Event.addListener(D,"click")==false){YAHOO.util.Event.addListener(D,"click",B.show,B,true)}}var I=this.findOutIfOnlyFirstTime(G);if(!I||I&&J){var H=this.getPanelElementContent(G,"header");if(H!=null){B.setHeader(H)}var K=this.getPanelElementContent(G,"body");if(K!=null){B.setBody(K)}var E=this.getPanelElementContent(G,"footer");if(E!=null){B.setFooter(E)}}window.document.getElementById(F).style.display="block";this.overlayManager.bringToTop(F);if(J||D==null){B.show()}this.overlayManager.focus(F)};IFactorPanelsHandler.prototype.valueIsTypeOf=function(B,A){if(B==null){if(A=="null"){return true}else{return false}}return(B.constructor.toString().indexOf(A)!=-1)};IFactorPanelsHandler.prototype.setDefaultValues=function(A){if(A.x==null&&A.y==null&&A.xy==null&&A.fixedcenter==null){A.fixedcenter=true}if(A.close==null){A.close=true}if(A.constraintoviewport==null){A.constraintoviewport=true}if(A.visible==null){A.visible=false}if(A.draggable==null){A.draggable=true}if(A.zIndex==null){A.zIndex=10000}};IFactorPanelsHandler.prototype.findOutIfOnlyFirstTime=function(A){onlyFirstTime=true;eventList=A.panel_reload_event;if(eventList!=null){var B;for(B=0;B<eventList.length;B++){eventName=eventList[B];if(eventName=="OnPanelOpen"){onlyFirstTime=false;break}}}return onlyFirstTime};IFactorPanelsHandler.prototype.getPanelElementContent=function(B,A){res=null;panelElementDef=B[A];if(panelElementDef==null){return null}if(panelElementDef.type=="text"){res=panelElementDef.properties.text}else{if(panelElementDef.type=="custom"){res=this[panelElementDef.properties.custom_method](B)}else{if(panelElementDef.type=="iframe"){str="<iframe";var C;for(C in panelElementDef.properties){val=panelElementDef.properties[C];if(val!=null){str=str+" "+C+'="'+val+'"'}}str=str+"></iframe>";res=str}}}return res};IFactorPanelsHandler.prototype.getWindowWidth=function(){var A;if(window.innerWidth){A=window.innerWidth}else{if(document.documentElement.clientWidth==0){A=document.body.clientWidth}else{A=document.documentElement.clientWidth}}return A};IFactorPanelsHandler.prototype.getWindowHeight=function(){var A;if(window.innerHeight){A=window.innerHeight}else{if(document.documentElement.clientHeight==0){A=document.body.clientHeight}else{A=document.documentElement.clientHeight}}return A};IFactorPanelsHandler.prototype.getPixelsAsNumber=function(A){if(A==null||A==""){return null}else{if(this.valueIsTypeOf(A,"Number")){return A}else{if(this.valueIsTypeOf(A,"String")){A=A.replace("px","");return parseInt(A)}else{return null}}}};IFactorPanelsHandler.prototype.getAproxMidCoordX=function(B){var G;var C=250;var A=this.getWindowWidth();var E=B.width;E=this.getPixelsAsNumber(E);if(E!=null){G=Math.round(E/2)}else{G=C}var F=Math.round(A*0.5);var D=Math.round(F-G);return D};IFactorPanelsHandler.prototype.getAproxMidCoordY=function(C){var G;var F=200;var B=this.getWindowHeight();var D=C.height;D=this.getPixelsAsNumber(D);if(D!=null){G=Math.round(D/2)}else{G=F}var A=Math.round(B*0.5);var E=Math.round(A-G);return E};IFactorPanelsHandler.prototype.getAproxMidCoordXY=function(A){var C=this.getAproxMidCoordX(A);var B=this.getAproxMidCoordY(A);return[C,B]};IFactorPanelsHandler.prototype.getAlertsPanelText=function(A){return this.stormCenter.getAlertsPanelBodyTxt()};IFactorPanelsHandler.prototype.createCustomerChart=function(C){var B,F;var E=this.getPixelsAsNumber(C.width);if(E==null){B=550}else{B=E-20}var G=this.getPixelsAsNumber(C.height);if(G==null){F=570}else{F=G-30}var A=this.stormCenter.getFullPathCustomerChartFile();var D="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='"+B+"px' height='"+F+"px' id='customerfusionchart'>";D=D+"<param name='movie' value='flashcharts/FC_2_3_MSColumnLine_DY_2D.swf'/>";D=D+"<param name='FlashVars' value='&dataURL="+A+"&chartWidth="+B+"&chartHeight="+F+"'/>";D=D+"<param name='quality' value='high'/>";D=D+"<param name='bgcolor' value='#FFFFFF'/>";D=D+"<embed src='flashcharts/FC_2_3_MSColumnLine_DY_2D.swf' flashvars='&dataURL="+A+"' quality='high' bgcolor='#FFFFFF' width='"+B+"px' height='"+F+"px' name='customerfusionchart' type='application/x-shockwave-flash' pluginspace='http://www.macromedia.com/go/getflashplayer'></embed>";D=D+"</object>";return D};IFactorPanelsHandler.prototype.createProviderChart=function(B){var D=this.getPixelsAsNumber(B.width);if(D==null){w=450}else{w=D-20}var E=this.getPixelsAsNumber(B.height);if(E==null){h=350}else{h=E-30}var A=this.stormCenter.getFullPathProviderChartFile();var C="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='"+w+"px' height='"+h+"px' id='wholesalechart'>";C=C+"<param name='movie' value='flashcharts/FC_2_3_Column2D.swf'/>";C=C+"<param name='FlashVars' value='&dataURL="+A+"&chartWidth="+w+"&chartHeight="+h+"'/>";C=C+"<param name='quality' value='high'/>";C=C+"<param name='bgcolor' value='#FFFFFF'/>";C=C+"<embed src='flashcharts/FC_2_3_Column2D.swf' flashvars='&dataURL="+A+"' quality='high' bgcolor='#FFFFFF' width='"+w+"px' height='"+h+"px' name='wholesalechart' type='application/x-shockwave-flash' pluginspace='http://www.macromedia.com/go/getflashplayer'></embed>";C=C+"</object>";return C};