microstrategy.HTMLATTR_SIZES="SIZES";microstrategy.HTMLATTR_SIZES_DELIM=",";microstrategy.HTMLATTR_DRAG_DISABLED=0;microstrategy.HTMLATTR_DRAG_ENABLED=1;mstrDialogImpl.prototype=new mstrBoneImpl();mstrDialogImpl.prototype.titleBar=null;mstrDialogImpl.prototype.topPosition=null;mstrDialogImpl.prototype.leftPosition=null;mstrDialogImpl.prototype.rect=null;mstrDialogImpl.prototype.isMidDrag=false;mstrDialogImpl.prototype.closeAfterDrag=false;mstrDialogImpl.prototype.afterresize=null;mstrDialogImpl.prototype.errorMessage=null;mstrDialogImpl.prototype.resizeHorizontally=false;mstrDialogImpl.prototype.resizeVertically=false;mstrDialogImpl.prototype.focusFieldId=null;mstrDialogImpl.prototype.onselectstartFn=null;mstrDialogImpl.prototype.onload=function(){try{this.initDialog();this.initErrorMessage();}catch(err){microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.initDialog=function(){try{this.initBone();this.isDraggable=((parseInt(this.elem.getAttribute("dg"))&1)!=0);this.initTitleBar();this.initBody();this.initStatusBar();this.addListeners();this.setFocus();}catch(err){microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.addListeners=function(){if(typeof (mstr)!="undefined"){this.attachWinListener(this,"resize","onresize");}else{document.onresize=new Function("e","return microstrategy.bone('"+this.id+"').onresize(e);");}};mstrDialogImpl.prototype.initErrorMessage=function(){try{if(this.errorMessage){this.renderErrorMessage();}}catch(err){microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.initResize=function(){try{if(this.elem){this.resizeLevel=parseInt(this.elem.getAttribute(microstrategy.HTMLATTR_RESIZE));if(this.resizeLevel&&!isNaN(this.resizeLevel)){if(this.resizeLevel&microstrategy.RESIZE_VERTICAL){this.resizeVertically=true;}if(this.resizeLevel&microstrategy.RESIZE_HORIZONTAL){this.resizeHorizontally=true;}}if(this.resizeVertically||this.resizeHorizontally){this.initResizeHandles();this.moveResizeHandles();}}}catch(err){microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.renderErrorMessage=function(){try{showMessage({contents:this.errorMessage,elements:microstrategy.OK_BUTTON,okEval:"microstrategy.bone('"+this.id+"').onCloseErrorMessage()",type:mstrMsgBoxImpl.MSG_ERROR});}catch(err){microstrategy.errors.log(err);}};mstrDialogImpl.prototype.onCloseErrorMessage=function(){try{this.setFocus();}catch(err){microstrategy.errors.log(err);}};mstrDialogImpl.prototype.initTitleBar=function(){try{if(this.elem){this.titleBar=microstrategy.subObjectFind(this.elem,["DIV","TD","TR"],microstrategy.SUBOBJTYPE_TITLEBAR);if(this.titleBar){var isDraggable=this.elem.getAttribute(microstrategy.HTMLATTR_DRAG);isDraggable=(!isNaN(parseInt(isDraggable)))?parseInt(isDraggable):microstrategy.HTMLATTR_DRAG_DISABLED;if(isDraggable&microstrategy.HTMLATTR_DRAG_ENABLED){this.titleBar.onmousedown=new Function("e","return microstrategy.bone('"+this.id+"').ondragdialogmousedown(e);");}}}return true;}catch(err){microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.closeDialog=function(){try{if(this.isMidDrag){this.closeAfterDrag=true;return ;}this.closeAfterDrag=false;var start=2;this.fadeOut(start);}catch(err){microstrategy.errors.log(err);}};mstrDialogImpl.prototype.fadeOut=function(i){try{i=i-2;if(false){window.setTimeout("microstrategy.bone('"+this.id+"').fadeOut("+i+")",0);}else{this.elem.style.visibility="hidden";togglePulldowns(this.elem,true);var end=parseInt(this.elem.getAttribute("op"));end=90;if(isNaN(end)||end<1){end=100;}}}catch(err){microstrategy.errors.log(err);}};mstrDialogImpl.prototype.ondragdialogmousedown=function(e){try{this.onselectstartFn=document.onselectstart;if(!e){e=window.event;}var src=getEventTarget(e);if(src.tagName=="IMG"){return false;}document.onselectstart=function(){return false;};this.rect=getElementById(this.id+"_dg");if(this.rect==null){var dragNode=document.createElement("div");dragNode.id=this.id+"_dg";dragNode.className="dragRect";this.elem.appendChild(dragNode);this.rect=dragNode;}if(typeof (mstr)!="undefined"){this.attachWinListener(this,"mousemove","ondragdialogstart");this.attachWinListener(this,"mouseup","onmouseup");}else{document.onmousemove=new Function("e","return microstrategy.bone('"+this.id+"').ondragdialogstart(e);");document.onmouseup=new Function("e","return microstrategy.bone('"+this.id+"').onmouseup(e);");}}catch(err){this.hideDragVisualCue();microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.ondragdialogstart=function(e){try{if(!e){e=window.event;}if(e.e){e=e.e;}var failed=false;if(this.rect){if(typeof (mstr)!="undefined"){this.attachWinListener(this,"mousemove","ondragdialog");this.attachWinListener(this,"mouseup","ondragdialogend");}else{document.onmousemove=new Function("e","return microstrategy.bone('"+this.id+"').ondragdialog(e);");document.onmouseup=new Function("e","return microstrategy.bone('"+this.id+"').ondragdialogend(e);");}this.isMidDrag=true;this.rect.style.display="block";this.rect.style.visibility="visible";getMouse(e);var parent=microstrategy.findAncestor(getEventTarget(e));if(parent!=null){this.leftPosition=lMouseX;this.topPosition=lMouseY;if(this.rect){this.rect.style.width=getObjWidth(this.elem)+"px";this.rect.style.height=getObjHeight(this.elem)+"px";}this.ondragdialog(e);}else{failed=true;}}else{failed=true;}if(failed){this.hideDragVisualCue();this.isMidDrag=false;this.onmouseup(e);}return false;}catch(err){this.hideDragVisualCue();this.isMidDrag=false;this.onmouseup(e);microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.ondragdialogend=function(e){try{this.isMidDrag=false;if(!e){e=window.event;}if(e.e){e=e.e;}this.onmouseup(e);getMouse(e);togglePulldowns(this.elem,true);if(this.rect!=null){var newX=getObjSumLeft(this.rect);var newY=getObjSumTop(this.rect);if(newX<0){newX=1;}if(newY<0){newY=1;}this.move(newX,newY);this.hideDragVisualCue();}if(this.closeAfterDrag){this.closeDialog();}return false;}catch(err){microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.resizePopUp=function resizePopUp(elem){try{if(elem){var popupMask=elem.getAttribute("popupMask");if(popupMask){var w=getObjWidth(elem);w=w||getObjInnerWidth(elem);var h=getObjHeight(elem);h=h||getObjInnerHeight(elem);popupMask.style.width=w+"px";popupMask.style.height=h+"px";}}}catch(err){microstrategy.errors.log(err);}};mstrDialogImpl.prototype.onresize=function(e){this.resizePopUp(this.elem);};mstrDialogImpl.prototype.hideDragVisualCue=function(){try{if(this.rect){this.rect.style.visibility="hidden";this.rect.style.display="none";}return false;}catch(err){microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.ondragdialog=function(e){try{if(!e){e=window.event;}if(e.e){e=e.e;}getMouse(e);moveObjTo(this.rect,lMouseX-this.leftPosition,lMouseY-this.topPosition);}catch(err){microstrategy.errors.log(err);}return false;};mstrDialogImpl.prototype.move=function(newX,newY){try{if(this.moveTo(newX,newY)){var um=microstrategy.updateManager;if(um&&this.beanPath){var ac=[];ac.push(um.createActionObject(this.elem,mstrUpdateManager.SET_TOPLEFT_POSITION,this.beanPath,["73001","73002"],[getObjTop(this.elem),getObjLeft(this.elem)],[]));um.add(ac,true);}}}catch(err){microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.moveTo=function(newX,newY){try{newX=Math.floor(newX);newY=Math.floor(newY);if(newX!=getObjLeft(this.elem)||newY!=getObjTop(this.elem)||newX==0||newY==0){moveObjTo(this.elem,newX,newY);}togglePulldowns(this.elem,false);return true;}catch(err){microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.initBody=function(){try{if(this.elem){this.body=microstrategy.subObjectFind(this.elem,["DIV","TD"],microstrategy.SUBOBJTYPE_BODY);}return true;}catch(err){microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.initStatusBar=function(){try{if(this.elem){this.statusBar=microstrategy.subObjectFind(this.elem,["DIV"],microstrategy.SUBOBJTYPE_STATUSBAR);}return true;}catch(err){microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.onCellResize=function(){this.moveResizeHandles();};mstrDialogImpl.prototype.initResizeHandles=function(){try{this.resizeBottom=document.createElement("img");this.resizeBottom.src=microstrategy.FOLDER_IMAGES+"1ptrans.gif";this.resizeBottom.style.position="absolute";this.resizeBottom.style.height="3px";this.resizeBottom.style.width="3px";if(!bIsIE4&&bIsW3C){this.resizeBottom.style.display="none";}if(this.resizeVertically){this.resizeBottom.style.cursor="n-resize";this.resizeBottom.onmousedown=new Function("e","return microstrategy.bone('"+this.id+"').onDialogResizeDown(e);");}this.elem.appendChild(this.resizeBottom);this.resizeRight=this.resizeBottom.cloneNode(true);this.resizeRight.style.width="3px";this.resizeRight.style.top="0px";if(this.resizeHorizontally){this.resizeRight.style.cursor="e-resize";this.resizeRight.onmousedown=new Function("e","return microstrategy.bone('"+this.id+"').onDialogResizeDown(e);");}this.elem.appendChild(this.resizeRight);}catch(err){microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.moveResizeHandles=function(){try{if(this.resizeBottom==null){return false;}var cWidth=(this.elem.style!=null&&this.elem.style.width!=null&&this.elem.style.width.length>0&&parseInt(this.elem.style.width)==getObjWidth(this.elem))?parseInt(this.elem.style.width):getObjWidth(this.elem);var cHeight=(this.elem.style!=null&&this.elem.style.height!=null&&this.elem.style.height.length>0&&parseInt(this.elem.style.height)==getObjHeight(this.elem))?parseInt(this.elem.style.height):getObjHeight(this.elem);with(this.resizeBottom.style){width=cWidth+"px";top=(cHeight-3)+"px";left="0px";}with(this.resizeRight.style){height=cHeight+"px";left=(cWidth-3)+"px";top="0px";}if(!bIsIE4&&bIsW3C){this.resizeBottom.style.display="block";this.resizeRight.style.display="block";}}catch(err){microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.onDialogResizeDown=function(e){try{if(!e){e=window.event;}getMouse(e);this.resizeX=lMouseX;this.resizeY=lMouseY;this.resizeHandler=getEventTarget(e);if(typeof (mstr)!="undefined"){this.attachWinListener(this,"mousemove","onDialogResizeStart");this.attachWinListener(this,"mouseup","onmouseup");}else{document.onmousemove=new Function("e","return microstrategy.bone('"+this.id+"').onDialogResizeStart(e);");document.onmouseup=new Function("e","return microstrategy.bone('"+this.id+"').onmouseup(e);");}return false;}catch(err){microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.onDialogResizeStart=function(e){try{if(!e){e=window.event;}if(e.e){e=e.e;}document.body.style.cursor=this.resizeHandler.style.cursor;this.resizeRight.onmouseout=null;this.tempHandler=document.createElement("img");this.tempHandler.src=microstrategy.FOLDER_IMAGES+"1ptrans.gif";this.tempHandler.style.position="absolute";this.tempHandler.style.zIndex=10000;this.tempHandler.style.backgroundColor="#ffff00";if(this.resizeHandler.style.cursor.toLowerCase()=="e-resize"){this.tempHandler.style.left=getObjSumLeft(this.resizeRight);this.tempHandler.style.top=getObjSumTop(this.resizeRight);this.tempHandler.style.width="3px";this.tempHandler.style.height=this.resizeRight.style.height;}else{this.tempHandler.style.left=getObjSumLeft(this.resizeBottom);this.tempHandler.style.top=getObjSumTop(this.resizeBottom);this.tempHandler.style.width=this.resizeBottom.style.width;this.tempHandler.style.height="3px";}document.body.appendChild(this.tempHandler);if(this.resizeVertically){this.resizeBottom.style.cursor="n-resize";this.resizeBottom.style.height="3px";}if(typeof (mstr)!="undefined"){this.attachWinListener(this,"mousemove","onDialogResize");this.attachWinListener(this,"mouseup","onDialogResizeEnd");}else{document.onmousemove=new Function("e","return microstrategy.bone('"+this.id+"').onDialogResize(e);");document.onmouseup=new Function("e","return microstrategy.bone('"+this.id+"').onDialogResizeEnd(e);");}this.onDialogResize(e);return false;}catch(err){microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.onDialogResize=function(e){try{if(!e){e=window.event;}if(e.e){e=e.e;}getMouse(e);if(this.elem==null){return false;}this.resizeBottom.style.zIndex=-200;this.resizeRight.style.zIndex=-200;var oLeft=getObjSumLeft(this.elem);var oTop=getObjSumTop(this.elem);var deltaX=lMouseX-this.resizeX;var deltaY=lMouseY-this.resizeY;var minSize=135;if(this.resizeHandler.style.cursor.toLowerCase()=="e-resize"){if(lMouseX<(oLeft+minSize)){deltaX=minSize-getObjLeft(this.resizeHandler);this.resizeBottom.style.width=minSize+"px";}else{this.resizeBottom.style.width=getObjWidth(this.resizeBottom)+deltaX;}moveObjTo(this.resizeHandler,getObjLeft(this.resizeHandler)+deltaX,getObjTop(this.resizeHandler));moveObjTo(this.tempHandler,getObjSumLeft(this.resizeHandler)+deltaX,getObjSumTop(this.resizeHandler));}else{if(lMouseY<(oTop+minSize)){deltaY=minSize-getObjHeight(this.resizeRight);this.resizeRight.style.height=minSize+"px";}else{this.resizeRight.style.height=getObjHeight(this.resizeRight)+deltaY;}moveObjTo(this.resizeHandler,getObjLeft(this.resizeHandler),getObjTop(this.resizeHandler)+deltaY);moveObjTo(this.tempHandler,getObjSumLeft(this.resizeHandler),getObjSumTop(this.resizeHandler)+deltaY);}this.resizeX=lMouseX;this.resizeY=lMouseY;return false;}catch(err){microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.onDialogResizeEnd=function(e){try{if(!e){e=window.event;}if(e&&e.e){e=e.e;}this.onmouseup(e);this.elem.style.width=(getObjLeft(this.resizeRight)+2)+"px";this.resizeRight.style.zIndex=1;if(this.resizeVertically){if(this.elem.style.height!=(getObjHeight(this.elem)+"px")){this.elem.style.height=(getObjTop(this.resizeBottom)-SCROLLBAR_SIZE)+"px";}else{this.elem.style.height=(getObjTop(this.resizeBottom)+2)+"px";}}this.resizeBottom.style.zIndex=1;if(this.mask){this.mask.onmaskedobjectresize();}this.resizeHandler.style.backgroundColor="";var updateManager=this.updateManager;var actionCollection=[];var DialogName=this.id;var DialogWidth=getObjWidth(this.elem);var DialogHeight=this.elem.style.height;document.body.style.cursor="auto";document.body.removeChild(this.tempHandler);microstrategy.eventManager.ondialogresize();if(this.afterresize){this.afterresize();}return false;}catch(err){microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.onmouseup=function(e,path){try{document.onselectstart=this.onselectstartFn;if(typeof (mstr)!="undefined"){this.detachWinListener((path)?path:this,"mousemove");this.detachWinListener((path)?path:this,"mouseup");}else{document.onmousemove=null;document.onmouseup=null;}return false;}catch(err){microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.onpostload=function(){try{mstrBoneImpl.prototype.onpostload.call(this);this.initResize();this.setFocus();}catch(err){microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.setFocus=function(){try{if(this.focusFieldId){if(this.focusTimer){window.clearTimeout(this.focusTimer);}this.focusTimer=window.setTimeout("microstrategy.bone('"+this.id+"').doSetFocus()",100);}}catch(err){microstrategy.errors.log(err);return false;}};mstrDialogImpl.prototype.doSetFocus=function(){try{if(this.focusFieldId){var form=this.elem.getElementsByTagName("form")[0];if(form){var field=form.elements[this.focusFieldId];if(field){microstrategy.setCursorToEnd(field);}}}}catch(err){microstrategy.errors.log(err);return false;}};function mstrDialogImpl(id){this.inherits=mstrBoneImpl;this.inherits(id);delete this.inherits;return this;}
