function IFactorPanelsHandler(A){this.parent=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(G,D,L,F){var H=this.panelDefinition[G];if(H==null){alert("Panel not defined!");return }var K=false;var B=this.overlayManager.find(G);if(B==null){var N=new Object();var A;for(A in H){var C=H[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](H)}}else{if(A=="xy"){if(this.valueIsTypeOf(C,"String")){C=this[C](H)}}}}if(C!=null){N[A]=C}}this.setDefaultValues(N);B=new YAHOO.widget.Panel(G,N);B.hideEvent.subscribe(function(){window.document.getElementById(G).style.display="none";B.isOpen=false});B.render();this.overlayManager.register([B]);K=true}B.params=F;if(D!=null){if(YAHOO.util.Event.addListener(D,"click")==false){YAHOO.util.Event.addListener(D,"click",B.show,B,true)}}var J=this.findOutIfOnlyFirstTime(H);if(!J||J&&K){var I;if(L!=null){I=L}else{I=this.getPanelElementContent(H,"header",F)}if(I!=null){B.setHeader(I)}var M=this.getPanelElementContent(H,"body",F);if(M!=null){B.setBody(M)}var E=this.getPanelElementContent(H,"footer",F);if(E!=null){B.setFooter(E)}}window.document.getElementById(G).style.display="block";this.overlayManager.bringToTop(G);if(K||D==null){B.show()}this.overlayManager.focus(G);B.isOpen=true};IFactorPanelsHandler.prototype.hidePanel=function(B){var A=this.overlayManager.find(B);if(A!=null){A.hide()}};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,C){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,C)}else{if(panelElementDef.type=="iframe"){str="<iframe";var D;for(D in panelElementDef.properties){val=panelElementDef.properties[D];if(val!=null){str=str+" "+D+'="'+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.parent.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.parent.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.parent.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};
