"use strict";function AttachmentPopupShow(n){ATTACHMENT_REORDER=!0;ATTACHMENT_TYPE=n;ATTACHMENT_DIRECT="";ATTACHMENT_ITEM=null;CONTEXT_ATTACH_VIEWER=!1;AttachmentSetReorderState();var i=ATTACHMENT_TYPE,t=40;n==="Edit"?(i="Entry",t=TILE_IS_SINGLE?210:310):n==="Detail"&&(i="Finding",t=310);_Element("AttachmentContainer").SetStyle("top",t+"px");_Element("AttachmentControls").SetStyle("top",t+"px");_Element("AttachmentIconContainer").SetStyle("top",t+32+"px");_Element("AttachmentControlText").SetInnerText(i+" Attachments");AttachmentPopupPrepare();AttachmentPopupOpen();AttachmentPopupThumbnails()}function AttachmentPopupPrepare(){_$PageLock();_Element("AttachmentIconIndicator").SetDisplay(!1);CommonRemoveChildren(_Element("AttachmentIconList").Object)}function AttachmentPopupThumbnails(){var i=ATTACHMENT_TYPE!=="Project"?TILE_ID:-1,t=-1;ATTACHMENT_TYPE==="Detail"&&(t=FINDING_ID<0?-2:FINDING_ID);var r=_Navigator("AJAX/Attachment/Load_Thumbnails.aspx",""),n=_Element("AttachmentLoadForm").Object;_Element("Attachment:Load:ProjectId",n).SetValue(GLOBAL_PROJECT_ID);_Element("Attachment:Load:TileId",n).SetValue(i);_Element("Attachment:Load:FindingId",n).SetValue(t);n.action=r.FullUrl;$_DocElement.SetDisabled(!1);n.submit();_$PageLock()}function AttachmentPopupThumbnailsLoaded(){var i=_Element("AttachmentIconList"),r,u,n,t;if(ATTACHMENT_TYPE!=="Project"&&(r=i.Object.childElementCount,EditAttachSet(ATTACHMENT_TYPE,r)),ATTACHMENT_REORDER)for(u=i.Object.children,n=[].slice.call(u),t=0;t0&&e>w?(r=!0,v=_NavigatorRecaller($_PopupDialogWarningId,null,"AttachmentImportDisplay"),o="The combined file size of all selected attachments ( "+l+" MB )\n\nexceeds the maximum allowable size of "+b+" MB.",CommonDialog($_PopupDialogErrorId,"Error","",o,0,90,!1,v)):h>0&&e>p&&(o="The combined file size of all selected attachments ( "+l+" MB ) may require some time to process.\n\nIf you wish to continue, please be patient and do not close or refresh your browser during execution.\n\nClick 'Cancel' to clear and reselect attachments.\nClick 'Continue' to proceed with the currently selected attachments.",CommonDialog($_PopupDialogWarningId,"Warning","",o,20,90,!0,null,!0),$_NavigatorStop=_NavigatorRecaller($_PopupDialogWarningId,null,"AttachmentImportDisplay"),$_NavigatorContinue=_NavigatorRecaller($_PopupDialogWarningId))}_Element("Attachment:Import:Title").SetInnerText(y);_Element("Attachment:Import:Enabled").SetDisplay(!r);_Element("Attachment:Import:Disabled").SetDisplay(r);_$PopupReposition()}function AttachmentImport(){var t=_Navigator("AJAX/Attachment/Import.aspx",""),n=_Element("AttachmentImportForm").Object;n.action=t.FullUrl;n.submit();_$PageLock()}function AttachmentImportResponse(n){var t;if(!CommonError(n)){if(_$PopupClose("Popup:Attachment:Import"),ATTACHMENT_TYPE==="Detail"&&(FINDING_ID<0&&(t=_Element("Hidden:Finding:TypeCode").GetString().GetValue("A")),FINDING_ID=_Number(n.substring(1)).GetValue(-1),SUMMARY_RELOAD=SummaryIsOpen()),TILE_RELOAD=EditIsOpen(),PUBLISH_RELOAD=GLOBAL_IS_PUBLISH_MODE,ATTACHMENT_DIRECT!==""){EditAttachIncrement(ATTACHMENT_DIRECT,ATTACHMENT_COUNT);EditDim(ATTACHMENT_DIRECT,!1);return}AttachmentPopupPrepare();AttachmentPopupThumbnails();return}}function AttachmentViewerOpen(n,t,i,r){var f,e;if(CONTEXT_ATTACH_VIEWER=r,t){AttachmentExportLock();f="AJAX/Attachment/Export.aspx";e=_Navigator(f,"");var u=_Element("AttachmentViewForm").Object,s=_Export(e,u,"AttachmentExportUnlock"),o=_$PageIsMobile();u.target=o?"_blank":"Global:Frame";_Element("Attachment:View:ProjectId",u).SetValue(GLOBAL_PROJECT_ID);_Element("Attachment:View:AttachmentId",u).SetValue(n);_Element("Attachment:View:IsExternal",u).SetValue(o?1:0);s.Post();return}AttachmentPopupDim();_$PageLock();AttachmentViewerLoadImage(n,i)}function AttachmentViewerLoadImage(n,t){var r="&p="+GLOBAL_PROJECT_ID+"&i="+n,u="AttachmentContextMenuShow( event, this, "+n+", false, "+t+", true );",f=Function("event",u),i=_Element("Attachment:Viewer:Image").Object,e=_Navigator("AJAX/Attachment/View.ashx",r);i.src=e.FullUrl;i.oncontextmenu=f}function AttachmentViewerLoaded(){_$PageBusy(!1);CommonOpenPopup(null,null,"Popup:Attachment:Viewer","Attach-View",null,_NavigatorRecaller("",null,"AttachmentPopupEnable"))}function AttachmentViewerDim(n){var t=_Element("Popup:Attachment:Viewer");t.SetDim(n);t.SetDisabled(n)}function AttachmentViewerEnable(){_$PageDim();_$PageBusy(!1);AttachmentViewerDim(!1)}function AttachmentExportLock(){if(CONTEXT_ATTACH_VIEWER){AttachmentViewerDim();return}AttachmentPopupDim()}function AttachmentExportUnlock(){if(CONTEXT_ATTACH_VIEWER){AttachmentViewerEnable();return}AttachmentPopupEnable()}function AttachmentAction(n){_$PopupClose("PopupAttachmentContextMenu");var t=n.split("|"),r=t[0]+".aspx",u="AJAX/Attachment/"+r,f=_Navigator(u,""),i=_Ajax(f,"AttachmentActionResponse");i.ObjectStore=t[3]*1;i.FormData="ProjectId="+GLOBAL_PROJECT_ID+"&AttachmentId="+CONTEXT_ATTACH_ID+"&IsInline="+t[1]+"&IsAppendix="+t[2];AttachmentExportLock();_$PageLock();i.Post()}function AttachmentActionResponse(n){var t=CONTEXT_ATTACH_VIEWER?"_AttachmentViewerEnable":"_AttachmentPopupEnable";CommonAjaxError(n,t)||(CONTEXT_ATTACH_VIEWER?n.ObjectStore===2?AttachmentViewerLoadImage(CONTEXT_ATTACH_ID,CONTEXT_ATTACH_DISPLAY):_$PopupClose("Popup:Attachment:Viewer"):AttachmentPopupEnable(),n.ObjectStore>0&&(TILE_RELOAD=EditIsOpen(),ATTACHMENT_TYPE==="Detail"&&(SUMMARY_RELOAD=SummaryIsOpen())),PUBLISH_RELOAD=GLOBAL_IS_PUBLISH_MODE,AttachmentPopupPrepare(),AttachmentPopupThumbnails())}function AttachmentExportError(n){$_ExportTimer&&clearTimeout($_ExportTimer);CommonError(n,"_AttachmentExportUnlock")}function AttachmentContextMenuShow(n,t,i,r,u,f){ATTACHMENT_ITEM=_Element(t);CONTEXT_ATTACH_ITEM=ATTACHMENT_ITEM.Clone();CONTEXT_ATTACH_TIME=_Date().Value.getTime();CONTEXT_ATTACH_ID=i;CONTEXT_ATTACH_EXTERNAL=r;CONTEXT_ATTACH_DISPLAY=u;CONTEXT_ATTACH_VIEWER=f;_Element(CONTEXT_ATTACH_ITEM.Object.firstElementChild).SetClassName("attachment-inner-selected");var e=_Element("AttachmentContextMenu").Object.children,s=f?"Mouse":"Context-Attach",o=ATTACHMENT_TYPE==="Project";_Element(e[0]).SetDisplay(!r&&f);_Element(e[1]).SetDisplay(!r&&!f);_Element(e[3]).SetDisplay(!GLOBAL_IS_READ_ONLY);_Element(e[4]).SetDisplay(!GLOBAL_IS_READ_ONLY&&!r);_Element(e[5]).SetDisplay(!GLOBAL_IS_READ_ONLY&&!r);_Element(e[6]).SetDisplay(!GLOBAL_IS_READ_ONLY&&!r);_Element(e[7]).SetDisplay(!GLOBAL_IS_READ_ONLY&&!r);_Element(e[8]).SetDisplay(!GLOBAL_IS_READ_ONLY);_Element(e[9]).SetDisplay(!GLOBAL_IS_READ_ONLY&&!r);_Element(e[10]).SetDisplay(!GLOBAL_IS_READ_ONLY&&!r&&!o&&u!==1);_Element(e[11]).SetDisplay(!GLOBAL_IS_READ_ONLY&&!r&&!o&&u===1);_Element(e[12]).SetDisplay(!GLOBAL_IS_READ_ONLY&&!r&&u!==2);_Element(e[13]).SetDisplay(!GLOBAL_IS_READ_ONLY&&!r&&u===2);_Element(e[14]).SetDisplay(!GLOBAL_IS_READ_ONLY&&!r&&!o&&u!==3);_Element(e[15]).SetDisplay(!GLOBAL_IS_READ_ONLY&&!r&&!o&&u===3);_Element(e[16]).SetDisplay(!GLOBAL_IS_READ_ONLY&&!r&&u!==0);_Element(e[17]).SetDisplay(!GLOBAL_IS_READ_ONLY&&!r&&u===0);CommonOpenPopup(n,t,"PopupAttachmentContextMenu",s,"AttachmentIcon",_NavigatorRecaller("",null,"AttachmentContextMenuClose",[Number(CONTEXT_ATTACH_TIME)]))}function AttachmentContextMenuClose(n){CONTEXT_ATTACH_TIME!==null&&n===CONTEXT_ATTACH_TIME&&(CommonClosePopup(!1),CONTEXT_ATTACH_ITEM!==null&&(_Element(CONTEXT_ATTACH_ITEM.Object.firstElementChild).SetClassName("attachment-inner"),CONTEXT_ATTACH_ITEM=null))}function AttachmentContextClose(){_$PopupClose("PopupAttachmentContextMenu");_$PopupClose("Popup:Attachment:Viewer")}function AttachmentContextView(){_$PopupClose("PopupAttachmentContextMenu");AttachmentViewerOpen(CONTEXT_ATTACH_ID,CONTEXT_ATTACH_EXTERNAL,CONTEXT_ATTACH_DISPLAY,CONTEXT_ATTACH_VIEWER)}function AttachmentContextExport(){_$PopupClose("PopupAttachmentContextMenu");AttachmentViewerOpen(CONTEXT_ATTACH_ID,!0,CONTEXT_ATTACH_DISPLAY,CONTEXT_ATTACH_VIEWER)}function AttachmentContextDelete(){_$PopupClose("PopupAttachmentContextMenu");$_NavigatorContinue=_NavigatorRecaller($_PopupDialogWarningId,null,"AttachmentAction",["Delete|0|0|1"]);CommonDialog($_PopupDialogWarningId,"Warning","","Are you sure you want to delete the selected attachment?\n\nClick 'Cancel' to abort the operation.\nClick 'Continue' to delete the attachment.",20,90,!0,null,!0)}function AttachmentContextRotate90(){AttachmentAction("Rotate|1|0|2")}function AttachmentContextRotate270(){AttachmentAction("Rotate|0|0|2")}function AttachmentContextInvert(){AttachmentAction("Invert|0|0|2")}function AttachmentContextInline(){AttachmentAction("Set_Display|1|0|0")}function AttachmentContextAppendix(){AttachmentAction("Set_Display|0|1|0")}function AttachmentContextAll(){AttachmentAction("Set_Display|1|1|0")}function AttachmentContextNone(){AttachmentAction("Set_Display|0|0|0")}function AttachmentCacheIcons(){_$ImageCacheExplicit("Images/Application/","Reorder_On.png");_$ImageCacheExplicit("Images/Application/","Reorder_Off.png")}function AttachmentSetReorderState(){var t,i,n;ATTACHMENT_REORDER=!ATTACHMENT_REORDER;t=ATTACHMENT_REORDER?"Reorder_On.png":"Reorder_Off.png";i=ATTACHMENT_REORDER?"OFF":"ON";_$ImageSwap("AttachmentsReorderIcon",t);n=_Element("AttachmentsReorderIcon");n.IsValid&&(n.Object.title="Turn attachment reorder mode "+i);AttachmentPopupPrepare();AttachmentPopupThumbnails()}function AttachmentDragInit(n){var r;ATTACH_DRAG_CACHE!==null&&AttachmentDrop(ATTACH_DRAG_CACHE,ATTACH_DRAG_CACHE.OverIndexes);ATTACH_DRAG_CACHE=n;var e=n.ScrollElement.GetRectangle(),t=n.DragElement,i=t.GetRectangle().Scroll().ScrollElement($_Body,!1),u=_Element(t.Object.firstElementChild),f=_Element(t.Object.parentElement);ATTACH_DRAG_CLONE=_Element(t.Object.cloneNode(!0));ATTACH_DRAG_CLONE.SetStyle("opacity",.3);f.Object.insertBefore(ATTACH_DRAG_CLONE.Object,t.Object);$_Body.Object.appendChild(t.Object);r=i.Left;t.SetStyle("opacity",.6);t.SetStyle("position","absolute");t.SetStyle("left",r+"px");t.SetStyle("top",i.Top+"px");u.SetStyle("cursor","no-drop")}function AttachmentDragOver(n,t){var i=AttachmentGetTarget(n,t),f=_Element(i.Object.firstElementChild),h=_Element(n.DragElement.Object.firstElementChild),r=AttachmentIsLeftHalf(n,f),c=i.Object.getAttribute("attachid"),l=_Number(c).GetValue(-101),u=n.DragElement.GetWidth(),e="pointer",o,s;r&&i.Object.previousElementSibling===ATTACH_DRAG_CLONE.Object&&(u=0,e="no-drop");r||i.Object.nextElementSibling!==ATTACH_DRAG_CLONE.Object||(u=0,e="no-drop");o=r?u:0;s=r?0:u;f.SetStyle("margin-left",o+"px");f.SetStyle("margin-right",s+"px");h.SetStyle("cursor",e)}function AttachmentDragOut(n,t){ConfigDragOut(n,t)}function AttachmentGetTarget(n,t){return ListGetTarget(n,t)}function AttachmentIsLeftHalf(n,t){return ConfigIsLeftHalf(n,t)}function AttachmentDrop(n,t){var u=n.DragElement,p=_Element(u.Object.firstElementChild),o=_Element("AttachmentIconList"),r=AttachmentGetTarget(n,t),w=r!==null,i=ATTACH_DRAG_CLONE.Object,f=i,s,h,c,a,v,e;if(w){var b=_Element(r.Object.firstElementChild),l=AttachmentIsLeftHalf(n,b),k=r.Object.getAttribute("attachid"),nt=_Number(k).GetValue(-101),d=r.Object.previousElementSibling;f=l&&d===i?i:r.Object;l||(s=r.Object.nextElementSibling,f=s===i?i:s);AttachmentDragOut(n,t)}if(u.SetStyle("position","static"),u.SetStyle("opacity",1),o.Object.insertBefore(u.Object,f),p.SetStyle("cursor","pointer"),o.Object.removeChild(i),ATTACH_DRAG_CLONE=null,ATTACH_DRAG_CACHE=null,f!==i){for(h=[],c=o.Object.children,e=0;e=1e3||i),a=_Element("Category:Edit:Save"),tt=GLOBAL_IS_CONFIG_MODE?[]:["IsParagraph"],v=i||GLOBAL_IS_CONFIG_MODE?"New Category Description:":"Project Override Description:",y=i||GLOBAL_IS_CONFIG_MODE?"New Category Button Name:":"Project Override Button Name:",p=i||GLOBAL_IS_CONFIG_MODE?"Default Category Page Break Setting:":"Project Override Page Break Setting:",w=_Number(t.Get("DefaultBreak")).GetValue(0),o=_Number(t.Get("ProjectBreak")).GetValue(0),s=_Element("Editable:Category:ProjectBreak"),b=s.GetOptionByValue(w).text,k=s.GetOptionByValue(o).text,u=_Element("Editable:Category:IsParagraph"),d=u.GetOptionByValue(0).text,g=u.GetOptionByValue(1).text,f;_Element("Category:Edit:ContainerLong").SetDisplay(!i);_Element("Category:Edit:ContainerShort").SetDisplay(!i);_Element("Category:Edit:ContainerBreak").SetDisplay(!GLOBAL_IS_CONFIG_MODE);_Element("Category:Edit:ContainerStatus").SetDisplay(l);_Element("Category:Edit:RowLong").SetDisplay(!r||h!=="");_Element("Category:Edit:RowShort").SetDisplay(!r||c!=="");_Element("Category:Edit:LabelLong").SetInnerText(v);_Element("Category:Edit:LabelShort").SetInnerText(y);_Element("Category:Edit:LabelBreak").SetInnerText(p);_Element("Display:Category:DefaultBreak").SetInnerText(b);_Element("Readonly:Category:ProjectBreak").SetInnerText(k);_Element("Editable:Category:ProjectBreak").SelectValue(o);_DataElement(t,"ProjectId","Category").SetHiddenInputString();_DataElement(t,"CategoryId","Category").SetHiddenInputString();_DataElement(t,"DefaultLong","Category").SetHiddenInputString();_DataElement(t,"DefaultShort","Category").SetHiddenInputString();_DataElement(t,"ProjectLong","Category").SetInputString();_DataElement(t,"ProjectShort","Category").SetInputString();_DataElement(t,"IsParagraph","Category").SetListBoxBoolean(null,null,d,g);_DataElement(t,"IsEnabled","Category").SetListBoxBoolean();f=_EditMode("Category",!0,"Category:Edit:Form");u=_Element("Editable:Category:IsParagraph");f.Enable(!r);f.EnableElement(u,GLOBAL_IS_CONFIG_MODE);a.SetDisplay(!r);CommonOpenPopup(null,null,"Popup:Category:Edit","Edit-Category");r||_Element("Editable:Category:ProjectLong").Focus()}function CategorySave(){if(GLOBAL_IS_CONFIG_MODE){var n=0,t="The following error occurred when attempting to save the category configuration:\n",i=_Element("Editable:Category:ProjectLong").GetString().Trim().Value,e=_Element("Editable:Category:ProjectShort").GetString().Trim().Value,r=_Element("Editable:Category:IsEnabled").GetNumber().GetValue(-1);if(i||(t+="\n"+ ++n+") A valid entry is required for the category description.",_$ElementTrack("Editable:Category:ProjectLong")),r<0&&(t+="\n"+ ++n+") A valid selection is required for the category visibility.",_$ElementTrack("Editable:Category:IsEnabled")),n>0){CommonDialog($_PopupDialogErrorId,"Error","",t);return}}var u=_Navigator("AJAX/Category/Save.aspx",""),f=_Ajax(u,"CommonAjaxResponse","Category:Edit:Form");_$PageLock();f.Post()}function CategoryContextMenu(n){var r=_Event(n),t,i;CONTEXT_CATEGORY_ID=CategoryGetId(r);t=_Element("CategoryContextMenu").Object.children;GLOBAL_IS_CONFIG_MODE?(i=CONTEXT_CATEGORY_ID>=1e3,_Element(t[4]).SetDisplay(i),_Element(t[5]).SetDisplay(!i)):(_Element(t[2]).SetDisplay(!GLOBAL_IS_READ_ONLY),_Element(t[3]).SetDisplay(GLOBAL_IS_READ_ONLY),_Element(t[5]).SetDisplay(!GLOBAL_IS_READ_ONLY),_Element(t[6]).SetDisplay(GLOBAL_IS_READ_ONLY),_Element(t[7]).SetDisplay(!GLOBAL_IS_READ_ONLY),_Element(t[8]).SetDisplay(GLOBAL_IS_READ_ONLY),_Element(t[9]).SetDisplay(!GLOBAL_IS_READ_ONLY),_Element(t[10]).SetDisplay(GLOBAL_IS_READ_ONLY));CommonOpenPopup(n,CategoryGetObject(r),"Popup:Category:ContextMenu","Context","CategoryContainer")}function CategoryContextSelect(){CategoryRequest(CONTEXT_CATEGORY_ID)}function CategoryContextEdit(){CategoryEdit(CONTEXT_CATEGORY_ID)}function CategoryContextSetNotApplicable(){CategoryContextSet("Set_Not_Applicable")}function CategoryContextSetCompleted(){CategoryContextSet("Set_Completed")}function CategoryContextSetIncomplete(){CategoryContextSet("Set_Incomplete")}function CategoryContextDelete(){CategoryContextSet("Delete")}function CategoryContextSet(n){$_NavigatorContinue=_NavigatorRecaller($_PopupDialogWarningId,null,"CategorySet",[n]);var t;switch(n){case"Set_Not_Applicable":t="This operation will mark all entries within the category as 'Not Applicable'.\n\nAll entry values, findings and attachments will be preserved.\n\nClick 'Cancel' to abort the operation.\nClick 'Continue' to complete the action.";break;case"Set_Completed":t="This operation will update multiple entries within the category.\n\nAny entry with a status of 'Not Started' will be marked as 'Not Applicable'.\nAny entry with a status of 'In Progress' will be marked as 'Completed'.\n\nClick 'Cancel' to abort the operation.\nClick 'Continue' to complete the action.";break;case"Set_Incomplete":t="This operation will update multiple entries within the category.\n\nAny entry with a status of 'Completed' will be marked as 'In-Progress'.\nAny entry with a status of 'Not Applicable' and an associated value, finding, or\nattachment will be marked as 'In-Progress'.\nAll other entries with a status of 'Not Applicable' will be marked as 'Not Started'.\n\nClick 'Cancel' to abort the operation.\nClick 'Continue' to complete the action.";break;case"Delete":t="This operation will delete the selected category and all associated entries.\n\nThe delete process is permanent and cannot be undone.\n\nOnce executed, any project entry data associated with the category will be irretrievable.\n\nUse the 'Export Configuration To File' function to create a backup of the current\nconfiguration prior to deleting.\n\nClick 'Cancel' to abort the operation.\nClick 'Continue' to complete the action."}CommonDialog($_PopupDialogWarningId,"Warning","",t,20,90,!0,null,!0)}function CategorySet(n){var i=n==="Delete",r=n+".aspx",u="AJAX/Category/"+r,f=_Navigator(u,""),t=_Ajax(f,"CommonAjaxResponse"),e="CategoryId="+CONTEXT_CATEGORY_ID,o=i?"":"&ProjectId="+GLOBAL_PROJECT_ID;t.FormData=e+o;_$PageLock();t.Post()}function CheckShow(){CHECK_LOAD_COUNT=0;GLOBAL_IS_READ_ONLY||CommonRemoveChildren(_Element("CheckOptionsList").Object);CheckFilterSet("All");CheckOpen();CheckLoad("Results",!1);GLOBAL_IS_READ_ONLY||CheckLoad("Options",!1)}function CheckLoad(n,t){var u,r;t&&(u="Check"+n+"List",r=_Element("Check"+n+"List"),CommonRemoveChildren(r.Object));var f=n==="Results"?"Items":"Options",e="AJAX/Checklist/Load_"+f+".aspx",o=_Navigator(e,""),i=_Ajax(o,"CheckLoadResponse");i.FormData="ProjectId="+GLOBAL_PROJECT_ID;i.ObjectStore={Suffix:n,Reload:t};_$PageLock();i.Post()}function CheckLoadResponse(n){var r=n.ObjectStore.Reload?"Force":"",u="_Check"+r+"Unlock",i,t;CommonAjaxError(n,u)||(i=n.Response.substring(1),t=n.ObjectStore.Suffix,CHECK_LIST[t]=_DataTable().FromString(i),CheckAddItems(t),CheckUnlock(n.ObjectStore.Reload))}function CheckOpen(){var n="CheckContainer";CHECK_POPUP=$_PopupCache[n];CHECK_POPUP instanceof _Popup||(CHECK_POPUP=_Popup(n),CHECK_POPUP.OpenHandler=_NavigatorRecaller("",null,"CheckOpenHandler"),CHECK_POPUP.CloseHandler=_NavigatorRecaller("",null,"CheckCloseHandler"));CHECK_POPUP.Open()}function CheckOpenHandler(){CheckDim();window.addEventListener("resize",CheckResize)}function CheckClose(){CommonClosePopup();CHECK_POPUP instanceof _Popup&&CHECK_POPUP.Close()}function CheckCloseHandler(){window.removeEventListener("resize",CheckResize)}function CheckDim(n){var t,r,i;if(n=typeof n=="boolean"?n:!0,t=_Element("CheckContainer"),r=t.Object.children,t.SetDim(n),t.SetDisabled(n),!n)for(i=0;i=2)&&CheckEnable()}function CheckForceUnlock(){CheckUnlock(!0)}function CheckAjaxError(n){CommonAjaxError(n,"_CheckEnable")||CheckEnable()}function CheckAjaxReset(n){var i=n.Response.charAt(0),t=n.Error||i===$_Char1;t=t||!t&&i!=="$";t&&CheckSetBox(n.ObjectStore.Cell,n.ObjectStore.ItemId,!0);CommonAjaxError(n,"_CheckEnable")||CheckLoad("Results",!0)}function CheckResize(){CommonDetectScroll("Check","Results");GLOBAL_IS_READ_ONLY||CommonDetectScroll("Check","Options")}function CheckFilter(n){CheckFilterSet(n);CheckAddItems("Results");CheckForceUnlock()}function CheckFilterSet(n){var i,r,u,t,f,e;_$PageLock();CHECK_FILTER=n;i=["All","Incomplete","Completed"];for(e in i)t=i[e],f=t===n?"-on":"-off",r="Check:Count:"+t,u="Check:Control:"+t,_Element(r).SetInnerText("0"),_Element(u).SetClassName("hand edit-pill-"+t.toLowerCase()+f);CommonRemoveChildren(_Element("CheckResultsList").Object)}function CheckAddItems(n){for(var f=n==="Results",e=_Element("Check"+n+"List"),s=_Element("Check"+n+"Bounds"),h=CHECK_LIST[n],c=h.Rows.length,b=(c+"").length*(GLOBAL_FONT_SIZE-2),i=[],r,o=0,l=0,a=0,v=null,y,p,t,w,u=0;u0&&CheckSetReorder(e,s,i);ListSortSetIcon("Check"+n+"Sort",o);f&&(_Element("Check:Count:All").SetInnerText(o),_Element("Check:Count:Incomplete").SetInnerText(l),_Element("Check:Count:Completed").SetInnerText(a));CommonDetectScroll("Check",n)}function CheckAddItem(n,t,i,r,u,f,e){var o=_Element($_Doc.createElement("div")),h=_Element($_Doc.createElement("div")),s=_Element($_Doc.createElement("div")),l=_Element($_Doc.createElement("div")),v=u+1,y=v+":",c=n==="Results",p=c?"chkid":"optid",w=c?"-check":"";if(h.SetClassName("list-item-number"+w),h.SetStyle("width",e+"px"),h.SetInnerText(y),s.SetClassName("list-item-text"),s.SetInnerText(f),s.Object.oncontextmenu=Function("event","CheckContextMenu( event, this, '"+n+"' );"),c||(s.Object.ondblclick=Function("CheckAddToItems( this );")),l.SetClassName("list-reorder"),l.Object.setAttribute("scrollable",1),c){var a=_Element($_Doc.createElement("div")),b=GLOBAL_IS_READ_ONLY?"":"hand ",k=r?"on":"off";a.SetClassName(b+"list-item-check-"+k);GLOBAL_IS_READ_ONLY||(a.Object.onclick=Function("CheckSetBox( this, "+i+" );"));o.Object.appendChild(a.Object)}return o.Object.appendChild(h.Object),o.Object.appendChild(s.Object),o.Object.appendChild(l.Object),o.SetClassName("list-item-container"),o.Object.setAttribute(p,i),t.Object.appendChild(o.Object),o}function CheckSetReorder(n,t,i){var u,r;if(!GLOBAL_IS_READ_ONLY)for(r=0;r0?n.charAt(0):$_Char1,e=n.length>0?n.substring(1):"",o=f===$_Char1,c=f!=="$",l=e!=="";if(o&&!l)return _Navigator().Timeout(),!0;if(c){_$PageBusy(!1);var i=null,r=_String(t),s=r.StartsWith("_"),u=r.Clone().ToLower().Value,a=o&&u==="refresh",h=u==="suppress",v=!h&&!s&&u!=="";return a?i=_NavigatorRecaller($_PopupDialogErrorId,_Navigator(),"Timeout"):v?i=_NavigatorRecaller($_PopupDialogErrorId,null,"_$Filter",[t]):s&&(i=_NavigatorRecaller($_PopupDialogErrorId,null,r.Value.substring(1))),CommonDialog($_PopupDialogErrorId,"Error","",e,0,90,!1,i),h&&($_NavigatorStop.SuppressUnlock=!0),!0}return!1}function CommonAjaxError(n,t){var i=_String(n.Response).Value;return i=n.Error?"!"+i:i,i=i===""?$_Char1:i,n.Response=i,CommonError(i,t)}function CommonAjaxRefilter(n){CommonAjaxError(n,"Refresh")||_$Filter("Project")}function CommonAjaxRefresh(n){CommonAjaxError(n,"Refresh")||_Navigator().Timeout()}function CommonAjaxResponse(n){CommonAjaxError(n)||_Navigator().Timeout()}function CommonOpenPopup(n,t,i,r,u,f){var it=_Event(n),o=0,e=5,rt="Bottom",l="Right",nt=!0,v=!0,h=!0,s=!1,k=!1,ut=!1,a=!0,ft=!0,d=!1,tt=!1,p=!1,et=!1,g=!1,st=_Element($_Form),ot=null,w=$_Body,b=_Element(u),y;it.Cancel();switch(r.toLowerCase()){case"stats":l="Left";d=!0;a=!1;h=!1;g=GLOBAL_IS_PROJECT_MODE;o=10;e=0;break;case"client":l="Left";d=!0;a=!1;h=!1;g=GLOBAL_IS_PROJECT_MODE;o=-10;e=10;break;case"menu":s=!0;nt=!1;a=!1;break;case"mousex":s=!0;k=!0;v=!1;o=10;e=3;break;case"mouse":s=!0;k=!0;ut=!0;v=!1;break;case"context":s=!0;v=!1;o=-5;e=3;break;case"context-tool":l="Left";et=!0;s=!0;a=!1;o=2;e=3;break;case"context-list":l="Left";s=!0;a=!1;o=2;e=3;break;case"context-tile":s=!0;v=!1;o=-5;e=3;w=_Element("TileContainer");break;case"context-topic":s=!0;v=!1;k=!0;o=5;e=3;w=_Element("TileContainer");break;case"context-item":s=!0;k=!0;v=!1;ft=!1;o=10;e=3;b=_Element(u+"List");break;case"context-attach":s=!0;v=!1;o=3;e=2;w=_Element(u+"Container");b=_Element(u+"List");break;case"attach-project":l="Left";s=!0;h=!1;p=!0;o=-40;break;case"attach-direct":l="Left";s=!0;h=!1;p=!0;break;case"attach-detail":case"attach-edit":case"edit-item":l="Left";rt="Top";s=!0;h=!1;p=!0;nt=!1;o=5;e=0;break;case"edit-category":l="Center";h=!1;p=!0;t=_Element("OptionsCategoryContainer");w=_Element("TileContainer");break;case"center":h=!1;p=!0;g=GLOBAL_IS_PROJECT_MODE;e=0;break;case"config-import":h=!1;p=!0;nt=!1;o=5;e=0;break;case"attach-view":h=!1;d=!0;e=0;break;case"publish":h=!1;tt=!0;w=_Element("PublishContainer")}if(CommonClosePopup(),b=b.IsValid?b:$_Body,y=$_PopupCache[i],s||!(y instanceof _Popup)){var ht=_Element(i),ct=_Element(t),c=_ElementLocator(ht,ct,b,w,o,e);c.Event=it;c.OpenDirection=rt+l;c.UseSourceOffsetWidth=nt;c.UseSourceOffsetHeight=v;c.AllowAlternateX=a;c.AllowAlternateY=a;c.UseAlternateOffsetWidth=a;c.UseAlternateOffsetHeight=a;c.UseMouseLocationX=k;c.UseMouseLocationY=ut;c.ScrollBody=ft;y=_Popup(c,null);y.CloseHandler=f;g&&(y.DisableElement=st);h&&(y.AutoDimParent=!1,y.AutoDisableParent=!1,y.SetAutoClose(5));(d||p||tt)&&_$PopupSetMotion(i,90,tt,d)}g&&ot&&!GLOBAL_IS_READ_ONLY&&!_$PageIsMobile()&&_$PopupTrackElement(i,ot);_$PopupOpen(i);GLOBAL_POPUP_IS_TOOL=et;h&&(GLOBAL_POPUP_ID=i,$_Body.Object.addEventListener("mouseup",CommonClosePopupTest),$_Body.Object.addEventListener("touchend",CommonClosePopupTest))}function CommonScrollPopup(){_$PopupCancelTimer(GLOBAL_POPUP_ID);_$PopupStartTimer(GLOBAL_POPUP_ID)}function CommonClosePopupTest(n){GLOBAL_POPUP_IS_TOOL&&_Element(GLOBAL_POPUP_ID).ContainsDescendant(_Event(n).SourceElement)||CommonClosePopup()}function CommonClosePopup(n){(n=typeof n=="boolean"?n:!0,$_Body.Object.removeEventListener("mouseup",CommonClosePopupTest),$_Body.Object.removeEventListener("touchend",CommonClosePopupTest),n)&&(_$PopupClose(GLOBAL_POPUP_ID),GLOBAL_POPUP_ID="",GLOBAL_POPUP_IS_TOOL=!1)}function CommonDialog(n,t,i,r,u,f,e,o,s){u=_Number(u).GetValue(0);f=_Number(f).GetValue(90);e=typeof e=="boolean"?e:!1;o=o instanceof _NavigatorRecaller?o:null;s=typeof s=="boolean"?s:!1;$_NavigatorStop=_NavigatorRecaller(n);var h=_PopupDialog(n,t);h.Header=i?i:h.Header;h.Content=r;s?(h.AddButton("Cancel","_$NavigatorContinue( false );",!1,"error"),h.AddButton("Continue","_$NavigatorContinue();",!1,"success")):h.AddButton("Close","_$NavigatorContinue( false );");h.Set();u>0&&_$PopupSetAutoClose(n,u,!0);_$PopupSetHandler(n,o);_$PopupSetMotion(n,f,!0,e);_$PopupOpen(n,!0)}function CommonClientPopup(n,t,i){var u=i.toLowerCase(),r=null;u!=="project"&&(r=_NavigatorRecaller("",null,"EditEnable",[i]),EditDim(i));CommonOpenPopup(n,t,"Popup:Global:Client","Client",null,r)}function CommomButton(n,t,i){var r="button-outer button-"+t+" popup-dialog-button-out-"+i;_Element(n).SetClassName(r)}function CommonFilter(n){var i=_Navigator("AJAX/Actions/Set_Filter.aspx",""),t=_Ajax(i,"CommonAjaxResponse");t.FormData="Id="+n;_$PageLock();t.Post()}function CommonClientSendMail(n){self.location.href=encodeURI("mailto:"+_Element(n).GetInnerText())}function CommonDetectScroll(n,t){var f=_Element(n+t+"Container"),i=_Element(n+t+"List"),e=_Element(n+t+"Indicator"),o=f.Object.scrollWidth,s=i.Object.scrollWidth,h=o-s,u=i.Object.scrollHeight>i.Object.offsetHeight,c=h>0,r=u&&!c,l=u?30:47,a=r?42:l;e.SetDisplay(r);i.Object.setAttribute("scrollable",r?1:0);i.SetStyle("padding-right",a+"px")}function CommonAboutPopup(){CommonOpenPopup(null,null,"Popup:Global:About","Attach-View")}function CommonAboutExitApplication(){top.close()}function ConfigInitialize(){GLOBAL_IS_REORDER_MODE&&(ConfigRegister("Category"),ConfigRegister("Tile"));_$PageDim(!1)}function ConfigRegister(n){var e=n+"Frame",f=_Element(e),o=n+"Container",r=_Element(o);if(f.IsValid&&r.IsValid){for(var s=n==="Tile",u=f.Object.children,i=[],t=0;t-101&&i.push(u[t]);for(t=0;t160&&(i=n.PointerLocation-80,n.PointerOffset.X=80);t.SetStyle("opacity",.6);t.SetStyle("position","absolute");t.SetStyle("left",i+"px");t.SetStyle("top",u.Top+"px");f.SetStyle("cursor","no-drop");r&&_Element(f.Object.firstElementChild).SetStyle("width","130px")}function ConfigDragOver(n,t){var i=ConfigGetTarget(n,t),f=_Element(i.Object.firstElementChild),h=_Element(n.DragElement.Object.firstElementChild),r=ConfigIsLeftHalf(n,f),c=ConfigIsTile(i),l=ConfigGetButtonId(i,c),a=ConfigGetButtonType(i),v=a==="break",y=l<0||v,u=n.DragElement.GetWidth(),e="pointer",o,s;r&&i.Object.previousElementSibling===CONFIG_DRAG_CLONE.Object&&(u=0,e="no-drop");!r&&(y||i.Object.nextElementSibling===CONFIG_DRAG_CLONE.Object)&&(u=0,e="no-drop");o=r?u:0;s=r?0:u;f.SetStyle("margin-left",o+"px");f.SetStyle("margin-right",s+"px");h.SetStyle("cursor",e)}function ConfigDragOut(n,t){var r=ConfigGetTarget(n,t),i=_Element(r.Object.firstElementChild),u=_Element(n.DragElement.Object.firstElementChild);i.SetStyle("margin-left","0px");i.SetStyle("margin-right","0px");u.SetStyle("cursor","no-drop")}function ConfigDrop(n,t){var i=n.DragElement,f=ConfigIsTile(i),h=_Element(i.Object.firstElementChild),p=f?"TileFrame":"CategoryFrame",e=_Element(p),c=ConfigGetButtonType(i),w=c==="break",b=c==="topic",r=ConfigGetTarget(n,t),k=r!==null,u=CONFIG_DRAG_CLONE.Object,o,s,v,y;if(k){var l=_Element(r.Object.firstElementChild),a=ConfigIsLeftHalf(n,l),d=ConfigGetButtonId(r,f),g=l.Object.title==="",nt=d<0||g,tt=r.Object.previousElementSibling;u=a&&tt===CONFIG_DRAG_CLONE.Object?CONFIG_DRAG_CLONE.Object:r.Object;a||(o=r.Object.nextElementSibling,u=nt||o===CONFIG_DRAG_CLONE.Object?CONFIG_DRAG_CLONE.Object:o);ConfigDragOut(n,t)}i.SetStyle("position","static");i.SetStyle("opacity",1);e.Object.insertBefore(i.Object,u);w&&(s=CONFIG_DRAG_CLONE.Object.nextElementSibling,s.hasAttribute("type")||e.Object.insertBefore(s,u));h.SetStyle("cursor","pointer");b&&_Element(h.Object.firstElementChild).SetStyle("width","auto");e.Object.removeChild(CONFIG_DRAG_CLONE.Object);v=u!==CONFIG_DRAG_CLONE.Object;CONFIG_DRAG_CLONE=null;CONFIG_DRAG_CACHE=null;y=f?ConfigReorderTiles():ConfigReorderCategories();v&&ConfigSave(f,y)}function ConfigGetTarget(n,t){return ListGetTarget(n,t)}function ConfigIsLeftHalf(n,t){var i=t.GetRectangle().ScrollRectangle(n.$_ScrollRectangle),u=_String(t.GetStyle("margin-left")).Replace("px","").ToNumber().GetValue(0),f=_String(t.GetStyle("margin-right")).Replace("px","").ToNumber().GetValue(0),r=i.Left+i.Width/2;return n.PointerLocation.X-1,h=u<-100,h){n.Object.removeChild(r);t--;continue}s&&o.push(u);f++;f>a&&(n.Object.insertBefore($_Doc.createElement("div"),r),f=1,t++)}return n.SetDisplay("table-row"),n.Object.offsetWidth,n.SetDisplay(),i.Object.scrollLeft=c,i.Object.scrollTop=l,o.join("|")}function ConfigReorderTiles(){for(var u=_Element("TileContainer"),y=u.Object.scrollLeft,p=u.Object.scrollTop,n=_Element("TileFrame"),c=!1,t=0,l=[],i,f,e,a,s,h,o,v,r=0;r-1,a=f<-100,s=e?h==="break":!1,o=e?h==="topic":!1,a){n.Object.removeChild(i);r--;continue}e&&l.push(f);t++;v=t>CONFIG_TILE_COLUMNS&&!s&&!o;(v||c&&!o)&&(n.Object.insertBefore($_Doc.createElement("div"),i),t=1,r++);t=o?0:t;c=s}return n.SetDisplay("table-row"),n.Object.offsetWidth,n.SetDisplay(),u.Object.scrollLeft=y,u.Object.scrollTop=p,l.join("|")}function ConfigSave(n,t){var r=n?"Tile":"Category",u="AJAX/Configuration/Set_Order_"+r+".aspx",f=_Navigator(u,""),i=_Ajax(f,"ConfigSaveResponse");i.FormData="Order="+t;_$PageLock();i.Post()}function ConfigSaveResponse(n){CommonAjaxError(n)||_$PageLock(!1)}function ConfigExport(){var n=_Navigator("AJAX/Configuration/Export.aspx",""),t=_Export(n,"Category:Export:Form");t.Post()}function ConfigImportPopup(){ConfigImportDisplay();_Element("ConfigurationImportForm").Object.reset();CommonOpenPopup(null,_Element("HeaderToolContainerConfig").Object,"Popup:Configuration:Import","Config-Import")}function ConfigImportDisplay(n){var i=!n||n.files.length===0,t=!1,u=_Element("Configuration:Import:Display"),r="No Configration File Selected",o=i?"italic":"",f,e;i?_Element("ConfigurationImportForm").Object.reset():(r=n.files[0].name,t=_String(r).ToLower().EndsWith(".ixconf"));u.SetInnerText(r);u.SetClassName("normal cfff "+o);_Element("Configuration:Button:Enabled").SetDisplay(t);_Element("Configuration:Button:Disabled").SetDisplay(!t);i||t||(f=_NavigatorRecaller($_PopupDialogErrorId,null,"ConfigImportDisplay"),e="A valid InspectX configuration file (.iXconf) must be selected.",CommonDialog($_PopupDialogErrorId,"Error","",e,0,90,!1,f))}function ConfigImport(){var t=_Navigator("AJAX/Configuration/Import.aspx",""),n=_Element("ConfigurationImportForm").Object;n.action=t.FullUrl;n.submit();_$PageLock()}function ConfigImportResponse(n){if(!CommonError(n)){var t=_NavigatorRecaller($_PopupDialogSuccessId,_Navigator(),"Timeout");_$PopupClose("Popup:Configuration:Import");_$PageBusy(!1);CommonDialog($_PopupDialogSuccessId,"Success","","The configuration was imported successfully.",5,90,!0,t)}}function DetailView(n,t,i,r){TILE_ID=n;FINDING_ID=_Number(t).GetValue(-1);i=typeof i=="boolean"?i:!1;r=_String(r).Value;var f=i?"&Node="+CONTEXT_PUBLISH_NODE:"",e=_Navigator("AJAX/Finding/Load.aspx",""),u=_Ajax(e,"DetailViewResponse");u.ObjectStore=r;u.FormData="ProjectId="+GLOBAL_PROJECT_ID+"&TileId="+n+"&FindingId="+FINDING_ID+f;SummaryDim();_$PageLock();u.Post()}function DetailViewResponse(n){if(!CommonAjaxError(n,"_SummaryEnable")){var t=n.Response.substring(1),i=_DataTable().FromString(t);DetailPopuplate(i,n.ObjectStore)}}function DetailPopuplate(n,t){var r,u,o;EDIT_LOAD_COUNT=0;EDIT_LOADED=!1;DETAIL_IS_FINDING=!0;LIST_ITEM=null;r=_Element("DetailValue");u=_Element("Detail:Divider");GLOBAL_IS_READ_ONLY?(r.SetStyle("bottom","21px"),u.SetStyle("bottom","21px")):(r.SetStyle("height","150px"),u.SetStyle("height","150px"));var i=n.Rows[0],p=_Number(i.Get("TileId")).GetValue(-1),c=_Number(i.Get("AttachCount")).GetValue(0),l=i.Get("Status").replace(" ","-").toLowerCase(),a=FINDING_ID<0?t:i.Get("TypeCode"),s=i.Get("Description"),h=i.Get("Recommendation");_DataElement(i,"ProjectId","Finding").SetHiddenInputString();_DataElement(i,"TileId","Finding").SetHiddenInputString();_DataElement(i,"FindingId","Finding").SetHiddenInputString();_DataElement(i,"Category","Finding").SetHiddenInputString();_DataElement(i,"Tile","Finding").SetHiddenInputString();_DataElement(i,"Status","Finding").SetHiddenInputString();EditAttachSet("Detail",c);_Element("Display:Finding:Status").SetClassName("f14 edit-status-"+l);DetailSetType(a);var v=EditGetReadonly("Detail","Description"),y=EditGetReadonly("Detail","Recommendation"),f=EditGetEditable("Detail","Description"),e=EditGetEditable("Detail","Recommendation");if(v.SetInnerText(GLOBAL_IS_READ_ONLY?s:""),y.SetInnerText(GLOBAL_IS_READ_ONLY?h:""),f.SetValue(GLOBAL_IS_READ_ONLY?"":s),e.SetValue(GLOBAL_IS_READ_ONLY?"":h),_Element("Detail:Caret:Outer:Description").SetDisplay(!1),_Element("Detail:Caret:Outer:Recommendation").SetDisplay(!1),_Element("Detail:Description:Indicator").SetDisplay(!1),_Element("Detail:Recommendation:Indicator").SetDisplay(!1),o=_Element("Detail:Button:Cancel"),o.Object.title=GLOBAL_IS_READ_ONLY?"Close finding window":"Discard changes and close finding window",o.SetInnerText(GLOBAL_IS_READ_ONLY?"Close":"Cancel"),_Element("Detail:Button:Save").SetDisplay(!GLOBAL_IS_READ_ONLY),GLOBAL_IS_READ_ONLY||(CommonRemoveChildren(_Element("DetailDescriptionList").Object),CommonRemoveChildren(_Element("DetailRecommendationList").Object),_Element("DetailNumberList").SelectIndex(0),DetailToggleView(!0,!0)),EditOpen("Detail"),GLOBAL_IS_READ_ONLY){DetailForceUnlock();return}f.Object.scrollTop=f.Object.scrollHeight;e.Object.scrollTop=e.Object.scrollHeight;EditSetVirtual("Detail","Description");EditSetVirtual("Detail","Recommendation");ListLoad("Detail","Description");ListLoad("Detail","Recommendation")}function DetailToggleView(n,t){t=typeof t=="boolean"?t:!1;DETAIL_IS_FINDING=n;var i=DETAIL_IS_FINDING?"Description":"Recommendation",r="Detail"+i+"List",u=_Element(r).Object.childElementCount;(ListSortSetIcon("DetailOptionsSort",u),_Element("DetailControlDescription").SetClassName("hand edit-pill-all-"+(DETAIL_IS_FINDING?"on":"off")),_Element("DetailControlRecommendation").SetClassName("hand edit-pill-all-"+(DETAIL_IS_FINDING?"off":"on")),_Element("Editable:Finding:Description").SetStyle("opacity",DETAIL_IS_FINDING?1:.5),_Element("Editable:Finding:Recommendation").SetStyle("opacity",DETAIL_IS_FINDING?.5:1),_Element("DetailDescriptionContainer").SetDisplay(DETAIL_IS_FINDING),_Element("DetailRecommendationContainer").SetDisplay(!DETAIL_IS_FINDING),_Element("Detail:Options:Prefix").SetInnerText(DETAIL_IS_FINDING?"Finding":"Recommendation"),t)||DetailResize()}function DetailSetType(n){var t=GLOBAL_IS_READ_ONLY?"":"hand ";_Element("DetailControl_A").SetClassName(t+"edit-pill-a-"+(n==="A"?"on":"off"));_Element("DetailControl_B").SetClassName(t+"edit-pill-b-"+(n==="B"?"on":"off"));_Element("DetailControl_C").SetClassName(t+"edit-pill-c-"+(n==="C"?"on":"off"));_Element("Hidden:Finding:TypeCode").SetValue(n)}function DetailEnable(){EditEnableHelper("Detail")}function DetailUnlock(n){EditUnlockHelper("Detail",n)}function DetailForceUnlock(){EditUnlockHelper("Detail",!0)}function DetailAjaxError(n){CommonAjaxError(n,"_DetailEnable")||DetailEnable()}function DetailAjaxResponse(n){CommonAjaxError(n,"_DetailEnable")||(PUBLISH_RELOAD=GLOBAL_IS_PUBLISH_MODE,TILE_RELOAD=EditIsOpen(),SUMMARY_RELOAD=SummaryIsOpen(),EditClose("Detail"))}function DetailResize(){EditResizeHelper("Detail")}function DetailSave(){var i=_Element("Hidden:Finding:TypeCode").GetValue(),f=_Element("Editable:Finding:Description").GetString().Trim().Value.length,e=_Element("Editable:Finding:Recommendation").GetString().Trim().Value.length,n=0,t="The following error occurred when attempting to save the finding:\n";if(i===""&&(t+="\n"+ ++n+") A valid finding type selection ( A, B, or C ) is required."),n>0){CommonDialog($_PopupDialogErrorId,"Error","",t);return}var r=_Navigator("AJAX/Finding/Save.aspx",""),u=_Ajax(r,"DetailAjaxResponse","Finding:Edit:Form");_Element("Hidden:Finding:FindingId").SetValue(FINDING_ID);_$PageBusy();u.Post();EditDim("Detail")}function SummaryShow(n){SUMMARY_TYPE=n;var i=SUMMARY_TYPE,t=40,r=n==="Edit";r&&(i="Entry",t=TILE_IS_SINGLE?210:310);_Element("SummaryOptionsIcon").SetDisplay(r);_Element("SummaryContainer").SetStyle("top",t+"px");_Element("SummaryControls").SetStyle("top",t+"px");_Element("SummaryResultsContainer").SetStyle("top",t+32+"px");_Element("SummaryControlText").SetInnerText(i+" Findings:");SummaryFilterSet("All");SummaryOpen();SummaryLoad(!1)}function SummaryLoad(n){n&&(SUMMARY_TYPE==="Project"&&(TILE_ID=-1),CommonRemoveChildren(_Element("SummaryResultsList").Object));var i=_Navigator("AJAX/Finding/Load_Summary.aspx",""),t=_Ajax(i,"SummaryLoadResponse");t.FormData="ProjectId="+GLOBAL_PROJECT_ID+"&TileId="+TILE_ID;_$PageLock();t.Post()}function SummaryLoadResponse(n){if(!CommonAjaxError(n,"_SummaryEnable")){var i=n.Response.substring(1),t=i.split(String.fromCharCode(3));SUMMARY_MAX_COUNT=_Number(_DataTable().FromString(t[0]).Rows[0].Get("MaxCount")).GetValue(0);SUMMARY_LIST=_DataTable().FromString(t[1]);SUMMARY_RELOAD=!1;SummaryAddItems()}}function SummaryOpen(){var n="SummaryContainer";SUMMARY_POPUP=$_PopupCache[n];SUMMARY_POPUP instanceof _Popup||(SUMMARY_POPUP=_Popup(n),SUMMARY_POPUP.OpenHandler=_NavigatorRecaller("",null,"SummaryOpenHandler"),SUMMARY_POPUP.CloseHandler=_NavigatorRecaller("",null,"SummaryCloseHandler"));SUMMARY_POPUP.Open()}function SummaryOpenHandler(){SummaryDim();window.addEventListener("resize",SummaryResize);SUMMARY_TYPE!=="Project"&&EditDim(SUMMARY_TYPE)}function SummaryIsOpen(){return _Element("SummaryContainer").IsDisplayed()}function SummaryClose(){CommonClosePopup();SUMMARY_POPUP instanceof _Popup&&SUMMARY_POPUP.Close()}function SummaryCloseHandler(){if(window.removeEventListener("resize",SummaryResize),SUMMARY_TYPE==="Project"){TILE_ID=-1;TILE_RELOAD&&_Navigator().Timeout();return}EditEnableHelper(SUMMARY_TYPE)}function SummaryDim(n){var t,r,i;if(n=typeof n=="boolean"?n:!0,t=_Element("SummaryContainer"),r=t.Object.children,t.SetDim(n),t.SetDisabled(n),!n)for(i=0;i0&&SummarySetReorder(u,l,r);for(c in t)_Element("Summary:Count:"+c).SetInnerText(t[c][0]);SUMMARY_TYPE==="Edit"&&EditFindingsSet(t);CommonDetectScroll("Summary","Results");SummaryEnable()}function SummarySetReorder(n,t,i){var u,r;if(!GLOBAL_IS_READ_ONLY)for(r=0;r0){CommonDialog($_PopupDialogErrorId,"Error","",t);$_NavigatorStop.SuppressUnlock=!0;return}var o=PROJECT_ACTION+".aspx",s="AJAX/Project/"+o,h=_Navigator(s,""),c=_Ajax(h,"ProjectSaveResponse","Project:Create:Form");_$PageLock();c.Post()}function ProjectSaveResponse(n){if(!CommonAjaxError(n,"Suppress")){var t=_NavigatorRecaller($_PopupDialogSuccessId,_Navigator(),"Timeout"),i=PROJECT_ACTION==="New"?"created":"copied",r="The project was "+i+" successfully.";_$PopupClose("Popup:Project:Create");_$PageBusy(!1);CommonDialog($_PopupDialogSuccessId,"Success","",r,5,90,!0,t)}}function ProjectSet(n){var i="Set_"+n+".aspx",r="AJAX/Project/"+i,u=_Navigator(r,""),t=_Ajax(u,"CommonAjaxRefresh");t.FormData="ProjectId="+CONTEXT_PROJECT_ID;_$PageLock();t.Post()}function ProjectDelete(){var t=_Navigator("AJAX/Project/Delete.aspx",""),n=_Ajax(t,"CommonAjaxRefresh");n.FormData="ProjectId="+CONTEXT_PROJECT_ID;_$PageLock();n.Post()}function ProjectContextMenuClose(n){CONTEXT_PROJECT_ROW!==null&&n.TimeStamp===CONTEXT_PROJECT_ROW.TimeStamp&&(CommonClosePopup(!1),_$GridHighlightRow(n.GridId,n.RowIndex,n.IsAlternate,n.SortColumn,!1),CONTEXT_PROJECT_ROW=null)}function ProjectContextMenu(n,t,i){var f=_String(t.onmouseover).Replace(/\n|\r/g," ").Replace(/.+\(/,"").Replace(/\).*/,"").Replace(/\'/g,"").Split(","),e={GridId:_String(f[0]).Trim().Value,RowIndex:_String(f[1]).Trim().ToNumber().Value,IsAlternate:_String(f[2]).Trim().ToBoolean(),SortColumn:_String(f[3]).Trim().ToNumber().Value,TimeStamp:_Date().Value.getTime()};PROJECT_CLICK_ROW=ProjectRowClone(e);PROJECT_ROW_INDEX=t.rowIndex;CONTEXT_PROJECT_ID=i;ProjectRowSelect(e);var s="ReadOnly_"+i,h="Percent_"+i,o=_Element(s).GetBoolean(),c=_Element(h).GetNumber().GetValue(0),u=_Element("ProjectContextMenu").Object.children,r=o?-1:0;r=c===1&&!o?1:r;_Element(u[8]).SetDisplay(r===-1);_Element(u[9]).SetDisplay(r===0);_Element(u[10]).SetDisplay(r===1);_Element(u[12]).SetDisplay(r!==-1);_Element(u[13]).SetDisplay(r===-1);CommonOpenPopup(n,t,"Popup:Project:ContextMenu","MouseX","Project:Results",_NavigatorRecaller("",null,"ProjectContextMenuClose",[ProjectRowClone(PROJECT_CLICK_ROW)]))}function ProjectContextSelect(){ProjectSelect(CONTEXT_PROJECT_ID)}function ProjectContextExport(){var n=_Navigator("AJAX/Project/Export.aspx",""),t=_Export(n,"Project:Export:Form");_Element("Project:Export:ProjectId","Project:Export:Form").SetValue(CONTEXT_PROJECT_ID);t.Post()}function ProjectContextReadOnly(){ProjectSet("Read_Only")}function ProjectContextEditable(){ProjectSet("Editable")}function ProjectContextDelete(){$_NavigatorContinue=_NavigatorRecaller($_PopupDialogWarningId,null,"ProjectDelete");CommonDialog($_PopupDialogWarningId,"Warning","","This operation will delete the selected project and all associated records.\n\nThe delete process is permanent and cannot be undone.\n\nOnce executed, the project and any related data will be irretrievable.\n\nUse the 'Export To File' function to create a backup of the project prior to deleting.\n\nClick 'Cancel' to abort the operation.\nClick 'Continue' to complete the action.",20,90,!0,null,!0)}function ProjectImportPopup(){ProjectImportDisplay();_Element("ProjectImportForm").Object.reset();CommonOpenPopup(null,null,"Popup:Project:Import","Center")}function ProjectImportDisplay(n){var i=!n||n.files.length===0,t=!1,f=_Element("Project:Import:Display"),r="No Project File Selected",o=i?"italic":"",u,e;i?_Element("ProjectImportForm").Object.reset():(r=n.files[0].name,t=_String(r).ToLower().EndsWith(".ixproj"));f.SetInnerText(r);f.SetClassName("normal cfff "+o);_Element("Project:Button:Enabled").SetDisplay(t);_Element("Project:Button:Disabled").SetDisplay(!t);_$PopupReposition();i||t||(u=_NavigatorRecaller($_PopupDialogErrorId,null,"ProjectImportDisplay"),e="A valid InspectX project file (.iXproj) must be selected.",u.SuppressUnlock=!0,CommonDialog($_PopupDialogErrorId,"Error","",e,0,90,!1,u),$_NavigatorStop.SuppressUnlock=!0)}function ProjectImport(){var t=_Navigator("AJAX/Project/Import.aspx",""),n=_Element("ProjectImportForm").Object;n.action=t.FullUrl;n.submit();_$PageLock()}function ProjectImportResponse(n){if(!CommonError(n,"Suppress")){var t=_NavigatorRecaller($_PopupDialogSuccessId,_Navigator(),"Timeout");_$PopupClose("Popup:Project:Import");_$PageBusy(!1);CommonDialog($_PopupDialogSuccessId,"Success","","The project was imported successfully.",5,90,!0,t)}}function PublishInitialize(){GLOBAL_IS_PUBLISH_MODE=!0;var n=_Element("PublishFocusNode").GetValue();n!==""&&(self.location.hash=n);_$PageLock(!1)}function PublishContextMenuClose(){CommonClosePopup()}function PublishContextMenu(n,t){var it=_Event(n),g=t.parentElement.id;CONTEXT_PUBLISH_NODE=g;var u=g.split(":"),i=_Element("PublishContextMenu").Object.children,nt=_Element("PublishUseAppendix").GetBoolean(),w=_Number(u[3]).GetValue(0),f=PublishNodeIsCollapsed(w),b=_Number(u[1]).GetValue(0),tt=_Number(u[2]).GetValue(0),y=u[0]==="x"&&tt!==200,p=u[0]==="p"||tt===200,a=u[0]==="h",o=u[0]==="c",v=u[0]==="s",s=u[0]==="t",e=u[0]==="l",h=u[0]==="f",rt=y&&w===0,ut=y&&w===1,k=s&&b===1,c=o&&b===1,l=o&&b===2,ft=_String(t.parentElement.getAttribute("type")).Value,d=a&&ft==="tree",et=p?"Mouse":"MouseX",r=0;_Element(i[r++]).SetDisplay(a&&f);_Element(i[r++]).SetDisplay(a&&!f);_Element(i[r++]).SetDisplay(o&&f);_Element(i[r++]).SetDisplay(o&&!f);_Element(i[r++]).SetDisplay(v&&f);_Element(i[r++]).SetDisplay(v&&!f);_Element(i[r++]).SetDisplay(s&&!e&&f);_Element(i[r++]).SetDisplay(s&&!e&&!f);_Element(i[r++]).SetDisplay(h&&f);_Element(i[r++]).SetDisplay(h&&!f);_Element(i[r++]).SetDisplay(!p&&!y&&!e&&(!a||d));_Element(i[r++]).SetDisplay(d);_Element(i[r++]).SetDisplay(d);_Element(i[r++]).SetDisplay(c);_Element(i[r++]).SetDisplay(c);_Element(i[r++]).SetDisplay(l);_Element(i[r++]).SetDisplay(l);_Element(i[r++]).SetDisplay(o&&!(l||c));_Element(i[r++]).SetDisplay(o&&!(l||c));_Element(i[r++]).SetDisplay(v);_Element(i[r++]).SetDisplay(v);_Element(i[r++]).SetDisplay(s&&!(e||k));_Element(i[r++]).SetDisplay(s&&!(e||k));_Element(i[r++]).SetDisplay(!p&&!y&&!a&&!e&&!h&&!k&&!c&&!l);_Element(i[r++]).SetDisplay(o&&!(c||l));_Element(i[r++]).SetDisplay(v);_Element(i[r++]).SetDisplay(s||e||rt);_Element(i[r++]).SetDisplay(s||e||ut);_Element(i[r++]).SetDisplay(h);_Element(i[r++]).SetDisplay(p);_Element(i[r++]).SetDisplay(h&&nt);_Element(i[r++]).SetDisplay(h&&nt);CommonOpenPopup(it,t,"PopupPublishContextMenu",et,"PublishContainer")}function PublishContextExpand(){PublishNodeSet(CONTEXT_PUBLISH_NODE,!0)}function PublishContextCollapse(){PublishNodeSet(CONTEXT_PUBLISH_NODE,!1)}function PublishContextExpandChildren(){PublishNodeExpandChildren(!0)}function PublishContextCollapseChildren(){PublishNodeExpandChildren(!1)}function PublishContextEdit(){PublishNodeEdit(CONTEXT_PUBLISH_NODE)}function PublishContextOverride(){var n="s"+CONTEXT_PUBLISH_NODE.substring(1);PublishNodeEdit(n)}function PublishNodeIsCollapsed(n){var t="node_"+n,i=_Element(t);return!i.IsDisplayed()}function PublishNodeSet(n,t,i){i&&_$PageLock();var u=n.split(":"),f=_Number(u[3]).Value,o=_Element(n),e="",r;switch(u[0]){case"h":r="section";break;case"s":r="topic";break;case"t":r="tile";break;case"f":r="finding";e=_String(o.GetClassName()).EndsWith("-tree")?"-tree":"-table";break;default:r="category"}_Element(_Element(n).Object.firstElementChild.firstElementChild).SetInnerHtml(t?"▼":"►");var s=t?"expanded":"collapsed",c="publish-"+r+"-"+s+e,h="node_"+f;_Element(h).SetDisplay(t);i&&PublishNodeSave([f],t,n)}function PublishNodeSwapState(n){var t=n.parentElement.id,i=t.split(":"),r=PublishNodeIsCollapsed(i[3]);PublishNodeSet(t,r,!0)}function PublishNodeEdit(n){PublishContextMenuClose();var i=n.split(":"),t=_Number(i[2]).GetValue(-1),r=_Number(i[1]).GetValue(-1);if(!(t<0)&&!(r<0)){PUBLISH_RELOAD=!1;switch(i[0]){case"c":CategoryEdit(t,!0);return;case"s":TileConfigRequest(t,!0);return;case"p":case"x":case"l":case"t":TileRequest(t,!0);return;case"f":DetailView(r,t,!0);return}CONTEXT_PUBLISH_NODE=null}}function PublishNodeExpandChildren(n){var u;_$PageLock();var s=CONTEXT_PUBLISH_NODE,i=s.split(":"),h=_Number(i[1]).GetValue(0),r=_Number(i[3]).Value,l=PublishNodeIsCollapsed(r),a="node_"+r,c=_Element(a).Object.children,t="",f=[],e,o;CONTEXT_PUBLISH_NODE=null;PublishContextMenuClose();switch(i[0]){case"h":t="c:";break;case"c":t="s:";t=h===1?"f:":t;t=h===2?"t:":t;break;case"s":t="t:";break;case"t":t="f:"}if(t!==""){for(l&&n&&(PublishNodeSet(s,n,!1),f.push(r)),u=0;u-1&&PublishNodeSaveAll(t,n)}function PublishNodeRecurse(n,t,i){for(var o,r,u,f,s,h,c,e=0;e0){r="The following error"+(n>1?"s":"")+" occurred when attempting to create a new publisher account:\n";u=r+t;CommonDialog($_PopupDialogErrorId,"Error","",u);return}var f=_Element("PublishAccountForm").Object,e=_Element("Popup:Publish"),c=_Navigator("AJAX/Publish/Final/Control/Account_Create.aspx",""),l=_Ajax(c,"PublishStatusResponse",f);_$PageBusy();l.Post();e.SetDim();e.SetDisabled();PublishDisableChildren(f)}function PublishSignIn(){var n=0,t="",e=_Element("PurchaseSignInEmailAddress").GetString().Trim(),o=_Element("PurchaseSignInPassword").GetString().Trim().Value,i,r;if(e.IsValidEmail()||(t+="\n"+ ++n+") A valid email address is required.",_$ElementTrack("PurchaseSignInEmailAddress")),o.length<8&&(t+="\n"+ ++n+") A valid password of at least 8 characters is required.",_$ElementTrack("PurchaseSignInPassword")),n>0){i="The following error"+(n>1?"s":"")+" occurred when attempting to sign in to your publisher account:\n";r=i+t;CommonDialog($_PopupDialogErrorId,"Error","",r);return}var u=_Element("PublishSignInForm").Object,f=_Element("Popup:Publish"),s=_Navigator("AJAX/Publish/Final/Control/Sign_In.aspx",""),h=_Ajax(s,"PublishStatusResponse",u);_$PageBusy();h.Post();f.SetDim();f.SetDisabled();PublishDisableChildren(u)}function PurchaseCouponKeyMask(n){var t=_Event(n),i=t.Object.keyCode,r=String.fromCharCode(i);/[0-9A-F]/i.test(r)||t.Cancel()}function PublishCouponApply(){var i=_Element("PurchaseCouponCodeEditable").GetString().Trim().Value;if(i.length!=8){_$ElementTrack("PurchaseCouponCodeEditable");CommonDialog($_PopupDialogErrorId,"Error","","The coupon code provided is invalid.");return}var n=_Element("PublishPurchaseForm").Object,t=_Element("Popup:Publish"),r=_Navigator("AJAX/Publish/Final/Control/Coupon_Apply.aspx",""),u=_Ajax(r,"PublishStatusResponse",n);_$PageBusy();u.Post();t.SetDim();t.SetDisabled();PublishDisableChildren(n)}function PublishCouponRemove(){var n=_Element("Popup:Publish"),t=_Navigator("AJAX/Publish/Final/Control/Coupon_Remove.aspx",""),i=_Ajax(t,"PublishStatusResponse");_$PageBusy();i.Post();n.SetDim();n.SetDisabled()}function PublishCardChange(){var r=_String(_Element("PurchaseCouponCodeReadonly").GetInnerText()).Trim().Value,u=_String(_Element("PurchaseCardNumber").GetInnerText()).Trim().Value,f=_String(_Element("PurchaseCardExpiration").GetInnerText()).Trim().Value,n=_Element("PublishPurchaseForm").Object,t=_Element("Popup:Publish"),e=_Navigator("AJAX/Publish/Final/View/Credit_Card.aspx",""),i=_Ajax(e,"PublishStatusResponse",n);i.FormData="CouponCode="+r+"&LastFour="+u+"&Expiration="+f;_$PageBusy();i.Post();t.SetDim();t.SetDisabled();PublishDisableChildren(n)}function PublishCardStore(){var n=0,t="",w=_Element("PurchaseSignInEmailAddress").GetString().Trim(),b=_Element("PurchaseSignInPassword").GetString().Trim().Value,s=_Element("PurchaseCardHolder").GetString().Trim().Value,h=_Element("PurchaseCardNumber").GetString().Trim().Replace(/[-]/g,"").Value,c=_Number(_Element("PurchaseCardMonth").GetSelectedValue()).Value,l=_Number(_Element("PurchaseCardYear").GetSelectedValue()).Value,a=l*100+c,i=_Date().Value,r=new Date(i.getFullYear(),i.getMonth(),i.getDate()),v=r.getFullYear()*100+r.getMonth()+1,u,f;if(s===""&&(t+="\n"+ ++n+") A valid cardholder name is required.",_$ElementTrack("PurchaseCardHolder")),/^[0-9]{13,19}$/.test(h)||(t+="\n"+ ++n+") A valid card number, 13 to 19 numbers in length, must be entered.",_$ElementTrack("PurchaseCardNumber")),a0){u="The following error"+(n>1?"s":"")+" occurred when attempting to validate the credit card:\n";f=u+t;CommonDialog($_PopupDialogErrorId,"Error","",f);return}var e=_Element("PublishCardForm").Object,o=_Element("Popup:Publish"),y=_Navigator("AJAX/Publish/Final/Control/Card_Store.aspx",""),p=_Ajax(y,"PublishStatusResponse",e);_$PageBusy();p.Post();o.SetDim();o.SetDisabled();PublishDisableChildren(e)}function PublishPurchase(){var r=_Element("PurchaseAmount").GetValue(),u=_Element("PurchaseRequiresCard").GetBoolean();if(u&&!_Element("PurchaseCardContainer").IsValid){PublishCardChange();return}var f=_String(_Element("PurchaseCouponCodeReadonly").GetInnerText()).Trim().Value,e=_Element("PurchaseIsFree").GetBoolean()?"1":"0",n=_Element("PublishPurchaseForm").Object,t=_Element("Popup:Publish"),o=_Navigator("AJAX/Publish/Final/Control/Card_Charge.aspx",""),i=_Ajax(o,"PublishStatusResponse",n);i.FormData="CouponCode="+f+"&GrandTotal="+r+"&IsFree="+e;_$PageBusy();i.Post();t.SetDim();t.SetDisabled();PublishDisableChildren(n)}function PublishFinalExport(){var n=_Element("PublishExportForm").Object,i=_Navigator("AJAX/Publish/Final/Export.aspx",""),r=_Export(i,n,"PublishExportUnlock"),t=_String(navigator.userAgent).ToLower().Contains("edge/");t||(n.target="_blank");_Element("Publish:Export:IsAppendixOnly",n).SetValue(PUBLISH_APPENDIX_ONLY?"1":"0");_Element("Publish:Export:IsExternal",n).SetValue(t?"0":"1");_$ElementTrack();$_DocElement.SetDisabled(!1);r.Post()}function PublishExportUnlock(){_$PageLock(!1)}function SettingsInitialize(){var n=_Element("SettingsTabName").GetValue(),t="Settings:Tab:"+n,i=_Element(t);SettingsSelect(i,!0);_$PageDim(!1);SettingsSelectFocus()}function SettingsTab(n){SettingsSelect(_Element(n))}function SettingsSelect(n,t){t=typeof t=="boolean"?t:!1;var u=_Element("SettingsTabName"),r=u.GetValue(),i=n.Id.split(":")[2];if(r!==i||t){var o="Settings:Tab:"+r,s="Settings:Content:"+r,h="Settings:Content:"+i,f=_Element(o),c=_Element(s),l=_Element(h),a=f.Object.getAttribute("type"),v=n.Object.getAttribute("type"),y="hand edit-pill edit-pill-"+a+"-off",p="hand edit-pill-"+v+"-on";if(f.SetClassName(y),n.SetClassName(p),c.SetDisplay(!1),l.SetDisplay(),u.SetValue(i),!t){var w=_Navigator("AJAX/Settings/Set_Tab.aspx",""),e=_Ajax(w,"SettingsSelectResponse");e.FormData="Tab="+i;_$PageLock();e.Post()}}}function SettingsSelectResponse(n){CommonAjaxError(n)||(_$PageLock(!1),SettingsSelectFocus())}function SettingsSelectFocus(){var t=_Element("SettingsTabName").GetValue(),n="SettingsGeneralBackupDirectory";n=t==="General"?"SettingsGeneralUpdateInterval":n;n=t==="Email"?"SettingsEmailServer":n;n=t==="Organization"?"SettingsCompanyName":n;n=t==="Inspectors"?"SettingsInspectorName_0":n;n=t==="Attachments"?"SettingsImageWarning":n;n=t==="Publishing"?"SettingsPublishingTemplate":n;$_ElementTracked=SETTINGS_ELEMENT;$_ElementDefault=_Element(n);SETTINGS_ELEMENT=null;_$ElementFocusTracked()}function SettingsGeneralValidate(){var n=_Element("SettingsGeneralBackupDirectory").GetString().Trim().Value,t,i;return n===""?!1:(t=/^([a-zA-z]:\\?)([^\s<>:"/\\|?* ]*[^\n\r\t<>:"/\\|?*]*[^\s<>:"/\\|?* ]\\?)*$/g,i=/^(\\{2})([^\s<>:"/\\|?* ]*[^\n\r\t<>:"/\\|?*]*[^\s<>:"/\\|?* ]\\?)+$/g,t.test(n)||i.test(n))?!1:(SETTINGS_MESSAGE+="\n"+ ++SETTINGS_ERROR+") Auto-backup path must be blank or a valid UNC or Windows path.",_$ElementTrack("SettingsGeneralBackupDirectory"),!0)}function SettingsEmailSetPort(n){var t=_Event(n),i=_NumberValidator(0,65535);_$ElementValidateNumber(t,t.SourceElement,i,1,0,!1,0)&&_$NavigatorSetSavePrompt()}function SettingsEmailTest(){var n;if(SETTINGS_ERROR=0,SETTINGS_MESSAGE="",SettingsEmailValidate(!0),SETTINGS_ERROR>0){n="The following error occurred when attempting to test the email settings:\n";CommonDialog($_PopupDialogErrorId,"Error","",n+SETTINGS_MESSAGE);return}var t=_Navigator("AJAX/Settings/Test_Email.aspx",""),i=_Ajax(t,"SettingsEmailTestResponse","SettingsForm");_$PageLock();i.Post()}function SettingsEmailTestResponse(n){if(!CommonAjaxError(n)){var t=_NavigatorRecaller(null,null,"SettingsSelect",[_Element("Settings:Tab:Email")],!1);_$PageBusy(!1);CommonDialog($_PopupDialogSuccessId,"Success","","The test email was dispatched successfully.",10,90,!0)}}function SettingsEmailValidate(n){n=typeof n=="boolean"?n:!1;var f=SETTINGS_ERROR,e=_Element("SettingsEmailEnabled").Object.checked,o=_Element("SettingsEmailServer").GetString().Trim().Value,s=_Element("SettingsEmailFrom").GetString().Trim().Value,t=_Element("SettingsEmailUsername").GetString().Trim().Value,i=_Element("SettingsEmailPassword").GetString().Trim().Value,r=_Element("SettingsEmailCC").GetString().Trim().Value,u=_Element("SettingsEmailBCC").GetString().Trim().Value,h=_Element("SettingsEmailNoteDesired").IsValid;return!e&&!n?!1:(o===""&&(SETTINGS_MESSAGE+="\n"+ ++SETTINGS_ERROR+") A valid email server must be specified.",_$ElementTrack("SettingsEmailServer")),_String(s).IsValidEmail()||(SETTINGS_MESSAGE+="\n"+ ++SETTINGS_ERROR+") A valid account email address is required.",_$ElementTrack("SettingsEmailFrom")),t===""&&i!==""&&(SETTINGS_MESSAGE+="\n"+ ++SETTINGS_ERROR+") An account username is required when a password is specified.",_$ElementTrack("SettingsEmailUsername")),t===""||i!==""||h||(SETTINGS_MESSAGE+="\n"+ ++SETTINGS_ERROR+") An account password is required when a username is specified.",_$ElementTrack("SettingsEmailPassword")),r===""||_String(r).IsValidEmail()||(SETTINGS_MESSAGE+="\n"+ ++SETTINGS_ERROR+") Carbon copy address must be blank or a valid email address.",_$ElementTrack("SettingsEmailBCC")),u===""||_String(u).IsValidEmail()||(SETTINGS_MESSAGE+="\n"+ ++SETTINGS_ERROR+") Blind carbon copy address must be blank or a valid email address.",_$ElementTrack("SettingsEmailNoteDesired")),SETTINGS_ERROR>f)}function SettingsInspectorsAdd(){var h=_Element("SettingsInspectorCount"),t=h.GetNumber().GetValue(0),c=_Element("SettingsInspectorTable").Object,o=$_Doc.createElement("tr"),u=_Element($_Doc.createElement("input")),i=_Element($_Doc.createElement("input")),r=_Element($_Doc.createElement("input")),f=_Element($_Doc.createElement("img")),s=_Element($_Doc.createElement("div")),e=_Element($_Doc.createElement("div")),n;n=SettingsInspectorsGetCell().Object;u.Object.id="SettingsInspectorDelete_"+t;u.Object.type="checkbox";u.Object.onclick=new Function("_$NavigatorSetSavePrompt();");u.SetValue(1);u.SetClassName("mt3");u.SetStyle("margin-top","3px");n.appendChild(u.Object);o.appendChild(n);n=SettingsInspectorsGetCell();n.SetStyle("padding-left","20px");n.SetStyle("padding-right","10px");i.Object.id="SettingsInspectorName_"+t;i.Object.type="text";i.Object.maxLength="100";i.Object.onfocus=new Function("_Element( this ).Select();");i.Object.onchange=new Function("_$NavigatorSetSavePrompt();");i.SetClassName("w200");i.SetStyle("margin-top","2px");n.Object.appendChild(i.Object);o.appendChild(n.Object);n=SettingsInspectorsGetCell();n.SetStyle("padding-left","10px");n.SetStyle("padding-right","20px");r.Object.id="SettingsInspectorTitle_"+t;r.Object.type="text";r.Object.maxLength="100";r.Object.onfocus=new Function("_Element( this ).Select();");r.Object.onchange=new Function("_$NavigatorSetSavePrompt();");r.SetClassName("w200");r.SetStyle("margin-top","2px");n.Object.appendChild(r.Object);o.appendChild(n.Object);n=SettingsInspectorsGetCell().Object;f.Object.id="SettingsInspectorImage_"+t;f.Object.title="Click for options";f.Object.onclick=new Function("event","SettingsImageContextMenu( event, "+t+" );");f.SetClassName("settings-signature");f.SetDisplay(!1);e.SetClassName("button popup-dialog-button-out-warning");e.SetStyle("width","140px");e.SetInnerText("Select Signature");e.Object.title="Click here to select a signature image";e.Object.onclick=new Function("SettingsImageSelect( "+t+" );");s.Object.id="SettingsInspectorButton_"+t;s.SetStyle("display","inline-block");s.Object.appendChild(e.Object);n.appendChild(f.Object);n.appendChild(s.Object);n.appendChild(SettingsInspectorsGetInput(t,"SettingsInspectorId",-1));n.appendChild(SettingsInspectorsGetInput(t,"SettingsInspectorExtension"));n.appendChild(SettingsInspectorsGetInput(t,"SettingsInspectorMimeType"));n.appendChild(SettingsInspectorsGetInput(t,"SettingsInspectorData"));n.appendChild(SettingsInspectorsGetInput(t,"SettingsInspectorChanged",0));o.appendChild(n);c.appendChild(o);c.appendChild(SettingsInspectorsGetRule());h.SetValue(++t)}function SettingsInspectorsGetCell(){var n=_Element($_Doc.createElement("td"));return n.SetClassName("p5 top center"),n}function SettingsInspectorsGetInput(n,t,i){var r=_Element($_Doc.createElement("input"));return r.Object.id=t+"_"+n,r.Object.type="hidden",i!==undefined&&r.SetValue(i),r.Object}function SettingsInspectorsGetRule(){var t=$_Doc.createElement("tr"),n=$_Doc.createElement("td"),i=_Element($_Doc.createElement("div"));return i.SetClassName("rule-light"),n.colSpan=4,n.appendChild(i.Object),t.appendChild(n),t}function SettingsInspectorsValidate(){for(var r,s=SETTINGS_ERROR,h=_Element("SettingsInspectorCount").GetNumber().GetValue(0),i=[],t,f,e,u,o,n=0;ns}function SettingsImageContextMenu(n,t){SETTINGS_IMAGE_ID=t;var i=_Event(n),r=_Element("SettingsContextMenu").Object.children,u=SETTINGS_IMAGE_ID<0?"Select A New Logo":"Select A New Signature",f=SETTINGS_IMAGE_ID<0?"Remove Logo":"Remove Signature";_Element(r[0].firstElementChild).SetInnerText(u);_Element(r[2].firstElementChild).SetInnerText(f);CommonOpenPopup(i,i.SourceElement,"PopupSettingsContextMenu","Mouse","SettingsBody")}function SettingsImageSelect(n){SETTINGS_IMAGE_ID=_Number(n).GetValue(-1);SettingsImageSelectFile()}function SettingsImageSelectFile(){_Element("SettingsImageImport").Object.click()}function SettingsImageGetData(){var t=_Navigator("AJAX/Settings/Get_Image_Data.aspx",""),n=_Element("SettingsImageForm").Object;n.action=t.FullUrl;n.submit();_$PageLock()}function SettingsImageSetData(n,t,i){var r="Inspector",u="_"+SETTINGS_IMAGE_ID;SETTINGS_IMAGE_ID<0&&(r="CompanyLogo",u="");_Element("SettingsImageForm").Object.reset();_Element("Settings"+r+"Changed"+u).SetValue(1);_Element("Settings"+r+"Extension"+u).SetValue(n);_Element("Settings"+r+"MimeType"+u).SetValue(t);_Element("Settings"+r+"Data"+u).SetValue(i);_Element("Settings"+r+"Image"+u).Object.src="data:"+t+";base64,"+i;_Element("Settings"+r+"Button"+u).SetDisplay(!1);_Element("Settings"+r+"Image"+u).SetDisplay();_$NavigatorSetSavePrompt();_$PageLock(!1)}function SettingsImageClear(){var n="Inspector",t="_"+SETTINGS_IMAGE_ID;SETTINGS_IMAGE_ID<0&&(n="CompanyLogo",t="");_Element("Settings"+n+"Extension"+t).SetValue();_Element("Settings"+n+"MimeType"+t).SetValue();_Element("Settings"+n+"Data"+t).SetValue();_Element("Settings"+n+"Image"+t).SetDisplay(!1);_Element("Settings"+n+"Button"+t).SetDisplay("inline-block");_Element("Settings"+n+"Changed"+t).SetValue(1);_$NavigatorSetSavePrompt()}function SettingsCompanyValidate(){var n=SETTINGS_ERROR,t=_Element("SettingsCompanyName").GetString().Trim().Value;return t===""&&(SETTINGS_MESSAGE+="\n"+ ++SETTINGS_ERROR+") A valid company must be specified.",_$ElementTrack("SettingsCompanyName")),SETTINGS_ERROR>n}function SettingsPublishSetSecurity(){var n=_String(_Element("SettingsPublishingReportUsePassword").GetSelectedValue()).ToBoolean();_Element("SettingsPublishingContainerPassword").SetDisplay(n);_Element("SettingsPublishingContainerConfirm").SetDisplay(n);_Element("SettingsPublishingContainerMessage").SetDisplay(n);_$NavigatorSetSavePrompt()}function SettingsPublishValidate(){var s=SETTINGS_ERROR,i=["A","B","C"],t,n,r,h=_String(_Element("SettingsPublishingReportUsePassword").GetSelectedValue()).ToBoolean(),u,o;for(u in i)t=i[u],n="SettingsFindingDescription"+t,r=_Element(n).GetString().Trim().Value,r===""&&(SETTINGS_MESSAGE+="\n"+ ++SETTINGS_ERROR+") A valid label is required for '"+t+"' Findings Description.",_$ElementTrack(n));if(h){var f=_Element("SettingsPublishingReportPassword").GetString().Trim().Value,c=_Element("SettingsPublishingReportConfirm").GetString().Trim().Value,e=_Element("SettingsPublishingContainerMessage").IsValid,l=f!==c,a=f==="";l&&(o=e?" or both be blank.":".",SETTINGS_MESSAGE+="\n"+ ++SETTINGS_ERROR+") The PDF report password and confirmation must match"+o,_$ElementTrack(n));!e&&a&&(SETTINGS_MESSAGE+="\n"+ ++SETTINGS_ERROR+") A PDF report password is required when protection is enabled.",_$ElementTrack(n))}return SETTINGS_ERROR>s}function SettingsExit(){if($_NavigatorSave){var n=_NavigatorRecaller($_PopupDialogWarningId,null,"SettingsExit",null,!1);_Navigator().ShowSavePrompt(n);return}CommonMenuAction(null,"Set_Mode_Settings")}function SettingsSave(){var n,t,i;if(SETTINGS_ERROR=0,SETTINGS_MESSAGE="",n="",n=SettingsGeneralValidate()&&n===""?"Settings:Tab:General":n,n=SettingsEmailValidate()&&n===""?"Settings:Tab:Email":n,n=SettingsCompanyValidate()&&n===""?"Settings:Tab:Organization":n,n=SettingsInspectorsValidate()&&n===""?"Settings:Tab:Inspectors":n,n=SettingsPublishValidate()&&n===""?"Settings:Tab:Publishing":n,SETTINGS_ERROR>0){t="The following error occurred when attempting to save the global settings:\n";i=_NavigatorRecaller(null,null,"SettingsSaveError",[n],!1);CommonDialog($_PopupDialogErrorId,"Error","",t+SETTINGS_MESSAGE,0,90,!1,i);return}var r=_Navigator("AJAX/Settings/Save.aspx",""),u=_Ajax(r,"SettingsSaveResponse","SettingsForm");_$PageLock();u.Post()}function SettingsSaveError(n){SETTINGS_ELEMENT=$_ElementTracked;SettingsSelect(_Element(n))}function SettingsSaveResponse(n){CommonAjaxError(n)||_Navigator().Timeout()}function SettingsExport(){var n=_Navigator("AJAX/Settings/Export.aspx",""),t=_Export(n,"Settings:Export:Form");t.Post()}function SettingsImportPopup(){SettingsImportDisplay();_Element("SettingsImportForm").Object.reset();CommonOpenPopup(null,_Element("HeaderToolContainerSettings").Object,"Popup:Settings:Import","Config-Import")}function SettingsImportDisplay(n){var i=!n||n.files.length===0,t=!1,u=_Element("Settings:Import:Display"),r="No Global Settings File Selected",o=i?"italic":"",f,e;i?_Element("SettingsImportForm").Object.reset():(r=n.files[0].name,t=_String(r).ToLower().EndsWith(".ixset"));u.SetInnerText(r);u.SetClassName("normal cfff "+o);_Element("Settings:Button:Enabled").SetDisplay(t);_Element("Settings:Button:Disabled").SetDisplay(!t);i||t||(f=_NavigatorRecaller($_PopupDialogErrorId,null,"SettingsImportDisplay"),e="A valid InspectX global settings file (.iXset) must be selected.",CommonDialog($_PopupDialogErrorId,"Error","",e,0,90,!1,f))}function SettingsImport(){var t=_Navigator("AJAX/Settings/Import.aspx",""),n=_Element("SettingsImportForm").Object;n.action=t.FullUrl;n.submit();_$PageLock()}function SettingsImportResponse(n){if(!CommonError(n)){var t=_NavigatorRecaller($_PopupDialogSuccessId,_Navigator(),"Timeout");_$PopupClose("Popup:Configuration:Import");_$PageBusy(!1);CommonDialog($_PopupDialogSuccessId,"Success","","The global settings were imported successfully.",5,90,!0,t)}}function TileGetObject(n,t){var r=_Event(n),i=r.IsValid?r.Source.parentElement:n.parentElement;return i.hasAttribute(t)?i:(i=i.parentElement,i.hasAttribute(t)?i:i.parentElement)}function TileGetAttribute(n,t){return TileGetObject(n,t).getAttribute(t)}function TileGetId(n){return _Number(TileGetAttribute(n,"tileid")).GetValue(-1)}function TileGetType(n){return _String(TileGetAttribute(n,"type")).Value}function TileSelect(n){TileRequest(TileGetId(n))}function TileRequest(n,t){if(TILE_ID=_Number(n).GetValue(-1),t=typeof t=="boolean"?t:!1,!(TILE_ID<0)){var r=t?"&Node="+CONTEXT_PUBLISH_NODE:"",u=_Navigator("AJAX/Tile/Load.aspx",""),i=_Ajax(u,"TileResponse");i.FormData="ProjectId="+GLOBAL_PROJECT_ID+"&TileId="+TILE_ID+r;_$PageLock();i.Post()}}function TileResponse(n){if(!CommonAjaxError(n)){var i=n.Response.substring(1),t=i.split(String.fromCharCode(3)),r=_DataTable().FromString(t[0]),u=_DataTable().FromString(t[1]);TilePopuplate(r,u)}}function TilePopuplate(n,t){var i=n.Rows[0],e=_Number(i.Get("TileId")).GetValue(-1),d=_Number(i.Get("CategoryId")).GetValue(-1),a=i.Get("Status").replace(" ","-").toLowerCase(),o=i.Get("TextValue"),r,h,f;EDIT_LOAD_COUNT=0;EDIT_LOADED=!1;TILE_RELOAD=!1;TILE_IS_SINGLE=_String(i.Get("IsSingleLine")).ToBoolean();LIST_ITEM=null;var s=_Element("EditValue"),v=TILE_IS_SINGLE?210:310,y=TILE_IS_SINGLE?242:342,p=TILE_IS_SINGLE?50:150;_Element("EditOptionsControls").SetStyle("top",v+"px");_Element("EditOptionsContainer").SetStyle("top",y+"px");GLOBAL_IS_READ_ONLY?s.SetStyle("bottom","21px"):s.SetStyle("height",p+"px");_DataElement(i,"ProjectId","Tile").SetHiddenInputString();_DataElement(i,"TileId","Tile").SetHiddenInputString();_DataElement(i,"StatusId","Tile").SetHiddenInputString();_DataElement(i,"Category","Tile").SetHiddenInputString();_DataElement(i,"Description","Tile").SetHiddenInputString();_DataElement(i,"Status","Tile").SetHiddenInputString();_Element("Display:Tile:Status").SetClassName("f14 edit-status-"+a);r=e>=1e3;h=r||e===200;_Element("Edit:Header:Counts").SetDisplay(h);_Element("Edit:Header:Findings").SetDisplay(r);EditAttachSet("Edit",t.Rows[0].Get("ItemCount"));EditFindingsSet({A:[t.Rows[1].Get("ItemCount"),t.Rows[1].Get("FindingId")],B:[t.Rows[2].Get("ItemCount"),t.Rows[2].Get("FindingId")],C:[t.Rows[3].Get("ItemCount"),t.Rows[3].Get("FindingId")]});var c=TILE_IS_SINGLE?"Single":"Multi",l=TILE_IS_SINGLE?"Multi":"Single",w=EditGetReadonly("Edit",c),b=EditGetReadonly("Edit",l),u=EditGetEditable("Edit",c),k=EditGetEditable("Edit",l);if(w.SetInnerText(GLOBAL_IS_READ_ONLY?o:""),b.SetInnerText(""),u.SetValue(GLOBAL_IS_READ_ONLY?"":o),k.SetValue(),_Element("Edit:Container:Single").SetDisplay(TILE_IS_SINGLE),_Element("Edit:Container:Multi").SetDisplay(!TILE_IS_SINGLE),_Element("Edit:Caret:Outer:Single").SetDisplay(!1),_Element("Edit:Caret:Outer:Multi").SetDisplay(!1),_Element("Edit:Options:Indicator").SetDisplay(!1),_Element("Edit:Reminders:Indicator").SetDisplay(!1),f=_Element("Edit:Button:Cancel"),f.Object.title=GLOBAL_IS_READ_ONLY?"Close entry window":"Discard changes and close entry window",f.SetInnerText(GLOBAL_IS_READ_ONLY?"Close":"Cancel"),_Element("Edit:Button:NotApplicable").SetDisplay(!GLOBAL_IS_READ_ONLY),_Element("Edit:Button:Incomplete").SetDisplay(!GLOBAL_IS_READ_ONLY),_Element("Edit:Button:Completed").SetDisplay(!GLOBAL_IS_READ_ONLY),GLOBAL_IS_READ_ONLY||(CommonRemoveChildren(_Element("EditOptionsList").Object),CommonRemoveChildren(_Element("EditRemindersList").Object),_Element("EditNumberList").SelectIndex(0)),EditOpen("Edit"),GLOBAL_IS_READ_ONLY){EditForceUnlock();return}u.Object.scrollTop=u.Object.scrollHeight;EditSetVirtual("Edit","Single");EditSetVirtual("Edit","Multi");ListLoad("Edit","Options");ListLoad("Edit","Reminders")}function TileConfigContextMenu(n){var o=_Event(n);CONTEXT_TILE_ID=TileGetId(o);var u=TileGetType(o),t=_Element("TileContextMenu").Object.children,s="Context-Tile";if(GLOBAL_IS_CONFIG_MODE){var r=u==="new",h=u==="break",i=u==="topic",f=u==="tile",e=CONTEXT_TILE_ID>=1e3;_Element(t[0]).SetDisplay(f);_Element(t[1]).SetDisplay(f);_Element(t[2]).SetDisplay(f&&e);_Element(t[3]).SetDisplay(f&&!e);s=i?"Context-Topic":s;_Element(t[4]).SetDisplay(i);_Element(t[5]).SetDisplay(i);_Element(t[6]).SetDisplay(i&&e);_Element(t[7]).SetDisplay(i&&!e);_Element(t[8]).SetDisplay(h);_Element(t[9]).SetDisplay(r);_Element(t[10]).SetDisplay(r);_Element(t[11]).SetDisplay(r);_Element(t[12]).SetDisplay(r);_Element(t[13]).SetDisplay(r)}else _Element(t[1]).SetDisplay(!GLOBAL_IS_READ_ONLY&&!i),_Element(t[2]).SetDisplay(!GLOBAL_IS_READ_ONLY&&!i),_Element(t[3]).SetDisplay(GLOBAL_IS_READ_ONLY);CommonOpenPopup(n,TileGetObject(o,"tileid"),"PopupTileContextMenu",s,"TileContainer")}function TileConfig(n){TileConfigRequest(TileGetId(n))}function TileConfigRequest(n,t){var i,r;if(n=_Number(n).GetValue(CONTEXT_TILE_ID),t=typeof t=="boolean"?t:!1,n<0){i=n<-1?3:1;r=_DataTable().FromCollection({CategoryId:GLOBAL_CATEGORY_ID,TileId:-1,TypeId:i,IsEnabled:_Element("TileConfigDefaultVisible").GetNumber().GetValue(1),IsApplicable:_Element("TileConfigDefaultApplicable").GetNumber().GetValue(1),IsSingleLine:_Element("TileConfigDefaultSingleLine").GetNumber().GetValue(0)});TileConfigPopuplate(r);return}var f=t?"&Node="+CONTEXT_PUBLISH_NODE:"",e=GLOBAL_IS_CONFIG_MODE?"":"&ProjectId="+GLOBAL_PROJECT_ID,o=_Navigator("AJAX/Tile/Load_Configuration.aspx",""),u=_Ajax(o,"TileConfigResponse");u.FormData="TileId="+n+e+f;_$PageLock();u.Post()}function TileConfigResponse(n){var t,i;if(!CommonAjaxError(n)){if(t=n.Response.substring(1),_$PageBusy(!1),t==="#"){TileConfigRequest(-1);return}i=_DataTable().FromString(t);TileConfigPopuplate(i)}}function TileConfigPopuplate(n){var t=n.Rows[0],rt=_Number(t.Get("ProjectId")).GetValue(-1),o=_Number(t.Get("TileId")).GetValue(-1),s=_Number(t.Get("TypeId")).GetValue(-1),p=t.Get("ProjectLong"),w=t.Get("ProjectShort"),r=o<0,h=s===1,ut=s===3,i=h?"Entry":"Topic",u=!GLOBAL_IS_CONFIG_MODE&&GLOBAL_IS_READ_ONLY,c=GLOBAL_IS_CONFIG_MODE&&(o>=1e3||r),b=_Element("TileConfig:Save"),k=r||GLOBAL_IS_CONFIG_MODE?"New "+i+" Description:":"Project Override Description:",d=r||GLOBAL_IS_CONFIG_MODE?"New "+i+" Button Name:":"Project Override Button Name:",g=r||GLOBAL_IS_CONFIG_MODE?"Default "+i+" Page Break Setting":"Project Override Page Break Setting:",nt=_Number(t.Get("DefaultBreak")).GetValue(0),l=_Number(t.Get("ProjectBreak")).GetValue(0),a=_Element("Editable:TileConfig:ProjectBreak"),v=a.GetOptionByValue(0),y=a.GetOptionByValue(1),f=v.text.replace(/Entry|Topic/,i),e=y.text.replace(/Entry|Topic/,i),tt=nt===0?f:e,it=l===0?f:e;v.text=f;y.text=e;_Element("Editable:TileConfig:DefaultLong:Label").SetInnerText(i);_Element("Editable:TileConfig:DefaultShort:Label").SetInnerText(i);_Element("Editable:TileConfig:DefaultBreak:Label").SetInnerText(i);_Element("Editable:TileConfig:CategoryId:Label").SetInnerText(i);_Element("Editable:TileConfig:IsEnabled:Label").SetInnerText(i);_Element("TileConfig:ContainerExtended").SetDisplay(c);_Element("TileConfig:ContainerExtendedTile").SetDisplay(h&&c);_Element("TileConfig:ContainerLong").SetDisplay(!r);_Element("TileConfig:ContainerShort").SetDisplay(!r);_Element("TileConfig:RowLong").SetDisplay(!u||p!=="");_Element("TileConfig:RowShort").SetDisplay(!u||w!=="");_Element("TileConfig:LabelLong").SetInnerText(k);_Element("TileConfig:LabelShort").SetInnerText(d);_Element("TileConfig:LabelBreak").SetInnerText(g);_Element("Display:TileConfig:DefaultBreak").SetInnerText(tt);_Element("Readonly:TileConfig:ProjectBreak").SetInnerText(it);_Element("Editable:TileConfig:ProjectBreak").SelectValue(l);_DataElement(t,"ProjectId","TileConfig").SetHiddenInputString();_DataElement(t,"TileId","TileConfig").SetHiddenInputString();_DataElement(t,"TypeId","TileConfig").SetHiddenInputString();_DataElement(t,"DefaultLong","TileConfig").SetHiddenInputString();_DataElement(t,"DefaultShort","TileConfig").SetHiddenInputString();_DataElement(t,"ProjectLong","TileConfig").SetInputString();_DataElement(t,"ProjectShort","TileConfig").SetInputString();_DataElement(t,"CategoryId","TileConfig").SetListBox();_DataElement(t,"IsEnabled","TileConfig").SetListBoxBoolean();_DataElement(t,"IsApplicable","TileConfig").SetListBoxBoolean();_DataElement(t,"IsSingleLine","TileConfig").SetListBoxBoolean();_EditMode("TileConfig",!0,"Tile:Config:Form").Enable(!u);b.SetDisplay(!u);CommonOpenPopup(null,null,"Popup:Tile:Config","Edit-Category");u||_Element("Editable:TileConfig:ProjectLong").Focus()}function TileConfigSave(){if(GLOBAL_IS_CONFIG_MODE){var n=0,t="The following error occurred when attempting to save the entry configuration:\n",r=_Element("Editable:TileConfig:ProjectLong").GetString().Trim().Value,c=_Element("Editable:TileConfig:ProjectShort").GetString().Trim().Value,u=_Element("Editable:TileConfig:IsEnabled").GetNumber().GetValue(-1),f=_Element("Editable:TileConfig:IsApplicable").GetNumber().GetValue(-1),e=_Element("Editable:TileConfig:IsSingleLine").GetNumber().GetValue(-1),o=_Element("Hidden:TileConfig:TypeId").GetNumber().GetValue(-1),i=o===3;if(r||(t+="\n"+ ++n+") A valid entry is required for the entry description.",_$ElementTrack("Editable:TileConfig:ProjectLong")),u<0&&(t+="\n"+ ++n+") A valid selection is required for the entry visibility.",_$ElementTrack("Editable:TileConfig:IsEnabled")),!i&&f<0&&(t+="\n"+ ++n+") A valid selection is required for the entry default status.",_$ElementTrack("Editable:TileConfig:IsApplicable")),!i&&e<0&&(t+="\n"+ ++n+") A valid selection is required for the entry size.",_$ElementTrack("Editable:TileConfig:IsSingleLine")),n>0){CommonDialog($_PopupDialogErrorId,"Error","",t);return}}var s=_Navigator("AJAX/Tile/Save_Configuration.aspx",""),h=_Ajax(s,"CommonAjaxResponse","Tile:Config:Form");_$PageLock();h.Post()}function TileConfigContextView(){TileRequest(CONTEXT_TILE_ID)}function TileConfigContextEdit(){TileConfigRequest(CONTEXT_TILE_ID)}function TileConfigContextNew(){TileConfigRequest(-1)}function TileConfigContextNewSub(){TileConfigRequest(-2)}function TileConfigContextNewBreak(){TileConfigSet("New_Break")}function TileConfigContextDeleteBreak(){TileConfigSet("Delete")}function TileConfigContextDelete(){$_NavigatorContinue=_NavigatorRecaller($_PopupDialogWarningId,null,"TileConfigSet",["Delete"]);CommonDialog($_PopupDialogWarningId,"Warning","","This operation will delete the selected entry.\n\nThe delete process is permanent and cannot be undone.\n\nOnce executed, any project data associated with the entry will be irretrievable.\n\nUse the 'Export Configuration To File' function to create a backup of the current\nconfiguration prior to deleting.\n\nClick 'Cancel' to abort the operation.\nClick 'Continue' to complete the action.",20,90,!0,null,!0)}function TileConfigSet(n){var i=n==="Delete",r=n+".aspx",u="AJAX/Tile/"+r,f=_Navigator(u,""),t=_Ajax(f,"CommonAjaxResponse"),e=i?"TileId="+CONTEXT_TILE_ID:"CategoryId="+GLOBAL_CATEGORY_ID;t.FormData=e;_$PageLock();t.Post()}function EditOpen(n){var t=n+"Container";EDIT_POPUP[n]=$_PopupCache[t];EDIT_POPUP[n]instanceof _Popup||(EDIT_POPUP[n]=_Popup(t),EDIT_POPUP[n].OpenHandler=_NavigatorRecaller("",null,"EditOpenHandler",[n]),EDIT_POPUP[n].CloseHandler=_NavigatorRecaller("",null,"EditCloseHandler",[n]));EDIT_POPUP[n].Open()}function EditOpenHandler(n){if(EditDim(n),n==="Edit"){window.addEventListener("resize",EditResize);return}window.addEventListener("resize",DetailResize)}function EditIsOpen(){return _Element("EditContainer").IsDisplayed()}function EditClose(n){CommonClosePopup();EDIT_POPUP[n]instanceof _Popup&&EDIT_POPUP[n].Close()}function EditCloseHandler(n){if(FINDING_ID=-1,n==="Edit"){TILE_ID=-1;window.removeEventListener("resize",EditResize);(TILE_RELOAD||PUBLISH_RELOAD)&&_Navigator().Timeout();return}if(window.removeEventListener("resize",DetailResize),SummaryIsOpen()){if(SUMMARY_RELOAD){SummaryLoad(!0);return}SummaryEnable();return}if(EditIsOpen()){if(TILE_RELOAD){EditFindingReloadCounts();return}EditEnable();return}GLOBAL_IS_PUBLISH_MODE&&PUBLISH_RELOAD&&_Navigator().Timeout()}function EditDim(n,t){var i,u,f,e,r;t=typeof t=="boolean"?t:!0;i=_Element(n+"Container");u=i.Object.children;i.SetDim(t);i.SetDisabled(t);_Element(n+"NumberList").SetDisabled(t);f=n==="Detail"?["Description","Recommendation"]:[EditGetSuffix(n)];for(e in f)EditGetEditable(n,f[e]).SetDisabled(t);if(!t)for(r=0;r0,u=i?"81px":"0px",f=i?"113px":"32px";_Element("EditFooter").SetDisplay(i);_Element("EditRemindersContainer").SetDisplay(i);_Element("EditRemindersControls").SetStyle("bottom",u);_Element("EditOptionsContainer").SetStyle("bottom",f)}}function EditAttachIncrement(n,t){var r=n==="Edit"?"Tile":"Finding",u="Display:"+r+":ItemCount:@",i=_Element(u),f=_Number(i.GetInnerText()).Value;i.SetInnerText(f+t);EditAttachPrepare(n)}function EditAttachSet(n,t){var i=n==="Edit"?"Tile":"Finding",r="Display:"+i+":ItemCount:@";_Element(r).SetInnerText(t);EditAttachPrepare(n)}function EditAttachPrepare(n){var i=n==="Edit"?"Tile":"Finding",r=n==="Edit"?"Entry":"Finding",u="Display:"+i+":ItemCount:@",f="Display:"+i+":AttachmentCount",e=_Element(u),t=_Element(f).Object,o=_Number(e.GetInnerText()).Value;if(o===0&&!GLOBAL_IS_READ_ONLY){t.title="Add New "+r+" Attachment";t.onclick=Function("event","AttachmentImportOpen( event, '"+n+"' );");return}t.title="View "+r+" Attachments";t.onclick=Function("AttachmentPopupShow( '"+n+"' );")}function EditFindingsSet(n){var t;for(var i in n)t=_Element("Display:Tile:ItemCount:"+i),t.SetInnerText(n[i][0]),t.IsValid&&t.Object.setAttribute("finding",n[i][1]);EditFindingsPrepare()}function EditFindingsPrepare(){var e=0,n=["A","B","C"],u=_Element("DisplayTileFindingIcon"),t,f,r,o;for(var i in n){if(t=_Element("Display:Tile:Pill:"+n[i]),f=_Element("Display:Tile:ItemCount:"+n[i]),r=_Number(f.GetInnerText()).Value,e+=r,r===1){o=f.Object.getAttribute("finding");t.Object.title="View this '"+n[i]+"' entry finding";t.Object.onclick=Function("event","EditNewFinding( event, '"+n[i]+"', "+o+" );");t.SetStyle("cursor","pointer");continue}r===1||GLOBAL_IS_READ_ONLY||(t.Object.title="Add new '"+n[i]+"' entry finding",t.Object.onclick=Function("event","EditNewFinding( event, '"+n[i]+"' );"),t.SetStyle("cursor","pointer"))}GLOBAL_IS_READ_ONLY||e>0&&(u.Object.title="View entry findings",u.Object.onclick=Function("SummaryShow( 'Edit' );"),u.SetStyle("cursor","pointer"))}function EditNewFinding(n,t,i){_Event(n).Cancel();EditDim("Edit");DetailView(TILE_ID,i,!1,t)}function EditFindingReloadCounts(){var t=_Navigator("AJAX/Tile/Load_Finding_Counts.aspx",""),n=_Ajax(t,"EditFindingReloadCountsResponse");n.FormData="ProjectId="+GLOBAL_PROJECT_ID+"&TileId="+TILE_ID;n.Post()}function EditFindingReloadCountsResponse(n){if(TILE_RELOAD=!1,!CommonAjaxError(n,"_EditEnable")){var i=n.Response.substring(1),t=_DataTable().FromString(i);EditFindingsSet({A:[t.Rows[0].Get("ItemCount"),t.Rows[0].Get("FindingId")],B:[t.Rows[1].Get("ItemCount"),t.Rows[1].Get("FindingId")],C:[t.Rows[2].Get("ItemCount"),t.Rows[2].Get("FindingId")]});EditEnable()}}function EditGetReadonly(n,t){t=typeof t=="string"?t:EditGetSuffix(n);var i=n==="Edit"?"Tile":"Finding",r="Readonly:"+i+":"+t;return _Element(r)}function EditGetEditable(n,t){t=typeof t=="string"?t:EditGetSuffix(n);var i=n==="Edit"?"Tile":"Finding",r="Editable:"+i+":"+t;return _Element(r)}function EditGetSuffix(n){return n==="Edit"?TILE_IS_SINGLE?"Single":"Multi":DETAIL_IS_FINDING?"Description":"Recommendation"}function EditSetVirtual(n,t){var r="ActiveXObject"in window,u=_$PageIsIOS()?6:0,f=n==="Edit"?20:22,e=r?4.25:0,o=f+u+e,s="calc( 100% - "+o+"px )",h=n+":Virtual:"+t,i=_Element(h);i.SetStyle("width",s);i.SetInnerText("")}function EditFocus(n,t,i){var r;if(i=typeof i=="boolean"?i:!1,i||EDIT_LOADED){r=EditGetCaret(t);r=r===null||i?[-1,-1]:r;var u=EditGetEditable(n,t).GetValue().length,f=r[0]<0||r[0]>u?u:r[0],e=r[1]<0||r[1]>u?u:r[1];(_Element(n+":Caret:Outer:"+t).SetDisplay(!1),EditSetCaret(t,f,e),EditSetPosition(n,t,f,e),i||n==="Edit")||DetailToggleView(t==="Description")}}function EditFocusOut(){window.ActiveXObject!==undefined&&$_Body.SetClassName("select-text")}function EditBlur(n,t,i){var e,s,l,w;if(i=typeof i=="boolean"?i:!1,e=EditGetEditable(n,t),!GLOBAL_IS_READ_ONLY&&(i||e.Object!==$_Doc.activeElement)){EDIT_FOCUS=!0;var b=n+":Virtual:"+t,a=_Element(b),v=/firefox/i.test(navigator.userAgent),u=e.Object.selectionStart,f=e.Object.selectionEnd,r=e.GetValue(),o=r.length;u=u>o?o:u;f=f>o?o:f;var h=u!=f,k=r==="",y=r.charAt(o-1)==="\n",c=0,p=0;r=k?" ":r;r+=y?"\n":"";v&&!h&&r.charAt(u)==="\n"?c=1:v&&h&&y&&(p=1);a.SetInnerText(r);s=$_Doc.createRange();l=a.Object.firstChild;s.setStart(l,u+c);s.setEnd(l,f+c+p);w=s.getClientRects();window.ActiveXObject!==undefined&&$_Body.SetClassName("select-none");EditSetCaret(t,u,f);EditRectangles(n,t,w,h)}}function EditRectangles(n,t,i,r){var c=window.ActiveXObject!==undefined,l=_Element(n+":Caret:Outer:"+t),e=_Element(n+":Caret:Inner:"+t),w=_Element(n+":Container:"+t),b=w.GetRectangle(),k=$_Body.GetRectangle(),h=EditGetEditable(n,t),a=i.length,d=r?.3:1,g=r?"bff6":"bf33",o,u,v,y,f,p,s;for(CommonRemoveChildren(e.Object),s=0;s-1&&(i=i.substring(0,h)+c+i.substring(h+1)),r){var rt=i.charAt(0).match(/\s/),ut=i.charAt(i.length-1).match(/\s/),ft=s.length>0?s.charAt(s.length-1).match(/\s/):!0,et=k.length>0?s.charAt(0).match(/\s/):!0;i=(!rt&&!ft?" ":"")+i+(!ut&&!et?" ":"")}if(a=o.Object.maxLength,l=s+i+k,l=v?l.substring(0,a):l,f=e[0]+i.length,f=v&&f>a?a:f,o.SetValue(l),EditSetCaret(t,f,f),y&&nt){g="EditSetPosition( '"+n+"', '"+t+"', "+f+", "+f+" );";setTimeout(g,0);return}EditSetPosition(n,t,f,f);y||(o.Focus(),_$PageIsMobile()&&_$ElementBlurAll())}function EditGetCaret(n){return EDIT_CARET[n]?EDIT_CARET[n]:null}function EditSetCaret(n,t,i){EDIT_CARET[n]=[t,i]}function EditSetPosition(n,t,i,r){var u=EditGetEditable(n,t).Object;u.selectionStart=i;u.selectionEnd=r}function EditToolMenu(n,t){EDIT_TOOL_TYPE=n;EDIT_TOOL_SUFFIX=t;var r=EDIT_TOOL_TYPE+":Icon:"+EDIT_TOOL_SUFFIX,i="Edit"+EDIT_TOOL_SUFFIX+"ContextMenu",u="Popup"+i;CommonOpenPopup(null,r,u,"Context-Tool");EditDetectScroll(i)}function EditToolMenuItem(n){var r=_Event(n),t=r.SourceElement.GetInnerText(),i=!1;EDIT_TOOL_SUFFIX==="Code"&&(t="[:"+t+":]",i=!0);EditSetText(EDIT_TOOL_TYPE,EditGetSuffix(EDIT_TOOL_TYPE),t,!0,i);CommonClosePopup()}function EditClear(n,t){var i=EditGetEditable(n,t);i.Focus();i.SetValue()}function EditDetectScroll(n){var u=_Element("Popup"+n),t=_Element(n),f=_Element(n+"Indicator"),e=u.Object.scrollWidth,o=t.Object.scrollWidth,s=e-o,r=t.Object.scrollHeight>t.Object.offsetHeight,h=s>0,i=r&&!h,c=r?30:47,l=i?42:c;f.SetDisplay(i);t.Object.setAttribute("scrollable",i?1:0)}function ListLoad(n,t,i){var u;i=typeof i=="boolean"?i:!1;u=n+t+"List";i&&CommonRemoveChildren(_Element(u).Object);var f=n==="Edit"?"Tile":"Finding",e="Load_"+t+".aspx",o="AJAX/"+f+"/"+e,s=_Navigator(o,""),r=_Ajax(s,"ListLoadResponse");r.ObjectStore={Type:n,Suffix:t,Reload:i};r.FormData="TileId="+TILE_ID;r.Post()}function ListLoadResponse(n){var r=n.ObjectStore.Reload?"Force":"",u="_"+n.ObjectStore.Type+r+"Unlock",t,i;CommonAjaxError(n,u)||(t=n.Response.substring(1),i=_DataTable().FromString(t),ListAddItems(n.ObjectStore.Type,n.ObjectStore.Suffix,i),CommonDetectScroll(n.ObjectStore.Type,n.ObjectStore.Suffix),EditRemindersCollapse(n.ObjectStore.Type,n.ObjectStore.Suffix),EditUnlockHelper(n.ObjectStore.Type,n.ObjectStore.Reload))}function ListAddItems(n,t,i){for(var o=_Element(n+t+"List"),l=_Element(n+t+"Bounds"),e=i.Rows.length,a=(e+"").length*(GLOBAL_FONT_SIZE-2),f=[],u,s,h,c,r=0;r=0&&r[1]>=0&&r[0]<=c&&r[1]<=c&&r[0]!==r[1]&&(b=r[0],k=r[1]);h=w.substring(b,k)}var f=o.toLowerCase(),et=u?"Discard "+f+" creation and close window":"Discard changes to "+f+" and close window",ot="Clear "+f+" contents",st=u?"Save new "+f:"Save changes to "+f,ht="Save "+f+" as new "+f+" without altering the original list item";_Element("Item:Button:Cancel").Object.title=et;_Element("Item:Button:Clear").Object.title=ot;_Element("Item:Button:Save").Object.title=st;_Element("Item:Button:SaveAs").Object.title=ht;_Element("Item:Button:SaveAs:Container").SetDisplay(!u);_Element("Item:Edit:Header").SetInnerText(ut);_Element("Item:Edit:ProjectId").SetValue(GLOBAL_PROJECT_ID);_Element("Item:Edit:TileId").SetValue(TILE_ID);_Element("Item:Edit:ItemId").SetValue(ft);_Element("Item:Edit:Type").SetValue(n);_Element("Item:Edit:Suffix").SetValue(t);e=_Element("Item:Edit:Text");l=h.length;e.SetValue(h);u||i.SetClassName("list-item-selected");s?CheckDim():EditDim(n);CommonOpenPopup(null,rt,"Popup:Edit:Item","Edit-Item",null,_NavigatorRecaller("",null,g));e.Object.selectionStart=l;e.Object.selectionEnd=l;e.Object.scrollTop=e.Object.scrollHeight;e.Focus()}function ListItemClear(){var n=_Element("Item:Edit:Text");n.SetValue();n.Focus()}function ListItemSave(n){var f,e;n=typeof n=="boolean"?n:!1;var i=_Element("Item:Edit:Type").GetValue(),r=_Element("Item:Edit:Suffix").GetValue(),o=_Element("Item:Edit:Text").GetString().Trim().Value.length,s=i==="Check"&&r==="Options"?"Option":"Item",u=i==="Edit"?"Tile":"Finding",t=r==="Reminders"?"reminder":"option";if(u=i==="Check"?"Checklist":u,t=r==="Results"?"checklist item":t,f=0,e="The following error occurred when attempting to save the "+t+":\n",o===0&&(e+="\n"+ ++f+") A valid entry is required for the "+t+".",_$ElementTrack("Item:Edit:Text")),f>0){CommonDialog($_PopupDialogErrorId,"Error","",e);return}n&&_Element("Item:Edit:ItemId").SetValue(-1);var h="AJAX/"+u+"/Save_"+s+".aspx",c=_Navigator(h,""),l=_Ajax(c,"ListItemSaveResponse","Item:Edit:Form");_$PageLock();l.Post()}function ListItemSaveResponse(n){if(!CommonAjaxError(n)){var r=_Element("Item:Edit:ItemId").GetNumber().GetValue(-1),u=_Element("Item:Edit:Text").GetValue(),t=_Element("Item:Edit:Type").GetValue(),i=_Element("Item:Edit:Suffix").GetValue(),f=r<0;if(f){_$PopupClose("Popup:Edit:Item");_$PageLock();t==="Check"?(CheckDim(),CheckLoad(i,!0)):(EditDim(t),ListLoad(t,i,!0));return}LIST_ITEM.SetInnerText(u);_$PopupClose("Popup:Edit:Item")}}function ListItemDelete(){_$PopupSetHandler($_PopupDialogWarningId);_$PopupClose($_PopupDialogWarningId);var t=CONTEXT_TYPE==="Edit"?"Tile":"Finding",i="AJAX/"+t+"/Delete_Item.aspx",r=_Navigator(i,""),n=_Ajax(r,"ListItemDeleteResponse"),u=_Number(LIST_ITEM.Object.parentElement.getAttribute("itemid")).GetValue(-1);n.FormData="TileId="+TILE_ID+"&Suffix="+CONTEXT_SUFFIX+"&ItemId="+u;EditDim(CONTEXT_TYPE);_$PageLock();n.Post()}function ListItemDeleteResponse(n){CommonAjaxError(n,"_ListItemUnlock")||ListLoad(CONTEXT_TYPE,CONTEXT_SUFFIX,!0)}function ListItemUnlock(){_$ElementIsValid(LIST_ITEM)&&LIST_ITEM.SetClassName("list-item-text");EditEnableHelper(CONTEXT_TYPE)}function ListSortDim(){EditDim(CONTEXT_TYPE)}function ListSortMenu(n,t,i,r){LIST_SORT_PRE_REQUEST=t;LIST_SORT_RESPONSE_HANDLER=i;_Element("Global:Sort:Table").SetValue(r.Table);_Element("Global:Sort:KeyColumn").SetValue(r.KeyColumn);_Element("Global:Sort:FilterColumn").SetValue(r.FilterColumn);_Element("Global:Sort:FilterValue").SetValue(r.FilterValue);_Element("Global:Sort:OrderBy").SetValue(r.OrderBy);var u=_Event(n);CommonOpenPopup(u,u.SourceElement,"PopupSortContextMenu","Context-List")}function ListSortCheckResults(n){CONTEXT_SUFFIX="Results";ListSortMenu(n,"CheckDim","CheckDeleteResponse",{Table:"project_checklist_items",KeyColumn:"item_id",FilterColumn:"project_id",FilterValue:GLOBAL_PROJECT_ID,OrderBy:"is_completed desc"})}function ListSortCheckOptions(n){CONTEXT_SUFFIX="Options";ListSortMenu(n,"CheckDim","CheckDeleteResponse",{Table:"checklist_options",KeyColumn:"option_id",FilterColumn:"",FilterValue:-1,OrderBy:""})}function ListSortTileOptions(n){CONTEXT_TYPE="Edit";CONTEXT_SUFFIX="Options";ListSortMenu(n,"ListSortDim","ListItemDeleteResponse",{Table:"tile_options",KeyColumn:"option_id",FilterColumn:"tile_id",FilterValue:TILE_ID,OrderBy:""})}function ListSortTileReminders(n){CONTEXT_TYPE="Edit";CONTEXT_SUFFIX="Reminders";ListSortMenu(n,"ListSortDim","ListItemDeleteResponse",{Table:"tile_reminders",KeyColumn:"reminder_id",FilterColumn:"tile_id",FilterValue:TILE_ID,OrderBy:""})}function ListSortFindingOptions(n){CONTEXT_TYPE="Detail";CONTEXT_SUFFIX=DETAIL_IS_FINDING?"Description":"Recommendation";ListSortMenu(n,"ListSortDim","ListItemDeleteResponse",{Table:"tile_options_"+CONTEXT_SUFFIX.toLowerCase(),KeyColumn:"option_id",FilterColumn:"tile_id",FilterValue:TILE_ID,OrderBy:""})}function ListSortAZ(){ListSort(!0)}function ListSortZA(){ListSort(!1)}function ListSort(n){_Element("Global:Sort:Ascending").SetValue(n?1:0);var t=_Navigator("AJAX/Actions/Sort_List.aspx",""),i=_Ajax(t,LIST_SORT_RESPONSE_HANDLER,"Global:Sort:Form");window[LIST_SORT_PRE_REQUEST]();_$PageLock();i.Post()}function ListSortSetIcon(n,t){_Element(n).SetDisplay(t>1)}function _DataTable(n,t){if(!(this instanceof _DataTable))return new _DataTable(n,t);this.RowSeparator=$_Char1;this.ColumnSeparator=$_Char2;this.Columns=[];this.Rows=[];this.$Instantiate=function(n,t){this.RowSeparator=_String(n).GetValue(this.RowSeparator);this.ColumnSeparator=_String(t).GetValue(this.ColumnSeparator)};this.FromString=function(n){var i=_String(n),t,r;if(i.Value===""){this.Columns=[];this.Rows=[];return}return t=i.Split(this.RowSeparator),r=t.shift(),this.FromArray(r,t)};this.FromCollection=function(n){var t,i;if(this.Columns=[],this.Rows=[],n!==undefined&&n){t=[];for(i in n)this.Columns.push(i),t.push(n[i]);return this.Rows.push(this.NewRow(t)),this}};this.FromArray=function(n,t){var f=n instanceof Array,e=typeof n=="string",r,i,u;for(r=f?n:[],r=e?_String(n).Split(this.ColumnSeparator):r,f=t instanceof Array,e=typeof t=="string",i=f?t:[],i=e?_String(t).Split(this.RowSeparator):i,this.Columns=r,this.Rows=[],u=0;uf?f:i,r=r===undefined||r>f?f:r,r=r=this.Values.length?-1:t};this.Get=function(n){var t=this.$GetColumnIndex(n);return t<0?"":this.Values[t]};this.Set=function(n,t){var i=this.$GetColumnIndex(n);i<0||(this.Values[i]=_String(t).Value)};this.GetDate=function(n){return _Date(this.Get(n)).Value};this.SetDate=function(n,t,i){var f=t instanceof Date,e=t instanceof _Date,o=_String(i).GetValue($_DateDataFormat),r,u;r=e?t:null;r=f?_Date(dDate):r;u=r?r.ToString(o):"";this.Set(n,u)};this.Delete=function(){this.DataTable.Delete(this.DataTable.Rows.indexOf(this))};this.Insert=function(n){this.DataTable.Insert(this,n)};this.$Instantiate.apply(this,arguments)}function _DataElement(n,t,i,r,u,f){function e(n,t,i,r){n!==undefined&&n&&n.IsValid&&n.SetInnerHtml(t);i!==undefined&&i&&i.IsValid&&i.SetValue(r)}if(!(this instanceof _DataElement))return new _DataElement(n,t,i,r,u,f);this.IsValid=!1;this.ColumnName=null;this.EditModeId="Default";this.DataRow=null;this.ReplaceDisplayNullWith="";this.ReplaceEditableNullWith="";this.ElementSuffix="";this.$Instantiate=function(n,t,i,r,u,f){t=_String(t).Trim().Value;this.IsValid=n instanceof _DataRow&&t;this.ColumnName=this.IsValid?t:this.ColumnName;this.DataRow=this.IsValid?n:this.DataRow;this.EditModeId=_String(i).GetValue("Default");this.ReplaceDisplayNullWith=typeof r=="string"?r:this.ReplaceDisplayNullWith;this.ReplaceEditableNullWith=typeof u=="string"?u:this.ReplaceEditableNullWith;this.ElementSuffix=typeof f=="string"?":"+f:this.ElementSuffix};this.$SetString=function(n,t,i,r,u,f){i=typeof i=="string"?i:"Yes";r=typeof r=="string"?r:"No";u=typeof u=="string"?u:i;f=typeof f=="string"?f:r;var h=this.DataRow.Get(this.ColumnName),o=_String(h).GetValue(this.ReplaceDisplayNullWith),s=_String(h).GetValue(this.ReplaceEditableNullWith),c=_String(o).ToBoolean(),l=_String(s).ToBoolean();t&&(o=c?i:r,s=l?u:f);var a=n?"Display":"Readonly",v=n?"Hidden":"Editable",y=a+":"+this.EditModeId+":"+this.ColumnName+this.ElementSuffix,p=v+":"+this.EditModeId+":"+this.ColumnName+this.ElementSuffix,w=_Element(y),b=_Element(p);o=_String(o).ToHtml(!0).Value;e(w,o,b,s)};this.$SetNumber=function(n,t,i,r,u,f,o){t=typeof t=="boolean"?t:!0;i=typeof i=="boolean"?i:!0;r=_Number(r).GetValue(-1);u=typeof u=="boolean"?u:!1;f=_String(f).Value;o=_String(o).GetValue("s");var h=this.DataRow.Get(this.ColumnName),d=h?h:this.ReplaceDisplayNullWith,g=h?h:this.ReplaceEditableNullWith,s=_Number(h),c=s.IsNumeric?s.Value:0,v=s.IsNumeric?s.ToString(t,r,u):"",y=s.IsNumeric?s.ToString(i,r,u):"",l=n?"Display":"Readonly",a=n?"Hidden":"Editable",p=l+":"+this.EditModeId+":"+this.ColumnName+this.ElementSuffix,w=a+":"+this.EditModeId+":"+this.ColumnName+this.ElementSuffix,b=_Element(p),k=_Element(w);e(b,v,k,y);_$DataSetLabelPlural(this.ColumnName+this.ElementSuffix,l,c,f,o);_$DataSetLabelPlural(this.ColumnName+this.ElementSuffix,a,c,f,o)};this.$SetListBox=function(n,t,i,r,u,f,e){r=typeof r=="string"?r:"-1";u=typeof u=="string"?u:"( Select One )";f=typeof f=="string"?f:"Yes";e=typeof e=="string"?e:"No";var s=_String(this.DataRow.Get(i)).GetValue(this.ReplaceDisplayNullWith),c=_String(this.DataRow.Get(this.ColumnName)).GetValue(this.ReplaceEditableNullWith),l=_String(s).ToBoolean();t&&(s=l?f:e);var a=n?"Display":"Readonly",v=n?"Hidden":"Editable",y=a+":"+this.EditModeId+":"+this.ColumnName+this.ElementSuffix,p=v+":"+this.EditModeId+":"+this.ColumnName+this.ElementSuffix,h=_Element(y),o=_Element(p);(s=_String(s).ToHtml().Value,h!==undefined&&h&&h.IsValid&&h.SetInnerText(s),o!==undefined&&(o||o.IsValid))&&(o.RemoveDefault(r),o.SelectValue(c)||(o.InsertDefault(u,r),o.SelectIndex(0)))};this.SetInputString=function(){this.$SetString(!1,!1)};this.SetInputBoolean=function(n,t,i,r){this.$SetString(!1,!0,n,t,i,r)};this.SetInputNumber=function(n,t,i,r,u,f){this.$SetNumber(!1,n,t,i,r,u,f)};this.SetListBox=function(n,t,i){this.$SetListBox(!1,!1,n,t,i)};this.SetListBoxBoolean=function(n,t,i,r){this.$SetListBox(!1,!0,null,n,t,i,r)};this.SetHiddenInputString=function(){this.$SetString(!0,!1)};this.SetHiddenInputBoolean=function(n,t,i,r){this.$SetString(!1,!1,n,t,i,r)};this.SetHiddenInputNumber=function(n,t,i,r,u,f){this.$SetNumber(!0,n,t,i,r,u,f)};this.SetHiddenListBox=function(n,t,i){this.$SetListBox(!0,!1,n,t,i)};this.SetHiddenListBoxBoolean=function(n,t,i,r){this.$SetListBox(!0,!0,null,n,t,i,r)};this.SetDate=function(n){var t=this.DataRow.GetDate(this.ColumnName),i=t?t:this.ReplaceDisplayNullWith,r="Display:"+this.EditModeId+":"+this.ColumnName,u=_Element(r),f=_String(_Date(i).ToString(n)).ToHtml().Value;e(u,f)};this.SetCalendar=function(){var t=this.DataRow.GetDate(this.ColumnName),n=this.EditModeId+":"+this.ColumnName;_$CalendarSetDate(n,dDate)};this.$Instantiate.apply(this,arguments)}function _$DataSetLabelPlural(n,t,i,r,u){r=r===undefined||!r?"":r;u=u===undefined||!u?"":u;var e=t+":Plural:"+n,f=_Element(e),o=i===1?r:u;f.IsValid&&f.SetInnerText(_String(o).Value)}function _EditMode(n,t,i,r){if(!(this instanceof _EditMode))return new _EditMode(n,t,i,r);this.EditModeId="Default";this.ContainerElement=null;this.IsValid=!1;this.IsEditable=!1;this.ExcludedElements=[];this.$Instantiate=function(n,t,i,r){var f=_$ElementIsValid(i)?i:_Element(i),e,u;if((this.EditModeId=_String(n).Trim().GetValue(this.EditModeId),this.ContainerElement=f.IsValid?f:$_DocElement,this.IsValid=this.ContainerElement.IsValid,this.IsEditable=typeof t=="boolean"?t:this.IsEditable,this.IsValid)&&(this.EnableButton("Edit",!this.IsEditable),this.EnableButton("Cancel",this.IsEditable),this.EnableButton("Save",this.IsEditable),$_EditModeCache[n]=this,r instanceof Array))for(e in r)u=_Element(r[e],this.Form),u.IsValid&&this.ExcludedElements.push(u)};this.$IsExcluded=function(n){if(!_$ElementIsValid(n))return!0;for(var t in this.ExcludedElements)if(n.Object===this.ExcludedElements[t].Object)return!0;return!1};this.$GetColumnName=function(n,t){t=typeof t=="boolean"?t:!1;var r=t?"Calendar":"Editable",o=":"+this.EditModeId+":",u=r+o,f=_String(n.Id),e=_String(n.Name),i="";return(f.StartsWith(u)?i=f.Value:e.StartsWith(u)&&(i=e.Value),!i)?"":(i=i.substring(u.length),!t)?i:(r=":Parent",_String(i).EndsWith(r)?i.slice(0,-r.length):"")};this.EnableButton=function(n,t){t=typeof t=="boolean"?t:!0;var i="EditMode:"+this.EditModeId+":"+n+":",r=i+"Enabled",u=i+"Disabled";_Element(r).SetDisplay(t);_Element(u).SetDisplay(!t)};this.EnableElement=function(n,t){var i,r,f,u;if(_$ElementIsValid(n)){if(t=typeof t=="boolean"?t:!0,i=this.$GetColumnName(n),r=this.$GetColumnName(n,!0),r){f=this.EditModeId+":"+r;u=$_CalendarCache[f];u instanceof _Calendar&&u.$SetEditMode(t);return}if(i){var o="Readonly:"+this.EditModeId+":"+i,e=_Element(o),s=t?e:n,h=t?n:e;s.SetDisplay(!1);h.SetDisplay()}}};this.Enable=function(n){var i,r,t;for(n=typeof n=="boolean"?n:!0,i=this.ContainerElement.Object.getElementsByTagName("*"),t=0;t0?"The current system configuration limits the number of records that may be exported to Excel to "+t+".\n\nFilter criteria yielding more than "+t+" record"+u+" will result in an export file of "+t+" row"+u+".\n\nTo avoid record truncation, please refine your filter criteria to reduce the number of records to "+t+" or less.\n\nClick 'Stop' to abort.\n\nClick 'Continue' to continue generating the Excel export file.":"The current system configuration does not limit the number of records that may be exported to Excel.\n\nFilter criteria yielding a large volume of records may timeout or take an extended duration to process.\n\nPlease do not close or refresh your browser window while your export file is being generated.\n\nClick 'Stop' to abort.\n\nClick 'Continue' to continue generating the Excel export file.";n=_PopupDialog($_PopupDialogWarningId,"Warning");n.Content=f;n.AddButton("Stop","_$NavigatorContinue( false );",!1,"error");n.AddButton("Continue","_$NavigatorContinue();",!1,"success");n.Set();$_NavigatorContinue=_NavigatorRecaller($_PopupDialogWarningId,this,"$Export",null,!1);$_NavigatorStop=_NavigatorRecaller($_PopupDialogWarningId);_$PopupOpen($_PopupDialogWarningId,!0);_$PopupTrackElement($_PopupDialogWarningId,this.$GetFocusElement())};this.$Export=function(){_Export(this.Navigator,this.Form,this.ExportHandler).Post()};this.$GetFocusElement=function(){var n=_$ElementIsValid(this.FocusElement)?this.FocusElement:this.DefaultElement;return _$ElementIsValid(n)?n:$_ElementDefault};this.Reset=function(n){var f=this.$GetElement("Table"),e,o,r,u,t,i;if(f.IsValid){for(n=typeof n=="boolean"?n:!0,e=this.$GetElement("DefaultRecordsPerPage").GetValue(),o=this.$GetElement("DefaultExportEntireList").GetValue(),r=f.Object.getElementsByTagName("select"),i=0;i0)){this.$ShowExportWarning();return}this.$Export()};this.DisplayResults=function(n,t){var i=_Number(n).GetValue(0),r=i>0,u=i===2;if(r&&(this.$GetElement("ResultHeader").SetDisplay(),this.$GetElement("ResultOverage").SetDisplay(u)),typeof window[this.FilterHandler]=="function"){window[this.FilterHandler].call(null,t);return}this.$GetElement("ResultContent").SetInnerHtml(t);_$PageDim(!1);this.Focus()};this.Focus=function(){_$ElementTrack(this.$GetFocusElement());_$ElementFocusTracked();this.FocusElement=null};this.$Instantiate.apply(this,arguments)}function _$FilterHandler(n){var t,i;if(_$PageBusy(!1),t=n.Response.charAt(0),!_Navigator().Timeout(t)){var u=n.Response.substring(1),r=n.ObjectStore,f=r instanceof _Filter;if(t===$_Char2){$_NavigatorStop=_NavigatorRecaller($_PopupDialogErrorId);i=_PopupDialog($_PopupDialogErrorId,"Error");i.Content=u;i.AddButton("Close","_$NavigatorContinue( false );");i.Set();_$PopupOpen($_PopupDialogErrorId,!0);_$PopupTrackElement($_PopupDialogErrorId,f?r.$GetFocusElement():$_ElementDefault);return}if(!f){_$PageDim(!1);_$ElementFocusTracked();return}r.DisplayResults(t,u)}}function _$FilterReset(n,t){var i=$_FilterCache[n];i instanceof _Filter&&i.Reset(t)}function _$FilterSort(n,t,i,r,u){var f=$_FilterCache[n];f instanceof _Filter&&f.Sort(t,i,r,u)}function _$FilterSetPage(n,t,i,r){var u=$_FilterCache[n];u instanceof _Filter&&u.SetPage(t,i,r)}function _$Filter(n,t){var i=$_FilterCache[n];i instanceof _Filter&&i.Filter(t)}function _$FilterExport(n,t){var i=$_FilterCache[n];i instanceof _Filter&&i.Export(t)}function _$FilterFocus(n){var t=$_FilterCache[n];if(t instanceof _Filter){t.Focus();return}_$ElementFocusTracked()}function _$FilterEnterKey(n,t,i,r){var u=_Event(n),f=$_FilterCache[t];if(_$EventIsValid(u)&&f instanceof _Filter){i=typeof i=="boolean"?i:!0;var e=u.Object.keyCode,o=e===13,s=e===8;if(i&&s){u.Cancel();return}if(o){u.Cancel();f.FocusElement=u.SourceElement;f.Filter(r);return}}}function _$KeepAlive(){var n=_Navigator("AJAX/Framework/Keep_Alive.aspx","");_Ajax(n,"_$KeepAliveResponse").Get()}function _$KeepAliveResponse(n){n instanceof _Ajax&&_Navigator().Timeout(n.Response)||setTimeout(_$KeepAlive,$_PageKeepAlive)}function _Calendar(n,t,i,r,u,f,e,o,s,h){if(!(this instanceof _Calendar))return new _Calendar(n,t,i,r,u,f,e,o,s,h);this.CalendarId="Default";this.PopupId="";this.NoDateEditable="( Select A Date )";this.NoDateReadonly="[ Not Selected ]";this.SelectionHandler="_$CalendarSelectDate";this.EnableWeekends=!0;this.ContainerElement=null;this.DisplayElement=null;this.ParentElement=null;this.FormatElement=null;this.ValueElement=null;this.Locator=null;this.$Instantiate=function(n,t,i,r,u,f,e,o,s,h){t=_String(t).Trim().GetValue("Default");this.PopupId="Popup:Calendar:"+t;this.CalendarId=_String(n).Trim().GetValue(this.CalendarId);this.NoDateEditable=_String(e).GetValue(this.NoDateEditable);this.NoDateReadonly=_String(o).GetValue(this.NoDateReadonly);this.SelectionHandler=_String(h).GetValue(this.SelectionHandler);this.EnableWeekends=typeof s=="boolean"?s:this.EnableWeekends;var c="Calendar:"+t+":Container",l="Calendar:"+this.CalendarId+":Display",a="Calendar:"+this.CalendarId+":Parent",v="Calendar:"+this.CalendarId+":Format",y="Calendar:"+this.CalendarId+":Value";this.ContainerElement=_Element(c);this.DisplayElement=_Element(l);this.ParentElement=_Element(a);this.FormatElement=_Element(v);this.ValueElement=_Element(y);this.Locator=_ElementLocator(_Element(this.PopupId),this.ParentElement,i,r,u,f);$_CalendarCache[this.CalendarId]=this};this.$GetHtml=function(n){var ut=this.ValueElement.GetDate(),ft=ut.ToString("yyyyMMdd"),et=_Date().ToString("yyyyMMdd"),c=n.getFullYear(),s=n.getMonth(),d=new Date(c,s,1),e=_Date(d),g=e.Clone().AddYears(-1).Value,nt=e.Clone().AddMonths(-1),tt=nt.Value,it=e.Clone().AddYears(1).Value,rt=e.Clone().AddMonths(1).Value,ot=e.GetMonthName(),st=("0000"+c).slice(-4),ht=g.getFullYear()+", "+g.getMonth(),ct=tt.getFullYear()+", "+tt.getMonth(),lt=it.getFullYear()+", "+it.getMonth(),at=rt.getFullYear()+", "+rt.getMonth(),y=e.GetDaysInMonth(),vt=nt.GetDaysInMonth(),yt=d.getDay(),l='',t+='',t+='',t+='',t+="",t+=l+'last_year.gif" title="Go back one year" width="12"'+a+ht+v,t+=l+'last_month.gif" title="Go back one month" width="11"'+a+ct+v,t+='",t+=r+"S"+u,t+=r+"M"+u,t+=r+"T"+u,t+=r+"W"+u,t+=r+"T"+u,t+=r+"F"+u,t+=r+"S"+u,t+="<\/tr>";;)if(o="calendar-day-disabled",w="",b="",k="",h="",f===0&&(t+=""),i<1?h=String(i+vt):i>y?h=String(i-y):(h=String(i),(f>0&&f<6||this.EnableWeekends)&&(p=_Date(new Date(c,s,i)).ToString("yyyyMMdd"),o=p===et?"calendar-day-today":"calendar-day-enabled",o=p===ft?"calendar-day-selected":o,b=" onmouseover=\"_Element( this ).SetClassName( 'calendar-day-highlighted' );\"",w=" onmouseout=\"_Element( this ).SetClassName( '"+o+"' );\"",k=' onclick="'+this.SelectionHandler+"( '"+this.CalendarId+"', "+c+", "+s+", "+i+' );"')),t+='
'+ot+"<\/div><\/td>",t+='
<\/form><\/td>',t+=l+'next_month.gif" title="Go forward one month" width="11"'+a+at+v,t+=l+'next_year.gif" title="Go forward one year" width="12"'+a+lt+v,t+="<\/tr>",t+="<\/table>",t+="<\/td>",t+="<\/tr>",t+="
"+h+"<\/td>",i++,f++,f>6&&(t+="<\/tr>",f=0,pt++),i>y&&f===0)break;return t+"<\/table>"};this.$SetEditMode=function(n){n=typeof n=="boolean"?n:!0;this.SetDate(this.ValueElement.GetDate(),n);this.ParentElement.SetDisplay(n)};this.Open=function(){var t=this.ValueElement.GetDate(),i=t.IsValid?t.Value.getFullYear():-1,r=t.IsValid?t.Value.getMonth():-1,n;this.Populate(i,r);this.Locator.ChildElement=_Element(this.PopupId);this.Locator.ParentElement=this.ParentElement;n=$_PopupCache[this.PopupId];n instanceof _Popup?n.Locator=this.Locator:n=_Popup(this.Locator);n.Open()};this.Close=function(){_$PopupClose(this.PopupId)};this.Populate=function(n,t){var i=n<0?new Date:new Date(n,t,1);this.ContainerElement.SetInnerHtml("");this.ContainerElement.SetInnerHtml(this.$GetHtml(i))};this.SetDate=function(n,t){t=typeof t=="boolean"?t:!0;var i=_Date(n),r=t?this.NoDateEditable:this.NoDateReadonly,u=i.IsValid?i.ToString(this.FormatElement.GetValue()):r;this.DisplayElement.SetInnerText(u);this.ValueElement.SetValue(i);this.Close()};this.$Instantiate.apply(this,arguments)}function _$CalendarOpen(n){var t=$_CalendarCache[n];t instanceof _Calendar&&t.Open()}function _$CalendarPopulate(n,t,i){var r=$_CalendarCache[n];r instanceof _Calendar&&r.Populate(t,i)}function _$CalendarSelectDate(n,t,i,r){_$CalendarSetDate(n,new Date(t,i,r));_$NavigatorSetSavePrompt()}function _$CalendarSetDate(n,t,i){var r=$_CalendarCache[n];r instanceof _Calendar&&r.SetDate(t,i)}function _$CalendarYearEntryKeyDown(n,t,i){var r=_Event(n),u=r.Object.keyCode,f=u===9,e=u===13;(f||e)&&(r.Cancel(),_$CalendarYearEntryValidate(t,i,!0))}function _$CalendarYearEntryValidate(n,t,i){var f="Calendar:Entry:"+n,r=_Element(f),u=r.GetString(),e=_$StringValidator(!1,!1,!1,!0,1,4);u.IsValid(e)?_$CalendarPopulate(n,u.ToNumber().Value,t):r.SetValue($_ElementTrackedValue);i&&_$ElementTrackValue(r)}function _Grid(n){if(!(this instanceof _Grid))return new _Grid(n);this.GridId="Default";this.FilterId="Default";this.$Instantiate=function(n){this.GridId=_String(n).Trim().GetValue(this.GridId);var t=_String(this.GridId),i="Table:",r=t.StartsWith(i),u=r?t.Value.substring(i.length):t.Value;this.FilterId=u;$_GridCache[this.GridId]=this};this.HighlightRow=function(n,t,i,r){_$GridRowHighlight("Table:"+this.GridId,n,t,i,r)};this.Sort=function(n,t,i,r,u,f){if(r=typeof r=="boolean"?r:!0,r){_$FilterSort(this.FilterId,n,t,i,u);return}i=typeof i=="boolean"?i:!0;var e=this.GridId+":Sort",o=_Navigator().RemoveParameter(e),s=i?"1":"0",h=o+"&"+e+"="+iColumnId+"|"+s;_Navigator(null,h).Go(u,f)};this.CheckAll=function(n,t,i){var u=_Element(this.GridId),r;if(u.IsValid)for(t=typeof t=="boolean"?t:!0,i=typeof bIsFilteredGrid=="string"?i:":",r=1;r<=u.Object.rows.length;r++)_Element(n+i+iRowIndex).Object.checked=t};this.$Instantiate.apply(this,arguments)}function _$GridGetObject(n){var t=$_GridCache[n];return t instanceof _Grid||(t=_Grid(n)),t}function _$GridHighlightRow(n,t,i,r,u){_$GridGetObject(n).HighlightRow(t,i,r,u)}function _$GridSort(n,t,i,r,u,f){_$GridGetObject(n).Sort(t,i,r,u,f)}function _$GridRowHighlight(n,t,i,r,u){var o=_Element(n),f,e,c,l;if(o.IsValid&&(f=_Element(o.Object.rows[t]),f.IsValid)){var a=u?"-hilite":"",s=i?"-alternate":"-primary",v="grid-row"+a+s,h=r-1;(f.SetClassName(v),h<0)||(e=_Element(f.Object.cells[h]),e.IsValid)&&(c=u?"-hilite":"-sort",l="grid-cell"+c+s,e.SetClassName(l))}}function _Popup(n,t,i,r,u,f){if(!(this instanceof _Popup))return new _Popup(n,t,i,r,u,f);this.PopupElement=null;this.ParentElement=$_DocElement;this.ScrollElement=$_DocElement;this.BoundingElement=$_DocElement;this.DisableElement=null;this.Locator=null;this.AutoCloseSeconds=0;this.KeepOpenWhenMousedOver=!1;this.AutoDimParent=!0;this.AutoDisableParent=!0;this.IsMovable=!1;this.IsFixed=!1;this.RequiresFocus=!1;this.PopupId="";this.Motion=null;this.IgnoreMouseOver=!1;this.OpenHandler=null;this.CloseHandler=null;this.$Instantiate=function(n,t,i,r,u,f){if(typeof n=="string"?this.PopupElement=_Element(n):_$ElementIsValid(n)?this.PopupElement=n:n instanceof _ElementLocator&&(this.PopupElement=n.ChildElement,t=t?t:n.ParentElement,i=n.ScrollElement,r=n.BoundingElement,f=n),this.ParentElement=_$ElementIsValid(t)?t:this.ParentElement,this.ScrollElement=_$ElementIsValid(i)?i:this.ScrollElement,this.BoundingElement=_$ElementIsValid(r)?r:this.BoundingElement,this.DisableElement=_$ElementIsValid(u)?u:this.DisableElement,this.Locator=f instanceof _ElementLocator?f:_ElementLocator(),!_$ElementIsValid(this.PopupElement)){console.log("Popup source element could not be resolved.");console.log(this);return}this.IsFixed=this.PopupElement.Object.hasAttribute("fixed");this.IsMovable=this.PopupElement.Object.hasAttribute("movable");this.PopupId=this.PopupElement.Id;this.SetMotion();$_PopupCache[this.PopupId]=this};this.$SetPosition=function(n,t,i){if(!this.IsFixed){if(this.Motion.$FlingEnd(),!n&&this.IsMovable){this.Motion.SetPosition(t,i);return}if(this.Locator.Center){this.Motion.Center(this.Locator.OffsetPixelsX,this.Locator.OffsetPixelsY);return}var r=this.Locator.GetOrigin();this.Motion.SetPosition(r.X,r.Y)}};this.$GetChildIds=function(n){var u=n==="All",r=[],i,t;for(var f in $_PopupActiveIds)if(i=$_PopupActiveIds[f],t=$_PopupCache[i],t.ParentElement.Object===this.PopupElement.Object){if((n==="Static"||u)&&!t.IsMovable&&!t.IsFixed){r.push(i);continue}if((n==="Movable"||u)&&t.IsMovable){r.push(i);continue}if((n==="Fixed"||u)&&t.IsFixed){r.push(i);continue}}return r};this.$SetTimer=function(){var n=this.PopupElement.Object;n.onmouseover=this.KeepOpenWhenMousedOver?Function("event","_$PopupCancelTimer( event, '"+this.PopupId+"' );"):null;n.onmouseout=this.KeepOpenWhenMousedOver?Function("event","_$PopupStartTimer( event, '"+this.PopupId+"' );"):null;n.ontouchstart=this.KeepOpenWhenMousedOver?Function("event","_$PopupCancelTimer( event, '"+this.PopupId+"' );"):null;n.ontouchend=this.KeepOpenWhenMousedOver?Function("event","_$PopupStartTimer( event, '"+this.PopupId+"' );"):null;this.$StartTimer()};this.$StartTimer=function(){$_PopupTimers[this.PopupId]||$_PopupActiveIds.indexOf(this.PopupId)<0||this.AutoCloseSeconds>0&&($_PopupTimers[this.PopupId]=setTimeout("_$PopupClose( '"+this.PopupId+"' );",this.AutoCloseSeconds*1e3))};this.$CancelTimer=function(){$_PopupTimers[this.PopupId]&&(clearTimeout($_PopupTimers[this.PopupId]),$_PopupTimers[this.PopupId]=null)};this.SetMotion=function(n,t,i){if(n=_Number(n).GetValue(0),t=typeof t=="boolean"?t:!1,i=typeof i=="boolean"?i:!1,!this.IsFixed){if(this.Motion?this.Motion.SetInertia(n,t):this.Motion=_ElementMotion(this.PopupElement,n,t,this.ScrollElement,this.BoundingElement,!1),this.IsMovable){this.Motion.BindTriggers([this.PopupId+":Bar"]);this.Motion.SetPopup(this,i);return}this.Motion.SetPopup(null,!1)}};this.Reset=function(n){var t,i;if(this.$SetPosition(!0,0,0),n){t=this.GetChildIds();for(i in t)$_PopupCache[t[i]].Reset(!0)}};this.Reposition=function(){var n=this.IsMovable?this.PopupElement.GetRectangle():_ElementRectangle(),t=n.Left,i=n.Top;this.$SetPosition(!1,t,i)};this.SetDocument=function(n){var t=0;for(var i in $_PopupActiveIds)t+=$_PopupCache[$_PopupActiveIds[i]].AutoDimParent?1:0;n&&t>0?_$PageDim():n||t!==0||_$PageDim(!1)};this.SetParent=function(n){var f;if(n){this.ScrollElement.Object.addEventListener("scroll",_$PopupReposition);this.AutoDimParent&&!this.ParentElement.IsDocElement&&this.ParentElement.SetDim();this.AutoDisableParent&&!this.ParentElement.IsDocElement&&this.ParentElement.SetDisabled();this.DisableElement&&this.DisableElement.SetDisabled();return}var r=0,i=0,u=0,t;for(f in $_PopupActiveIds)t=$_PopupCache[$_PopupActiveIds[f]],r+=this.ScrollElement.Object===t.ScrollElement.Object?1:0,i+=this.ParentElement.Object===t.ParentElement.Object?1:0,u+=this.DisableElement&&t.DisableElement&&this.DisableElement.Object===t.DisableElement.Object?1:0;r===0&&this.ScrollElement.Object.removeEventListener("scroll",_$PopupReposition);this.AutoDimParent&&!this.ParentElement.IsDocElement&&i===0&&this.ParentElement.SetDim(!1);this.AutoDisableParent&&!this.ParentElement.IsDocElement&&i===0&&this.ParentElement.SetDisabled(!1);this.DisableElement&&u===0&&this.DisableElement.SetDisabled(!1)};this.GetChildIds=function(){return this.$GetChildIds("All")};this.GetFixedChildIds=function(){return this.$GetChildIds("Fixed")};this.GetMovableChildIds=function(){return this.$GetChildIds("Movable")};this.GetStaticChildIds=function(){return this.$GetChildIds("Static")};this.Close=function(){var n=$_PopupActiveIds.indexOf(this.PopupId),t=this.GetChildIds();n>-1&&$_PopupActiveIds.splice(n,1);for(n in t)$_PopupCache[t[n]].Close();this.$CancelTimer();this.SetParent(!1);this.SetDocument(!1);this.PopupElement.SetDisplay(!1);this.CloseHandler instanceof _NavigatorRecaller&&(this.CloseHandler.PopupId="",this.CloseHandler.ActivateAllPopups=!1,this.CloseHandler.Call())};this.FocusTracked=function(){this.RequiresFocus&&(this.RequiresFocus=!1,_$ElementFocusTracked())};this.SetAutoClose=function(n,t){this.$CancelTimer();t=typeof t=="boolean"?t:!0;this.AutoCloseSeconds=_Number(n).GetValue(0);this.AutoCloseSeconds=this.AutoCloseSeconds<0?0:this.AutoCloseSeconds;this.KeepOpenWhenMousedOver=t&&this.AutoCloseSeconds>0;$_PopupActiveIds.indexOf(this.PopupId)>-1&&this.$SetTimer()};this.Open=function(){$_PopupCache[this.PopupId]&&(this.$CancelTimer(),$_PopupActiveIds.indexOf(this.PopupId)<0&&$_PopupActiveIds.push(this.PopupId),this.Motion||this.SetMotion(),this.SetDocument(!0),this.SetParent(!0),this.PopupElement.SetVisible(!1),this.PopupElement.SetDim(!1),this.PopupElement.SetDisplay(),this.Reset(!1),_$ElementBlurAll(),this.PopupElement.SetVisible(),_Element(this.PopupId+":ContentContainer").Focus(),$_Body.Object.addEventListener("scroll",_$PopupReposition),window.addEventListener("resize",_$PopupReposition),this.$SetTimer(),this.OpenHandler instanceof _NavigatorRecaller&&(this.OpenHandler.PopupId="",this.OpenHandler.ActivateAllPopups=!1,this.OpenHandler.Call()))};this.$Instantiate.apply(this,arguments)}function _$PopupOpen(n,t){t=typeof t=="boolean"?t:!1;t&&_$PopupDeactivateAll();var i=$_PopupCache[n];i instanceof _Popup&&i.Open()}function _$PopupClose(n,t){t=typeof t=="boolean"?t:!1;var i=$_PopupCache[n],r=i instanceof _Popup;return(r&&i.Close(),t&&_$PopupActivateAll(),r&&i.FocusTracked(),$_PopupActiveIds.length===0)?($_Body.Object.removeEventListener("scroll",_$PopupReposition),window.removeEventListener("resize",_$PopupReposition),!0):!1}function _$PopupReset(n){var t=$_PopupCache[n];t instanceof _Popup&&t.Reset(!0)}function _$PopupCancelTimer(n,t){var i=$_PopupCache[t];i instanceof _Popup&&i.$CancelTimer(!0)}function _$PopupStartTimer(n,t){var i=$_PopupCache[t];i instanceof _Popup&&i.$StartTimer(!0)}function _$PopupReposition(){var u=$_PopupActiveIds.slice(0),i=[],t=[],n;for(var r in $_PopupActiveIds)n=$_PopupActiveIds[r],$_PopupCache[n].IsMovable?i.push(n):$_PopupCache[n].IsFixed||t.push(n);_$PopupRepositionRecursive(t,i);_$PopupRepositionRecursive(t,t.slice(0))}function _$PopupRepositionRecursive(n,t){var i,r,u;for(var f in t)i=t[f],r=$_PopupCache[i],u=n.indexOf(i),r.Reposition(),u>-1&&n.splice(u,1),_$PopupRepositionRecursive(n,r.GetStaticChildIds())}function _$PopupDeactivateAll(){var i=[],r=[],t,n;for(var u in $_PopupActiveIds)t=$_PopupActiveIds[u],n=$_PopupCache[t].PopupElement,n.GetDim()||(i.push(t),n.SetDim()),n.GetDisabled()||(r.push(t),n.SetDisabled());$_PopupDimmed=i;$_PopupDisabled=r}function _$PopupActivateAll(){var n;for(n in $_PopupDisabled)$_PopupCache[$_PopupDisabled[n]].PopupElement.SetDisabled(!1);for(n in $_PopupDimmed)$_PopupCache[$_PopupDimmed[n]].PopupElement.SetDim(!1);$_PopupDimmed=[];$_PopupDisabled=[]}function _$PopupTrackElement(n,t,i,r,u){if(!_$ElementIsValid($_ElementTracked)){var f=$_PopupCache[n];f instanceof _Popup&&(_$ElementTrack(t,i,r,u),f.RequiresFocus=!0)}}function _$PopupSetAutoClose(n,t,i){var r=$_PopupCache[n];r instanceof _Popup&&r.SetAutoClose(t,i)}function _$PopupSetMotion(n,t,i,r){var u=$_PopupCache[n];u instanceof _Popup&&u.SetMotion(t,i,r)}function _$PopupSetHandler(n,t,i){i=typeof i=="boolean"?i:!0;var r=$_PopupCache[n],u=t instanceof _NavigatorRecaller?t:null;r instanceof _Popup&&(i?r.CloseHandler=t:r.OpenHandler=t)}function _PopupDialog(n,t,i,r){if(!(this instanceof _PopupDialog))return new _PopupDialog(n,t,i,r);this.PopupId="";this.Theme="";this.IsValid=!1;this.IsContentHtml=!1;this.CenterContent=r;this.PixelWidth=0;this.HeaderClass="popup-dialog-header";this.ContentClass="popup-dialog-content";this.ButtonContainerClass="popup-dialog-button-container";this.ButtonOutClass="button popup-dialog-button-out";this.ButtonOverClass="button popup-dialog-button-over";this.ButtonDisabledClass="button-dim popup-dialog-button-dim";this.Header="";this.Content="";this.Buttons=[];this.$Instantiate=function(n,t,i,r){n=_String(n).Value;t=_String(t).ToLower().Value;i=_Number(i).RoundTo(1).GetValue(0);r=typeof r=="boolean"?r:!1;var u=t!=="",f=u?"-"+t:"",e=_Element(n);switch(n){case $_PopupDialogWarningId:case $_PopupDialogErrorId:case $_PopupDialogSuccessId:$_PopupCache[n]instanceof _Popup||_Popup(n)}this.PopupId=n;this.Theme=t;this.IsValid=_$ElementIsValid(e);this.CenterContent=r;this.PixelWidth=i>0?i:0;this.HeaderClass+=f;this.ContentClass+=f;this.Header=u?": : : "+this.Theme.toUpperCase()+" : : :":this.Header};this.$GetElement=function(n){return _Element(this.PopupId+":"+n)};this.$RenderButton=function(n,t){var o=this.Theme!=="",i=o?"-"+this.Theme:"",r=t.ClassNames instanceof Array,f=r?"":_String(t.ClassNames).Trim().Value,s=f!=="";i=s?"-"+f:i;var h=r?_String(t.ClassNames[0]).Trim().Value:this.ButtonOutClass+i,a=r?_String(t.ClassNames[1]).Trim().Value:this.ButtonOverClass+i,c=r?_String(t.ClassNames[2]).Trim().Value:this.ButtonDisabledClass+i,e=_Element(n.insertCell(-1)),u=_Element($_Doc.createElement("div")),l=t.IsDisabled?c:h;e.SetClassName("l10 r10");u.SetClassName(l);u.SetInnerText(t.Text);t.IsDisabled||(u.Object.onclick=Function(t.ClickEvalCode));e.Object.appendChild(u.Object)};this.AddButton=function(n,t,i,r){n=_String(n).ToHtml(!0,!0).Value;t=_String(t).Trim().Value;i=i!==undefined&&i||!t;r=r!==undefined?r:null;this.Buttons.push({Text:n,ClickEvalCode:t,IsDisabled:i,ClassNames:r})};this.Set=function(){var e;if(this.IsValid){var a=this.$GetElement("ContentContainer"),t=this.$GetElement("Header"),n=this.$GetElement("Content"),i=this.$GetElement("ButtonContainer"),r=this.$GetElement("ButtonRow"),o=null,f=_String(this.Header),u=_String(this.Content),s=f.Clone().Trim().Value,h=u.Clone().Trim().Value;for(t.SetInnerHtml(f.ToHtml(!0).Value),n.SetInnerHtml(this.IsContentHtml?u.Value:u.ToHtml(!0).Value),t.SetClassName(this.HeaderClass),n.SetClassName(this.ContentClass),i.SetClassName(this.ButtonContainerClass),n.SetStyle("text-align",this.CenterContent?"center":"initial"),n.SetStyle("width",this.PixelWidth>0?this.PixelWidth+"px":"auto"),t.SetDisplay(s!==""),n.SetDisplay(h!=="");r.Object.cells.length>0;)r.Object.deleteCell(-1);if(this.Buttons instanceof Array&&this.Buttons.length>0){for(e in this.Buttons)this.$RenderButton(r.Object,this.Buttons[e]);if(this.Buttons.length==1)var c=_String(this.Buttons[0].ClickEvalCode).ToScript().Value,l="_$EventEnterKey( event, '"+c+"', true, true );",o=Function("event",l);i.SetDisplay()}else i.SetDisplay(!1);_Element($_Form).SetDisabled();_$PageSetKeyDownHandler(o)}};this.$Instantiate.apply(this,arguments)}function _Ajax(n,t,i){if(!(this instanceof _Ajax))return new _Ajax(n,t,i);this.Navigator=null;this.ResponseHandler="";this.Form=null;this.IsAsync=!0;this.Timeout=0;this.IsPost=!1;this.Error=null;this.FormData=null;this.Username=null;this.Password=null;this.ObjectStore=null;this.Request=null;this.Response=null;this.RequestId=-1;this.$Instantiate=function(n,t,i){i=typeof i=="string"?$_Doc.forms[i]:i;i=i instanceof HTMLFormElement?i:$_Form;this.Navigator=n;this.ResponseHandler=_String(t).Value;this.Form=i};this.$SetFormData=function(){var r,n,i,u,f,e,o,t;if(!this.FormData)for(this.FormData="",r=this.Form.elements,t=0;t11&&(u+=1,t=0);return f=this.GetDaysInMonth(),o=e>f?f:e,this.Value=new Date(u,t,o),this};this.AddDays=function(n){var t=_Number(n);return!this.IsValid||!t.IsNumeric?this:(this.Value=new Date(this.Value.getTime()+t.Value*864e5),this)};this.AddHours=function(n){var t=_Number(n);return!this.IsValid||!t.IsNumeric?this:(this.Value=new Date(this.Value.getTime()+t.Value*36e5),this)};this.AddMinutes=function(n){var t=_Number(n);return!this.IsValid||!t.IsNumeric?this:(this.Value=new Date(this.Value.getTime()+t.Value*6e4),this)};this.AddSeconds=function(n){var t=_Number(n);return!this.IsValid||!t.IsNumeric?this:(this.Value=new Date(this.Value.getTime()+t.Value*1e3),this)};this.AddMilliseconds=function(n){var t=_Number(n);return!this.IsValid||!t.IsNumeric?this:(this.Value=new Date(this.Value.getTime()+t.Value),this)};this.GetMonthName=function(){return this.IsValid?$_DateMonthNames[this.Value.getMonth()]:""};this.GetDayName=function(){return this.IsValid?$_DateDayNames[this.Value.getDay()]:""};this.GetDaysInMonth=function(){return this.IsValid?_$DateGetDaysInMonth(this.Value.getFullYear(),this.Value.getMonth()):0};this.Clone=function(){return _Date(this)};this.ToString=function(n){if(!this.IsValid)return"";var l=String(this.Value.getFullYear()),g=this.Value.getMonth(),a=String(this.Value.getDate()),tt=this.Value.getDay(),r=this.Value.getHours(),v=String(this.Value.getMinutes()),y=String(this.Value.getSeconds()),e=String(this.Value.getMilliseconds()),p=this.GetMonthName(),w=String(g+1),b=this.GetDayName(),k=String(r),u="AM";r>11&&(r-=12,u="PM");var d=r===0?"12":String(r),nt=_String(n).Value,f=nt?n:"yyyy-MM-dd HH:mm:ss",o=[],s=String.fromCharCode(1),h=[],c=String.fromCharCode(2),i;for(f=t(f,/"[^"]+"/,s,o),f=t(f,/[^yMdEHhmsSFfTtAa\x01\x02]+/,c,h),i=f,i=i.replace(/[M]{4,}/g,String.fromCharCode(3)),i=i.replace(/[M]{3}/g,String.fromCharCode(4)),i=i.replace(/[dE]{4,}/g,String.fromCharCode(5)),i=i.replace(/[dE]{3}/g,String.fromCharCode(6)),i=i.replace(/[y]{3,}/g,l),i=i.replace(/[y]{1,2}/g,l.substring(2,4)),i=i.replace(/[H]{2,}/g,String("00"+k).slice(-2)),i=i.replace(/[H]{1}/g,k),i=i.replace(/[h]{2,}/g,String("00"+d).slice(-2)),i=i.replace(/[h]{1}/g,d),i=i.replace(/[m]{2,}/g,String("00"+v).slice(-2)),i=i.replace(/[m]{1}/g,v),i=i.replace(/[s]{2,}/g,String("00"+y).slice(-2)),i=i.replace(/[s]{1}/g,y),i=i.replace(/[SFf]{3,}/g,String("000"+e).slice(-3)),i=i.replace(/[SFf]{2}/g,String("00"+e).slice(-2)),i=i.replace(/[SFf]{1}/g,e),i=i.replace(/[ta]{2,}/g,u.toLowerCase()),i=i.replace(/[ta]{1}/g,u.charAt(0).toLowerCase()),i=i.replace(/[M]{2}/g,String("00"+w).slice(-2)),i=i.replace(/[M]{1}/g,w),i=i.replace(/[d]{2}/g,String("00"+a).slice(-2)),i=i.replace(/[d]{1}/g,a),i=i.replace(/[TA]{2,}/g,u),i=i.replace(/[TA]{1}/g,u.charAt(0)),i=i.replace(/\x03/g,p),i=i.replace(/\x04/g,p.substring(0,3)),i=i.replace(/\x05/g,b),i=i.replace(/\x06/g,b.substring(0,3)),o.reverse(),h.reverse();i.indexOf(c)>-1;)i=i.replace(c,h.pop());while(i.indexOf(s)>-1)i=i.replace(s,o.pop());return i};this.$Instantiate.apply(this,arguments)}function _$DateGetDaysInMonth(n,t){var u=_Number(n),i,r;return(t=_Number(t).GetValue(-1),!u.IsNumeric||t.Value<0||t.Value>11)?0:(i=n%4==0?29:28,r=[31,i,31,30,31,30,31,31,30,31,30,31],r[t])}function _$ElementIsValid(n){return n instanceof _Element&&n.IsValid}function _$ElementIsEditable(n,t){return _$ElementIsValid(t)||(t=_$EventIsValid(n)?n.SourceElement:_Event(n).SourceElement),_$ElementIsValid(t)&&(t.Object.isContentEditable||t.IsForm)}function _$ElementBlurAll(){try{$_Doc.activeElement.blur()}catch(n){}}function _$ElementCanFocus(n){return _$ElementIsValid(n)&&n.IsDisplayed()&&!n.GetDisabled()&&!n.GetDim()&&n.GetVisible()&&!_$PageIsMobile()}function _$ElementFocusTracked(){var n=_$ElementIsValid($_ElementTracked),t=n?$_TabGroupTracked:$_TabGroupDefault,i=n?$_TabTracked:$_TabDefault,r=n?$_ElementTracked:$_ElementDefault;($_ElementTracked=null,$_TabGroupTracked="",$_TabTracked=null,_$ElementCanFocus(r))&&(t&&i&&_$TabGroupSelectTab(t,i),r.Focus())}function _$ElementSetDefault(n,t,i,r){var u=_Element(n,t);$_ElementDefault=u.IsValid?u:null;$_ElementTracked=null;$_TabGroupDefault=_String(i).Trim().Value;$_TabGroupTracked="";$_TabDefault=$_TabGroupDefault?r:null;$_TabTracked=null}function _$ElementTrack(n,t,i,r){if(!_$ElementIsValid($_ElementTracked)){var u=_Element(n,t);$_ElementTracked=u.IsValid?u:null;$_TabGroupTracked=_String(i).Trim().Value;$_TabTracked=$_TabGroupTracked?r:null}}function _$ElementTrackValue(n,t){var i=_Element(n,t);$_ElementTrackedValue=i.GetValue();i.Select()}function _$ElementTrackIndex(n,t){var i=_Element(n,t);$_ElementTrackedIndex=i.GetSelectedIndex();i.Focus()}function _$ElementGetHexColor(n){var f=_String(n),i,r,u,t;if(!f.ToLower().StartsWith("rgb")||(i=f.Value.replace(/rgb\(|\)/gi,"").split(","),r="#",i.length!=3))return n;for(t=0;t<3;t++){if(u=_Number(i[t]),!u.IsNumeric)return n;r+=u.ToHexString(2)}return r}function _$ElementSetPostBackHandler(n){_Element("__EVENTTARGET").SetValue(_String(n))}function _$ElementLimitSize(n,t){var i=_$Event(n);i.SourceElement&&i.SourceElement.GetValue().length>=_Number(t).GetValue(0)&&i.Cancel()}function _$ElementValidateNumber(n,t,i,r,u,f,e,o){if(!_$ElementIsValid(t))return!1;var h=_Event(n),c=t.GetValue(),s=_Number(c);return s.IsNumeric&&(s.RoundTo(r,u),s.IsValid(i))?(t.SetValue(s.ToString(f,e,o)),!0):(h.Cancel(),t.SetValue($_ElementTrackedValue),t.Focus(),!1)}function _$ElementDragDropMouseStart(n){this.$DragDrop.Init(n,!0)}function _$ElementDragDropTouchStart(n){this.$DragDrop.Init(n,!1)}function _$ElementDragDropMouseMove(n){$_ElementDragDrop.Drag(n,!0)}function _$ElementDragDropTouchMove(n){$_ElementDragDrop.Drag(n,!1)}function _$ElementDragDropMouseEnd(n){$_ElementDragDrop.Drop(n,!0)}function _$ElementDragDropTouchEnd(n){$_ElementDragDrop.Drop(n,!1)}function _$ElementMotionMouseStart(n){this.$Motion.Start(n,!0)}function _$ElementMotionTouchStart(n){this.$Motion.Start(n,!1)}function _$ElementMotionMouseMove(n){$_ElementMotion.Move(n,!0)}function _$ElementMotionTouchMove(n){$_ElementMotion.Move(n,!1)}function _$ElementMotionMouseEnd(n){$_ElementMotion.End(n,!0)}function _$ElementMotionTouchEnd(n){$_ElementMotion.End(n,!1)}function _$ElementAnimate(){$_ElementFlingTimer&&clearTimeout($_ElementFlingTimer);for(var n in $_ElementFling)$_ElementFling[n].Fling();$_ElementFling.length>0&&($_ElementFlingTimer=setTimeout(_$ElementAnimate,10))}function _$ElementBoundsExpand(n,t){_$ElementBoundsCollapse(!1);t&&_Element(n).Select()}function _$ElementBoundsCollapse(n){n=typeof n=="boolean"?n:!0;n=n||!("ontouchstart"in window);var t=$_ElementBoundsExpanded;$_ElementBoundsExpanded=!n;t&&n&&_$PopupReposition()}function _$ElementGetBounds(n,t,i,r){var f,e;r=typeof r=="boolean"?r:!1;var o=$_Body.GetRectangle(),c=_ElementRectangle(0,0,window.innerWidth,window.innerHeight).ScrollRectangle(o,!1),s=t.GetRectangle().ScrollRectangle(o,!1).ScrollKeyboard(),h=s.GetIntersection(c),u=h===null?s:h;return _$ElementIsValid(i)?(f=i.GetWidth(),e=i.GetHeight(),($_ElementBoundsExpanded||r)&&u.Extend(f,e,f,e),u.Right-=i.GetWidth(),u.Bottom-=i.GetHeight(),u.Right=Math.max(u.Right,u.Left),u.Bottom=Math.max(u.Bottom,u.Top),u):$_ElementBoundsExpanded||r?_ElementRectangle(-1e4,-1e4,1e4,1e4):u}function _$ElementSetTouchClick(n,t){var i,r;if(t=typeof bBlockBackspace=="boolean"?t:!0,n===undefined)i=$_Doc;else{if(r=_Element(n),!r.IsValid)return;i=r.Object}if(t){i.addEventListener("touchstart",_$EventTouchHandler,!0);i.addEventListener("touchend",_$EventTouchHandler,!0);return}i.removeEventListener("touchstart",_$EventTouchHandler);i.removeEventListener("touchend",_$EventTouchHandler)}function _Element(n,t){function i(n,t){return t===undefined||t===null||t.text===undefined||t.value===undefined?null:n?t.value:t.text}if(!(this instanceof _Element))return new _Element(n,t);this.IsValid=!1;this.Object=null;this.Form=null;this.IsDocElement=!1;this.IsForm=!1;this.Id="";this.Name="";this.Tag="";this.Type="";this.Display="inline";this.$Instantiate=function(n,t){if(typeof n=="object"&&n?(n=n instanceof _Element?n.Object:n,n=n===$_Doc?$_Doc.documentElement:n,this.Object=n):typeof n=="string"&&(this.Object=$_Doc.getElementById(n),this.Object||(t=typeof t=="string"?$_Doc.forms[t]:t,t=t instanceof HTMLFormElement?t:$_Form,this.Form=t,this.Object=this.Form?this.Form.elements[n]:null)),this.Object){this.IsValid=!0;this.IsDocElement=this.Object===$_Doc.documentElement;this.Id=_String(this.Object.id).Value;this.Name=_String(this.Object.name).Value;this.Tag=_String(this.Object.tagName).ToLower().Value;this.Type=_String(this.Object.type).ToLower().Value;switch(this.Tag){case"button":case"datalist":case"fieldset":case"form":case"input":case"keygen":case"label":case"legend":case"optgroup":case"option":case"output":case"select":case"textarea":this.IsForm=!0}var i="";switch(this.Tag){case"table":i="table";break;case"tbody":i="table-row-group";break;case"tr":i="table-row";break;case"td":i="table-cell";break;case"div":i="block"}this.Display=i?i:this.Display}};this.Clone=function(){return _Element(this)};this.GetDisabled=function(){return this.IsValid?this.Object.disabled:!1};this.SetDisabled=function(n){this.IsValid&&(n=typeof n=="boolean"?n:!0,this.Object.disabled=n)};this.GetVisible=function(){return this.IsValid?this.GetStyle("visibility")!=="hidden":!1};this.SetVisible=function(n){if(this.IsValid){n=typeof n=="boolean"?n:!0;var t=n?"visible":"hidden";this.SetStyle("visibility",t)}};this.GetDisplay=function(){return this.IsValid?this.GetStyle("display"):""};this.IsDisplayed=function(){return this.GetDisplay().toLowerCase()!=="none"};this.SetDisplay=function(n){this.IsValid&&(n=typeof n=="boolean"?n?this.Display:"none":_String(n).GetValue(this.Display),this.Object.style.display=n)};this.GetZIndex=function(){return this.IsValid?this.GetStyle("z-index"):-1};this.SetZIndex=function(n){this.IsValid&&this.SetStyle("z-index",n)};this.GetDim=function(){return this.IsValid?_Number(this.GetZIndex()).GetValue(100)<100:!1};this.SetDim=function(n){this.IsValid&&(n=typeof n=="boolean"?n:!0,this.SetZIndex(n?50:150))};this.GetClassName=function(){return this.IsValid?this.Object.className:""};this.SetClassName=function(n){this.IsValid&&(this.Object.className=n)};this.GetStyle=function(n){return this.IsValid?window.getComputedStyle(this.Object).getPropertyValue(n):null};this.SetStyle=function(n,t){this.IsValid&&(this.Object.style[n]=t)};this.GetInnerHtml=function(){return this.IsValid?this.Object.innerHTML:""};this.SetInnerHtml=function(n){this.IsValid&&(this.Object.innerHTML=n)};this.GetInnerText=function(){return this.IsValid?this.Object.textContent:""};this.SetInnerText=function(n){this.IsValid&&(this.Object.textContent=n)};this.SetTouchClick=function(n){this.IsValid&&_$ElementSetTouchClick(this,n)};this.GetRectangle=function(){var n;if(!this.IsValid)return _ElementRectangle();if(n=this.Object,this.IsDocElement)return _ElementRectangle(0,0,n.clientWidth,n.clientHeight,n.scrollLeft,n.scrollTop);for(var i=0,r=0,u=n.scrollLeft,f=n.scrollTop,e=n.clientWidth?n.clientWidth:n.offsetWidth,o=n.clientHeight?n.clientHeight:n.offsetHeight,t;n&&n!==$_Body.Object;)i+=n.offsetLeft,r+=n.offsetTop,t=n.parentElement,n=n.offsetParent,t&&(u+=t.scrollLeft,f+=t.scrollTop);return e+=i,o+=r,_ElementRectangle(i,r,e,o,u,f)};this.GetWidth=function(){return this.IsValid?this.Object.offsetWidth:-1};this.GetHeight=function(){return this.IsValid?this.Object.offsetHeight:-1};this.IntersectsX=function(n){return this.IsValid?this.GetRectangle().IntersectsX(n):!1};this.IntersectsY=function(n){return this.IsValid?this.GetRectangle().Scroll().IntersectsY(n):!1};this.Intersects=function(n,t){return this.IsValid?this.GetRectangle().Scroll().Intersects(n,t):!1};this.IntersectsElement=function(n){if(!this.IsValid||!_$ElementIsValid(n))return!1;var t=this.GetRectangle().Scroll(),i=n.GetRectangle().Scroll();return};this.GetEditable=function(){return _$ElementIsEditable(null,this)};this.Focus=function(){this.IsValid&&_$ElementCanFocus(this)&&($_ElementFocusTimer&&clearTimeout($_ElementFocusTimer),window.focus(),$_ElementFocusCache=this.Object,$_ElementFocusTimer=setTimeout("$_ElementFocusCache.focus();",1))};this.IsChildOf=function(n){return this.IsValid&&_$ElementIsValid(n)&&this.Object.parentElement===n.Object};this.IsDescendantOf=function(n){if(!this.IsValid||!_$ElementIsValid(n))return!1;for(var t=this.Object.parentElement;t;){if(t===n.Object)return!0;t=t.parentElement}return!1};this.ContainsChild=function(n){if(!this.IsValid||!_$ElementIsValid(n))return!1;for(var t=0;tu)return;i=this.GetOptionByIndex(r)}i.text=n;i.value=t}};this.InsertBefore=function(n,t,i){if(this.IsValid){var u=new Option(n,t),r;r=i===undefined||i===null||i.text===undefined?_Number(i).GetValue(0):this.GetOptionIndex(i);r=r<0?0:r;this.Object.add(u,r)}};this.InsertAfter=function(n,t,i){if(this.IsValid){var u=new Option(n,t),f=this.GetOptionCount()-1,r;r=i===undefined||i===null||i.text===undefined?_Number(i).GetValue(f):this.GetOptionIndex(i);r=r<0?-1:r;this.Object.add(u,++r)}};this.InsertDefault=function(n,t){if(this.IsValid){n=n===undefined?"( Select One )":_String(n).Value;t=_String(t).Value;var i=this.GetOptionCount();(i===0||i>0&&this.GetOptionByIndex(0).value!==t)&&this.InsertBefore(n,t)}};this.RemoveDefault=function(n){if(this.IsValid){n=_String(n).Value;var t=this.GetOptionCount();t>0&&this.GetOptionByIndex(0).value===n&&this.Remove(0)}};this.Remove=function(n){if(this.IsValid){var i=this.GetOptionCount()-1,t;(t=n===undefined||n===null||n.text===undefined?_Number(n).GetValue(-1):this.GetOptionIndex(n),t<0||t>i)||this.Object.remove(t)}};this.RemoveAll=function(){if(this.IsValid)for(var n=0;nr||i>u?null:_ElementRectangle(t,i,r,u)};this.IntersectsX=function(n){return n>=this.Left&&n<=this.Right};this.IntersectsY=function(n){return n>=this.Top&&n<=this.Bottom};this.Intersects=function(n,t){return this.IntersectsX(n)&&this.IntersectsY(t)};this.Expand=function(n){return this.Extend(n,n,n,n)};this.Extend=function(n,t,i,r){return this.Left-=n,this.Top-=t,this.Right+=i,this.Bottom+=r,this.Width+=n+i,this.Height+=t+r,this};this.$Instantiate.apply(this,arguments)}function _ElementCoordinates(n,t){if(!(this instanceof _ElementCoordinates))return new _ElementCoordinates(n,t);this.X=0;this.Y=0;this.$Instantiate=function(n,t){this.X=_Number(n).GetValue(this.X);this.Y=_Number(t).GetValue(this.Y)};this.Clone=function(){return _ElementCoordinates(this.X,this.Y)};this.Offset=function(n,t){return n=_Number(n).GetValue(0),t=_Number(t).GetValue(0),this.X+=n,this.Y+=t,this};this.OffsetRectangle=function(n,t){t=typeof t=="boolean"?t:!0;n=n instanceof _ElementRectangle?n:_ElementRectangle();var i=t?1:-1;return this.Offset(n.Left*i,n.Top*i)};this.OffsetElement=function(n,t){return n=_$ElementIsValid(n)?n:$_Body,this.OffsetRectangle(n.GetRectangle(),t)};this.Scroll=function(n,t){return n=_Number(n).GetValue(0),t=_Number(t).GetValue(0),this.X-=n,this.Y-=t,this};this.ScrollRectangle=function(n,t){t=typeof t=="boolean"?t:!0;n=n instanceof _ElementRectangle?n:_ElementRectangle();var i=t?1:-1;return this.Scroll(n.ScrollLeft*i,n.ScrollTop*i)};this.ScrollElement=function(n,t){return n=_$ElementIsValid(n)?n:$_Body,this.ScrollRectangle(n.GetRectangle(),t)};this.ScrollKeyboard=function(n){return _$PageIsIOS()&&_$ElementIsEditable(null,_Element($_Doc.activeElement))?this.ScrollElement($_Body,n):this};this.$Instantiate.apply(this,arguments)}function _ElementLocator(n,t,i,r,u,f){if(!(this instanceof _ElementLocator))return new _ElementLocator(n,t,i,r,u,f);this.ChildElement=null;this.ParentElement=null;this.ScrollElement=null;this.BoundingElement=null;this.OffsetPixelsX=0;this.OffsetPixelsY=0;this.Center=!0;this.Event=null;this.UseMouseLocationX=!1;this.UseMouseLocationY=!1;this.OpenDirection="BottomRight";this.UseSourceOffsetWidth=!0;this.UseSourceOffsetHeight=!0;this.AllowAlternateX=!0;this.AllowAlternateY=!0;this.UseAlternateOffsetWidth=!0;this.UseAlternateOffsetHeight=!0;this.ScrollBody=!0;this.$Instantiate=function(n,t,i,r,u,f){this.ChildElement=_$ElementIsValid(n)?n:this.ChildElement;this.ParentElement=_$ElementIsValid(t)?t:this.ParentElement;this.ScrollElement=_$ElementIsValid(i)?i:this.ScrollElement;this.BoundingElement=_$ElementIsValid(r)?r:this.BoundingElement;this.OffsetPixelsX=_Number(u).GetValue(this.OffsetPixelsX);this.OffsetPixelsY=_Number(f).GetValue(this.OffsetPixelsY);this.Center=!this.ChildElement||!this.ParentElement};this.Clone=function(){return _ElementLocator(this.ChildElement,this.ParentElement,this.BoundingElement,this.OffsetPixelsX,this.OffsetPixelsY)};this.GetOrigin=function(){var d,g;if(!_$ElementIsValid(this.ChildElement)||!_$ElementIsValid(this.ParentElement))return _ElementCoordinates(this.OffsetPixelsX,this.OffsetPixelsY);this.ScrollElement=_$ElementIsValid(this.ScrollElement)?this.ScrollElement:$_DocElement;this.BoundingElement=_$ElementIsValid(this.BoundingElement)?this.BoundingElement:$_DocElement;var u=_Event(this.Event).Object,nt=u?u.clientX:0,tt=u?u.clientY:0,it=u?this.UseMouseLocationX:!1,rt=u?this.UseMouseLocationY:!1,v=_String(this.OpenDirection).ToLower(),o=v.Contains("left"),ut=v.Contains("center"),s=v.Contains("top"),ft=v.Contains("middle"),r=_$ElementGetBounds(this.ScrollElement,this.BoundingElement),t=this.ParentElement.GetRectangle(),et=$_Body.GetRectangle(),ot=this.ScrollElement.Object===$_Body.Object,vt=this.ScrollElement.Object===this.BoundingElement.Object;t.ScrollElement(this.ScrollElement,!ot);ot||(t.ScrollRectangle(et,!1).ScrollKeyboard(),this.ScrollBody&&t.ScrollRectangle(et,!1));var h=this.ChildElement.GetWidth(),c=this.ChildElement.GetHeight(),w=it?nt:t.Left,st=it?nt:t.Right,l=this.UseSourceOffsetWidth?st:w,y=this.UseAlternateOffsetWidth?this.UseSourceOffsetWidth?w:st:l,n=o?l-h-this.OffsetPixelsX:l+this.OffsetPixelsX,ht=o?l-this.OffsetPixelsX:l+h+this.OffsetPixelsX,f=o?y+this.OffsetPixelsX:y-h-this.OffsetPixelsX,ct=o?y+h+this.OffsetPixelsX:y-this.OffsetPixelsX;ut&&(n=w+t.Width/2-h/2,ht=n,f=n,ct=n);var b=rt?tt:t.Top,lt=rt?tt:t.Bottom,a=this.UseSourceOffsetHeight?lt:b,p=this.UseAlternateOffsetHeight?this.UseSourceOffsetHeight?b:lt:a,i=s?a-c-this.OffsetPixelsY:a+this.OffsetPixelsY,k=s?a-this.OffsetPixelsY:a+c+this.OffsetPixelsY,e=s?p+this.OffsetPixelsY:p-c-this.OffsetPixelsY,at=s?p+c+this.OffsetPixelsY:p-this.OffsetPixelsY;return ft&&(i=b+t.Height/2-c/2,k=i,e=i,at=i),d=n,g=k,ut||(d=o?this.AllowAlternateX&&nn?f:n:this.AllowAlternateX&&ht>r.Right&&f>r.Left&&fi?e:i:this.AllowAlternateY&&k>r.Bottom&&e>r.Top&&e-1&&($_ElementFling.splice(n,1),$_ElementFling.length===0&&clearTimeout($_ElementFlingTimer));this.State="Rest"};this.$FlingClose=function(){this.Popup&&this.FlingToClose&&!this.GetBounds().Intersects(this.CurrentLocation.X,this.CurrentLocation.Y)&&this.$_Expand&&(this.$_Expand=!1,_NavigatorRecaller(this.Popup.PopupId).Call())};this.Clone=function(){return _ElementMotion(this.ParentElement,this.FlingInertia,this.EnableRebound,this.ScrollElement,this.BoundingElement,this.BindParentElement)};this.BindTriggers=function(n){this.UnbindTriggers();var r=n instanceof Array?n:[],u=[],i;for(var t in r)i=_$ElementIsValid(r[t])?r[t]:_Element(r[t]),i.IsValid&&u.indexOf(i.Object)<0&&(u.push(i.Object),this.TriggerElements.push(i));this.TriggerElements.length===0&&this.TriggerElements.push(this.ParentElement);for(t in this.TriggerElements)this.TriggerElements[t].Object.$Motion=this,this.TriggerElements[t].Object.addEventListener("mousedown",_$ElementMotionMouseStart),this.TriggerElements[t].Object.addEventListener("touchstart",_$ElementMotionTouchStart)};this.UnbindTriggers=function(){for(var n in this.TriggerElements)delete this.TriggerElements[n].Object.$Motion,this.TriggerElements[n].Object.removeEventListener("mousedown",_$ElementMotionMouseStart),this.TriggerElements[n].Object.removeEventListener("touchstart",_$ElementMotionTouchStart)};this.GetBounds=function(n){return this.State==="Moving"||this.State==="Fling"?this.$_Expand?this.$_BoundsExpanded:this.$_Bounds:_$ElementGetBounds(this.ScrollElement,this.BoundingElement,this.ParentElement,n)};this.GetCoordinates=function(n,t){if(!this.ParentElement.IsValid)return _ElementCoordinates(n,t);var s=this.State==="Fling",u=this.Popup&&this.FlingToClose,f=s&&u,r=!this.EnableRebound||u,i=this.GetBounds(),e=ni.Right,o=ti.Bottom,h=e||o;if(h){if(f&&!this.$_Expand&&this.Velocity>this.$_ThresholdClose)return this.$_Expand=!0,_ElementCoordinates(n,t);r=f&&!this.$_Expand?!1:r;this.Vector.X*=e?-1:1;this.Vector.Y*=o?-1:1;this.Velocity=r?0:this.Velocity}return this.$_Expand&&this.Velocity===0&&(this.$_Expand=!1,_NavigatorRecaller(this.Popup.PopupId).Call()),n=n>i.Right?i.Right:n,n=ni.Bottom?i.Bottom:t,t=t100?100:n;this.FlingInertia=n;this.Inertia=.89+this.FlingInertia/1e3;this.EnableRebound=typeof t=="boolean"?t:!1};this.SetPopup=function(n,t){this.Popup=n;this.FlingToClose=t};this.Start=function(n,t){var i=_Event(n);if(this.ParentElement.IsValid&&_$EventIsValid(i)&&(!t||!(i.Object.button>1))){this.$FlingEnd();this.State="Active";this.DocClassName=$_DocElement.GetClassName();this.ParentClassName=this.ParentElement.GetClassName();this.ZIndex=_Number(this.ParentElement.GetZIndex()).GetValue("auto");this.$_Bounds=this.GetBounds();this.$_BoundsExpanded=this.GetBounds(!0);this.ParentElement.SetZIndex(500);var r=this.ParentElement.GetRectangle(),u=t?i.MouseLocation:i.TouchLocation,f=u.X,e=u.Y,o=f-r.Left,s=e-r.Top;if(this.CurrentLocation=_ElementCoordinates(r.Left,r.Top),this.PreviousLocation=this.CurrentLocation.Clone(),this.PointerOffset=_ElementCoordinates(o,s),$_ElementMotion=this,t){$_Body.Object.addEventListener("mousemove",_$ElementMotionMouseMove);$_Body.Object.addEventListener("mouseup",_$ElementMotionMouseEnd);return}this.Popup&&this.Popup.$CancelTimer();i.Cancel();$_Body.Object.addEventListener("touchmove",_$ElementMotionTouchMove);$_Body.Object.addEventListener("touchend",_$ElementMotionTouchEnd)}};this.Move=function(n,t){var i=_Event(n);if(this.ParentElement.IsValid&&_$EventIsValid(i)){this.State="Moving";this.PreviousLocation=this.CurrentLocation.Clone();var r=t?i.MouseLocation:i.TouchLocation,u=r.X-this.PointerOffset.X,f=r.Y-this.PointerOffset.Y;this.SetPosition(u,f)}};this.End=function(n,t){var u=_Event(n),i,r;if(this.ParentElement.IsValid&&_$EventIsValid(u)){if(t?($_Body.Object.removeEventListener("mousemove",_$ElementMotionMouseMove),$_Body.Object.removeEventListener("mouseup",_$ElementMotionMouseEnd)):(u.Cancel(),$_Body.Object.removeEventListener("touchmove",_$ElementMotionTouchMove),$_Body.Object.removeEventListener("touchend",_$ElementMotionTouchEnd),this.Popup&&this.Popup.$StartTimer()),this.ParentElement.SetZIndex(this.ZIndex),this.FlingInertia<=0){this.State="Rest";return}if(i=this.CurrentLocation.X-this.PreviousLocation.X,r=this.CurrentLocation.Y-this.PreviousLocation.Y,this.Velocity=Math.sqrt(Math.pow(i,2)+Math.pow(r,2)),this.Velocity>1){this.$FlingStart(i,r);return}this.State="Rest"}};this.Fling=function(){this.Velocity*=this.Inertia;var n=this.Vector.X*this.Velocity,t=this.Vector.Y*this.Velocity,i=this.CurrentLocation.X+n,r=this.CurrentLocation.Y+t;this.SetPosition(i,r);this.Velocity-1&&!f?(r.push(t),this.OverIndexes.splice(i,1),u=!0):i<0&&f&&this.OverIndexes.push(t);u&&typeof window[this.OutHandler]=="function"&&window[this.OutHandler](this,r);this.OverIndexes.length>0&&typeof window[this.OverHandler]=="function"&&window[this.OverHandler](this,this.OverIndexes.slice(0))};this.Clone=function(){return _ElementDragDrop(this.DragElement,this.TriggerElements,this.TargetElements,this.InitHandler,this.DragHandler,this.OverHandler,this.DropHandler,this.ScrollElement,this.BoundingElement)};this.BindTriggers=function(n){this.UnbindTriggers();var r=n instanceof Array?n:[],u=[],i;for(var t in r)i=_$ElementIsValid(r[t])?r[t]:_Element(r[t]),i.IsValid&&u.indexOf(i.Object)<0&&(u.push(i.Object),this.TriggerElements.push(i));this.TriggerElements.length===0&&this.TriggerElements.push(this.DragElement);for(t in this.TriggerElements)this.TriggerElements[t].Object.$DragDrop=this,this.TriggerElements[t].Object.addEventListener("mousedown",_$ElementDragDropMouseStart),this.TriggerElements[t].Object.addEventListener("touchstart",_$ElementDragDropTouchStart)};this.UnbindTriggers=function(){for(var n in this.TriggerElements)delete this.TriggerElements[n].Object.$DragDrop,this.TriggerElements[n].Object.removeEventListener("mousedown",_$ElementDragDropMouseStart),this.TriggerElements[n].Object.removeEventListener("touchstart",_$ElementDragDropTouchStart)};this.RegisterTargets=function(n){var i=n instanceof Array?n:[],u=[],t;for(var r in i)t=_$ElementIsValid(i[r])?i[r]:_Element(i[r]),t.IsValid&&t.Object!==this.DragElement.Object&&u.indexOf(t.Object)<0&&(u.push(t.Object),this.TargetElements.push(t))};this.GetBounds=function(){return _$ElementGetBounds(this.ScrollElement,this.BoundingElement,this.DragElement)};this.GetCoordinates=function(n,t){if(!this.DragElement.IsValid)return _ElementCoordinates(n,t);this.$_Bounds===null&&(this.$_Bounds=this.GetBounds());var i=this.$_Bounds;return n=n>i.Right?i.Right:n,n=ni.Bottom?i.Bottom:t,t=t1))){this.$CacheScroll();this.$_Bounds=null;this.OverIndexes=[];this.PointerLocation=t?this.Event.MouseLocation:this.Event.TouchLocation;this.PointerBound=_ElementCoordinates().Clone();var i=this.DragElement.GetRectangle().Scroll(),r=this.PointerLocation.X-i.Left,u=this.PointerLocation.Y-i.Top;if(this.PointerOffset=_ElementCoordinates(r,u),typeof window[this.InitHandler]=="function"&&window[this.InitHandler](this),this.DocClassName=$_DocElement.GetClassName(),this.DragClassName=this.DragElement.GetClassName(),this.ZIndex=_Number(this.DragElement.GetZIndex()).GetValue("auto"),this.DragElement.SetZIndex(500),$_ElementDragDrop=this,t){$_Body.Object.addEventListener("mousemove",_$ElementDragDropMouseMove);$_Body.Object.addEventListener("mouseup",_$ElementDragDropMouseEnd);return}this.Event.Cancel();$_Body.Object.addEventListener("touchmove",_$ElementDragDropTouchMove);$_Body.Object.addEventListener("touchend",_$ElementDragDropTouchEnd)}};this.Drag=function(n,t){var i,r,u;(this.IsMouseEvent=t,this.Event=_Event(n),this.DragElement.IsValid&&_$EventIsValid(this.Event))&&(this.PointerLocation=t?this.Event.MouseLocation:this.Event.TouchLocation,this.CurrentLocation=this.PointerLocation.Clone(),this.$_ScrollKeyboard&&(this.PointerLocation.ScrollKeyboard(!1),this.CurrentLocation.ScrollKeyboard()),this.CurrentLocation.Scroll(this.PointerOffset.X,this.PointerOffset.Y),this.CurrentLocation.ScrollElement($_Body,!1),this.PointerBound=this.PointerLocation.Clone(),typeof window[this.DrawHandler]=="function"&&window[this.DrawHandler](this),this.SetPosition(),i=this.DragElement.GetRectangle().Scroll(),this.$_ScrollKeyboard&&i.ScrollKeyboard(!1),r=this.PointerBound.X,u=this.PointerBound.Y,r=ri.Right?i.Right:r,u=ui.Bottom?i.Bottom:u,this.PointerBound=_ElementCoordinates(r,u),typeof window[this.DragHandler]=="function"&&window[this.DragHandler](this),this.$DragOverHelper())};this.Drop=function(n,t){(this.IsMouseEvent=t,this.Event=_Event(n),this.DragElement.IsValid&&_$EventIsValid(this.Event))&&(t?($_Body.Object.removeEventListener("mousemove",_$ElementDragDropMouseMove),$_Body.Object.removeEventListener("mouseup",_$ElementDragDropMouseEnd)):(this.Event.Cancel(),$_Body.Object.removeEventListener("touchmove",_$ElementDragDropTouchMove),$_Body.Object.removeEventListener("touchend",_$ElementDragDropTouchEnd)),this.DragElement.SetZIndex(this.ZIndex),typeof window[this.DropHandler]=="function"&&window[this.DropHandler](this,this.OverIndexes.slice(0)))};this.$Instantiate.apply(this,arguments)}function _Event(n){if(!(this instanceof _Event))return new _Event(n);this.IsValid=!1;this.Object=null;this.Source=null;this.SourceElement=null;this.IsTouchEnabled=!1;this.MouseLocation=_ElementCoordinates();this.TouchLocation=_ElementCoordinates();this.$Instantiate=function(n){if(n=_$EventIsValid(n)?n.Object:n,n=typeof n=="object"&&n!==null&&"timeStamp"in n?n:null,this.IsValid=n!==null,this.Object=n,this.IsTouchEnabled="ontouchstart"in window,this.IsValid)if(this.Source=this.Object.target,this.SourceElement=_Element(this.Source),this.MouseLocation=_ElementCoordinates(this.Object.clientX,this.Object.clientY),this.IsTouchEnabled&&this.Object.changedTouches&&this.Object.changedTouches.length>0){var t=this.Object.changedTouches[0];this.TouchLocation=_ElementCoordinates(t.clientX,t.clientY)}else this.TouchLocation=this.MouseLocation.Clone()};this.Clone=function(){return _Event(this)};this.Cancel=function(){return this.IsValid?(this.Object.preventDefault(),this.Object.stopPropagation(),!1):!0};this.$Instantiate.apply(this,arguments)}function _$EventIsValid(n){return n instanceof _Event&&n.IsValid}function _$EventFalse(){return!1}function _$EventTrue(){return!0}function _$EventCancel(n){_Event(n).Cancel()}function _$EventBlockPageKeys(n){var t=_Event(n);if(t.IsValid){var i=t.Object.keyCode,r=i===27,u=i===116,f=t.Object.ctrlKey&&(i===78||i===82),e=i===8&&!_$ElementIsEditable(t),o=r||u||f||e;return o?t.Cancel():!0}}function _$EventBlockBackspace(n){return _$EventBlockKey(n,8)}function _$EventBlockEnter(n){return _$EventBlockKey(n,13)}function _$EventBlockKey(n,t){var i=_Event(n);return i.Object.keyCode!==t?!0:i.Cancel()}function _$EventEnterKey(n,t,i,r,u){i=typeof i=="boolean"?i:!0;r=typeof r=="boolean"?r:!1;u=_$ElementIsValid(u)?u:_Element(u);var f=_Event(n),e=f.Object.keyCode,o=e===13,s=r&&e===32,h=e===8;return i&&h?f.Cancel():(o||s)&&(t||u.IsValid)?(u.IsValid?(_$EventDispatch(u,"Event","change"),_$EventDispatch(u,"Event","focus")):eval(t),f.Cancel()):!0}function _$EventKeyClick(n){var t=_Event(n),i=t.Object.keyCode,r=i===9,u=i===13,f=i===32;return(u||f)&&_$EventDispatch(t.Source,"MouseEvent","click"),r||t.Cancel(),r}function _$EventDispatch(n,t,i){if(n=_$ElementIsValid(n)?n:_Element(n),n.IsValid){var r=$_Doc.createEvent(t);r.initEvent(i,!1,!1);n.Object.dispatchEvent(r)}}function _$EventTouchHandler(n){var i=_Event(n),t=-1;(t=i.Object.type==="touchstart"?1:t,t=i.Object.type==="touchend"?0:t,t<0)||_$EventTouchRecurse(i,n.changedTouches[0].target,t)}function _$EventTouchRecurse(n,t,i){var r,u;if(t){if(r=n.Object.changedTouches[0],!t.onclick&&!t.oncontextmenu&&!t.ondblclick){_$EventTouchRecurse(n,t.parentElement,i);return}if(n.Cancel(),i===1){if($_EventTouchCount++,$_EventTouchCount===2){if(u=$_EventTouchSource,_$EventTouchClear(),n.Source===u){_$EventTouchDispatch(r,"dblclick");return}$_EventTouchCount=1}$_EventTouchCount===1&&($_EventTouchSource=n.Source,$_EventTouchCache=r,$_EventTouchTimer=setTimeout(_$EventTouchContext,500));return}$_EventTouchCount===1&&($_EventTouchTimer&&clearTimeout($_EventTouchTimer),$_EventTouchTimer=setTimeout(_$EventTouchClick,100))}}function _$EventTouchClear(){$_EventTouchTimer&&clearTimeout($_EventTouchTimer);$_EventTouchCount=0;$_EventTouchSource=null;$_EventTouchTimer=null;$_EventTouchCache=null}function _$EventTouchClick(){if($_EventTouchCache!==null){var n=$_EventTouchCache;_$EventTouchClear();_$EventTouchDispatch(n,"click")}}function _$EventTouchContext(){if($_EventTouchCache!==null){var n=$_EventTouchCache;_$EventTouchClear();_$EventTouchDispatch(n,"contextmenu")}}function _$EventTouchDispatch(n,t){var i=$_Doc.createEvent("MouseEvent"),r=t==="contextmenu";i.initMouseEvent(t,!0,!0,window,1,n.screenX,n.screenY,n.clientX,n.clientY,n.ctrlKey,n.altKey,n.shiftKey,n.metaKey,r?2:1,null);n.target.dispatchEvent(i)}function _$ImageCache(n,t,i){var r=!1;(typeof t=="string"&&_String(t).Value?r=!0:typeof t=="number"&&_Number(t).IsNumeric&&(r=!0),r&&_String(i).Value)&&($_ImageCache[n]instanceof Array||($_ImageCache[n]=[]),$_ImageCache[n][t]=new Image,$_ImageCache[n][t].src=i)}function _$ImageCacheSequential(n,t,i,r,u,f){var s,o,e,h,c;if(typeof i=="string"){if(s=_String(i).Value,!s)return;i=[s]}if(n=_String(n).Value,t=_String(t).Value,r=_String(r).Value,i instanceof Array&&i.length!==0&&r)for(c in i)if(o=_String(i[c]).Value,o)for(e=u;e<=f;e++)h=n+t+"_"+e+"_"+o+"."+r,_$ImageCache(o,e,h)}function _$ImageCacheExplicit(n,t,i,r){if(t=_String(t).Value,t){var f=n+t,u=!1;typeof i=="string"&&_String(i).Value?u=!0:typeof i=="number"&&_Number(i).IsNumeric&&(u=!0);u||(i=t);r=_String(r).Value;r=r?r:"explicit";_$ImageCache(r,i,f)}}function _$ImageSwap(n,t,i){var e,r,u,f;(typeof n=="string"&&(e=_String(n).Value,n=_Element($_Doc.images[e])),n=_$ElementIsValid(n)?n:_Element(n),n.IsValid)&&(r=!1,typeof t=="string"&&_String(t).Value?r=!0:typeof t=="number"&&_Number(t).IsNumeric&&(r=!0),r||(t=_String(n.Object.name).Value,t=t?t:n.Id,t))&&(i=_String(i).Value,i=i?i:"explicit",u=$_ImageCache[i],u instanceof Array&&(f=u[t],f instanceof Image&&(n.Object.src=f.src)))}function _Navigator(n,t,i){if(!(this instanceof _Navigator))return new _Navigator(n,t,i);this.Path=$_PagePath;this.BaseQueryString=$_PageQuery;this.TargetFrame=self;this.QueryString="";this.FullPath="";this.FullUrl="";this.$Instantiate=function(n,t,i){this.Path=_String(n).GetValue(this.Path);this.BaseQueryString=typeof t=="string"?t:this.BaseQueryString;this.TargetFrame=i!==undefined&&i&&i.document?i:this.TargetFrame;this.QueryString=this.GetStamped(this.BaseQueryString);this.FullPath=this.Path.charAt(0)==="/"?this.Path:$_PageRoot+this.Path;this.FullUrl=this.FullPath+this.QueryString};this.$SetPromptDialog=function(){var n=_PopupDialog($_PopupDialogWarningId,"Warning");n.Content="Changes to the current page have not been saved.\n\nClick 'Stop' to abort the current request, stop and make changes.\n\nClick 'Continue' to discard changes and continue the requested action.";n.AddButton("Stop","_$NavigatorContinue( false );",!1,"error");n.AddButton("Continue","_$NavigatorContinue();",!1,"success");n.Set()};this.GetStamped=function(n){return"?s="+$_PageStamp+"&r="+ ++$_NavigatorLinkCount+_String(n).Value};this.Go=function(n,t){var n=typeof n=="boolean"?n:!0,t=typeof t=="boolean"?t:!0;if(n&&$_NavigatorSave){this.ShowSavePrompt();return}t&&_$PageLock();try{this.TargetFrame.location.replace(encodeURI(this.FullUrl))}catch(i){this.TargetFrame.location.href=encodeURI(this.FullUrl)}};this.GoBack=function(n,t,i,r){n=_String(n).Value;t=t===undefined?$_PageQuery:_String(t).Value;n||(n=$_PageRoot,t="");var u=$_PageLastPath?$_PageLastPath:n,f=$_PageLastPath?$_PageLastQuery:t;_Navigator(u,f,this.TargetFrame).Go(i,r)};this.Timeout=function(n){if(n!==undefined&&_String(n).Value.charAt(0)!==$_Char1)return!1;var i=top,t=top.opener;return t&&(t.closed||(i=t)),_Navigator($_PageRoot,null,i).Go(!1),!0};this.SetSavePrompt=function(n){_$NavigatorSetSavePrompt(typeof n=="boolean"?n:!0)};this.ShowSavePrompt=function(n,t){var u=n instanceof _NavigatorRecaller,f=t instanceof _NavigatorRecaller,i,r;if(n=u?n:_NavigatorRecaller($_PopupDialogWarningId,this,"Go",arguments,!1),t=f?t:_NavigatorRecaller($_PopupDialogWarningId),i=n.PopupId,r=i===$_PopupDialogWarningId,r&&this.$SetPromptDialog(),!($_PopupCache[i]instanceof _Popup)){console.log("The popup with ID ["+i+"] is not in the popup cache.");console.log($_PopupCache);return}$_NavigatorContinue=n;$_NavigatorStop=t;_$PopupOpen(i,!0)};this.RemoveParameter=function(n){var i,r,o,f;if(n=_String(n).ToLower().Value,!n)return this.QueryString;var e="",t=this.QueryString.substring(1),u=t.indexOf("#");u>0&&(e=t.substring(u),t=t.substring(0,u));i="";r=_String(t).Split("&");for(f in r)o=_String(r[f]).Split("="),o[0].toLowerCase()!==n&&(i+=(i?"&":"")+r[f]);return this.QueryString=(i?"?":"")+i+e,this.QueryString};this.$Instantiate.apply(this,arguments)}function _NavigatorRecaller(n,t,i,r,u){if(!(this instanceof _NavigatorRecaller))return new _NavigatorRecaller(n,t,i,r,u);this.Instance=null;this.FunctionName="";this.Arguments=null;this.PopupId="";this.ActivateAllPopups=!0;this.SuppressFocus=!1;this.SuppressUnlock=!1;this.$Instantiate=function(n,t,i,r,u){this.Instance=t===undefined?null:t;this.Arguments=r===undefined?null:r;this.FunctionName=_String(i).Value;this.PopupId=_String(n).Value;this.ActivateAllPopups=typeof u=="boolean"?u:!0};this.Call=function(){if(this.SuppressUnlock||_Element($_Form).SetDisabled(!1),this.PopupId?_$PopupClose(this.PopupId,this.ActivateAllPopups):this.ActivateAllPopups&&_$PopupActivateAll(),this.Instance){typeof this.Instance[this.FunctionName]=="function"&&this.Instance[this.FunctionName].apply(this.Instance,this.Arguments);return}if(typeof window[this.FunctionName]=="function"){window[this.FunctionName].apply(null,this.Arguments);return}this.SuppressFocus||_$ElementFocusTracked()};this.$Instantiate.apply(this,arguments)}function _$NavigatorSetSavePrompt(n){$_NavigatorSave=typeof n=="boolean"?n:!0}function _$NavigatorContinue(n){var t=$_NavigatorContinue,i=$_NavigatorStop;if($_NavigatorContinue=null,$_NavigatorStop=null,_$PageSetKeyDownHandler(),n=typeof n=="boolean"?n:!0,n&&t instanceof _NavigatorRecaller){_$NavigatorSetSavePrompt(!1);t.Call();return}if(i instanceof _NavigatorRecaller){i.Call();return}_Element($_Form).SetDisabled(!1)}function _Number(n){if(!(this instanceof _Number))return new _Number(n);this.IsNumeric=!1;this.Value=null;this.Separator="";this.$Instantiate=function(n){var t=1e3,i=t.toLocaleString(),e=i.length-3,r=i.substring(1,e),u,f;n instanceof _Number?n=n.Value:typeof n=="string"&&(u="\\s|\\"+r,f=RegExp(u,"gi"),n=n.replace(f,""),n=n===""?null:n);t=Number(n);this.IsNumeric=n!==undefined&&n!==null&&isFinite(t);this.Value=this.IsNumeric?t:null;this.Separator=r};this.Clone=function(){return _Number(this)};this.GetValue=function(n){return this.IsNumeric?this.Value:n};this.RoundTo=function(n,t){if(n=_Number(n).GetValue(0),!this.IsNumeric||n<=0)return this;var r,u,i;return r=_Number(t),u=r.Numeric&&(r.Value===-1||r.Value===0||r.Value===1)?r.Value:0,i=this.Value/n,i=t<0?Math.floor(i):Math.round(i),i=t>0?Math.ceil(i):i,this.Value=i*n,this};this.ToHexString=function(n){if(!this.IsNumeric)return"";var t=this.Value.toString(16).toLowerCase();return(n=_Number(n).RoundTo(1).GetValue(0),n=n<0?0:n,n=n>64?64:n,n===0)?t:(Array(n+1).join("0")+t).slice(-n)};this.ToString=function(n,t,i){if(!this.IsNumeric)return"";var u=_Number(t),f=u.IsValid?u.RoundTo(1).Value:-1,e=typeof i=="boolean"?i:!1,o=typeof n=="boolean"?n:!0,r;return r=f<0?String(this.Value):this.Value.toFixed(f),r=e?r:String(r*1),o?Number(r).toLocaleString():r};this.IsValid=function(n){return this.IsNumeric&&n instanceof _NumberValidator?n.IsValid(this.Value):!1};this.$Instantiate.apply(this,arguments)}function _NumberValidator(n,t,i,r,u,f){if(!(this instanceof _NumberValidator))return new _NumberValidator(n,t,i,r,u,f);this.MinimumValue=null;this.MaximumValue=null;this.MinimumScale=0;this.MaximumScale=0;this.MinimumPrecision=-1;this.MaximumPrecision=-1;this.$Instantiate=function(n,t,i,r,u,f){this.MinimumValue=_Number(n).GetValue(this.MinimumValue);this.MaximumValue=_Number(t).GetValue(this.MaximumValue);this.MinimumScale=_Number(i).GetValue(this.MinimumScale);this.MaximumScale=_Number(r).GetValue(this.MaximumScale);this.MinimumPrecision=_Number(u).GetValue(this.MinimumPrecision);this.MaximumPrecision=_Number(f).GetValue(this.MaximumPrecision)};this.IsValid=function(n){if(!_Number(n).IsNumeric)return!1;var i=String(n),t=i.length,r=i.indexOf(".")+1,u=r?t-r:0;return this.MinimumValue!==null&&nthis.MaximumValue?!1:this.MinimumScale>0&&t0&&t>this.MaximumScale?!1:this.MinimumPrecision>-1&&u-1&&u>this.MaximumPrecision?!1:!0};this.$Instantiate.apply(this,arguments)}function _String(n){if(!(this instanceof _String))return new _String(n);this.Value="";this.$Instantiate=function(n){n=n instanceof _String?n.Value:n;n=n===undefined||n===null?"":String(n);this.Value=n};this.Clone=function(){return _String(this)};this.GetValue=function(n){return this.Value?this.Value:n};this.Append=function(n){return this.Value+=_String(n).Value,this};this.TrimStart=function(){return this.Value=this.Value.replace(/^\s+/,""),this};this.TrimEnd=function(){return this.Value=this.Value.replace(/\s+$/,""),this};this.Trim=function(){return this.TrimStart().TrimEnd()};this.TrimAll=function(){return this.Value=this.Value.replace(/\s/gi,""),this};this.SingleSpace=function(){return this.Value=this.Trim().Value.replace(/\s+/gi," "),this};this.Replace=function(n,t){return this.Value=this.Value.replace(n,t),this};this.ToUpper=function(){return this.Value=this.Value.toUpperCase(),this};this.ToLower=function(){return this.Value=this.Value.toLowerCase(),this};this.RemoveTags=function(){return this.Value=this.Value.replace(/(<[^>]+>)/gi,""),this};this.RemoveMsXml=function(){for(var i="",n,t;;){if(n=this.Value.indexOf("