var __aspxPCWIdSuffix="_PW";function ASPxPCResizeCursorInfo(horizontalDirection,verticalDirection,horizontalOffset,verticalOffset){this.horizontalDirection=horizontalDirection;this.verticalDirection=verticalDirection;this.horizontalOffset=horizontalOffset;this.verticalOffset=verticalOffset;this.course=verticalDirection+horizontalDirection;}
ASPxClientPopupControl=_aspxCreateClass(ASPxClientControl,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.animationDelay=30;this.animationMaxDelay=400;this.appearAfter=300;this.disappearAfter=500;this.allowResize=false;this.enableAnimation=true;this.allowCorrectYOffsetPosition=true;this.contentUrl="";this.contentUrlArray=[];this.cookieName="";this.closeAction="OuterMouseClick";this.popupAction="LeftMouseClick";this.popupElementID="";this.popupElementIDArray=[];this.showOnPageLoad=false;this.showOnPageLoadArray=[];this.popupHorizontalAlign=__aspxNotSetAlignIndicator;this.popupVerticalAlign=__aspxNotSetAlignIndicator;this.popupHorizontalOffset=0;this.popupVerticalOffset=0;this.shadowHeight=5;this.shadowWidth=5;this.windows=[];this.windowCount=0;this.isDragged=false;this.zIndex=-1;this.left=0;this.top=0;this.isDraggedArray=[];this.zIndexArray=[];this.leftArray=[];this.topArray=[];this.height=0;this.width=0;this.heightArray=[];this.widthArray=[];this.isLiveResizingMode=true;this.isPopupPositionCorrectionOn=true;this.SSLSecureBlankUrl="";this.popupElement=null;this.popupElements=[];this.headerHeight=0;this.headerHeightArray=[];this.footerHeight=0;this.footerHeightArray=[];this.ResizeBorderSize=6;this.ResizeCornerBorderSize=20;this.PopUp=new ASPxClientEvent();this.CloseUp=new ASPxClientEvent();aspxGetPopupControlCollection().Add(this);},Initialize:function(){this.InitializeArrays();if(this.HasDefaultWindow())this.InitializeWindow(-1);for(var i=0;i<this.popupElementIDArray.length;i++)this.InitializeWindow(i);this.constructor.prototype.Initialize.call(this);},AfterInitialize:function(){if(this.HasDefaultWindow())this.AfterInitializeWindow(-1);for(var i=0;i<this.popupElementIDArray.length;i++)this.AfterInitializeWindow(i);this.constructor.prototype.AfterInitialize.call(this);},InitializeArrays:function(){if(this.GetWindowCountCore()>0){if(this.contentUrlArray.length==0)this.InitializeArray(this.contentUrlArray,"");if(this.popupElementIDArray.length==0)this.InitializeArray(this.popupElementIDArray,"");if(this.showOnPageLoadArray.length==0)this.InitializeArray(this.showOnPageLoadArray,false);if(this.isDraggedArray.length==0)this.InitializeArray(this.isDraggedArray,false);if(this.zIndexArray.length==0)this.InitializeArray(this.zIndexArray,-1);if(this.leftArray.length==0)this.InitializeArray(this.leftArray,0);if(this.topArray.length==0)this.InitializeArray(this.topArray,0);if(this.widthArray.length==0)this.InitializeArray(this.widthArray,0);if(this.heightArray.length==0)this.InitializeArray(this.heightArray,0);if(__aspxIE){if(this.headerHeightArray.length==0)this.InitializeArray(this.headerHeightArray,-1);if(this.footerHeightArray.length==0)this.InitializeArray(this.footerHeightArray,-1);}}},InitializeArray:function(array,value){for(var i=0;i<this.GetWindowCountCore();i++)array[i]=value;},InitializeWindow:function(index){this.GetPopupElement(index);var element=this.GetWindowElement(index);if(element!=null){element.onresize=new Function("aspxPWResize(\""+this.name+"\",\""+element.id+"\");");if(__aspxIE)this.AttachOnDragStartEventToWindowImages(index);element.isHiding=false;element.isIEContentHeightInit=false;element.isPopupPositionCorrectionOn=this.isPopupPositionCorrectionOn||!this.GetShowOnPageLoad(index);if(this.GetShowOnPageLoad(index)&&this.GetZIndex(index)>0){this.FirstShowWindow(index,false);aspxGetPopupControlCollection().SetWindowElementZIndex(element,this.GetZIndex(index));element.isPopupPositionCorrectionOn=true;}}},AfterInitializeWindow:function(index){if(this.GetShowOnPageLoad(index)&&this.GetZIndex(index)<0){this.FirstShowWindow(index,true);var element=this.GetWindowElement(index);if(element!=null)element.isPopupPositionCorrectionOn=true;}},AttachOnDragStartEventToWindowImages:function(index){this.AttachChildImagesPreventDragStartEvent(this.GetWindowHeaderElement(index));this.AttachChildImagesPreventDragStartEvent(this.GetWindowFooterElement(index));},AttachChildImagesPreventDragStartEvent:function(parentElem){var images=parentElem==null?null:_aspxGetElementsByTagName(parentElem,"img");if(images!=null){for(var i=0;i<images.length;i++)images[i].ondragstart=new Function("return _aspxPreventDragStart(event)");}},FirstShowWindow:function(index,allowChangeZIndex){var isFreeWindow=this.GetIsDragged(index);var x=__aspxInvalidPosition;var y=__aspxInvalidPosition;if(isFreeWindow){x=this.GetWindowLeft(index);y=this.GetWindowTop(index);var popupHorizontalOffsetBackup=this.popupHorizontalOffset;var popupVerticalOffsetBackup=this.popupVerticalOffset;this.popupHorizontalOffset=0;this.popupVerticalOffset=0;}
var enableAnimationBackup=this.enableAnimation;this.enableAnimation=false;this.DoShowWindowAtPos(index,x,y,isFreeWindow,false,allowChangeZIndex);this.enableAnimation=enableAnimationBackup;if(isFreeWindow){this.popupHorizontalOffset=popupHorizontalOffsetBackup;this.popupVerticalOffset=popupVerticalOffsetBackup;}},GetIsDragged:function(index){if(0<=index&&index<this.isDraggedArray.length)return this.isDraggedArray[index];return this.isDragged;},SetIsDragged:function(index,value){if(0<=index&&index<this.isDraggedArray.length)this.isDraggedArray[index]=value;else this.isDragged=value;},HasDefaultWindow:function(){return this.GetWindowCountCore()==0;},GetCurrentLeft:function(index){return this.GetPosition(index,true);},GetCurrentTop:function(index){return this.GetPosition(index,false);},GetHeaderHeight:function(index){if(0<=index&&index<this.headerHeightArray.length)return this.headerHeightArray[index];return this.headerHeight;},GetFooterHeight:function(index){if(0<=index&&index<this.footerHeightArray.length)return this.footerHeightArray[index];return this.footerHeight;},SetHeaderHeight:function(index,height){if(0<=index&&index<this.headerHeightArray.length)this.headerHeightArray[index]=height;else this.headerHeight=height;},SetFooterHeight:function(index,height){if(0<=index&&index<this.footerHeightArray.length)return this.footerHeightArray[index]=height;else this.footerHeight=height;},GetPosition:function(index,isLeft){if(0<=index&&index<this.GetWindowCountCore())return isLeft?this.leftArray[index]:this.topArray[index];return isLeft?this.left:this.top;},GetPopupElement:function(index){var popupElement=this.GetPopupElementInternal(index);if(!_aspxIsExistsElement(popupElement)){var popupElement=_aspxFindPopupElementById(this.GetPopupElementID(index));if(_aspxIsExistsElement(popupElement)){popupElement.DXPopupControl=this;popupElement.DXPopupWindowIndex=index;popupElement.isPopuped=false;if(this.popupAction=="LeftMouseClick")_aspxAttachEventToElement(popupElement,"mouseup",aspxPEMEvent);else if(this.popupAction=="RightMouseClick")_aspxAttachEventToElement(popupElement,"contextmenu",aspxPEMEvent);else if(this.popupAction=="MouseOver")_aspxAttachEventToElement(popupElement,"mouseover",aspxPEMOver);if(this.popupAction=="LeftMouseClick"||this.popupAction=="RightMouseClick")_aspxAttachEventToElement(popupElement,"mousedown",aspxPEMEvent);this.SetPopupElementInternal(index,popupElement);}}return popupElement;},GetPopupElementInternal:function(index){if(0<=index&&index<this.GetWindowCountCore())return this.popupElements[index];return this.popupElement;},SetPopupElementInternal:function(index,element){if(0<=index&&index<this.GetWindowCountCore())this.popupElements[index]=element;else this.popupElement=element;},GetPopupElementID:function(index){if(0<=index&&index<this.GetWindowCountCore())return this.popupElementIDArray[index];return this.popupElementID;},GetShowOnPageLoad:function(index){if(0<=index&&index<this.showOnPageLoadArray.length)return this.showOnPageLoadArray[index];return this.showOnPageLoad;},GetWindowCountCore:function(){return(this.windows.length>0)?this.windows.length:this.windowCount;},GetWindowIFrame:function(index){var element=this.GetWindowElement(index);var iFrame=element.overflowElement;if(!_aspxIsExists(iFrame)){iFrame=this.GetWindowIFrameElement(index);element.overflowElement=iFrame;}return iFrame;},GetWindowElementId:function(index){return this.name+__aspxPCWIdSuffix+index;},GetWindowElement:function(index){return _aspxGetElementById(this.GetWindowElementId(index));},GetWindowContentIFrameElementId:function(index){return this.name+"_CIF"+index;},GetWindowContentIFrameElement:function(index){return _aspxGetElementById(this.GetWindowContentIFrameElementId(index));},GetWindowContentIFrameUrl:function(index){if(0<=index&&index<this.contentUrlArray.length)return this.contentUrlArray[index];return this.contentUrl;},LoadWindowContentUrl:function(index){var url=this.GetWindowContentIFrameUrl(index);this.LoadWindowContentFromUrl(index,url);},LoadWindowContentFromUrl:function(index,url){var element=this.GetWindowContentIFrameElement(index);if(_aspxIsExists(element)&&element.src!=url)element.src=url;},GetWindowContentElement:function(index){return _aspxGetElementById(this.name+"_PWC"+index);},GetWindowHeaderElement:function(index){return _aspxGetElementById(this.name+"_PWH"+index);},GetWindowHeaderGripElement:function(index){return _aspxGetElementById(this.name+"_FGRP"+index);},GetWindowFooterElement:function(index){return _aspxGetElementById(this.name+"_PWF"+index);},GetWindowIndex:function(element){var id=element.id;var pos=id.lastIndexOf(__aspxPCWIdSuffix);return parseInt(id.substr(pos+__aspxPCWIdSuffix.length));},GetWindowIFrameElement:function(index){return _aspxGetElementById(this.name+"_DXPWIF"+index);},GetWindowMainCell:function(element){return this.GetWindowMainTable(element).rows[0].cells[0];},GetWindowMainTable:function(element){var shadowTable=_aspxGetElementById(this.name+"_PWST"+this.GetWindowIndex(element));return shadowTable!=null?shadowTable:element;},GetWindowClientTable:function(index){return _aspxGetElementById(this.name+"_CLW"+index);},GetWindowLeft:function(index){if(0<=index&&index<this.leftArray.length)return this.leftArray[index];return this.left;},SetWindowLeft:function(index,left){if(0<=index&&index<this.leftArray.length)this.leftArray[index]=left;else this.left=left;},GetWindowHeightInternal:function(index){if(0<=index&&index<this.heightArray.length)return this.heightArray[index];return this.height;},SetWindowHeight:function(index,height){if(0<=index&&index<this.heightArray.length)this.heightArray[index]=height;else this.height=height;},GetWindowWidthInternal:function(index){if(0<=index&&index<this.widthArray.length)return this.widthArray[index];return this.width;},SetWindowWidth:function(index,width){if(0<=index&&index<this.widthArray.length)this.widthArray[index]=width;else this.width=width;},GetWindowTop:function(index){if(0<=index&&index<this.topArray.length)return this.topArray[index];return this.top;},SetWindowTop:function(index,top){if(0<=index&&index<this.topArray.length)return this.topArray[index]=top;else return this.top=top;},GetWindowsStateInputElement:function(){return _aspxGetElementById(this.name+"WS");},GetZIndex:function(index){if(0<=index&&index<this.zIndexArray.length)return this.zIndexArray[index];return this.zIndex;},GetCurrentZIndex:function(index){var element=this.GetWindowElement(index);if(element!=null){if(element.style.zIndex!="")return element.style.zIndex;if(0<=index&&index<this.GetWindowCountCore())return this.zIndexArray[index];return this.zIndex;}},GetCurrentWindowWidth:function(index){var element=this.GetWindowElement(index);if(element!=null){var mainCell=this.GetWindowMainCell(element);if(mainCell.firstChild.offsetWidth>0)return mainCell.firstChild.offsetWidth;return this.GetWindowWidthInternal(index);}},GetCurrentWindowHeight:function(index){var element=this.GetWindowElement(index);if(element!=null){var mainCell=this.GetWindowMainCell(element);if(mainCell.firstChild.offsetHeight>0)return mainCell.firstChild.offsetHeight;return this.GetWindowHeightInternal(index);}},GetClientPopupPos:function(element,popupElement,pos,isX){var index=this.GetWindowIndex(element);if(this.GetIsDragged(index))return new _aspxPopupPosition(this.GetPosition(index,isX),false);return isX?this.GetClientPopupPosX(element,popupElement,pos):this.GetClientPopupPosY(element,popupElement,pos);},GetClientPopupPosX:function(element,popupElement,x){var mainElement=this.GetWindowMainCell(element);var popupPosition=_aspxGetPopupAbsoluteX(mainElement,popupElement,this.popupHorizontalAlign,this.popupHorizontalOffset,x,this.GetWindowLeft(this.GetWindowIndex(element)));return this.CorrectPopupPositionForClientWindow(element,popupPosition,true);},GetClientPopupPosY:function(element,popupElement,y){var mainElement=this.GetWindowMainCell(element);var popupPosition=_aspxGetPopupAbsoluteY(mainElement,popupElement,this.popupVerticalAlign,this.popupVerticalOffset,y,this.GetWindowTop(this.GetWindowIndex(element)));return(this.allowCorrectYOffsetPosition?this.CorrectPopupPositionForClientWindow(element,popupPosition,false):popupPosition);},CorrectPopupPositionForClientWindow:function(element,popupPosition,isX){if(element.isPopupPositionCorrectionOn){var min=isX?_aspxGetDocumentScrollLeft():_aspxGetDocumentScrollTop();var max=min+(isX?_aspxGetDocumentClientWidth():_aspxGetDocumentClientHeight());max-=(isX?element.offsetWidth+this.shadowWidth:element.offsetHeight+this.shadowHeight);if(popupPosition.position>max)popupPosition.position=max;if(popupPosition.position<min)popupPosition.position=min;}return popupPosition;},DoShowWindow:function(index,evt){if(!this.InternalIsWindowVisible(index)){var x=_aspxGetEventX(evt);var y=_aspxGetEventY(evt);this.DoShowWindowAtPos(index,x,y,false,true,true);}},DoShowWindowAtPos:function(index,x,y,ignorePopupElement,closeOtherWindows,allowChangeZIndex){if(closeOtherWindows)aspxGetPopupControlCollection().DoHideAllWindows(null,this.GetWindowElementId(index),false);var element=this.GetWindowElement(index);if(element!=null){var isMoving=this.InternalIsWindowVisible(index);_aspxSetElementDisplay(element,true);if(__aspxIE&&!element.isIEContentHeightInit){element.isIEContentHeightInit=true;this.GetWindowContentElement(index).style.height="0px";this.CorrectContentCellHeight(element,false);}
var popupElement=ignorePopupElement?null:this.GetPopupElement(index);var horizontalPopupPosition=this.GetClientPopupPos(element,popupElement,x,true);var verticalPopupPosition=this.GetClientPopupPos(element,popupElement,y,false);if(!this.GetIsDragged(index)){horizontalPopupPosition.position-=_aspxGetPositionElementOffset(element,true);verticalPopupPosition.position-=_aspxGetPositionElementOffset(element,false);}
var clientX=horizontalPopupPosition.position;var clientY=verticalPopupPosition.position;this.SetIsDragged(index,true);this.SetWindowLeft(index,clientX);this.SetWindowTop(index,clientY);this.UpdateWindowsStateInputElement();this.UpdateWindowsStateCookie();if(this.enableAnimation&&!isMoving){this.StartAnimation(element,index,horizontalPopupPosition,verticalPopupPosition);}else{_aspxSetStylePosition(element,clientX,clientY);this.DoShowWindowIFrame(index,clientX,clientY,__aspxInvalidDimension,__aspxInvalidDimension);_aspxSetElementVisibility(element,true);}if(!isMoving){aspxGetPopupControlCollection().RegisterVisibleWindow(element);if(_aspxIsExists(this.RaisePopUp))this.RaisePopUp(index);}if(allowChangeZIndex){aspxGetPopupControlCollection().ActivateWindowElement(element);}
this.LoadWindowContentUrl(index);}},DoShowWindowIFrame:function(index,x,y,width,height){if(!__aspxIE||__aspxIE7)return;var element=this.GetWindowElement(index);var iFrame=this.GetWindowIFrame(index);if(_aspxIsExists(element)&&_aspxIsExists(iFrame)){var cell=this.GetWindowMainCell(element);if(width<0)width=cell.offsetWidth;if(height<0)height=cell.offsetHeight;_aspxSetStyleSize(iFrame,width,height);if(x!=__aspxInvalidPosition&&y!=__aspxInvalidPosition)_aspxSetStylePosition(iFrame,x,y);_aspxSetElementDisplay(iFrame,true);}},DoHideWindow:function(index){if(!this.InternalIsWindowVisible(index))return;var element=this.GetWindowElement(index);if(element!=null){element.isHiding=true;this.SetIsDragged(index,false);this.UpdateWindowsStateInputElement();this.UpdateWindowsStateCookie();element.isHiding=false;_aspxStopAnimation(element);_aspxSetElementVisibility(element,false);_aspxSetElementDisplay(element,false);if(_aspxIsExists(element.savedParent))element.savedParent.appendChild(element);this.DoHideWindowIFrame(element);aspxGetPopupControlCollection().UnregisterVisibleWindow(element);if(_aspxIsExists(this.RaiseCloseUp))this.RaiseCloseUp(index);}},DoHideWindowIFrame:function(element){if(!__aspxIE||__aspxIE7)return;var iFrame=element.overflowElement;if(_aspxIsExists(iFrame)){_aspxSetElementDisplay(iFrame,false);if(_aspxIsExists(iFrame.savedParent))iFrame.savedParent.appendChild(iFrame);}},CorrectContentCellHeight:function(element,isResizing){if(__aspxIE){var index=this.GetWindowIndex(element);var clientTable=this.GetWindowClientTable(index);var headerCell=this.GetWindowHeaderElement(index);var contentCell=this.GetWindowContentElement(index);var footerCell=this.GetWindowFooterElement(index);var windowMainCell=this.GetWindowMainCell(element);var mainCellHeight=windowMainCell.clientHeight-this.GetTwoVerticalPaddingSize(windowMainCell);var headerHeight=_aspxIsExists(headerCell)?headerCell.offsetHeight:0;var footerHeight=_aspxIsExists(footerCell)?footerCell.offsetHeight:0;if(isResizing){headerHeight=this.GetHeaderHeight(index);footerHeight=this.GetFooterHeight(index);}else{this.SetHeaderHeight(index,headerHeight);this.SetFooterHeight(index,footerHeight);}
var correctedHeight=mainCellHeight-headerHeight-footerHeight;contentCell.style.height=correctedHeight+"px";var verticalsPaddings=contentCell.offsetHeight-correctedHeight;contentCell.style.height=correctedHeight-verticalsPaddings+"px";}},GetTwoVerticalPaddingSize:function(element){var heightWithBorders=element.clientHeight;var paddingTopBackup=element.style.paddingTop;var paddingBottomBackup=element.style.paddingBottom;element.style.paddingTop="0px";element.style.paddingBottom="0px";var heightWithoutBorders=element.clientHeight;element.style.paddingTop=paddingTopBackup;element.style.paddingBottom=paddingBottomBackup;return(heightWithBorders-heightWithoutBorders);},InternalIsWindowVisible:function(index){var element=this.GetWindowElement(index);return(element!=null)?_aspxGetElementVisibility(element):false;},OnActivate:function(index){var element=this.GetWindowElement(index);if(element!=null)aspxGetPopupControlCollection().ActivateWindowElement(element);},OnAnimationTimer:function(index){var animationDivElement=this.GetWindowElement(index);if(_aspxIsExists(animationDivElement)){var element=this.GetWindowMainTable(animationDivElement);var mainCell=this.GetWindowMainCell(animationDivElement);var iframeElement=this.GetWindowIFrame(index);_aspxOnAnimationTimer(animationDivElement,element,mainCell,iframeElement,this.animationDelay,this.animationMaxDelay,__aspxPCAnimationAccelerator);}},OnDragStart:function(evt,index){this.SetIsDragged(index,true);this.ShowDragCursor(index);var element=this.GetWindowElement(index);var gragXOffset=_aspxGetAbsoluteX(element)-_aspxGetPositionElementOffset(element,true)-_aspxGetEventX(evt)-_aspxGetIEDocumentClientOffset(true);var gragYOffset=_aspxGetAbsoluteY(element)-_aspxGetPositionElementOffset(element,false)-_aspxGetEventY(evt)-_aspxGetIEDocumentClientOffset(false);aspxGetPopupControlCollection().InitDragObject(this,index,gragXOffset,gragYOffset);},OnDrag:function(index,x,y){var element=this.GetWindowElement(index);if(element!=null){_aspxSetStylePosition(element,x,y);this.SetWindowLeft(index,x);this.SetWindowTop(index,y);var iFrame=element.overflowElement;if(_aspxIsExists(iFrame))_aspxSetStylePosition(iFrame,x,y);if(__aspxOpera)_aspxClearSelection();}},OnDragStop:function(index){var element=this.GetWindowElement(index);this.HideDragCursor(index);this.UpdateWindowsStateInputElement();this.UpdateWindowsStateCookie();},CreateResizePanel:function(index){var element=this.GetWindowElement(index);var mainCell=this.GetWindowMainCell(element);var resizePanel=document.createElement("DIV");_aspxGetParentNode(element).appendChild(resizePanel);resizePanel.style.overflow="hidden";resizePanel.style.position="absolute";resizePanel.style.zIndex=__aspxPopupControlZIndex+aspxGetPopupControlCollection().visiblePopupWindowIds.length*2+2;if(!this.isLiveResizingMode)resizePanel.style.border="black 1px dotted";return resizePanel;},OnResizeStart:function(evt,index){if(!aspxGetPopupControlCollection().IsResizeInint()){var cursor=this.CreateResizeCursorInfo(evt,index);if(cursor.course!=""){var resizePanel=this.CreateResizePanel(index);this.UpdateResizeCursor(resizePanel,cursor.verticalDirection,cursor.horizontalDirection);aspxGetPopupControlCollection().InitResizeObject(this,index,cursor,resizePanel);this.OnResize(evt,index,cursor,resizePanel);}}return aspxGetPopupControlCollection().IsResizeInint();},OnResize:function(evt,index,cursor,resizePanel){this.OnResizePanel(evt,index,cursor,resizePanel);if(this.isLiveResizingMode)this.OnResizeWindow(index,cursor,resizePanel);if(!__aspxIE)_aspxClearSelection();},OnResizePanel:function(evt,index,cursor,resizePanel){var x=_aspxGetEventX(evt);var y=_aspxGetEventY(evt);var element=this.GetWindowElement(index);var mainCell=this.GetWindowMainCell(element);var clientWindow=this.GetWindowClientTable(index);var left=_aspxGetAbsoluteX(mainCell);var top=_aspxGetAbsoluteY(mainCell);var newLeft=_aspxGetAbsoluteX(element);var newTop=_aspxGetAbsoluteY(element);var newHeight=mainCell.offsetHeight;var newWidth=mainCell.offsetWidth;if(cursor.horizontalDirection=="e")newWidth=x-newLeft+cursor.horizontalOffset+1;if(cursor.verticalDirection=="s")newHeight=y-newTop+cursor.verticalOffset+1;if(cursor.horizontalDirection=="w"){newLeft=x-_aspxGetPositionElementOffset(element,true)-cursor.horizontalOffset;newWidth=newWidth-(x-left)+cursor.horizontalOffset;}else newLeft-=_aspxGetPositionElementOffset(element,true);if(cursor.verticalDirection=="n"){newTop=y-_aspxGetPositionElementOffset(element,false)-cursor.verticalOffset;newHeight=newHeight-(y-top)+cursor.verticalOffset;}else newTop-=_aspxGetPositionElementOffset(element,false);if(!this.isLiveResizingMode){newWidth-=2;newHeight-=2;}if(newWidth>0&&newHeight>0){_aspxSetStylePosition(resizePanel,newLeft-_aspxGetIEDocumentClientOffset(true),newTop-_aspxGetIEDocumentClientOffset(false));_aspxSetStyleSize(resizePanel,newWidth,newHeight);this.SetWindowLeft(index,newLeft);this.SetWindowTop(index,newTop);}},OnResizeWindow:function(index,cursor,resizePanel){this.SetClientWindowSize(index,resizePanel.offsetWidth,resizePanel.offsetHeight);var element=this.GetWindowElement(index);var mainCell=this.GetWindowMainCell(element);var heightCorrection=mainCell.offsetHeight-resizePanel.offsetHeight;var widthCorrection=mainCell.offsetWidth-resizePanel.offsetWidth;var left=_aspxGetAbsoluteX(resizePanel)-(cursor.horizontalDirection=="w"?widthCorrection:0)-_aspxGetIEDocumentClientOffset(true);var top=_aspxGetAbsoluteY(resizePanel)-(cursor.verticalDirection=="n"?heightCorrection:0)-_aspxGetIEDocumentClientOffset(false);left-=_aspxGetPositionElementOffset(element,true);top-=_aspxGetPositionElementOffset(element,false);_aspxSetStylePosition(element,left,top);this.DoShowWindowIFrame(index,left,top,__aspxInvalidDimension,__aspxInvalidDimension);},OnResizeStop:function(evt,index,cursor,resizePanel){if(this.allowResize){if(!this.isLiveResizingMode)this.OnResizeWindow(index,cursor,resizePanel);this.CreateResizeCursorInfo(evt,index);this.UpdateWindowsStateInputElement();this.UpdateWindowsStateCookie();}},SetClientWindowSize:function(index,width,height){var element=this.GetWindowElement(index);var mainCell=this.GetWindowMainCell(element);var clientWindow=this.GetWindowClientTable(index);var windowHorizontalTwoBorderSize=mainCell.offsetWidth-clientWindow.offsetWidth;var windowVerticalTwoBorderSize=mainCell.offsetHeight-clientWindow.offsetHeight;width-=windowHorizontalTwoBorderSize;height-=windowVerticalTwoBorderSize;if(width>=0&&height>=0){if(__aspxIE){this.GetWindowContentElement(index).style.height="0px";mainCell.style.height="0px";}
_aspxSetStyleSize(clientWindow,width,height);this.CorrectContentCellHeight(element,true);if(__aspxOpera){var contentIFrame=this.GetWindowContentIFrameElement(index);if(_aspxIsExists(contentIFrame)){contentIFrame.style.height="99%";contentIFrame.style.height="100%";}}
_aspxSetStyleSize(mainCell,width,height);if(__aspxMozilla){_aspxSetElementDisplay(element,false);_aspxSetElementDisplay(element,true);}
_aspxSetStyleSize(element,clientWindow.offsetWidth+this.shadowWidth+windowHorizontalTwoBorderSize,clientWindow.offsetHeight+this.shadowHeight+windowVerticalTwoBorderSize);this.SetWindowWidth(index,clientWindow.offsetWidth);this.SetWindowHeight(index,clientWindow.offsetHeight);}},CreateResizeCursorInfo:function(evt,index){var element=this.GetWindowElement(index);var mainCell=this.GetWindowMainCell(element);var clientWindow=this.GetWindowClientTable(index);var headerElement=this.GetWindowHeaderElement(index);var left=_aspxGetAbsoluteX(mainCell);var top=_aspxGetAbsoluteY(mainCell);var x=_aspxGetEventX(evt);var y=_aspxGetEventY(evt);var leftOffset=Math.abs(x-left);var rightOffset=Math.abs(x-left-mainCell.offsetWidth+1);var topOffset=Math.abs(y-top);var bottomOffset=Math.abs(y-top-mainCell.offsetHeight+1);var cursorInfo=this.CreateResizeBorderCursorInfo(index,leftOffset,rightOffset,topOffset,bottomOffset);var gripCell=this.GetWindowHeaderGripElement(index);if(gripCell){var gripCursorInfo=this.CreateGripCursorInfo(index,mainCell,gripCell,rightOffset,bottomOffset);if(_aspxIsExists(gripCursorInfo))cursorInfo=gripCursorInfo;}
this.UpdateResizeCursor(clientWindow,cursorInfo.verticalDirection,cursorInfo.horizontalDirection);this.UpdateResizeCursor(mainCell,cursorInfo.verticalDirection,cursorInfo.horizontalDirection);if(_aspxIsExists(headerElement))this.UpdateResizeCursor(headerElement,cursorInfo.verticalDirection,cursorInfo.horizontalDirection);return cursorInfo;},CreateGripCursorInfo:function(index,mainCell,gripCell,rightOffset,bottomOffset){var gripWidth=mainCell.offsetWidth-(_aspxGetAbsoluteX(gripCell)-_aspxGetAbsoluteX(mainCell));var gripHeight=mainCell.offsetHeight-(_aspxGetAbsoluteY(gripCell)-_aspxGetAbsoluteY(mainCell));if(gripHeight>bottomOffset&&gripWidth>rightOffset)return new ASPxPCResizeCursorInfo("e","s",rightOffset,bottomOffset);return null;},CreateResizeBorderCursorInfo:function(index,leftOffset,rightOffset,topOffset,bottomOffset){var ResizeBorderSize=this.ResizeBorderSize;var verticalDirection=this.GetResizeVerticalCourse(ResizeBorderSize,topOffset,bottomOffset);ResizeBorderSize=verticalDirection!=""?this.ResizeCornerBorderSize:this.ResizeBorderSize;var horizontalDirection=this.GetResizeHorizontalCourse(ResizeBorderSize,leftOffset,rightOffset);if(verticalDirection==""&&horizontalDirection!="")verticalDirection=this.GetResizeVerticalCourse(this.ResizeCornerBorderSize,topOffset,bottomOffset);var horizontalOffset=leftOffset<rightOffset?leftOffset:rightOffset;var verticalOffset=topOffset<bottomOffset?topOffset:bottomOffset;return new ASPxPCResizeCursorInfo(horizontalDirection,verticalDirection,horizontalOffset,verticalOffset);},GetResizeVerticalCourse:function(ResizeBorderSize,topOffset,bottomOffset){if(ResizeBorderSize>topOffset)return "n";if(ResizeBorderSize>bottomOffset)return "s";return "";},GetResizeHorizontalCourse:function(ResizeBorderSize,leftOffset,rightOffset){if(ResizeBorderSize>leftOffset)return "w";if(ResizeBorderSize>rightOffset)return "e";return "";},UpdateResizeCursor:function(element,verticalDirection,horizontalDirection){var cursor=verticalDirection+horizontalDirection;if(cursor!=""){cursor+="-resize";this.ShowTemporaryCursor(element,cursor);}else this.HideTemporaryCursor(element);},ShowTemporaryCursor:function(element,cursor){if(!_aspxIsExists(element.savedCursor))element.savedCursor=element.style.cursor;element.style.cursor=cursor;},HideTemporaryCursor:function(element){if(_aspxIsExists(element.savedCursor)){element.style.cursor=element.savedCursor;element.savedCursor=null;}},ResizeWindowIFrame:function(index){if(!__aspxIE||__aspxIE7)return;if(!this.InternalIsWindowVisible(index))return;var iFrame=this.GetWindowIFrame(index);if(_aspxIsExists(iFrame)){var cell=this.GetWindowMainCell(this.GetWindowElement(index));_aspxSetStyleSize(iFrame,cell.offsetWidth,cell.offsetHeight);}},ShowDragCursor:function(index){var dragElement=this.GetDragElement(index);if(dragElement)this.ShowTemporaryCursor(dragElement,"move");},HideDragCursor:function(index){var dragElement=this.GetDragElement(index);if(dragElement!=null)this.HideTemporaryCursor(dragElement);},GetDragElement:function(index){var headerElement=this.GetWindowHeaderElement(index);var element=this.GetWindowElement(index);if(element!=null)return(headerElement!=null?headerElement:this.GetWindowMainCell(element));return null;},OnActivateMouseDown:function(evt,index){this.OnActivate(index);},OnCloseButtonClick:function(index){this.DoHideWindow(index);},OnMouseDown:function(evt,index,isDraggingAllowed){if(_aspxGetIsLeftButtonPressed(evt)){_aspxClearSelection();var isResizing=false;if(this.allowResize)isResizing=this.OnResizeStart(evt,index);if(isDraggingAllowed&&!isResizing)this.OnDragStart(evt,index);}},OnMouseMove:function(evt,index){this.CreateResizeCursorInfo(evt,index);},StartAnimation:function(animationDivElement,index,horizontalPopupPosition,verticalPopupPosition){var element=this.GetWindowMainTable(animationDivElement);var clientX=horizontalPopupPosition.position;var clientY=verticalPopupPosition.position;_aspxInitAnimationDiv(animationDivElement,clientX,clientY,"aspxPCATimer(\""+this.name+"\", "+index+")");var horizontalDirection=_aspxGetAnimationHorizontalDirection(horizontalPopupPosition,this.popupHorizontalAlign,this.popupVerticalAlign);var verticalDirection=_aspxGetAnimationVerticalDirection(verticalPopupPosition,this.popupHorizontalAlign,this.popupVerticalAlign);var xPos=horizontalDirection*animationDivElement.offsetHeight;var yPos=verticalDirection*animationDivElement.offsetWidth;_aspxSetStylePosition(element,xPos,yPos);_aspxSetElementVisibility(animationDivElement,true);this.DoShowWindowIFrame(index,clientX,clientY,0,0);animationDivElement.timerID=window.setTimeout(animationDivElement.onTimerString,this.animationDelay);},GetWindowsState:function(){var state="";if(this.HasDefaultWindow()){state+=this.GetWindowState(-1);}for(var i=0;i<this.GetWindowCountCore();i++){state+=this.GetWindowState(i);if(i<this.GetWindowCountCore()-1)state+=";";}return state;},GetWindowState:function(index){var element=this.GetWindowElement(index);if(element!=null){var mainCell=this.GetWindowMainCell(element);var visibleFlag=(!this.InternalIsWindowVisible(index)||element.isHiding)?"0":"1";var isDraggedFlag=this.GetIsDragged(index)?"1":"0";var zIndex=this.GetCurrentZIndex(index);var width=this.GetCurrentWindowWidth(index);var height=this.GetCurrentWindowHeight(index);var state=visibleFlag+":"+isDraggedFlag+":"+zIndex+":"+this.GetCurrentLeft(index)+":"+this.GetCurrentTop(index)+":"+width+":"+height;return state;}return "";},UpdateWindowsStateCookie:function(){if(this.cookieName!=""){var windowsState=this.GetWindowsState();_aspxDelCookie(this.cookieName,windowsState);_aspxSetCookie(this.cookieName,windowsState);}},UpdateWindowsStateInputElement:function(){var element=this.GetWindowsStateInputElement();if(element!=null)element.value=this.GetWindowsState();}});ASPxClientPopupControlCollection=_aspxCreateClass(ASPxClientCollection,{constructor:function(){this.constructor.prototype.constructor.call(this);this.draggingControl=null;this.draggingWindowIndex=-1;this.gragXOffset=0;this.gragYOffset=0;this.visiblePopupWindowIds=new Array();this.zIndex=__aspxPopupControlZIndex;this.overControl=null;this.overWindowIndex=-1;this.overXPos=__aspxInvalidPosition;this.overYPos=__aspxInvalidPosition;this.appearTimerID=-1;this.disappearTimerID=-1;this.resizeControl=null;this.resizeIndex=-2;this.resizeCursor="";this.resizePanel=null;this.selectBanned=false;},DoHideAllWindows:function(srcElement,excptId,applyToAll){for(var i=this.visiblePopupWindowIds.length-1;i>=0;i--){var id=this.visiblePopupWindowIds[i];if(id==excptId)continue;if(srcElement!=null&&_aspxGetParentById(srcElement,id)!=null)continue;var pos=id.lastIndexOf(__aspxPCWIdSuffix);var name=id.substring(0,pos);var index=id.substr(pos+__aspxPCWIdSuffix.length);var popupControl=aspxGetPopupControlCollection().Get(name);if(popupControl!=null&&((popupControl.closeAction!="CloseButton"&&popupControl.closeAction!="None")||applyToAll)){popupControl.DoHideWindow(parseInt(index));}}},DoShowAtCurrentPos:function(name,index){var pc=this.Get(name);if(pc!=null&&!pc.InternalIsWindowVisible(index))pc.DoShowWindowAtPos(index,this.overXPos,this.overYPos,false,true,true);},ActivateWindowElement:function(element){var visibleWindowsCount=this.visiblePopupWindowIds.length;if(__aspxPopupControlZIndex<=element.style.zIndex&&element.style.zIndex!=visibleWindowsCount*2+__aspxPopupControlZIndex){this.DeleteWindowFromZIndexOrder(element);}
this.SetWindowElementZIndex(element,__aspxPopupControlZIndex+visibleWindowsCount*2);},DeleteWindowFromZIndexOrder:function(element){for(var i=0;i<this.visiblePopupWindowIds.length;i++){var windowElement=_aspxGetElementById(this.visiblePopupWindowIds[i]);if(windowElement.style.zIndex>element.style.zIndex)this.SetWindowElementZIndex(windowElement,windowElement.style.zIndex-2);}},SetWindowElementZIndex:function(element,zIndex){element.style.zIndex=zIndex;var iFrame=element.overflowElement;if(_aspxIsExists(iFrame)){iFrame.style.zIndex=zIndex-1;}
this.UpdateWindowsStateInputElement(element.id);this.UpdateWindowsStateCookie(element.id);},ClearAppearTimer:function(){this.appearTimerID=_aspxClearTimer(this.appearTimerID);},ClearDisappearTimer:function(){this.disappearTimerID=_aspxClearTimer(this.disappearTimerID);},IsAppearTimerActive:function(){return this.appearTimerID>-1;},IsDisappearTimerActive:function(){return this.disappearTimerID>-1;},SetAppearTimer:function(name,index,timeout){this.appearTimerID=_aspxSetTimeout("aspxPEMOverTimer(\""+name+"\", "+index+")",timeout);},SetDisappearTimer:function(name,index,timeout){this.disappearTimerID=_aspxSetTimeout("aspxPEMOutTimer(\""+name+"\", "+index+")",timeout);},InitDragObject:function(control,index,x,y){this.draggingControl=control;this.draggingWindowIndex=index;this.gragXOffset=x;this.gragYOffset=y;this.selectBanned=true;},InitOverObject:function(control,index,evt){this.overControl=control;this.overWindowIndex=index;this.SaveCurrentMouseOverPos(evt);},InitResizeObject:function(control,index,cursor,resizePanel){this.resizeControl=control;this.resizeIndex=index;this.resizeCursor=cursor;this.resizePanel=resizePanel;this.selectBanned=true;},IsResizeInint:function(){return this.resizeControl!=null;},ClearDragObject:function(){this.draggingControl=null;this.draggingWindowIndex=-1;this.gragXOffset=0;this.gragYOffset=0;this.selectBanned=this.resizeControl!=null;},ClearResizeObject:function(){this.resizeControl=null;this.resizeIndex=-2;this.resizeCursor="";this.selectBanned=this.draggingControl!=null;_aspxGetParentNode(this.resizePanel).removeChild(this.resizePanel);},Drag:function(evt){var x=_aspxGetEventX(evt)+this.gragXOffset;var y=_aspxGetEventY(evt)+this.gragYOffset;this.draggingControl.OnDrag(this.draggingWindowIndex,x,y);},DragStop:function(){this.draggingControl.OnDragStop(this.draggingWindowIndex);this.ClearDragObject();},ResizeStop:function(evt){this.resizeControl.OnResizeStop(evt,this.resizeIndex,this.resizeCursor,this.resizePanel);aspxGetPopupControlCollection().ClearResizeObject();},OnPWMouseMove:function(evt,name,index){if(this.draggingControl==null&&this.overControl==null&&this.resizeControl==null){var pc=aspxGetPopupControlCollection().Get(name);if(pc!=null)pc.OnMouseMove(evt,index);}},OnMouseDown:function(evt){var srcElement=_aspxGetEventSource(evt);this.DoHideAllWindows(srcElement,"",false);aspxGetPopupControlCollection().ClearAppearTimer();},OnMouseMove:function(evt){if(this.draggingControl!=null){if(__aspxIE&&!_aspxGetIsLeftButtonPressed(evt))return this.DragStop();else this.Drag(evt);}else if(this.overControl!=null){this.OnMouseOver(evt);}else if(this.resizeControl!=null){if(__aspxIE&&!_aspxGetIsLeftButtonPressed(evt))this.ResizeStop(evt);else this.resizeControl.OnResize(evt,this.resizeIndex,this.resizeCursor,this.resizePanel);}},OnMouseOver:function(evt){var element=_aspxFindParentPopupElementByEvent(evt,aspxTestPopupControlOverElement);if(element!=null){this.ClearDisappearTimer();this.SaveCurrentMouseOverPos(evt);return _aspxCancelBubble(evt);}
this.OnMouseOut();},OnMouseOut:function(){if(!_aspxIsExists(this.overControl)||_aspxIsExists(this.draggingControl))return;this.ClearAppearTimer();if(this.overControl.closeAction=="MouseOut"&&this.overControl.InternalIsWindowVisible(this.overWindowIndex)){if(!this.IsDisappearTimerActive())this.SetDisappearTimer(this.overControl.name,this.overWindowIndex,this.overControl.disappearAfter);}else this.OverStop();},OnMouseUp:function(evt){if(this.draggingControl!=null)this.DragStop();if(this.resizeControl!=null)this.ResizeStop(evt);},OnSelectStart:function(){return!this.selectBanned;},OverStop:function(){this.overControl=null;this.overWindowIndex=-1;},SaveCurrentMouseOverPos:function(evt){this.overXPos=_aspxGetEventX(evt);this.overYPos=_aspxGetEventY(evt);},RegisterVisibleWindow:function(element){_aspxArrayPush(this.visiblePopupWindowIds,element.id);},UnregisterVisibleWindow:function(element){this.DeleteWindowFromZIndexOrder(element);_aspxArrayRemove(this.visiblePopupWindowIds,element.id);},UpdateWindowsStateCookie:function(id){var pos=id.lastIndexOf(__aspxPCWIdSuffix);var name=id.substring(0,pos);var popupControl=aspxGetPopupControlCollection().Get(name);if(popupControl!=null)popupControl.UpdateWindowsStateCookie(false);},UpdateWindowsStateInputElement:function(id){var pos=id.lastIndexOf(__aspxPCWIdSuffix);var name=id.substring(0,pos);var popupControl=aspxGetPopupControlCollection().Get(name);if(popupControl!=null)popupControl.UpdateWindowsStateInputElement(false);}});var __aspxPopupControlCollection=null;function aspxGetPopupControlCollection(){if(__aspxPopupControlCollection==null)__aspxPopupControlCollection=new ASPxClientPopupControlCollection();return __aspxPopupControlCollection;}
function aspxPEMOverTimer(name,index){aspxGetPopupControlCollection().DoShowAtCurrentPos(name,index);}
function aspxPEMOutTimer(name,index){var pc=aspxGetPopupControlCollection().Get(name);aspxGetPopupControlCollection().OverStop();if(pc!=null)pc.DoHideWindow(index);}
function aspxPWCBClick(name,index){var pc=aspxGetPopupControlCollection().Get(name);if(pc!=null)pc.OnCloseButtonClick(index);}
function aspxPWCBMDown(evt){return _aspxCancelBubble(evt);}
function aspxPEMOver(evt){var element=_aspxFindParentPopupElementByEvent(evt,aspxTestPopupControlElement);if(element!=null){var popupControl=element.DXPopupControl;var index=element.DXPopupWindowIndex;if(!popupControl.InternalIsWindowVisible(index)){aspxGetPopupControlCollection().SetAppearTimer(popupControl.name,index,popupControl.appearAfter);aspxGetPopupControlCollection().InitOverObject(popupControl,index,evt);}}}
function aspxPEMEvent(evt){var element=_aspxFindParentPopupElementByEvent(evt,aspxTestPopupControlElement);if(element!=null){if(evt.type=="mousedown"){if(element.DXPopupControl.InternalIsWindowVisible(element.DXPopupWindowIndex))element.isPopuped=true;else element.isPopuped=false;aspxGetPopupControlCollection().OnMouseDown(evt);}else{if(element.DXPopupControl.popupAction=="RightMouseClick"||_aspxGetIsLeftButtonPressed(evt)){if(element.DXPopupControl.popupAction=="RightMouseClick")_aspxPreventContextMenu(evt);if(!(element.isPopuped&&element.DXPopupControl.closeAction=="OuterMouseClick"))element.DXPopupControl.DoShowWindow(element.DXPopupWindowIndex,evt);if(element.DXPopupControl.closeAction=="MouseOut")aspxGetPopupControlCollection().InitOverObject(element.DXPopupControl,element.DXPopupWindowIndex,evt);return false;}}}}
function aspxPWDGMDown(evt,name,index){var pc=aspxGetPopupControlCollection().Get(name);if(pc!=null){pc.OnActivateMouseDown(evt,index);pc.OnMouseDown(evt,index,true);}if(!__aspxIE)evt.preventDefault();return aspxPWCBMDown(evt);}
function aspxPWGripMDown(evt,name,index){aspxPWMDown(evt,name,index,false);return aspxPWCBMDown(evt);}
function aspxPWMDown(evt,name,index,isDraggingAllowed){var pc=aspxGetPopupControlCollection().Get(name);if(pc!=null){pc.OnActivateMouseDown(evt,index);pc.OnMouseDown(evt,index,isDraggingAllowed);}}
function aspxPWResize(name,index){var pc=aspxGetPopupControlCollection().Get(name);if(pc!=null)pc.ResizeWindowIFrame(index);}
function aspxPWMMove(evt,name,index){aspxGetPopupControlCollection().OnPWMouseMove(evt,name,index);}
function aspxPCATimer(name,index){var pc=aspxGetPopupControlCollection().Get(name);if(pc!=null)pc.OnAnimationTimer(index);}
_aspxAttachEventToDocument("mousedown",aspxPopupControlDocumentMouseDown);function aspxPopupControlDocumentMouseDown(evt){if(_aspxFindParentPopupElementByEvent(evt,aspxTestPopupControlElement)==null)return aspxGetPopupControlCollection().OnMouseDown(evt);}
_aspxAttachEventToDocument("mouseup",aspxPopupControlDocumentMouseUp);function aspxPopupControlDocumentMouseUp(evt){return aspxGetPopupControlCollection().OnMouseUp(evt);}
_aspxAttachEventToDocument("mousemove",aspxPopupControlDocumentMouseMove);function aspxPopupControlDocumentMouseMove(evt){aspxGetPopupControlCollection().OnMouseMove(evt);}
_aspxAttachEventToDocument("mouseout",aspxPopupControlDocumentMouseOut);function aspxPopupControlDocumentMouseOut(){aspxGetPopupControlCollection().OnMouseOut();}
_aspxAttachEventToDocument("selectstart",aspxPopupControlDocumentSelectStart);function aspxPopupControlDocumentSelectStart(evt){return aspxGetPopupControlCollection().OnSelectStart(evt);}
function aspxTestPopupControlElement(element){return(_aspxIsExists(element.DXPopupControl)&&_aspxIsExists(element.DXPopupWindowIndex));}
function aspxTestPopupControlOverElement(element){var collection=aspxGetPopupControlCollection();var windowId=collection.overControl.GetWindowElementId(collection.overWindowIndex);var popupElementId=collection.overControl.GetPopupElement(collection.overWindowIndex).id;return(element.id==windowId||element.id==popupElementId);}