function RadWindow(id){ this.IsIE=(null!=document.all) && (window.opera==null); this.IsQuirksMode=(document.all && !window.opera && "C\x53\x531Compa\x74"!=document.compatMode); this.Id=id; this.Width=0; this.Height=0; this.OnClientClosing=null; this.ContentWindow=null; this.ContentWrapperTable=null; this.Caption=null; this.X=0; this.Y=0; this.ShowContentWhenMoving= true; this.CanMove= true; this.CanResize= true; this.DragMode=""; this.IsModal= false; this.Container=null; this.Parent=null; this.Argument=null; this.ReturnValue=null; this.ExitCode=null; this.ZIndex=0; this.AdjustPosInterval=-1; this.CallbackFunc=null; this.OnLoadFunc=null; this.Param=null; this.ModalSetCapture= false; this.UseRadWindow= true; this.Window=null; this.InnerHTML=null; this._overImage=null; }RadWindow.prototype.OnLoad= function ( ){if (this.Window && ""!=this.Window.document.title){ this.SetCaption(this.Window.document.title); }if (this.OnLoadFunc){ this.OnLoadFunc( ); }};RadWindow.prototype.SetCapture= function (bContainerCapture){if (this.UseRadWindow){if (null!=bContainerCapture){ this.bContainerCapture=bContainerCapture; }else if (null!=this.bContainerCapture){bContainerCapture=this.bContainerCapture; }else {bContainerCapture= false; }if (this.ModalSetCapture && this.IsIE){ this.ContentWrapperTable.setCapture(bContainerCapture); }}};RadWindow.prototype.ReleaseCapture= function ( ){if (this.UseRadWindow){if (this.ModalSetCapture && this.IsIE){if (this.ContentWrapperTable)this.ContentWrapperTable.releaseCapture( ); }}};RadWindow.prototype.SetZIndex= function (zIndex){ this.ZIndex=zIndex; if (this.ContentWrapperTable){ this.ContentWrapperTable.style.zIndex=this.ZIndex; }};RadWindow.prototype.ToggleContent= function ( ){if (this.UseRadWindow && this.IsIE){var displayStyle=""; if (parseInt(this.Height)==parseInt(this.ContentWrapperTable.style.height)){ this.SetHeight(0); displayStyle="\x6eone"; }else { this.SetHeight(this.Height); displayStyle="\x69nl\x69\156\x65"; }}};RadWindow.prototype.IsVisible= function ( ){if (this.ContentWrapperTable){return this.ContentWrapperTable.style.display==""; }return false; };RadWindow.prototype.ShowWindow= function (show,x,y){if (null==show){show= true; }var displayStyle=show?"": "\x6eone"; if (this.ContentWrapperTable){ this.ContentWrapperTable.style.display=displayStyle; }if (show){if (null!=x && null!=y){x+=10; if (this.ContentWrapperTable){ this.ContentWrapperTable.style.left=x+'\x70x'; this.ContentWrapperTable.style.top=y+'px'; }}}if (this.Parent){ this.Parent.OnShowWindow(this,show); }};RadWindow.prototype.Initialize2= function (contentElem,show,containerElem,modal,zIndex){ this.Initialize(contentElem,show); this.IsModal=modal; this.Container=containerElem; this.SetZIndex(zIndex); };RadWindow.prototype.Initialize= function (contentElem,show){if (this.Id){ this.ContentWrapperTable=document.getElementById("\x52adW\x69\156\x64owCon\x74entWr\x61pper"+this.Id); this.ContentWindow=document.getElementById("\x52\x61\x64Wi\x6edowConte\x6etWindo\x77"+this.Id); this.Caption=document.getElementById("\x52a\x64\x57ind\x6fwCaptio\x6e"+this.Id); if (null==show){var show= true; } this.ShowWindow(show); }else {alert("\x4eo win\x64\157\x77 Id pro\x76ided"); }} ; RadWindow.prototype.SetContentWindowSize= function (width,height){ this.Width=width; this.Height=height; } ; RadWindow.prototype.SetContentVisible= function (visible){if (this.ContentWindow){ this.ContentWindow.style.visibility=visible?"visi\x62le": "\x68idd\x65\156"; }} ; RadWindow.prototype.Close= function (exitCode,dialogCallbackFunction,execCallBack){if (null!=this.OnClientClosing && (this.OnClientClosing(exitCode)== false)){return; } this.ShowWindow( false); this.ExitCode=exitCode; if (this.AdjustPosInterval>-1){window.clearInterval(this.AdjustPosInterval); this.AdjustPosInterval=-1; }if (this.IsModal)this.ReleaseCapture( ); try {if (this.CallbackFunc && false !=execCallBack)this.CallbackFunc(this.ReturnValue,this.Param); if (dialogCallbackFunction){dialogCallbackFunction(this.ReturnValue,this.Param); }}catch (ex){}if (this.Parent)this.Parent.DestroyWindow(this ); if (!this.UseRadWindow && this.Window)this.Window.close( ); } ; RadWindow.prototype.ToggleCanMove= function (oDiv){if (!this.UseRadWindow)return; this.CanMove=!this.CanMove; oDiv.className=this.CanMove?"\122\x61dERa\x64WindowBu\x74tonPin\x4fff": "RadERad\x57\x69nd\x6fwButtonP\x69nOn"; if (!this.CanMove){if (this.IsIE){ this.TopOffset=parseInt(this.ContentWrapperTable.style.top)-RadGetScrollTop(document); this.StartUpdatePosTimer(100); }else { this.ContentWrapperTable.style.position="fixe\x64"; }}else {if (this.IsIE){window.clearInterval(this.AdjustPosInterval); this.TopOffset=null; }else { this.ContentWrapperTable.style.position="abso\x6c\165\x74e"; }}};RadWindow.prototype.StartUpdatePosTimer= function (iInterval){if (!this.UseRadWindow)return; this.AdjustPosInterval=window.setInterval("\x55pda\x74\x65Wi\x6edowPos(\x27"+this.Id+"\x27\051",iInterval); };function UpdateWindowPos(wndId){var wnd=GetEditorRadWindowManager( ).LookupWindow(wndId); if (wnd)wnd.SetPosition( ); }RadWindow.prototype.CanDrag= function ( ){if (!this.UseRadWindow)return true; return ("move"==this.DragMode && this.CanMove) || ("size"==this.DragMode && this.CanResize); };RadWindow.prototype.OnDragStart= function (e){ this.SetActive( true); if (!this.CanDrag( ))return; this.X=(e.offsetX==null)?e.layerX:e.offsetX; this.Y=(e.offsetY==null)?e.layerY:e.offsetY; MousePosX=e.clientX; MousePosY=e.clientY; this.SetContentVisible(this.ShowContentWhenMoving); RadWindowDragStart( ); } ; RadWindow.prototype.SetActive= function (activate){if (!this.UseRadWindow)return; if (activate){if (null!=RadWindowActiveWindow && RadWindowActiveWindow!=this )RadWindowActiveWindow.SetActive( false); RadWindowActiveWindow=this ; if (this.Parent)this.Parent.ActivateWindow(this ); }else {if (this ==RadWindowActiveWindow)RadWindowActiveWindow=null; }};RadWindow.prototype.HitTest= function (x,y){var left=parseInt(this.ContentWrapperTable.style.left); if (isNaN(left))return false; var top=parseInt(this.ContentWrapperTable.style.top); if (isNaN(top))return false; return left<=x && x<=(left+this.Width) && top<=y && y<=(top+this.Height); };RadWindow.prototype.SetPosition= function (left,top){if (!this.UseRadWindow){if (this.Window){ this.Window.dialogLeft=left; this.Window.dialogTop=top; }}else {if (!left)left=this.ContentWrapperTable.style.left; if (!top){if (this.TopOffset!=null)top=parseInt(this.TopOffset)+RadGetScrollTop(document); else top=this.ContentWrapperTable.style.top; }left=parseInt(left); top=parseInt(top); if (!isNaN(left) && !isNaN(top)){if (left<=0)left=0; if (top<=0)top=0; this.ContentWrapperTable.style.left=left+'\x70x'; this.ContentWrapperTable.style.top=top+'\x70x'; }}};RadWindow.prototype.GetWidth= function ( ){var width=0; if (!this.UseRadWindow){if (this.Window)width=this.Window.dialogWidth; }else {if (this.IsIE){width=parseInt(this.ContentWrapperTable.clientWidth); }else {width=parseInt(this.ContentWrapperTable.scrollWidth); }if (isNaN(width))width=0; }return width; };RadWindow.prototype.SetWidth= function (width){width=parseInt(width); if (isNaN(width))return; if (!this.UseRadWindow){if (this.Window){if (this.Window.dialogWidth){ this.Window.dialogTop=this.Window.screenTop-30; this.Window.dialogLeft=this.Window.screenLeft-4; this.Window.dialogWidth=width+"px"; }else { this.Window.outerWidth=width; }}}else {if (width)this.ContentWrapperTable.style.width=width+"\x70x"; }};RadWindow.prototype.GetHeight= function ( ){var height=0; if (!this.UseRadWindow){if (this.Window)height=this.Window.dialogHeight; }else {if (this.IsIE){height=parseInt(this.ContentWrapperTable.clientHeight); if (isNaN(height))height=0; }else {height=this.ContentWrapperTable.scrollHeight; }}return height; };RadWindow.prototype.SetHeight= function (height){height=parseInt(height); if (isNaN(height))return; if (!this.UseRadWindow){if (this.Window){if (this.Window.dialogWidth){ this.Window.dialogTop=this.Window.screenTop-30; this.Window.dialogLeft=this.Window.screenLeft-4; this.Window.dialogHeight=height+"p\x78"; }else { this.Window.outerHeight=height; }}}else {var oTable=this.ContentWrapperTable; var oFirstTable=oTable.getElementsByTagName("\x54ABLE")[0]; if (oFirstTable)oFirstTable.setAttribute("\x62o\x72\x64er","\x31"); this.ContentWrapperTable.style.height=height+"\x70x"; this.FixIeHeight(this.ContentWrapperTable,height); oFirstTable.setAttribute("border","\x30"); }};RadWindow.prototype.FixIeHeight= function (oElem,height){if (this.IsIE && "CSS1Co\x6dpat"==document.compatMode){var oHeight=oElem.offsetHeight; if (oHeight!=0 && oHeight!=height){var difference=(oHeight-height); var newHeight=(height-difference); if (newHeight>0){oElem.style.height=(newHeight+4)+"px"; }}}} ; function RadWindowUnInitializeDrag(targetWindow){var oSpan=RadWindowActiveWindowSpan; targetWindow.SetPosition(oSpan.style.left,oSpan.style.top); var extra=targetWindow.IsQuirksMode?6: 0; extra+=targetWindow.IsIE?2: 0; extraHeight=extra; if (targetWindow.IsIE && !targetWindow.IsQuirksMode && extraHeight>0)extraHeight-=2; targetWindow.SetSize(extra+(oSpan.clientWidth?oSpan.clientWidth:oSpan.offsetWidth),extraHeight+(oSpan.clientHeight?oSpan.clientHeight:oSpan.offsetHeight)); if (RadWindowActiveWindowSpan)RadWindowActiveWindowSpan.style.visibility="hidde\x6e"; }RadWindow.prototype.SetSize= function (width,height){if (!this.UseRadWindow && !document.all && this.Window && this.Window.resizeTo){ this.Window.resizeTo(width,height); }else { this.SetWidth(width); this.SetHeight(height); }if (width>0)this.Width=width; if (height>0)this.Height=height; };RadWindow.prototype.SetCaption= function (caption){if (this.Caption){ this.Caption.innerHTML=caption; }};var RadWindowActiveWindow=null; var RadWindowActiveWindowSpan=null; var MousePosX=0; var MousePosY=0; function RadWindowDragStart( ){if (!RadWindowActiveWindow.CanDrag( ))return; if (document.all && document.body.attachEvent){document.body.setCapture( ); document.body.attachEvent("onmo\x75semove",RadWindowDrag); document.body.attachEvent("onmouseu\x70",RadWindowDragEnd); }else if (document.addEventListener){document.addEventListener("mous\x65move",RadWindowDrag, false); document.addEventListener("mou\x73eup",RadWindowDragEnd, false); }RadWindowInitializeDrag(RadWindowActiveWindow); }function RadWindowDragEnd( ){if (document.all && document.body.detachEvent){document.body.detachEvent("\x6fnmou\x73\x65m\x6f\166\x65",RadWindowDrag); document.body.detachEvent("onm\x6fuseup",RadWindowDragEnd); document.body.releaseCapture( ); }else if (document.removeEventListener){document.removeEventListener("m\x6fusemo\x76\x65",RadWindowDrag, false); document.removeEventListener("\x6douseup",RadWindowDragEnd, false); }if (RadWindowActiveWindow.IsModal)RadWindowActiveWindow.SetCapture( ); RadWindowUnInitializeDrag(RadWindowActiveWindow); RadWindowActiveWindow.SetContentVisible( true); }function RadWindowDrag(e){if (RadWindowActiveWindow.CanDrag( )){switch (RadWindowActiveWindow.DragMode){case "\x6dove":RadWindowMove(e); break; case "\x73ize":RadWindowSize(e); break; }}e.cancelBubble= true; e.returnValue= false; if (e.preventDefault)e.preventDefault( ); MousePosX=e.clientX; MousePosY=e.clientY; return false; }function RadWindowInitializeDrag(targetWindow){if (!targetWindow)return; if (!RadWindowActiveWindowSpan){RadWindowActiveWindowSpan=document.createElement("DIV"); RadWindowActiveWindowSpan.className="\122\x61dETable\x57rapperRe\x73izeSp\x61n"; RadWindowActiveWindowSpan.style.position="absolute"; RadWindowActiveWindowSpan.style.zIndex=50000; document.body.appendChild(RadWindowActiveWindowSpan); }RadWindowActiveWindowSpan.style.visibility="\x76isibl\x65"; RadWindowActiveWindowSpan.style.top=targetWindow.ContentWrapperTable.style.top; RadWindowActiveWindowSpan.style.left=targetWindow.ContentWrapperTable.style.left; RadWindowActiveWindowSpan.style.width=parseInt(targetWindow.GetWidth( ))+"\x70x"; RadWindowActiveWindowSpan.style.height=parseInt(targetWindow.GetHeight( ))+"\x70x"; switch (targetWindow.DragMode){case "\x6dove":RadWindowActiveWindowSpan.style.cursor="d\x65fault"; break; case "size":RadWindowActiveWindowSpan.style.cursor="\x73e-resi\x7a\145"; break; }}function RadWindowMove(e){var RadWindowX=RadWindowActiveWindow.X; var RadWindowY=RadWindowActiveWindow.Y; var el=RadWindowActiveWindowSpan; var left=0; var top=0; if (document.all){left=e.clientX*1+RadGetScrollLeft(document)-RadWindowX; top=e.clientY*1+RadGetScrollTop(document)-RadWindowY; }else {left=e.pageX*1-RadWindowX-RadGetScrollLeft(document); top=e.pageY*1-RadWindowY-RadGetScrollTop(document); }if (left<0){left=0; }if (top<0){top=0; }el.style.left=left+"px"; el.style.top=top+"px"; }var minWidth=155; var minHeight=43; function RadWindowSize(e){var offsetX=e.clientX-MousePosX; var offsetY=e.clientY-MousePosY; var oSpan=RadWindowActiveWindowSpan; var width=oSpan.clientWidth?oSpan.clientWidth:oSpan.offsetWidth; var height=oSpan.clientHeight?oSpan.clientHeight:oSpan.offsetHeight; if (document.all && !window.opera && "CSS1Com\x70at"!=document.compatMode){width=oSpan.offsetWidth; height=oSpan.offsetHeight; }width+=offsetX; height+=offsetY; if (width<minWidth)width=minWidth; if (height<minHeight)height=minHeight; RadWindowActiveWindowSpan.style.width=width+"\x70x"; RadWindowActiveWindowSpan.style.height=height+"\x70x"; }function GetTopWindow( ){var topWindow=null; var argumentsContainParentWindow= false; try {if (window.dialogArguments.parentWindow && argumentsContainParentWindow){argumentsContainParentWindow= true; }}catch (ex){argumentsContainParentWindow= false; }if (window.dialogArguments!=null && argumentsContainParentWindow){topWindow=window.dialogArguments.parentWindow; }else if (window.opener && !document.all && window.isRadWindow){topWindow=opener; }else {topWindow=window; }var stopLoop= false; while (topWindow.parent && !stopLoop){try {topWindowTagName=topWindow.parent.tagName.toUpperCase( ); }catch (exception){topWindowTagName=""; }if (topWindow.parent==topWindow){break; }try {if (topWindow.parent.document.domain!=window.document.domain){break; }}catch (exc){stopLoop= true; continue; }try {if (topWindow.frameElement!=null && (topWindow.frameElement.tagName!="\x49FRAM\x45" || topWindow.frameElement.name!="RadW\x69ndowCon\x74ent")){break; }}catch (exc){alert('\x69n th\x65\040\x45xcepti\x6f\156\x21'); stopLoop= true; }topWindow=topWindow.parent; }return topWindow; }function Document_OnFocus(e){if (!e){e=window.event; }GetEditorRadWindowManager( ).ActivateWindow( ); }function Document_OnKeyDown(e){if (!e){e=window.event; }return GetEditorRadWindowManager( ).OnKeyDown(e); }function RadWindowInfo( ){ this.IsIE=(null!=document.all); this.ID=null; this.Url=""; this.InnerHtml=""; this.InnerObject=null; this.Width=300; this.Height=200; this.Caption=""; this.IsVisible= true; this.Argument=null; this.CallbackFunc=null; this.OnLoadFunc=null; this.Param=null; this.Resizable= true; this.Movable= true; this.CloseHide= false; this.UseClassicDialogs= true; }function GetEditorRadWindowManager( ){var topWindow=GetTopWindow( ); if (!topWindow.radWindowManager){topWindow.radWindowManager=new RadEditorWindowManager( ); }return topWindow.radWindowManager; }function RadEditorWindowManager( ){ this.ChildWindows=new Array( ); this.ActiveWindow=null; this.TopWindowZIndex=10001; this.ContainerPool=new Array( ); this.IsIE=(null!=document.all) && (window.opera==null); this._overImage=null; if (document.body!=null){document.body.onfocus=Document_OnFocus; if (this.IsIE && document.body.attachEvent){document.body.attachEvent("\157\x6ekeyd\x6fwn",Document_OnKeyDown); }else if (document.body.addEventListener){document.body.addEventListener("keydo\x77n",Document_OnKeyDown, false); }}}RadEditorWindowManager.prototype.ShowModalWindow= function (radWindowInfo){var wnd=this.CreateWindow( true ,radWindowInfo); return wnd; };RadEditorWindowManager.prototype.ShowModallessWindow= function (radWindowInfo){var wnd=this.CreateWindow( false ,radWindowInfo); return wnd; };RadEditorWindowManager.prototype.CreateWindow= function (bIsModal,radWindowInfo){if (!radWindowInfo)return null; if (window.opera)radWindowInfo.UseClassicDialogs= true; var id=""; if (!radWindowInfo.ID || radWindowInfo.ID==""){id=this.ChildWindows.length; }else {id=radWindowInfo.ID; }var caption=""; if (null==radWindowInfo.Caption){caption="\x5b"+id+"\x5d"; }else {caption=radWindowInfo.Caption; }var radWindow=this.GetWindow(id); radWindow.Argument=radWindowInfo.Argument; radWindow.Width=radWindowInfo.Width; radWindow.Height=radWindowInfo.Height; radWindow.CallbackFunc=radWindowInfo.CallbackFunc; radWindow.Param=radWindowInfo.Param; radWindow.CanResize=radWindowInfo.Resizable; radWindow.CanMove=radWindowInfo.Movable; radWindow.OnLoadFunc=radWindowInfo.OnLoadFunc; radWindow.UseRadWindow=!radWindowInfo.UseClassicDialogs; if (radWindowInfo.UseClassicDialogs && this.IsIE){var features="\x73tat\x75\163\x3ano;"+"\x72esizab\x6c\x65:y\x65\163\x3b"+"\x63\145n\x74\145\x72\072\x79es;"+"\x68elp\x3a\x6eo;"+"\x6dinimi\x7a\145\x3a\156\x6f\073"+"\x6daximize:\x6e\157\x3b"+"\x73\143\x72\x6fll\x3a\156\x6f\073"+"bor\x64\145\x72\x3ath\x69n;"+"\x73tatu\x73\x62ar\x3a\156o\x3b"+"\x64ialogWi\x64\164\x68\072"+radWindowInfo.Width+"px;"+"\144\x69\x61log\x48eight:"+radWindowInfo.Height+"\x70x"; if (radWindowInfo.InnerHtml && radWindowInfo.InnerHtml!=""){radWindow.InnerHTML=radWindowInfo.InnerHtml; }if (!radWindowInfo.Url || ""==radWindowInfo.Url)radWindowInfo.Url="ja\x76ascrip\x74:\047\x27"; var dialogArguments= {parentWindow:window,radWindow:radWindow,IsRadWindowArgs: true } ; window.showModalDialog(radWindowInfo.Url,dialogArguments,features); }else if (radWindowInfo.UseClassicDialogs && !this.IsIE){if (!radWindowInfo.Url || ""==radWindowInfo.Url)radWindowInfo.Url="j\x61vascr\x69\160\x74:\047\047"; window.childRadWindow=radWindow; radWindow.Window=window.open(radWindowInfo.Url,"\x5fblank","stat\x75s=no,too\x6cbar=no,\x6cocatio\x6e=no,res\x69zable=\x79es,m\x65nuba\x72=no,w\x69dth="+radWindowInfo.Width+"\x2chei\x67\150\x74="+radWindowInfo.Height+"\054\x6dodal=ye\x73"); }else if (!radWindowInfo.UseClassicDialogs){var container=null; if (this.ContainerPool.length>0){container=this.ContainerPool.pop( ); }else {container=document.createElement("\x53P\x41\x4e"); document.body.appendChild(container); }var oHtml=this.BuildWrapperTableHtml(id,radWindowInfo.Width,radWindowInfo.Height,caption,bIsModal,radWindowInfo.CloseHide); container.innerHTML=oHtml; var contentElem=(null!=radWindowInfo.InnerObject)?radWindowInfo.InnerObject:document.getElementById("RadWin\x64owCont\x65ntFrame"+id); radWindow.Initialize2(contentElem, true ,container,bIsModal, ++this.TopWindowZIndex); var frm=document.getElementById("\x52adW\x69\156\x64owCont\x65\156\x74Frame"+id); radWindow.Window=null!=frm?frm.contentWindow:null; radWindow.Iframe=frm; if (radWindowInfo.InnerHtml && radWindowInfo.InnerHtml!=""){var doc=frm.contentWindow.document; doc.open( ); doc.write(radWindowInfo.InnerHtml); doc.close( ); }else if (radWindowInfo.Url && radWindowInfo.Url!=""){frm.src=radWindowInfo.Url; }if (bIsModal){ this.SetCapture(radWindow, false); }if (null==radWindowInfo.IsVisible){radWindowInfo.IsVisible= false; }var windowStartPosition=this.GetWindowStartPosition(radWindowInfo); radWindow.SetSize(radWindowInfo.Width,radWindowInfo.Height); radWindow.ShowWindow(radWindowInfo.IsVisible,windowStartPosition.horizontal,windowStartPosition.vertical); }return radWindow; };RadEditorWindowManager.prototype.GetWindowStartPosition= function (radWindowInfo){var vcenterDeclination=parseInt(radWindowInfo.Height)/2; var hcenterDeclination=parseInt(radWindowInfo.Width)/2; var documentCenterPositions=this.GetDocumentVisibleCenter( ); var top=documentCenterPositions.vertical-vcenterDeclination; if (top<0)top=0; var left=documentCenterPositions.horizontal-hcenterDeclination; if (left<0)left=0; return {horizontal:left,vertical:top } ; } ; RadEditorWindowManager.prototype.GetDocumentVisibleCenter= function ( ){var innerWidth=0; var innerHeight=0; var canvas=document.body; var compatMode=!((RadControlsNamespace.Browser.IsMozilla || RadControlsNamespace.Browser.IsIE) && document.compatMode!="\x43SS1Comp\x61\164"); if (compatMode && !RadControlsNamespace.Browser.IsSafari){canvas=document.documentElement; }if (window.innerWidth){innerWidth=window.innerWidth; innerHeight=window.innerHeight; }else {innerWidth=canvas.clientWidth; innerHeight=canvas.clientHeight; }var documentVisibleCenterX=this.GetVisibleCenterCoordinate(canvas.scrollLeft,innerWidth); var documentVisibleCenterY=this.GetVisibleCenterCoordinate(canvas.scrollTop,innerHeight); return {horizontal:documentVisibleCenterX,vertical:documentVisibleCenterY } ; } ; RadEditorWindowManager.prototype.GetVisibleCenterCoordinate= function (documentStartDeclination,visibleSize){var visibleAreaMiddle=parseInt(visibleSize)/2; return parseInt(documentStartDeclination)+visibleAreaMiddle; } ; RadEditorWindowManager.prototype.DestroyWindow= function (childWindow){var nextWndToActivate=this.GetPrevWindow(childWindow.Id); this.UnregisterChild(childWindow); if (nextWndToActivate!=childWindow){ this.ActivateWindow(nextWndToActivate); }if (childWindow.Iframe){childWindow.Iframe.src="\x6aa\x76\x61sc\x72ipt:\047\047\x3b"; }eval(this.GetWindowVarName(childWindow.Id)+" = nul\x6c;"); if (childWindow.Container){ this.ContainerPool.push(childWindow.Container); }};RadEditorWindowManager.prototype.GetPrevWindow= function (id){var bNeedPrev= false; var retWnd=null; for (var i=this.ChildWindows.length-1; i>=0; i--){var wnd=this.ChildWindows[i]; if (wnd && wnd.Id==id){bNeedPrev= true; }else if (wnd && bNeedPrev){return wnd; }else if (null==retWnd){retWnd=wnd; }}return retWnd; };RadEditorWindowManager.prototype.CloseWindow= function (id){var wnd=this.LookupWindow(id); if (wnd){wnd.Close( ); }};RadEditorWindowManager.prototype.ActivateWindow= function (radWindow){if (!radWindow){radWindow=this.ActiveWindow; }if (radWindow){if (radWindow.IsModal){ this.SetCapture(radWindow, false); }if (radWindow!=this.ActiveWindow){if (this.ActiveWindow){ this.ActiveWindow.SetZIndex(this.TopWindowZIndex-1); }radWindow.SetZIndex(this.TopWindowZIndex); this.ActiveWindow=radWindow; }if (radWindow.IsModal){ this.ShowOverImage(radWindow, true); }}};RadEditorWindowManager.prototype.RegisterChild= function (childWindow){ this.ChildWindows[this.ChildWindows.length]=childWindow; };RadEditorWindowManager.prototype.UnregisterChild= function (childWindow){for (var i=0; i<this.ChildWindows.length; i++){var wnd=this.ChildWindows[i]; if (wnd==childWindow){ this.ChildWindows[i]=null; return; }}};RadEditorWindowManager.prototype.SetCapture= function (childWindow,bContainerCapture){try {if (childWindow){childWindow.SetCapture(bContainerCapture); }}catch (ex){}};RadEditorWindowManager.prototype.LookupWindow= function (id){for (var i=0; i<this.ChildWindows.length; i++){var wnd=this.ChildWindows[i]; if (wnd && id==wnd.Id){return wnd; }}return null; };RadEditorWindowManager.prototype.LookupRadWindowByBrowserWindowRef= function (browserWindow){for (var i=0; i<this.ChildWindows.length; i++){var radWindow=this.ChildWindows[i]; if (null!=radWindow && browserWindow==radWindow.Window){return radWindow; }}return null; };RadEditorWindowManager.prototype.GetCurrentRadWindow= function (browserWindow){if (browserWindow.dialogArguments && ( true ==browserWindow.dialogArguments.IsRadWindowArgs)){return browserWindow.dialogArguments.radWindow; }else if (browserWindow.opener!=null && browserWindow.opener.childRadWindow!=null){return browserWindow.opener.childRadWindow; }else {var oLast=this.LookupRadWindowByBrowserWindowRef(browserWindow); return oLast; }};RadEditorWindowManager.prototype.GetWindow= function (id){var wnd=this.LookupWindow(id); if (!wnd){var varName=this.GetWindowVarName(id); eval(varName+"\x20= new\x20\x52ad\x57indow(\047"+id+"\047\x29;"); wnd=eval(varName); wnd.Parent=this ; this.RegisterChild(wnd); }return wnd; };RadEditorWindowManager.prototype.GetWindowVarName= function (id){return "wi\x6edow.radW\x69\156\x64\157\x77\137"+id; };RadEditorWindowManager.prototype.GetWindowFromPos= function (x,y){var wnd=null; for (var i=0; i<this.ChildWindows; i++){var childWnd=this.ChildWindows[i]; if (childWnd && childWnd.HitText(x,y)){if (!wnd || wnd.ZIndex<childWnd.ZIndex){wnd=childWnd; }}}return wnd; };RadEditorWindowManager.prototype.OnShowWindow= function (childWindow,visible){if (visible){ this.ActiveWindow=childWindow; }else {if (this.ActiveWindow==childWindow){ this.ActiveWindow=null; }}if (childWindow.IsModal){ this.ShowOverImage(childWindow,visible); }};RadEditorWindowManager.prototype.OnKeyDown= function (evt){switch (evt.keyCode){case 115:if (evt.altKey && this.ActiveWindow){}else if (evt.ctrlKey && this.ActiveWindow){}evt.keyCode=8; break; case 27:if (this.ActiveWindow){ this.ActiveWindow.Close( ); }break; default:return; }evt.cancelBubble= true; evt.returnValue= false; };RadEditorWindowManager.prototype.BuildWrapperTableHtml= function (id,width,height,caption,bIsModal,bHide){var url=document.all?"\x6aavasc\x72\151\x70t:\047\x27;": ""; var closeFunc=bHide?"S\x68owWindow\x28false)": "\x43lose\x28\051"; var html=""; html+="\011\011\x3c\x74a\x62\154\x65\040\x62order=\x270\047\x20id=\047Rad\x57indow\x43onten\x74Wrappe\x72"+id+"\047 class=\x27\x52ad\x45TableWr\x61pper\047\x20st\x79le=\047\x77\x69dth: "+width+"\x3bheight\x3a"+height+";z-ind\x65\170:\x31000; po\x73\151\x74ion:abs\x6flute;\047 cell\x73paci\x6eg=\047\x30\047 cell\x70addin\x67=\047\x30\047\x20>\x0a"+"\x09\011\x09\074\x74r \x20style=\x27\150\x65\151\x67\150\x74:1px;\x27>\012"+"\011\x09\011\x09\074\x74d \x77\151\x64\164\x68\075\x271\047\x20cl\x61ss=\047RadETa\x62leWra\x70perHe\x61derLe\x66t\047\x20now\x72ap>\x3c/td>\012"+"\x09\011\011\x09\074\x74d widt\x68=\047\x3100%\047 class\x3d\047\x52ad\x45TableW\x72apper\x48eaderC\x65nter\x27 nowra\x70=\047\x74r\x75e\047\x20on\x6doused\x6fwn=\047radW\x69ndow_"+id+"\x2e\104\x72\x61gM\x6fde=\042\x6dove\x22; retu\x72n radW\x69\156\x64ow_"+id+"\x2eOnDragSt\x61\162\x74\050\x65vent);\x27\040\x6fnselec\x74start\x3d\047\x72et\x75\162\x6e fals\x65;\047\x3e\012"+"\011\x09\011\x09\011\x3cspan\x20id=\047\x52ad\x57\151\x6edowCap\x74ion"+id+"\047\x20onse\x6c\145\x63\x74st\x61rt=\047\x72etu\x72n fals\x65;\047\x20c\x6cass=\047RadERa\x64Windo\x77Heade\x72\047\x3e"+caption+"\074\x2fspan>\x0a"+"\x09\011\x09\011\x3c/t\x64>\012"; if (!bIsModal){html+="\x09\011\x3ctd \x77\151\x64\164\x68\075\x271\047\x20clas\x73=\047\x52a\x64ETable\x57rapper\x48eader\x43enter\x27 nowr\x61p>\012"+"\x09\011\x09\011\x09\074span cl\x61ss=\047\x52adE\x52adWind\x6fwBut\x74onPin\x4fff\047\x20id\x3d\047\x42utt\x6f\156\x50in\047\x20o\x6eclic\x6b=\047\x72ad\x57indow\x5f"+id+"\x2eToggleCa\x6e\115\x6f\x76e(\x74his)\047\076\x26nbsp;\x3c\x2fs\x70an>"+"\011\x09\011\x3c/td\x3e\012"; }var scrolling="auto"; if (this.GetWindow(id)!=null && this.GetWindow(id).Argument!=null){var customizedScrolling=this.GetWindow(id).Argument.scrolling; if (customizedScrolling){switch (customizedScrolling){case "yes":case "\x6eo":case "a\x75to":scrolling=customizedScrolling; break; default:break; }}}html+="\011\011\x09\011\x3ctd \x77\151\x64th=\047\x31\047\x20cl\x61ss=\047RadE\x54ableW\x72apper\x48eaderC\x65nter\x27 nowr\x61p>\012"+"\x09\011\x09\074\163\x70\141\x6e class=\x27\122\x61\144\x45RadWi\x6edow\x42\165\x74tonClo\x73e\047\x20id\x3d\047\x42utto\x6eClose\x27 onc\x6cick=\x27\162\x61dWind\x6fw_"+id+"\x2e"+closeFunc+"\047>&\x6ebsp;\x3c/span>\x0a"+"\011\x09\011\x09\074/td>\012"+"\011\011\x09\011\x3ctd widt\x68=\047\x31\047\040\x63lass=\x27\122\x61dETa\x62leWrap\x70erHea\x64erRig\x68t\047\x20no\x77rap>\074/td\x3e\012"+"\011\x09\011\x3c/tr\x3e\012"+"\011\x09\011\x3ctr sty\x6c\145\x3d\047\x68eight\x3a100%\047\040\x3e\012"+"\011\x09\011\x09\x3c\x74d \x73\164\x79\154\x65\075\x27height\x3a100%\x3b\047\x20co\x6cspan=\x27\065\x27>\012"+"\011\x09\011\x09\011\x3ctable\x20height=\x27100%\047\040\x73tyle=\x27heig\x68t:100\x25\047\x20bord\x65r=\047\x30\047 widt\x68=\047\x3100\x25\047\x20 ce\x6clspac\x69ng=\0470\047\x20cel\x6cpadd\x69ng=\0470\047\x3e\012"+"\011\x09\011\x09\011\x09\074\x74r \x73tyle=\047height:\x3100%\047>\012"+"\x09\011\x09\011\x09\011\x09\074\x74d w\x69dth=\047\x31\047\040\x63las\x73=\047\x52ad\x45Table\x57rappe\x72BodyL\x65ft\047\x20no\x77rap>\x3c/td>\x0a"+"\x09\011\x09\011\x09\011\x09\074td id=\x27\x52ad\x57indowC\x6fnten\x74Windo\x77"+id+"\047\x20 st\x79\x6ce=\x27height:\x3100%;bor\x64er:0px\x20\163\x6flid \x62lue;\047 heig\x68t=\047\x3100\x25\047\x20widt\x68=\047\x3100\x25\047\x20cla\x73s=\047\122\x61dETa\x62leWra\x70perBo\x64yCen\x74er\047 alig\x6e=\047\x6cef\x74\047\x20va\x6cign=\x27top\047 \x6fnse\x6cects\x74art\x3d\047\x72e\x74urn \x66als\x65;\047\x3e\x0a"+"\x09\011\x09\011\x09\011\x09\011\x3cifr\x61me nam\x65=\047\x52adW\x69ndow\x43onten\x74\047\x20fram\x65borde\x72=\047\x30px\047 sty\x6ce=\047\x68e\x69ght:1\x300%;wi\x64th:10\x30%;bor\x64er:0\x70x sol\x69d gr\x65en\047 id=\x27\122\x61dWin\x64owCo\x6etent\x46ram\x65"+id+"\047\x20src=\x27"+url+"\x27 scrolli\x6eg=\047"+scrolling+"\047\040\x62order=\047no\047\x20>\074\x2fif\x72ame>\012"+"\011\011\x09\011\x09\011\x09\074\x2ftd>\012"+"\x09\011\011\x09\011\x09\011\x3ctd wid\x74h=\047\x31\047\x20cl\x61ss=\047RadE\x54ableW\x72\141\x70perBo\x64yRigh\x74\047\x20nowr\x61p>\074/td>\012"+"\x09\011\011\x09\011\x09\074\x2ftr>\012"+"\x09\011\x09\011\x09\074\x2ftabl\x65>\012"+"\011\x09\011\x09\074\x2ftd>\x0a"+"\011\x09\011\x3c/tr>\x0a"+"\011\x09\011\x3ctr styl\x65\075\x27height\x3a1px;\047\076\x0a"+"\011\011\x09\011\x3ctd cols\x70an=\047\x35\047\040\x77idth=\x27100%\x27 styl\x65=\047\x68eig\x68t:1px\x3b\047\x20>\012"+"\011\011\x09\011\x09\074\x74able\x20\142\x6f\162\x64\145\x72=\047\x30\047 widt\x68=\047\x3100%\x27 heig\x68t=\047\x31\047\040\x63ell\x73paci\x6eg=\047\x30\047 cell\x70addi\x6eg=\047\x30\047>\012"+"\x09\011\x09\011\011\x09\074\x74r>\012"+"\011\011\x09\011\x09\011\x09\074\x74d w\x69\144\x74\150\x3d\047\x31\047\x20c\x6cass=\047RadET\x61bleWr\x61pperFo\x6fterLe\x66t\047\x20no\x77rap>&\x6ebsp;\x3c/td>\012"+"\011\011\x09\011\x09\011\x09\074\x74d co\x6cspan=\0473\047\x20id=\x27Bord\x65rBotto\x6d\047\x20wid\x74h=\047\x3100\x25\047\x20cla\x73s=\047\x52ad\x45Table\x57rapp\x65rFoo\x74erCen\x74er\047\x20n\x6fwrap\x3e&nbsp\x3b\074\x2ftd>\x09\011\x0a"+"\011\x09\011\x09\011\x09\011\x3ctd w\x69\144\x74h=\047\x31\047\x20i\x64=\047\x43or\x6eerBot\x74omRig\x68t\047\x20cla\x73s=\047\x52a\x64ETabl\x65Wrapp\x65rFoot\x65rRigh\x74\047\x20onm\x6fusedo\x77n=\047radW\x69ndow_"+id+".\x44ragMode=\x22\163\x69\172e\x22; retu\x72n radW\x69\156\x64ow_"+id+".OnDr\x61gStart(\x65\166e\x6et);\047\x20on\x73\145\x6c\145\x63tsta\x72t=\047\162\x65turn \x66alse;\x27 nowr\x61p>&nb\x73p;\074\x2ft\x64>\012"+"\011\x09\011\x09\011\x09\074\x2ftr\x3e\012"+"\x09\011\x09\011\011\x3c/table>\x0a"+"\x09\011\x09\011\x3c/td\x3e\012"+"\x09\011\x09\074\x2ftr>\012"+"\x09\011\x3c/table\x3e\012"; return html; };RadEditorWindowManager.prototype.SetOverImage= function (imageId){ this._overImage=document.getElementById(imageId); };RadEditorWindowManager.prototype.GetOverImage= function ( ){if (!this._overImage){ this._overImage=document.getElementById("\x4fVER_IM\x47"); }return this._overImage; };RadEditorWindowManager.prototype.ShowOverImage= function (wnd,visible){var overImage=this.GetOverImage( ); if (overImage){if (wnd && visible){var viewPortSize=RadControlsNamespace.Screen.GetViewPortSize( ); overImage.style.position="\x61bsolu\x74\x65"; overImage.style.left=0; overImage.style.top=0; overImage.style.width=viewPortSize.width+"\x70x"; overImage.style.height=viewPortSize.height+"px"; overImage.style.zIndex=wnd.ZIndex; overImage.style.display=""; }else {overImage.style.display="n\x6fne"; }}};function RadGetScrollTop(oDocument){if (oDocument.documentElement && oDocument.documentElement.scrollTop){return oDocument.documentElement.scrollTop; }else {return oDocument.body.scrollTop; }}function RadGetScrollLeft(oDocument){if (oDocument.documentElement && oDocument.documentElement.scrollLeft){return oDocument.documentElement.scrollLeft; }else {return oDocument.body.scrollLeft; }}function CloseDlg(returnValue,callbackFunction,execCallBack){if (window.radWindow){window.radWindow.ReturnValue=returnValue; window.radWindow.Close(null,callbackFunction,execCallBack); }}function InitializeRadWindow(editorID){window["\x47etDia\x6c\157\x67Argume\x6ets"]= function (isInSpell){if (window["radWindo\x77"]){if (isInSpell){return window["\x72adWindo\x77"].Argument.CustomArguments; }else {return window["radWin\x64ow"].Argument; }}else {return null; }};window["\151\x73RadWindo\x77"]= true; window["\x72adWind\x6f\167"]=GetEditorRadWindowManager( ).GetCurrentRadWindow(window); if (window["\162\x61dWindow"]){if (window.dialogArguments){window["radWi\x6edow"].Window=window; }window["rad\x57indow"].OnLoad( ); }var dialogArguments=GetDialogArguments( ); if (dialogArguments){if (dialogArguments.HideEditorStatusBar){dialogArguments.HideEditorStatusBar(editorID); }}if (document.addEventListener){document.onclick= function (e){var eventTarget=e.target; if (eventTarget && (eventTarget.tagName=="\x42UTTON" || (eventTarget.tagName=="INPUT" && eventTarget.type.toLowerCase( )=="bu\x74ton"))){e.cancelBuble= true; e.returnValue= false; if (e.preventDefault)e.preventDefault( ); return false; }} ; }}

