﻿Module.createNamespace('com.wjstc.WidgetMoveablePanel');Module.require('com.wjstc.Common',1.1);Module.require('com.wjstc.Util',1.1);com.wjstc.WidgetMoveablePanel.NAME='com.wjstc.WidgetMoveablePanel';com.wjstc.WidgetMoveablePanel.VERSION=1.1;com.wjstc.WidgetMoveablePanel.f='';com.wjstc.WidgetMoveablePanel.c={x:0,y:0,w:0,h:0,tw:0};com.wjstc.WidgetMoveablePanel.m='0';com.wjstc.WidgetMoveablePanel.MoveablePanel=function(v){v.cType='numId';var j=new com.wjstc.WidgetMoveablePanel.createMP(v);this.statusId=j.statusId;this.bodyId=j.bodyId;this.tableId=j.tableId;this.numId=j.numId;this.divId=j.divId;this.titleId=j.titleId;this.numId=j.numId;this.oConf=v;com.wjstc.HideSelectIE6.hs.registerObj(this.divId);return this;};com.wjstc.WidgetMoveablePanel.MoveablePanel.prototype.show=function(){var oConf={};com.wjstc.Util.addStyleProperties(oConf,com.wjstc.WidgetMoveablePanel.oDefaultPanelConfig);if(typeof(this.oConf)!='undefined'){if(!this.oConf||typeof(this.oConf)!='object'){throw new Error("Parameter this.oConf in function 'com.wjstc.WidgetMoveablePanel.MoveablePanel.prototype.show()' is not an Object.");return null;}else{com.wjstc.Util.addStyleProperties(oConf,this.oConf);}}com.wjstc.WidgetMoveablePanel.showMP(this.divId,this.titleId,oConf);return this;};com.wjstc.WidgetMoveablePanel.MoveablePanel.prototype.setZIndex=function(I){com.wjstc.Common.getObjById(this.divId).style.zIndex=I;};com.wjstc.WidgetMoveablePanel.MoveablePanel.prototype.getBodyId=function(){return com.wjstc.WidgetMoveablePanel.strId+'div_'+this.numId+'_body';};com.wjstc.WidgetMoveablePanel.MoveablePanel.prototype.getTitleId=function(){return com.wjstc.WidgetMoveablePanel.strId+'div_'+this.numId+'_title';};com.wjstc.WidgetMoveablePanel.MoveablePanel.prototype.getStatusId=function(){return com.wjstc.WidgetMoveablePanel.strId+'div_'+this.numId+'_status';};com.wjstc.WidgetMoveablePanel.MoveablePanel.prototype.close=function(){com.wjstc.WidgetMoveablePanel.closeMP(this.divId,this.numId);};com.wjstc.WidgetMoveablePanel.MoveablePanel.prototype.remove=function(){com.wjstc.WidgetMoveablePanel.removeMP(this.divId,this.numId);};com.wjstc.WidgetMoveablePanel.strId='wjstc_moveable_container_';com.wjstc.WidgetMoveablePanel.maxId=0;com.wjstc.WidgetMoveablePanel.G=[];com.wjstc.WidgetMoveablePanel.oDefaultPanelConfig={bodyStyle:"border:1px solid #6f9dd9;background-color:#ffffff;padding:6px;border-width:0 1px 1px 1px;font-family:Arial,Verdana,Helvetica,sans-serif;vertical-align:top;text-align:center;",bodyWidth:"28em",bodyHeight:"12em",containerStyle:"border:1px solid #6f9dd9;background-color:#bbd8fc;padding:1px;",containerPosition:"xy",containerX:"18em",containerY:"8em",containerBottomTitle:'N',replaceHeader:'N',modal:'N',zIndexValue:38,titleText:'Moveable Panel',titleStyle:"font-family:Arial,Verdana,Helvetica,sans-serif;border:1px solid #6f9dd9;padding:2px;background-color:#80ffff;text-align:center;vertical-align:middle;cursor:default;",titleMouseOverStyle:"border-color:#888888;background-color:#FFD494;cursor:move;",titleMouseDownStyle:"background-color:#FFB874;",resizable:'Y',statusStyle:"font-family:Arial,Verdana,Helvetica,sans-serif;border:0px solid #999999;padding:1px;background-color:#ECE9D8;text-align:left;vertical-align:middle;cursor:default;",visibilityValue:'visible',showStatusBar:'N',onInfoFn:"com.wjstc.WidgetMoveablePanel.aboutMP(event);",onBodyMouseDownFn:'',onBodyClickFn:'',allowToPrint:'N',onresizeFn:''};com.wjstc.WidgetMoveablePanel.createMP=function(oPanelConfig,event){var oConf={};com.wjstc.Util.addStyleProperties(oConf,com.wjstc.WidgetMoveablePanel.oDefaultPanelConfig);if(typeof(oPanelConfig)!='undefined'){if(!oPanelConfig||typeof(oPanelConfig)!='object'){throw new Error("Parameter oPanelConfig in function 'com.wjstc.WidgetMoveablePanel.createMP=function(oPanelConfig)' is not an Object.");return null;}else{com.wjstc.Util.addStyleProperties(oConf,oPanelConfig);}}var d=null;var numId=com.wjstc.WidgetMoveablePanel.getNumId();var divId=com.wjstc.WidgetMoveablePanel.strId+'div_'+numId;var titleId=divId+"_title";var statusId=divId+"_status";var resizerId=divId+"_resizer";var bodyId=divId+"_body";var tableId=divId+"_table";if(document.body){d=com.wjstc.Common.getObjById(divId);if(!d){d=document.createElement('div');d.id=divId;d.style.visibility='hidden';d.style.zIndex=oConf.zIndexValue;d.style.display='block';d.style.position='absolute';d.style.border='0px solid red';document.body.appendChild(d);}else{if(d.style.display!='none'){com.wjstc.Fading.fs.unregisterObj(divId);com.wjstc.HideSelectIE6.hs.unregisterObj(name);}}com.wjstc.Common.moveToXY(d,10000,10000);d.style.visibility='hidden';d.style.display='block';com.wjstc.Util.addStyleProperties(d.style,com.wjstc.Util.CSStoJSobj(oConf.containerStyle));var ss="<table id='"+tableId+"' cellspacing='0' cellpadding='0' style='border:0px solid #6f9dd9;' onclick='"+oConf.onBodyClickFn+"' onmousedown='"+oConf.onBodyMouseDownFn+"'>"+"<tr><td id='"+titleId+"_td' style=\""+oConf.titleStyle+"border-right-width:0;height:1.4em;position:relative;\""+" ondblclick=\"com.wjstc.WidgetMoveablePanel.closeMP('"+divId+"',"+numId+");\""+" onmousedown=\""+oConf.onBodyMouseDownFn+com.wjstc.Util.CSStoJScode(oConf.titleMouseDownStyle)+"com.wjstc.DragDrop.drag(com.wjstc.Common.getObjById('"+divId+"'),event,null,com.wjstc.WidgetMoveablePanel.hideSelectMC,null);\" "+" onmouseup=\""+com.wjstc.Util.CSStoJScode(oConf.titleMouseOverStyle)+"\""+" onmouseover=\""+com.wjstc.Util.CSStoJScode(oConf.titleMouseOverStyle);if(oConf.replaceHeader=='Y'){ss+="com.wjstc.Common.getObjById('"+titleId+"').innerHTML='Drag to move...';";}ss+="\" onmouseout=\""+com.wjstc.Util.CSStoJScode(oConf.titleStyle+'border-right-width:0;');if(oConf.replaceHeader=='Y'){ss+="com.wjstc.Common.getObjById('"+titleId+"').innerHTML='"+com.wjstc.Util.quoteProtect(oConf.titleText)+"';";}ss+="\">"+"<p id='"+titleId+"' style='display:inline;text-align:left;padding:0;margin:0;border:0px solid red;'>"+oConf.titleText+"<\/p>";if(!com.wjstc.Util.tmp2){ss+="<div style=\""+";cursor:pointer;width:1.4em;"+oConf.titleStyle+"position:absolute;top:1px;right:"+((oConf.allowToPrint=='Y')?3.4:1.7)+"em;font-weight:normal;text-align:center;\" "+" onmouseover=\""+com.wjstc.Util.CSStoJScode(oConf.titleMouseOverStyle+"font-weight:normal;text-align:center;")+"this.style.width='1.7em';this.style.cursor='pointer';if(typeof(com)!='undefined'){"+oConf.onInfoFn+"};"+"if (event.stopPropagation){event.stopPropagation();}else{event.cancelBubble = true;};"+"if (event.preventDefault){event.preventDefault();}else{event.returnValue = false;};return false;\" "+" onmouseout=\""+com.wjstc.Util.CSStoJScode(oConf.titleStyle+"font-weight:normal;text-align:center;")+"this.style.width='1.7em';return false;\""+">?<\/div>";}if(oConf.allowToPrint=='Y'){ss+="<div align='center' style=\""+";cursor:pointer;width:1.4em;"+oConf.titleStyle+"background-image: url(img/print.gif);background-position:center;background-repeat: no-repeat;position:absolute;top:1px;right:1.7em;\" "+" onclick=\"com.wjstc.WidgetMoveablePanel.printMP('"+divId+"',"+numId+");return false;\" "+" onmouseover=\""+com.wjstc.Util.CSStoJScode(oConf.titleMouseOverStyle)+"this.style.width='1.4em';this.style.cursor='pointer';"+"if (event.stopPropagation){event.stopPropagation();}else{event.cancelBubble = true;};"+"if (event.preventDefault){event.preventDefault();}else{event.returnValue = false;};return false;\" "+" onmouseout=\""+com.wjstc.Util.CSStoJScode(oConf.titleStyle)+"this.style.width='1.4em';return false;\""+">&nbsp;<\/div>";}ss+="<div align='center' style=\""+";cursor:pointer;width:1.4em;"+oConf.titleStyle+"background-image: url(img/close3.gif);background-position:center;background-repeat: no-repeat;position:absolute;top:1px;right:1px;\" "+" onclick=\"com.wjstc.WidgetMoveablePanel.closeMP('"+divId+"',"+numId+");return false;\" "+" onmouseover=\""+com.wjstc.Util.CSStoJScode(oConf.titleMouseOverStyle)+"this.style.width='1.4em';this.style.cursor='pointer';"+"if (event.stopPropagation){event.stopPropagation();}else{event.cancelBubble = true;};"+"if (event.preventDefault){event.preventDefault();}else{event.returnValue = false;};return false;\" "+" onmouseout=\""+com.wjstc.Util.CSStoJScode(oConf.titleStyle)+"this.style.width='1.4em';return false;\""+">&nbsp;<\/div>";ss+="<\/td>";if(oConf.resizable=='Y'){ss+="<\/tr><tr><td colspan='1' style='position:relative;'>"+"<div id='"+bodyId+"' "+"style=\"border:1px solid #6f9dd9;border-bottom-color:#bbd8fc;padding:0px;"+"padding:0 2px 5px 0;overflow:hidden;margin:0;"+oConf.bodyStyle+((oConf.bodyWidth&&oConf.bodyWidth!='none')?"width:"+oConf.bodyWidth+";":"")+"height:"+oConf.bodyHeight+";\">"+"<\/div>"+"<div style=\"position:absolute;height:100%;"+"bottom:0px;"+"right:0px;"+"border:0px solid red;width:5px;z-index:"+((oConf.zIndexValue-0)+2)+";\""+" onmousedown=\"com.wjstc.WidgetMoveablePanel.getPhantomH(event,"+numId+",'H');"+"com.wjstc.DragDrop.drag(com.wjstc.DragDrop.dragHelper,event,com.wjstc.WidgetMoveablePanel.DownFn,"+"com.wjstc.WidgetMoveablePanel.MoveFn,com.wjstc.WidgetMoveablePanel.DropFn);\" "+" onmouseover=\"this.style.cursor='e-resize';\" "+" onmouseout=\"this.style.cursor='default';\">"+"<\/div>"+"<\/td>";}else{ss+="<\/tr><tr><td id='"+bodyId+"' colspan='1' style=\""+oConf.bodyStyle+((oConf.bodyWidth&&oConf.bodyWidth!='none')?"width:"+oConf.bodyWidth+";":"")+"\">"+"Body"+"<\/td>";}if(oConf.containerBottomTitle=='Y'){ss+="<tr><td colspan='1' id='"+titleId+"' style=\""+oConf.titleStyle+((oConf.bodyWidth&&oConf.bodyWidth!='none')?"width:"+oConf.bodyWidth+";":"")+";\""+" ondblclick=\"com.wjstc.WidgetMoveablePanel.closeMP('"+divId+"',"+numId+");\""+" onmousedown=\""+com.wjstc.Util.CSStoJScode(oConf.titleMouseDownStyle)+"com.wjstc.DragDrop.drag(com.wjstc.Common.getObjById('"+divId+"'),event,null,com.wjstc.WidgetMoveablePanel.hideSelectMC,null);\" "+" onmouseup=\""+com.wjstc.Util.CSStoJScode(oConf.titleMouseOverStyle)+"\""+" onmouseover=\""+com.wjstc.Util.CSStoJScode(oConf.titleMouseOverStyle)+"\""+" onmouseout=\""+com.wjstc.Util.CSStoJScode(oConf.titleStyle)+"\">Drag to move...<\/td>";}if(oConf.resizable=='Y'||oConf.showStatusBar=='Y'){ss+="<\/tr><tr><td colspan='1' style=\""+oConf.statusStyle+"position:relative;vertical-align:bottom;width:100%;height:100%;\"><p id='"+statusId+"' style=\"display:inline;text-align:left;padding:0;margin:0;border:0px solid red;\"><\/p>";if(oConf.resizable=='Y'){ss+="<div id='"+resizerId+"_resizer' style=\"position:absolute;"+"bottom:"+((com.wjstc.Util.isIEboth)?1:2)+"px;"+"right:"+((com.wjstc.Util.isIEboth)?1:2)+"px;"+"border:0px solid red;width:11px;height:11px;z-index:"+((oConf.zIndexValue-0)+3)+";background-image: url(img/drag.gif);background-position:center;background-repeat:no-repeat;\""+" onmousedown=\"com.wjstc.WidgetMoveablePanel.getPhantomH(event,"+numId+",'HV');"+"com.wjstc.DragDrop.drag(com.wjstc.DragDrop.dragHelper,event,com.wjstc.WidgetMoveablePanel.DownFn,"+"com.wjstc.WidgetMoveablePanel.MoveFn,com.wjstc.WidgetMoveablePanel.DropFn);\" "+" onmouseover=\"this.style.cursor='nw-resize';\" "+" onmouseout=\"this.style.cursor='default';\">"+"<\/div>";ss+="<div style=\"position:absolute;width:100%;"+"bottom:0px;"+"left:0px;"+"border:0px solid green;height:5px;z-index:"+((oConf.zIndexValue-0)+2)+";\""+" onmousedown=\"com.wjstc.WidgetMoveablePanel.getPhantomH(event,"+numId+",'V');"+"com.wjstc.DragDrop.drag(com.wjstc.DragDrop.dragHelper,event,com.wjstc.WidgetMoveablePanel.DownFn,"+"com.wjstc.WidgetMoveablePanel.MoveFn,com.wjstc.WidgetMoveablePanel.DropFn);\" "+" onmouseover=\"this.style.cursor='n-resize';\" "+" onmouseout=\"this.style.cursor='default';\">"+"<\/div>";}ss+="&nbsp;<\/td>";}ss+="<\/tr></table>";d.innerHTML=ss;var pos=oConf.containerPosition.toLowerCase();if(pos=="center"){com.wjstc.Util.moveToCenter(d);}else if(pos=="xy"){if(typeof(oConf.containerX)!='undefined'&&typeof(oConf.containerY)!='undefined'){com.wjstc.Common.moveAbsolutrToXY(d,oConf.containerX,oConf.containerY);}else{com.wjstc.Util.moveToCenter(d);}}else{if(typeof(event)!='undefined'){var L=(com.wjstc.Common.getMouseX(event)-0)+10;var H=(com.wjstc.Common.getMouseY(event)-0)+10;com.wjstc.Common.moveToXY(d,L,H);}else{com.wjstc.Util.moveToCenter(d);}}if(oConf.visibilityValue){d.style.visibility=oConf.visibilityValue;}else{d.style.visibility='visible';}}com.wjstc.WidgetMoveablePanel.showMP(divId,titleId,oConf);this.divId=divId;this.titleId=titleId;this.statusId=statusId;this.bodyId=bodyId;this.tableId=tableId;this.numId=numId;this.oConf=oConf;com.wjstc.WidgetMoveablePanel.G[numId]={titleId:titleId,numId:numId,oConf:oConf,divId:divId,statusId:statusId,bodyId:bodyId,tableId:tableId};if(typeof(oConf.cType)=='undefined'){return divId;}else{return{titleId:titleId,numId:numId,oConf:oConf,divId:divId,statusId:statusId,bodyId:bodyId,tableId:tableId};}};com.wjstc.WidgetMoveablePanel.aboutMP=function(evt){var s="<div><div style='overflow: visible; font-family:Helvetica,Arial,Verdana,sans-serif; font-size:0.92em;width:100%;"+"font-weight:normal; text-align: center; vertical-align: middle;"+" border: solid 1px #CCCCCC; background-color: #D0E0FE;'><br \/>"+com.wjstc.Util.t('Professional Moveable Panel Widget')+"<br \/>"+com.wjstc.Util.t('Version 1.1')+"<br \/>"+"<b>&copy;<\/b>&nbsp;2001-2008<br \/>"+"Ardent Edge LLC<br \/>"+"All Rights Reserved<br \/><br \/>"+com.wjstc.Util.t('For latest version please visit:')+"<br \/>"+"<b style='color:#0000FF;'>www.ardentedge.com<\/b><br \/><br \/>"+"<\/div><\/div>";com.wjstc.Util.tooltipStart(evt,s,{width:'17em',background:'#CFFFFE',padding:'5px 7px 5px 5px',border:'1px dotted #007C84',color:'#001644',font:'0.75em Arial,Helvetica,sans-serif'});};com.wjstc.WidgetMoveablePanel.hideSelectMP=function(){com.wjstc.HideSelectIE6.hs.hideShowHS();};com.wjstc.WidgetMoveablePanel.showMP=function(name,titleId,oConf){if(oConf.modal=='Y'){com.wjstc.Fading.fs.registerObj(name,titleId+'_td');}com.wjstc.Common.getObjById(name).style.display='';};com.wjstc.WidgetMoveablePanel.printMP=function(name,J){var k=com.wjstc.WidgetMoveablePanel.strId+'div_'+J+'_body';HTML_Print(com.wjstc.Common.getObjById(k).innerHTML);};com.wjstc.WidgetMoveablePanel.closeMP=function(name,numId){com.wjstc.Common.getObjById(name).style.display='none';com.wjstc.Fading.fs.unregisterObj(name);com.wjstc.HideSelectIE6.hs.unregisterObj(name);};com.wjstc.WidgetMoveablePanel.removeMP=function(name,numId){com.wjstc.Common.getObjById(name).style.display='none';com.wjstc.Fading.fs.unregisterObj(name);com.wjstc.HideSelectIE6.hs.unregisterObj(name);com.wjstc.Util.removeFromDOM(name);};com.wjstc.WidgetMoveablePanel.getNumId=function(){return com.wjstc.WidgetMoveablePanel.maxId++;};com.wjstc.WidgetMoveablePanel.getPhantomH=function(g,i,f){com.wjstc.WidgetMoveablePanel.m=i;com.wjstc.WidgetMoveablePanel.f='';if(typeof(f)!='undefined'){com.wjstc.WidgetMoveablePanel.f=f;}if(!com.wjstc.DragDrop.isDragging){com.wjstc.DragDrop.isDragging=true;if(com.wjstc.DragDrop.dragHelper==null){com.wjstc.DragDrop.dragHelper=document.createElement('div');com.wjstc.DragDrop.dragHelper.style.backgroundColor='yellow';com.wjstc.DragDrop.dragHelper.id='wjstc_DragDropHelper';com.wjstc.DragDrop.dragHelper.style.zIndex=100;com.wjstc.DragDrop.dragHelper.style.position='absolute';com.wjstc.DragDrop.dragHelper.style.padding='0';com.wjstc.DragDrop.dragHelper.style.display='none';com.wjstc.DragDrop.dragHelper.style.border='1px dotted #000000';document.body.appendChild(com.wjstc.DragDrop.dragHelper);}else{com.wjstc.DragDrop.dragHelper=com.wjstc.Common.getObjById('wjstc_DragDropHelper');}com.wjstc.DragDrop.dragHelper.innerHTML="";com.wjstc.Common.moveToXY(com.wjstc.DragDrop.dragHelper,com.wjstc.Common.getMouseX(g),com.wjstc.Common.getMouseY(g));com.wjstc.Util.setOpacity(com.wjstc.DragDrop.dragHelper,75);com.wjstc.DragDrop.dragHelper.style.display='none';if(com.wjstc.WidgetMoveablePanel.f=='V'){document.body.style.cursor='n-resize';}else if(com.wjstc.WidgetMoveablePanel.f=='H'){document.body.style.cursor='e-resize';}else if(com.wjstc.WidgetMoveablePanel.f=='HV'||com.wjstc.WidgetMoveablePanel.f=='VH'){document.body.style.cursor='nw-resize';}}};com.wjstc.WidgetMoveablePanel.DownFn=function(etd,g){var k=com.wjstc.WidgetMoveablePanel.strId+'div_'+com.wjstc.WidgetMoveablePanel.m+'_body';com.wjstc.WidgetMoveablePanel.c.o=com.wjstc.Common.getW(k);com.wjstc.WidgetMoveablePanel.c.l=com.wjstc.Common.getH(k);com.wjstc.WidgetMoveablePanel.c.C=com.wjstc.Common.getMouseX(g);com.wjstc.WidgetMoveablePanel.c.B=com.wjstc.Common.getMouseY(g);var K=com.wjstc.WidgetMoveablePanel.strId+'div_'+com.wjstc.WidgetMoveablePanel.m+"_title";com.wjstc.WidgetMoveablePanel.c.F=com.wjstc.Common.getW(K)+30;com.wjstc.DragDrop.dragHelper.innerHTML='';};com.wjstc.WidgetMoveablePanel.MoveFn=function(etd,g){var C=com.wjstc.Common.getMouseX(g);var r=C-com.wjstc.WidgetMoveablePanel.c.C;var B=com.wjstc.Common.getMouseY(g);var A=B-com.wjstc.WidgetMoveablePanel.c.B;com.wjstc.WidgetMoveablePanel.ajustPane(r,A);};com.wjstc.WidgetMoveablePanel.ajustPane=function(r,A){var k=com.wjstc.WidgetMoveablePanel.strId+'div_'+com.wjstc.WidgetMoveablePanel.m+'_body';if(com.wjstc.WidgetMoveablePanel.f.indexOf('H')>=0){var o=(com.wjstc.WidgetMoveablePanel.c.o-0)+(r-0)-14;if(o<com.wjstc.WidgetMoveablePanel.c.F){o=com.wjstc.WidgetMoveablePanel.c.F;}com.wjstc.Common.getObjById(k).style.width=o+'px';}if(com.wjstc.WidgetMoveablePanel.f.indexOf('V')>=0){var l=(com.wjstc.WidgetMoveablePanel.c.l-0)+(A-0)-13;if(l<0){l=0;}com.wjstc.Common.getObjById(k).style.height=l+'px';}eval(com.wjstc.WidgetMoveablePanel.G[com.wjstc.WidgetMoveablePanel.m].oConf.onresizeFn);};com.wjstc.WidgetMoveablePanel.DropFn=function(etd,ev,moved){document.body.style.cursor='default';var D=com.wjstc.DragDrop.dragHelper;com.wjstc.HideSelectIE6.hs.unregisterObj(D.divId);D.style.display='none';com.wjstc.Util.removeFromDOM(D);com.wjstc.DragDrop.dragHelper=null;com.wjstc.DragDrop.isDragging=false;}