
// Generated by Intersoft Script Optimizer V1.5 + Intersoft JS Engine MaxObfuscate(tm) V1.0 
// Generated Datetime : 11/26/2008 2:43:01 PM
// Copyright (c) 2005 Intersoft Solutions.
// Unauthorized decryption/reproduction of any codes contained herein is strictly prohibited and will result in severe civil and criminal penalties .
//**Start Encode**
function SelectedObject(v08863,v58f95,vaba21){ this.tblName =v08863; this.gridId =v58f95; this.element =vaba21; this.rowIndex =0; this.cellIndex =0; this.type =""; this.getRowElement =this.GetRowElement =function() { if (this.element) { if (this.element.tagName =="TR") return this.element; else return this.element.parentElement; } return null; }; this.GetRowObject =this.ToRowObject =function() { var v9c38 =wgGetRootRow(this.GetRowElement()); if (v9c38) { var vcf984 =ISGetObject(this.gridId); var v6ae35 =vcf984.Tables[this.tblName]; return v6ae35.ToRowObject(v9c38); } }; this.getColSetRowElement =this.GetColSetRowElement =function() { var v58f95 =wgGetGridById(this.gridId); var v6ae35 =v58f95.Tables[this.tblName]; if (v6ae35.IsUseColumnSet) return wgGetColumnSetRow(this.element); return null; }; this.getColSetRowsElement =this.GetColSetRowsElement =function() { var v58f95 =wgGetGridById(this.gridId); var v6ae35 =v58f95.Tables[this.tblName]; if (v6ae35.IsUseColumnSet) return wgGetColumnSetRows(this.element); return null; }; return this;}function wgGetLastSelectedObject(){ return wg_Global.LastSelObj;}function wgGetRowHeader(vf8019){ if (!vf8019) return null; var v8b799 =WG50Engine.GetTable(vf8019); if (!v8b799) return null; var v76032 =ISGetObject(v8b799.gridId); if (!v76032) return null; for (var vc9b39=0; vc9b39<vf8019.cells.length; vc9b39++) { var v9f640 =vf8019.cells[vc9b39]; WG50Engine.EmulateAttributes(v9f640); if (v9f640.type =="RowSelector" ||v9f640.type =="RowHeader") return v9f640; } return null;}function wgGetValidActiveCell(v11e55){ if (v11e55.type !="Cell") return v11e55.parentElement.cells[wgGetFirstEditableCell(v11e55.parentElement)]; else return v11e55;}function wgGetLastVisibleRow(vf7e94){ var vc6555 =null; try { vc6555 =vf7e94.rows[vf7e94.rows.length -1]; } catch (e) { vc6555 =null; } if (vc6555 ==null) { var ve0711 =ISGetObject(vf7e94.gridId).Tables[vf7e94.tblName]; if (ve0711.Get("AllowAddNew")=="Yes") { vc6555 =vf7e94.parentElement.previousSibling.childNodes[0].rows[0]; vc6555 =ve0711.GetNewRow(vc6555); var v42e24 =new SelectedObject(vf7e94.tblName,vf7e94.gridId,vc6555); return v42e24; } } if (vc6555) WG50Engine.EmulateAttributes(vc6555); if (vc6555 &&(vc6555.style.display =="none" ||vc6555.type =="GroupTotalRow" ||vc6555.type =="PR" ||vc6555.type =="CSRecord" ||vc6555.type =="ColHeader")) { return wgGetPrevVisibleRow(vf7e94,vc6555); } else { var v25843 =ISGetObject(vf7e94.gridId); var ve0711 =v25843.Tables[vf7e94.tblName]; if (v25843.LastSelObj.element.type =="NewRow") { vc6555 =vf7e94.rows[vf7e94.rows.length -1]; WG50Engine.EmulateAttributes(vc6555); if (vc6555.style.display =="none" ||vc6555.type =="GroupTotalRow" ||vc6555.type =="PR" ||vc6555.type =="CSRecord" ||vc6555.type =="ColHeader") { return wgGetPrevVisibleRow(vf7e94,vc6555); } } var v42e24 =new SelectedObject(vf7e94.tblName,vf7e94.gridId,vc6555); return v42e24; } return null;}function wgGetLastChildVisibleRow(v69185){ if (v69185.style.display =="none") v69185 =wgGetPreviousRow(tb,v69185); else { var v01629 =v69185.cells[v69185.cells.length -1]; var v2560 =v01629.childNodes[v01629.childNodes.length -1]; WG50Engine.EmulateAttributes(v2560); var vd9676 =document.getElementById("dvTB_" +v2560.gridId +"_" +v2560.tblName +"_" +v2560.subId).childNodes[0]; var va808 =wgGetLastVisibleRow(vd9676); if (va808) { if (va808.type =="HierRecord") va808 =wgGetLastChildVisibleRow(va808.element); if (va808) return va808; } else v69185 =wgGetPreviousRow(tb,v69185); } return v69185;}function wgGetPrevVisibleRow(v07774,v80c76){ var v04668 =ISGetObject(v07774.gridId); var v16c19 =v04668.Tables[v07774.tblName]; var v8e810 =wgGetPreviousRow(v07774,v80c76); WG50Engine.EmulateAttributes(v80c76); if (v80c76.type =="NewRow") { if (v16c19.Get("AllowFilter")=="Yes" &&v16c19.IsFilterRowVisible()) { var vdc031 =v16c19.GetFilterRow(v80c76); if (vdc031) { v8e810 =vdc031; var v82f16 =new SelectedObject(v07774.tblName,v07774.gridId,v8e810); return v82f16; } } else v8e810 =null; } else if (v80c76.type =="FilterRow") v8e810 =null; while (v8e810 !=null) { if (v8e810.type =="HierRecord") { if (v8e810.style.display =="none") v8e810 =wgGetPreviousRow(v07774,v8e810); else { var v0c56 =v8e810.cells[v8e810.cells.length -1]; var v1ca26 =v0c56.childNodes[v0c56.childNodes.length -1]; WG50Engine.EmulateAttributes(v1ca26); var v2ec19 =document.getElementById("dvTB_" +v1ca26.gridId +"_" +v1ca26.tblName +"_" +v1ca26.subId).childNodes[0]; var v5cb22 =wgGetLastVisibleRow(v2ec19); if (v5cb22) { if (v5cb22.element.type =="HierRecord") v5cb22 =wgGetLastChildVisibleRow(v5cb22.element); if (v5cb22) return v5cb22; } else v8e810 =wgGetPreviousRow(v07774,v8e810); } } else { if (v8e810.style.display =="none" ||v8e810.type =="GroupTotalRow" ||v8e810.type =="PR" ||v8e810.type =="CSRecord" ||v8e810.type =="RowSeparator" ||v8e810.type =="ColHeader") v8e810 =wgGetPreviousRow(v07774,v8e810); else { var v82f16 =new SelectedObject(v07774.tblName,v07774.gridId,v8e810); return v82f16; } } } if (v8e810 ==null &&v80c76.type !="NewRow") { var v1dc62 =v16c19.Get("AllowAddNew"); if (v1dc62 =="Yes") { var vd1343 =v16c19.GetNewRow(v80c76); if (vd1343) { v8e810 =vd1343; var v82f16 =new SelectedObject(v07774.tblName,v07774.gridId,v8e810); return v82f16; } } if (v16c19.Get("AllowFilter")=="Yes") { var vdc031 =v16c19.GetFilterRow(v80c76); if (vdc031) { v8e810 =vdc031; var v82f16 =new SelectedObject(v07774.tblName,v07774.gridId,v8e810); return v82f16; } } } if (v8e810 ==null) { var v04668 =ISGetObject(v07774.gridId); var v16c19 =v04668.Tables[v07774.tblName]; if (!v16c19.IsRootTable) { var v8b320 =v16c19.GetElement(WG40.COLHEADER,WG40.HTMLDIV,v80c76).parentElement; if (v8b320) { if (v8b320.previousSibling) { v8b320 =v8b320.previousSibling.previousSibling; WG50Engine.EmulateAttributes(v8b320); var v5489 =document.getElementById("dvTB_" +v8b320.gridId +"_" +v8b320.tblName +"_" +v8b320.subId).childNodes[0]; return wgGetLastVisibleRow(v5489); } } var v2d582 =v16c19.GetParentRow(v80c76); if (v2d582) { var v66e75 =WG50Engine.GetTable(v2d582); return new SelectedObject(v66e75.tblName,v66e75.gridId,v2d582); } } } return null;}function wgGetPrevSiblingRow(v11065,v23724){ var v7e545; WG50Engine.EmulateAttributes(v23724); if (v23724.type =="NewRow") return null; else if (v23724.type =="Record") { v7e545 =wgGetPreviousRow(v11065,v23724); if (v7e545) { if (v7e545.type =="HierRecord") v7e545 =wgGetPreviousRow(v11065,v7e545); else if (v7e545.type =="NewRow") v7e545 =null; } } else if (v23724.type =="GroupHeader") { v7e545 =wgGetPreviousRow(v11065,v23724); if (v7e545) v7e545 =WGUIEngine.GetTRByGroupIndex(v7e545,v23724.groupIndex,"previous"); if (v7e545) if (v7e545.parentIndex !=v23724.parentIndex) v7e545 =null; } if (v7e545 ==null) return null; var v80515 =new SelectedObject(v11065.tblName,v11065.gridId,v7e545); return v80515;}function wgGetFirstVisibleRow(v9034){ var vca949 =null; try { vca949 =v9034.rows[0]; } catch (e) { vca949 =null; } if (vca949) WG50Engine.EmulateAttributes(vca949); if (vca949 &&(vca949.style.display =="none" ||vca949.type =="GroupTotalRow" ||vca949.type =="PR" ||vca949.type =="CSRecord" ||vca949.type =="ColHeader")) { return wgGetNextVisibleRow(v9034,vca949); } else { WG50Engine.EmulateAttributes(v9034); var vc1a64 =ISGetObject(v9034.gridId).Tables[v9034.tblName]; if (vc1a64.Get("AllowAddNew")=="Yes") { if (!vca949) vca949 =v9034.parentElement.previousSibling.childNodes[0].rows[0]; vca949 =vc1a64.GetNewRow(vca949); } var v38052 =new SelectedObject(v9034.tblName,v9034.gridId,vca949); return v38052; } return null;}function wgGetNextSiblingRow(ve2695,v71a92){ var v36240; WG50Engine.EmulateAttributes(v71a92); if (v71a92.type =="NewRow") return null; else if (v71a92.type =="Record") { var v64613 =wgGetGridById(ve2695.gridId); var vb5855 =v64613.Tables[ve2695.tblName]; if (vb5855.IsUseColumnSet) { v36240 =wgGetLowestColumnSetRow(v71a92); v36240 =wgGetNextRow(ve2695,v36240); } else v36240 =wgGetNextRow(ve2695,v71a92); if (v36240) { if (v36240.type =="PR") v36240 =wgGetNextRow(ve2695,v36240); if (v36240 &&v36240.type =="HierRecord") v36240 =wgGetNextRow(ve2695,v36240); else if (v36240.type =="NewRow" ||v36240.type =="GroupTotalRow") v36240 =null; } } else if (v71a92.type =="GroupHeader") { v36240 =wgGetNextRow(ve2695,v71a92); if (v36240) v36240 =WGUIEngine.GetTRByGroupIndex(v36240,v71a92.groupIndex,"next"); if (v36240) if (v36240.parentIndex !=v71a92.parentIndex) v36240 =null; } if (v36240 ==null) return null; var vfda74 =new SelectedObject(ve2695.tblName,ve2695.gridId,v36240); return vfda74;}function wgGetNextVisibleRow(va3420,v76858){ var ve0a15 =ISGetObject(va3420.gridId); var v9a32 =ve0a15.Tables[va3420.tblName]; var v0eb7 =wgGetNextRow(va3420,v76858); var vf8b38 =false; if (v76858.type =="NewRow") vf8b38 =true; else if (wgIsFilterRow(v76858)&&v9a32.Get("AllowAddNew")=="No") vf8b38 =true; if (vf8b38) { var ve0a15 =ISGetObject(va3420.gridId); var v9a32 =ve0a15.Tables[va3420.tblName]; var vf6734 =0;  tbl =v9a32.GetElement(WG40.BODY,WG40.HTMLTABLE,v76858); if (ve0a15.EnableSection508Standards) vf6734 =WG50Engine.GetFirstRecordRowIndex(tbl); if (tbl.rows.length>0) v0eb7 =tbl.rows[vf6734]; else v0eb7 =null; } while (v0eb7 !=null) { if (v0eb7.type =="HierRecord") { if (v0eb7.style.display =="none") v0eb7 =wgGetNextRow(va3420,v0eb7); else { var vb3690 =v0eb7.cells[v0eb7.cells.length -1]; var v1ec42 =vb3690.childNodes[0]; WG50Engine.EmulateAttributes(v1ec42); var v07593 =document.getElementById("dvTB_" +v1ec42.gridId +"_" +v1ec42.tblName +"_" +v1ec42.subId).childNodes[0]; var v80c52 =wgGetFirstVisibleRow(v07593); if (v80c52) return v80c52; else v0eb7 =wgGetNextRow(va3420,v0eb7); } } else { if (v0eb7.style.display =="none" ||v0eb7.type =="GroupTotalRow" ||v0eb7.type =="PR" ||v0eb7.type =="CSRecord"  ||!v0eb7.type ||v0eb7.type =="RowSeparator" ||v0eb7.type =="ColHeader") { v0eb7 =wgGetNextRow(va3420,v0eb7); } else { var vbe789 =new SelectedObject(va3420.tblName,va3420.gridId,v0eb7); return vbe789; } } } if (v0eb7 ==null) { if (!v9a32.IsRootTable) { var vc7090 =v9a32.GetElement(WG40.COLHEADER,WG40.HTMLDIV,v76858).parentElement; if (vc7090) { if (vc7090.nextSibling) { vc7090 =vc7090.nextSibling.nextSibling; WG50Engine.EmulateAttributes(vc7090); var vd6a40 =document.getElementById("dvTB_" +vc7090.gridId +"_" +vc7090.tblName +"_" +vc7090.subId).childNodes[0]; return wgGetFirstVisibleRow(vd6a40); } } var v8e519 =v9a32.GetParentRow(v76858); if (v8e519) { var vcfc12 =WG50Engine.GetTable(v8e519); v8e519 =wgGetNextSiblingRow(vcfc12,v8e519); if (!v8e519) return null; v8e519 =wgGetPreviousRow(vcfc12,v8e519.element); return wgGetNextVisibleRow(vcfc12,v8e519); } } } return null;}var WGEventEngine = { ProcessMouseEvents: function(v87712,v75e4,vdc024) { var v6f860; if (!v87712) return; if (v87712.tagName !="TD" &&v87712.tagName !="TH") { v6f860 =v87712; v87712 =WG50Engine.GetTDorTH(v87712); } if (!v87712) return; if (v87712.tagName =="TD" ||v87712.tagName =="TH") { var vfa120 =v87712.parentElement; var v5f046; WG50Engine.EmulateAttributes(v87712); WG50Engine.EmulateAttributes(vfa120); if (!v87712.type) return; else if (v87712.type =="SubCell") { v87712 =WG50Engine.GetTD(v87712.parentElement);  if (v87712) vfa120 =v87712.parentElement; } if (!v87712.type) return; if (wgIsValidClickableCell(v87712)||wgIsValidRow(vfa120)) { if (v87712.type =="RowSelector") v75e4 =true; var v06b8 =WG50Engine.GetTable(vfa120); var v55025 =ISGetObject(v06b8.gridId); if (!v55025 ||!v55025.Enabled) return; var v53075 =v55025.Tables[v06b8.tblName]; var v12c38 =v53075.Get("CellClickAction"); var vd4c70 =v53075.GetSelRowStyle(); var v66f59 =v53075.GetFocusCellStyle(); var v28d20 =v55025.ResolveImagePathEx(v55025.LayoutSettings.ImageSettings.CurrentRowImage); var v88655 =false; if (!vdc024) if (!ISEvent.Raise(v55025.LayoutSettings.ClientSideEvents.OnCellClick,v55025.Id,v53075.Id,vfa120.rowIndex,v87712.cellIndex,v87712,vfa120.position)) return; if (event !=null &&v53075.Get("AllowMultipleSelection")=="Yes" &&ISEvent.IsRightButton(event)) {  var vf0b17 =v53075.GetCheckedRows();  for (var v59266=0; v59266<vf0b17.length; v59266++) { if (wgIsSameRow(vf0b17[v59266],vfa120)) return; } }  if (v12c38 =="RowSelect" ||v12c38 =="CellSelect" ||wgIsValidRow(vfa120)) { var va4f89 =v53075.Get("AllowEdit")=="Yes"; if (v55025.LastSelObj &&(v55025.ActiveEditCell ||v55025.LastEditObj)) { v5f046 =v55025.LastSelObj.element; if (v5f046.tagName =="TD") v5f046 =v5f046.parentElement; if (!wgIsSameRow(v5f046,vfa120)||v75e4) { var v6c822 =v55025.ExitEdit(1)[0]; if (!v6c822) return; } else { if (((va4f89 ||(vfa120.type =="NewRow"))||vfa120.type =="FilterRow")&&!v75e4 &&vfa120.type !="GroupHeader") { if (v6f860) { if (v6f860.rowChecker) WGUIEngine.RowCheckerClicked(v6f860,event.shiftKey); else WGEditEngine.CheckBoxClicked(v6f860,v87712); } WGEventEngine.ButtonClicked(v55025,v53075,v6f860,v87712); v88655 =true; if (v55025.LastEditObj) { var v6c822 =v55025.ExitEditMode(); if (v6c822 &&(v12c38 !="CellSelect" ||vfa120.type =="NewRow" ||vfa120.type =="FilterRow")) { WGEditEngine.HighlightEditCell(v87712); var vfbd64 =v55025.LayoutSettings.EditOnClick; if (vfbd64 ||vfa120.type =="NewRow" ||vfa120.type =="FilterRow") { if (wgIsFilterRow(vfa120)&&v6f860 &&v6f860.tagName =="IMG") return; if (!vdc024 &&event.button !=2) v55025.ActivateEditMode(); if (vfa120.type =="NewRow" ||wgIsFilterRow(vfa120)||vfbd64) return; } else { v87712.setActive(); return; } } else if (v6c822 &&v12c38 =="CellSelect" &&v55025.LayoutSettings.EditOnClick) {  } else return; } else { if (v12c38 !="CellSelect") { WGEditEngine.HighlightEditCell(v87712); if (v55025.LayoutSettings.EditOnClick ||vfa120.type =="NewRow" ||vfa120.type =="FilterRow") { if (wgIsFilterRow(vfa120)&&v6f860 &&v6f860.tagName =="IMG") return; if (!vdc024 &&event.button !=2) v55025.ActivateEditMode(); } return; } } } } } } var v63123 =false; if ((v12c38 =="RowSelect" ||v87712.type =="RowSelector" ||vfa120.type =="GroupHeader" ||vfa120.type =="NewRow" ||vfa120.type =="FilterRow")) { v63123 =true; } if (v63123) { if (v53075.Get("AllowMultipleSelection")=="Yes" &&event !=null &&(wgIsFilterRow(vfa120)||wgIsNewRow(vfa120))&&(event.ctrlKey ||event.shiftKey)) return; if (v87712.type =="RowSelector") { if (!ISEvent.Raise(v55025.LayoutSettings.ClientSideEvents.OnRowSelectorClick,v55025.Id,v53075.Id,vfa120.rowIndex,vfa120,vfa120.position)) return; v75e4 =true; } if (vfa120.type =="NewRow") WGEventEngine.CreateNewCells(v55025,vfa120); WGEventEngine.SelectRow(vfa120,v28d20); if (wgIsColumnSetRow(vfa120)&&v87712.type =="RowSelector" &&v12c38 =="CellSelect") { if (typeof(WGEditEngine)!="undefined") WGEditEngine.ClearEditCell(v87712);  WGEventEngine.HighlightRow(vfa120,vd4c70,v66f59,"Forcedraw",true); } else WGEventEngine.HighlightRow(vfa120,vd4c70,v66f59,"",vdc024); if (((va4f89 &&(vfa120.type =="Record" ||vfa120.type =="CSRecord"))||vfa120.type =="FilterRow")&&!v75e4) { if (v55025.HasFocus()) { WGEditEngine.HighlightEditCell(v87712); if (wgIsFilterRow(vfa120)&&v6f860 &&v6f860.tagName =="IMG") return; if (v55025.LayoutSettings.EditOnClick) v55025.ActivateEditMode(); } else { WGEditEngine.HighlightEditCell(v87712,"Nodraw"); } } else if (wgIsRecordRow(vfa120)&&!va4f89) v55025.ActiveEditCell =null; if (v75e4 &&va4f89) { if (v55025.HasFocus()) v87712.setActive(); } if ((vfa120.type =="GroupHeader" ||!va4f89)&&v55025.ActiveEditCell &&v55025.ActiveEditCell.rowElement.type =="NewRow") { WGEditEngine.SetNewRowInfoText(v55025.ActiveEditCell.rowElement); v55025.ActiveEditCell =null; } else if (vfa120.type =="NewRow") { WGEditEngine.ProcessInitialEdit(vfa120); if (!vdc024) v55025.ActivateEditMode(); } else if (vfa120.type =="FilterRow") { if (event.button ==ISEvent.LEFT) v55025.ActivateEditMode(); } else if (vfa120.type =="GroupHeader" &&v55025.ActiveEditCell) v55025.ActiveEditCell =null; } else if (v12c38 =="CellSelect" &&vfa120.type !="PR") { if (v5f046) { if (!wgIsSameRow(v5f046,vfa120)) WGEventEngine.SelectRow(vfa120,v28d20); } else WGEventEngine.SelectRow(vfa120,v28d20); WGEventEngine.HighlightCell(v87712,vd4c70,v66f59,"",vdc024); if (v55025.LayoutSettings.EditOnClick) v55025.ActivateEditMode(); } } if (v6f860 &&v6f860.type =="checkbox") { WG50Engine.EmulateAttributes(v6f860); if (v6f860.rowChecker) WGUIEngine.RowCheckerClicked(v6f860,event.shiftKey); else { if (typeof (WGEditEngine)!="undefined") { if (typeof (WGEditEngine.CheckBoxClicked)=="function") WGEditEngine.CheckBoxClicked(v6f860,v87712); } } } if (!v88655) WGEventEngine.ButtonClicked(v55025,v53075,v6f860,v87712);   } }, ButtonClicked: function(v10d42,vb2071,v2f362,ve0c57) { if (IS.safari) { if (v2f362 &&v2f362.tagName =="IMG" &&v2f362.parentElement !=null) if (v2f362.parentElement.tagName =="BUTTON") v2f362 =v2f362.parentElement; }  if (v2f362 &&v2f362.tagName =="BUTTON") { WG50Engine.EmulateAttributes(v2f362); if (v2f362.disabled) return; var v32951 =wgGetColNameByCell(ve0c57); var vf7423 =ISEvent.Raise(v10d42.LayoutSettings.ClientSideEvents.OnButtonClick,v10d42.Id,vb2071.Id,v32951,v2f362.keyValue); if (vf7423) { if (IS.moz ||IS.safari) { event.cancelBubble =true; event.returnValue =false; } var ve5458 =vb2071.Columns.GetNamedItem(v32951); if (ve5458.ButtonAutoPostback) { var v07a12 =ve5458.ButtonPostbackMode; if (v07a12 =="OnTheFly") { WG50Engine.ExecuteFlyPostback(v10d42.Name,"ButtonClick",v2f362); } else { var ve9456 =v10d42.Name +"\03" +vb2071.Id +"\03" +v32951 +"\03" +v2f362.keyValue; __doPostBack(v10d42.ServerUniqueID,"ButtonClick:" +ve9456); } } } } }, CreateNewCells: function(v9a556,v80279) { var v72e81; var v88191 =v80279.cells; var v9fc95 =0; for (var v2fb80=0; v2fb80<v88191.length; v2fb80++) { if (v88191[v2fb80].type =="NewRowInfoCell") { v72e81 =v88191[v2fb80]; break; } } if (v72e81) { var ve940 =v9a556.Tables[WG50Engine.GetTableNameByRow(v80279)]; if (ve940.IsUseColumnSet) { WGCSEngine.CreateNewCells(v9a556,ve940,v80279,v72e81); return; }  if (ve940.IsRootTable) v9fc95 =1; v80279.origColSpan =v72e81.colSpan; v80279.infoText =v72e81.innerText; v72e81.colSpan =1; v72e81.innerText =" "; v72e81.type ="Cell"; v80279.oldClassName =v72e81.className; v72e81.className =v9a556.RowClass; for (var v2fb80=0; v2fb80<v80279.origColSpan -1; v2fb80++) { var vf8741 =v80279.insertCell(-1); vf8741.type ="Cell"; vf8741.className =v9a556.RowClass;  if (v9fc95 ==1 &&v2fb80 ==v80279.origColSpan -2) vf8741.type =""; } if (v9a556.FreezePaneActive &&v9a556.FreezeConfig !=null) { var vff654 =new WebGridPartOption(); vff654.AddNewRow =true;  WGUIEngine.ProcessFreezeLayout(v9a556,true,vff654); }  WGEditEngine.InitializeNewRow(v9a556,v80279); } }, RemoveNewCells: function(v62287) { var va8b12; var v69f58 =v62287.cells; var v47033 =WG50Engine.GetTable(v62287); var vec548 =wgGetGridById(v47033.gridId); var v36c43 =vec548.Tables[v47033.tblName]; if (v36c43.IsUseColumnSet) { WGCSEngine.RemoveNewCells(vec548,v36c43,v62287); return; } for (var v07593=0; v07593<v69f58.length; v07593++) { if (v69f58[v07593].type =="Cell") { va8b12 =v69f58[v07593]; break; } } if (va8b12) { var v59841 =0;  if (v36c43.IsRootTable &&vec548.FreezePaneActive) { for (var v07593=0; v07593<v62287.cells.length; v07593++) v62287.cells[v07593].style.display =""; } for (var v07593=0; v07593<v62287.origColSpan -1; v07593++) { v62287.deleteCell(va8b12.cellIndex +1); v59841++; } va8b12.colSpan =v62287.origColSpan; va8b12.innerText =v62287.infoText; va8b12.type ="NewRowInfoCell"; va8b12.style.cssText =""; va8b12.className =v62287.oldClassName; } }, GetContentSpan: function(v93442) { for (var v5d658=0; v5d658<v93442.childNodes.length; v5d658++) { if (v93442.childNodes[v5d658].tagName =="SPAN" &&v93442.childNodes[v5d658].getAttribute("content")=="") return v93442.childNodes[v5d658]; else if (v93442.childNodes[v5d658].childNodes.length>0) { var vc5486 =WGEventEngine.GetContentSpan(v93442.childNodes[v5d658]); if (vc5486) return vc5486; } } return null; }, RedrawSelectedRowBorder: function(v83083,vc0b52,v92e78,vafe91) { var v68b78 =wgGetCellCount(v83083); var v64d96 =WG50Engine.GetTable(v83083); if (!v83083 ||!v64d96) return; var v3cb88 =ISGetObject(v64d96.gridId); var v5c258 =v3cb88.Tables[v64d96.tblName]; var v5989 =v5c258.GetSelRowStyle(); var va3515 =v5c258.GetFocusCellStyle(); var ve0459 =false; var v1bf99; var v22436 =v3cb88.LayoutSettings.RowHighlightType; if (va3515 !="") va3515 =va3515.substring(va3515.indexOf(":")+1); if (wgGetActiveGrid()!=v3cb88.Name) v92e78 =true;  if (vafe91) v92e78 =false; if (v92e78) { v5989 =v3cb88.GetBlurRowStyle(); va3515 ="0px"; } else { if (vc0b52 =="CheckedRow") { v5989 =v5c258.GetCheckedRowStyle(); if (v5989 ==null ||v5989 =="") return; va3515 =""; } }  v83083.selectionMode =vc0b52; if (wgIsColumnSetRow(v83083)||(v5c258.PreviewRowVisible &&v83083.type !="GroupHeader" &&v83083.type !="NewRow")) { WGCSEngine.DrawSelRowBorder(v83083,vc0b52,v92e78); return; } if (v5c258.SelfReferencingSettings.Enabled &&v5c258.SelfReferencingSettings.IsTreeViewSelectionMode  &&v83083.type !="GroupHeader" &&v83083.type !="NewRow") { var vb4266 =v5c258.SelfReferencingSettings.ExpandColumnMember; var v8a388 =wgGetCellByName(v83083,vb4266); var v9da20 =WGEventEngine.GetContentSpan(v8a388); if (vc0b52 =="Clear") v9da20.runtimeStyle.cssText =""; else { if (vc0b52 !="Redraw") v9da20.runtimeStyle.cssText =v5989; v9da20.runtimeStyle.border =va3515; } return; } for (var v52e25=0; v52e25<v83083.cells.length; v52e25++) { var v37041 =v83083.cells[v52e25]; var vc2540 =false; WG50Engine.EmulateAttributes(v37041); if (v37041.type =="Cell" ||v37041.type =="GroupCell" ||v37041.type =="FilterColumn") { if (vc0b52 =="Clear") { if (!IS.ie &&v37041.currentStyle.display =="none") vc2540 =true; v37041.runtimeStyle.cssText ="";  if (vc2540) v37041.style.display ="none"; else if (!IS.ie &&v37041.style.display =="none") v37041.style.display =""; } else { if (vc0b52 !="Redraw") { if (!IS.ie &&v37041.currentStyle.display =="none") vc2540 =true;  v37041.runtimeStyle.cssText =v5989;  if (vc2540) v37041.style.display ="none"; }  if (IS.opera) continue;  if (v22436 =="EntireRow") { if (!ve0459) { ve0459 =true; v37041.runtimeStyle.borderLeft =va3515; v37041.runtimeStyle.borderTop =va3515; v37041.runtimeStyle.borderBottom =va3515; if (v68b78>1 ||v37041.type =="GroupCell") v37041.runtimeStyle.borderRightWidth ="0"; else v37041.runtimeStyle.borderRight =va3515; } else { v1bf99 =v37041; v37041.runtimeStyle.borderTop =va3515; v37041.runtimeStyle.borderBottom =va3515; v37041.runtimeStyle.borderLeftWidth ="0"; v37041.runtimeStyle.borderRightWidth ="0"; } } } } } if (v1bf99 &&v22436 =="EntireRow") { with (v1bf99.runtimeStyle) { borderRight =va3515; borderTop =va3515; borderBottom =va3515; borderLeftWidth ="0"; } } if (vc0b52 =="Clear" &&v83083.isRowChecked &&!v92e78) WGEventEngine.RedrawSelectedRowBorder(v83083,"CheckedRow"); }, HighlightRow: function(vb8b8,v61618,v92634,v44f85,v3f039) { if (!vb8b8) return; if (v44f85 =="Clear" &&vb8b8.tagName =="TD") { WGEventEngine.HighlightCell(vb8b8,v61618,v92634,"Clear"); return; } if (v44f85 =="Clear") { var v9ba22 =WG50Engine.GetTable(vb8b8); if (!v9ba22) return; var v63171 =ISGetObject(v9ba22.gridId); if (!WG50Engine.IsSelectedObjectValid(v63171.LastSelObj)) return; } else { var v9ba22 =WG50Engine.GetTable(vb8b8); var v63171 =ISGetObject(v9ba22.gridId); var v72d74 =false; if (vb8b8.type =="PR") vb8b8 =wgGetPreviousRow(v9ba22,vb8b8); if (v63171.LastSelObj) { var v51474 =v63171.Tables[v9ba22.tblName];  if (event !=null &&v51474.Get("AllowMultipleSelection")=="Yes") { var v77e33 =v63171.LastSelObj.GetRowElement(); if (event.ctrlKey &&!event.shiftKey) { if (!wgIsSameRow(v77e33,vb8b8)) { if (!v77e33.isRowChecked &&v77e33.selectionMode !="Clear") v51474.AddSelectedRow(v77e33); }  if (!vb8b8.isRowChecked) v51474.AddSelectedRow(vb8b8); else { v51474.RemoveSelectedRow(vb8b8); v44f85 ="Clear"; } } else { var v00f94 =v51474.GetCheckedRows();  if (v00f94.length >0 &&!event.ctrlKey) { for (var v7e215=0; v7e215<v00f94.length; v7e215++) { var v50e38 =v00f94[v7e215];  v50e38.isRowChecked =false; WGEventEngine.HighlightRow(v50e38,"","","Clear"); }  v51474.ClearSelectedRows(); }  if (event.shiftKey &&!wgIsSameRow(v77e33,vb8b8)) { if (!wgIsSameRow(v77e33,vb8b8)) { if (!v77e33.isRowChecked &&v77e33.selectionMode !="Clear") v51474.AddSelectedRow(v77e33); }  if (vb8b8.rowIndex >v77e33.rowIndex) { var v19112 =wgGetNextRow(v9ba22,v77e33); while (v19112 !=vb8b8) { if (!v19112.isRowChecked) v51474.AddSelectedRow(v19112,true);  v19112 =wgGetNextRow(v9ba22,v19112); } } else { var v19112 =wgGetPreviousRow(v9ba22,v77e33); while (v19112 !=vb8b8) { if (!v19112.isRowChecked) v51474.AddSelectedRow(v19112,true);  v19112 =wgGetPreviousRow(v9ba22,v19112); } } v51474.AddSelectedRow(vb8b8); v72d74 =true; } } }  if (!wgIsSameRow(v63171.LastSelObj.element,vb8b8)) { if (!v72d74) WGEventEngine.HighlightRow(v63171.LastSelObj.element,"","","Clear"); if (v63171.LastSelObj.element.type =="NewRow") { WGEventEngine.RemoveNewCells(v63171.LastSelObj.element); } } } else { if (v63171.LastSelObj &&wgIsSameRow(v63171.LastSelObj.element,vb8b8)&&v44f85 !="Forcedraw") return; } if (!v3f039) { if (!ISEvent.Raise(v63171.LayoutSettings.ClientSideEvents.OnBeforeRowSelect,v63171.Id,v9ba22.tblName,v63171.LastSelObj)) return; } var vc4c42 =new SelectedObject(v9ba22.tblName,v9ba22.gridId,vb8b8); vc4c42.type ="Row"; vc4c42.rowIndex =vb8b8.rowIndex; v63171.LastSelObj =vc4c42; if (!v3f039) { if (!ISEvent.Raise(v63171.LayoutSettings.ClientSideEvents.OnRowSelect,v63171.Id,v9ba22.tblName,vb8b8.rowIndex,vb8b8,vb8b8.position)) return; }  if (v63171.LayoutSettings.RowChangedAction !="None" &&event !=null &&!wgIsNewRow(vb8b8)&&!wgIsFilterRow(vb8b8)) { var v57928 =v63171.LayoutSettings.RowChangedAction;  if (v57928 =="FullPagePostback") { var v9d890 =vb8b8.keyValue +"\03" +v9ba22.tblName; __doPostBack(v63171.ServerUniqueID,"RowChanged:" +v9d890); } else if (v57928 =="OnTheFlyPostback") { WG50Engine.ExecuteFlyPostback(v63171.Name,"RowChanged",vb8b8); } } } WGEventEngine.RedrawSelectedRowBorder(vb8b8,v44f85); }, HighlightCell: function(vde910,vdea25,vc9c8,v8fd36,v41a27) { if (!vde910.origStyle) vde910.origStyle =vde910.style.cssText; if (vc9c8 !="") vc9c8 =vc9c8.substring(vc9c8.indexOf(":")+1); if (v8fd36 =="Clear" &&vde910.tagName =="TR") { WGEventEngine.HighlightRow(vde910,vdea25,vc9c8,"Clear"); return; } if (v8fd36 =="Clear") { } else { var vc9883 =WG50Engine.GetTable(vde910.parentElement); var v90a7 =ISGetObject(vc9883.gridId); if (v90a7.LastSelObj &&v90a7.LastSelObj.element !=vde910) { WGEventEngine.HighlightCell(v90a7.LastSelObj.element,"","","Clear"); } if (v90a7.LastSelObj &&v90a7.LastSelObj.GetRowElement()!=vde910.parentElement) { var v4fc86 =v90a7.LastSelObj.GetRowElement(); if (v4fc86 &&v4fc86.type =="NewRow") { WGEventEngine.HighlightRow(v4fc86,"","","Clear"); WGEventEngine.RemoveNewCells(v4fc86); } } var vac350 =new SelectedObject(vc9883.tblName,vc9883.gridId,vde910); var v5b161 =v90a7.Tables[vc9883.tblName]; vac350.type ="Cell"; vac350.rowIndex =vde910.parentElement.rowIndex; vac350.cellIndex =wgGetCellPosByName(vde910.parentElement,vde910); v5b161.LastAECIndex =vde910.cellIndex;  if (v5b161.IsUseColumnSet) v5b161.LastCSIndex =[vde910.r,vde910.c,vde910.cs]; v90a7.LastSelObj =vac350; if (!v41a27) if (!ISEvent.Raise(v90a7.LayoutSettings.ClientSideEvents.OnCellSelect,vc9883.gridId,vc9883.tblName,vac350.rowIndex, vac350.cellIndex,vde910)) return; var v7e121 =v5b161.Get("AllowEdit")=="Yes"; if (v7e121) { v90a7.ActiveEditCell =new wgActiveCell(vc9883.gridId,vc9883.tblName,vde910); v90a7.ActiveEditCell.rowElement =vde910.parentElement; } } if (v8fd36 =="Clear") { vde910.runtimeStyle.cssText =""; if (vde910.stripedClass) { vde910.className +=vde910.stripedClass; vde910.stripedClass =""; } } else { with (vde910.runtimeStyle) { cssText =vdea25; borderLeft =borderRight =borderBottom =borderTop =vc9c8; } if (vde910.className.indexOf("DefNoBrdBottom")>=0) { vde910.className =vde910.className.replace(/DefNoBrdBottom/g,""); vde910.stripedClass ="DefNoBrdBottom "; } if (vde910.className.indexOf("DefNoBrdRight")>=0) { vde910.className =vde910.className.replace(/DefNoBrdRight/g,""); vde910.stripedClass +="DefNoBrdRight "; } } }, SelectRow: function(va074,v36223) { if (!va074) return; var v2d585 =WG50Engine.GetTable(va074); if (!v2d585) return; var v7e413 =ISGetObject(v2d585.gridId); if (v7e413.LastSelObj &&v36223 !=null) { obj =v7e413.LastSelObj.element; if (obj.tagName =="TR") WGEventEngine.SelectRow(obj,null); else WGEventEngine.SelectRow(obj.parentElement,null); } if (!v7e413) return; if (wgIsColumnSetRow(va074)) va074 =wgGetColumnSetRow(va074); else if (va074.type =="PR") va074 =wgGetPreviewRowParent(va074); var ve4560 =wgGetRowHeader(va074); if (!ve4560) return; if (v36223) { if (v7e413.CurrentRowImage) { ve4560.innerHTML =""; ve4560.appendChild(v7e413.CurrentRowImage); } else { ve4560.innerHTML ="<img src='" +v36223 +"' align='absmiddle'>"; v7e413.CurrentRowImage =ve4560.children[0]; } } else { if (va074.type =="NewRow") { v36223 =v7e413.ResolveImagePathEx(v7e413.LayoutSettings.ImageSettings.NewRowImage); ve4560.innerHTML ="<img src='" +v36223 +"' align='absmiddle'>"; } else ve4560.innerHTML ="&nbsp;"; } if (IS.moz ||IS.safari) WGMozEngine.WorkaroundFocus(v7e413); va074.markedEdit =false; }, ProcessDoubleClick: function(vdf435) { var v60f60 =event.srcElement; var v4522; if (v60f60.tagName !="TD" &&v60f60.tagName !="TH") v60f60 =WG50Engine.GetTDorTH(v60f60); if (!v60f60 ||(v60f60.tagName !="TD" &&v60f60.tagName !="TH")) return; if (v60f60.tagName =="TD" ||v60f60.tagName =="TH") v4522 =WG50Engine.GetTable(v60f60.parentElement); else if (v60f60.tagName =="TR") v4522 =WG50Engine.GetTable(v60f60); if (!v4522) return; if (v4522.tagName !="TABLE" ||!v4522.gridId) return; if (v4522.tblName !=vdf435) return; var v7e813 =ISGetObject(v4522.gridId); var v3a266 =v7e813.Tables[v4522.tblName]; var v7ca71 =v60f60.parentElement; if (v7e813.EnableSection508Standards) { var v3b658 =WGUIEngine.OnColumnHeaderDblClick();  if (v3b658) return; } if (!ISEvent.Raise(v7e813.LayoutSettings.ClientSideEvents.OnCellDblClick,v4522.gridId,v4522.tblName,v7ca71.rowIndex,v60f60.cellIndex,v60f60,v7ca71.position)) return; if (v7ca71.type =="GroupHeader") { WGUIEngine.ChangeImage(v7e813,wgGetCellByPosition(v7ca71,0).childNodes[0],v7ca71.expanded); WGUIEngine.ToggleGroupRow(null,v7ca71); } else if (wgIsRecordRow(v7ca71)) { if (!v7e813.LayoutSettings.EditOnClick) { if (v3a266.Get("AllowEdit")=="Yes") v7e813.ActivateEditMode(); else { if (typeof (v7ca71.srLevel)!="undefined") wgToggleSelfRefRow(v7ca71); } } } event.cancelBubble =true; event.returnValue =false; }, OnKeyPress: function() { if (IS.moz &&wg_Global.LastKeyDownProcessed) { event.cancelBubble =true; event.returnValue =false; } }, OnKeyUp: function() { }, ProcessKeyboardEvents: function(v3f593) { var ve2770 =(v3f593 ? v3f593 : event); var v56960 =ve2770.srcElement; if (!v56960) v56960 =ve2770._srcElement; var tbl,vf1342; if (v56960.tagName =="TD") { tbl =WG50Engine.GetTable(v56960.parentElement); vf1342 =v56960.parentElement; } else if (v56960.tagName =="TR") { tbl =WG50Engine.GetTable(v56960); vf1342 =v56960; } else if (v56960.tagName =="SPAN" ||v56960.tagName =="NOBR") { v56960 =WG50Engine.GetTD(v56960); vf1342 =v56960.parentElement; tbl =WG50Engine.GetTable(v56960); } if (!tbl) return; if (tbl.tagName !="TABLE" ||!tbl.gridId) return; var v96b83 =ISGetObject(tbl.gridId); var va4f73 =v96b83.Tables[tbl.tblName]; var vbe815 =false; var vc4c72 =false; var v95c75 =false; var v95d41 =true; var v9c978 =false; var vbfb89 =v96b83.LastSelObj; var vb4168 =false; var v3ff12 =null; if (IS.moz) { if (vbfb89) { v56960 =vbfb89.element; tbl =WG50Engine.GetTable(v56960); } } if (tbl !=va4f73.GetElement(WG40.BODY,WG40.HTMLTABLE,vf1342)) { if (!vbfb89) return; v56960 =vbfb89.element; tbl =WG50Engine.GetTable(v56960); } try { if (!ISEvent.Raise(v96b83.LayoutSettings.ClientSideEvents.OnKeyDown,v96b83.Name,tbl.tblName,v56960.parentElement.rowIndex,v56960.cellIndex)) return; } catch (e) { return; } var vcae45 =va4f73.Get("CellClickAction"); if (vcae45 =="None") vc4c72 =true; if (vc4c72) { event.cancelBubble =true; return; } var v2e050 =new SelectedObject(tbl.tblName,tbl.gridId,null); var vc7718 =false; var v0bb62 =false; if (ve2770.keyCode ==187 &&ve2770.ctrlKey) vc7718 =true; if (ve2770.keyCode ==189 &&ve2770.ctrlKey) v0bb62 =true; switch (ve2770.keyCode) { case 35: var vf1342 =vbfb89.element; if (vbfb89.type =="Cell") vf1342 =vf1342.parentElement; if (vcae45 =="RowSelect" ||vf1342.type =="GroupHeader") { try { if (vf1342.type =="NewRow") v2e050 =wgGetLastVisibleRow(va4f73.GetElement(WG40.BODY,WG40.HTMLTABLE)); else v2e050 =wgGetLastVisibleRow(tbl); } catch (e) { } } else { if (vf1342.type !="NewRow") { v2e050.cellIndex =wgGetCellCount(vbfb89.element.parentElement)-1; v2e050.element =wgGetCellByPosition(vbfb89.element.parentElement,v2e050.cellIndex); } } if (v2e050) { var va6043 =v96b83.Tables[v2e050.tblName].Get("CellClickAction"); if (va6043 =="RowSelect" ||vf1342.type =="GroupHeader") v2e050.type ="Row"; else if (va6043 =="CellSelect") v2e050.type ="Cell"; v95c75 =true; vbe815 =true; } if (!ve2770.ctrlKey &&vcae45 !="CellSelect") { if (vf1342.type =="NewRow" ||wgIsFilterRow(vf1342)||(wgIsRecordRow(vf1342)&&va4f73.Get("AllowEdit")=="Yes")) { var vec885 =wgGetLastEditableCell(vf1342); if (vec885) WGEditEngine.HighlightEditCell(vec885); v95c75 =false; } } break; case 36: var vf1342 =vbfb89.element; if (vbfb89.type =="Cell") vf1342 =vf1342.parentElement; if (vcae45 =="RowSelect" ||vf1342.type =="GroupHeader") v2e050 =wgGetFirstVisibleRow(tbl); else { if (vf1342.type !="NewRow") { v2e050.element =wgGetCellByPosition(vbfb89.element.parentElement,0); v2e050.cellIndex =0; } } if (v2e050) { var va6043 =v96b83.Tables[v2e050.tblName].Get("CellClickAction"); if (va6043 =="RowSelect" ||vf1342.type =="GroupHeader") v2e050.type ="Row"; else if (va6043 =="CellSelect") { v2e050.type ="Cell"; } v95c75 =true; vbe815 =true; } if (!ve2770.ctrlKey &&vcae45 !="CellSelect") { if (vf1342.type =="NewRow" ||wgIsFilterRow(vf1342)||(wgIsRecordRow(vf1342)&&va4f73.Get("AllowEdit")=="Yes")) { WGEditEngine.ProcessInitialEdit(vf1342); v95c75 =false; } } break; case 9: if (ve2770.ctrlKey) { while (true) { var v55c64; if (!ve2770.shiftKey) v55c64 =wgGetNextFocusableElement(v96b83,null,v55c64); else v55c64 =wgGetPrevFocusableElement(v96b83,null,v55c64); if (v55c64) { if (v96b83.LastEditObj) v96b83.ExitEditMode(); try { v55c64.focus(); break; } catch (e) { } } else break; } v95c75 =false; vbe815 =true; break; } case 37: if (ve2770.keyCode ==37 ||(ve2770.keyCode ==9 &&ve2770.shiftKey)) { var vf1342 =vbfb89.element; if (vcae45 =="RowSelect" ||vf1342.type =="GroupHeader" ||vf1342.type =="NewRow" ||wgIsFilterRow(vf1342)) { if (vbfb89.type =="Cell") vf1342 =vf1342.parentElement; if (vf1342.type =="GroupHeader" &&vf1342.expanded =="True") { WGUIEngine.ChangeImage(v96b83,wgGetCellByPosition(vf1342,0).childNodes[0],vf1342.expanded); WGUIEngine.ToggleGroupRow(null,vf1342); } else if (typeof (vf1342.srLevel)!="undefined" &&!va4f73.Get("AllowEdit")=="Yes") { if (vcae45 !="CellSelect") { var v8257 =WGUIEngine.GetSelfRefImage(va4f73,vf1342); WGUIEngine.ChangeImage(v96b83,v8257,vf1342.srExpanded); WGUIEngine.ToggleSelfRefRow(v8257); } } else if (vf1342.type =="NewRow" ||wgIsFilterRow(vf1342)||(wgIsRecordRow(vf1342)&&va4f73.Get("AllowEdit")=="Yes")) { if (!wgActiveCellValid(v96b83,vf1342)) { WGEditEngine.ProcessInitialEdit(vf1342); } else { var v17c63 =wgGetPrevEditableCell(v96b83.ActiveEditCell.element,vf1342); if (v17c63) { if (!v17c63.rowChanged) { WGEditEngine.HighlightEditCell(v17c63.element); if (wgIsColumnSetRow(vf1342)) v17c63.element.setActive(); } if (v17c63.rowChanged) { vf1342 =v17c63.rowElement; v2e050.type ="Row"; v2e050.element =vf1342; v95c75 =true; if (v17c63.element) { vb4168 =true; v3ff12 =v17c63.element; } } if (wgIsColumnSetRow(vf1342)) v95d41 =false; } } } } else if (vcae45 =="CellSelect") { if (vbfb89.cellIndex -1>=0) { v2e050 =new SelectedObject(vbfb89.tblName,vbfb89.gridId,null); v2e050.cellIndex =vbfb89.cellIndex -1; v2e050.rowIndex =vbfb89.rowIndex; v2e050.type ="Cell"; v2e050.element =wgGetCellByPosition(vbfb89.element.parentElement,v2e050.cellIndex); v95c75 =true; } } vbe815 =true; break; } case 9: if (ve2770.shiftKey) break; case 39: var vf1342 =vbfb89.element; if (vcae45 =="RowSelect" ||vbfb89.element.type =="GroupHeader" ||vf1342.type =="NewRow" ||wgIsFilterRow(vf1342)) { if (vbfb89.type =="Cell") vf1342 =vf1342.parentElement; if (vf1342.type =="GroupHeader") { if (vf1342.expanded =="False") { WGUIEngine.ChangeImage(v96b83,wgGetCellByPosition(vf1342,0).childNodes[0],vf1342.expanded); WGUIEngine.ToggleGroupRow(null,vf1342); } else { if (ve2770.keyCode ==9) { var vf2391 =wgGetNextVisibleRow(tbl,vf1342); var v02135 =wgGetFirstEditableCell(vf2391.element);  if (vf2391 &&vf2391.element) { vf1342 =vf2391.element; v2e050.type ="Row"; v2e050.element =vf1342; v95c75 =true;  if (v02135 >-1) { v02135 =vf1342.cells[v02135]; vb4168 =true; v3ff12 =v02135; } } } } } else if (typeof (vf1342.srLevel)!="undefined" &&!va4f73.Get("AllowEdit")=="Yes") { if (vcae45 !="CellSelect") { var v8257 =WGUIEngine.GetSelfRefImage(va4f73,vf1342); WGUIEngine.ChangeImage(v96b83,v8257,vf1342.srExpanded); WGUIEngine.ToggleSelfRefRow(v8257); } } else if (vf1342.type =="NewRow" ||wgIsFilterRow(vf1342)||(wgIsRecordRow(vf1342)&&va4f73.Get("AllowEdit")=="Yes")) { if (!wgActiveCellValid(v96b83,vf1342)) { WGEditEngine.ProcessInitialEdit(vf1342); } else { var v02135 =wgGetNextEditableCell(v96b83.ActiveEditCell.element,vf1342); if (v02135) { if (!v02135.rowChanged) { if (v96b83.LayoutSettings.FocusNewRowOnLastCell &&va4f73.Get("AllowAddNew")=="Yes" &&v02135.element ==v96b83.ActiveEditCell.element  &&parseFloat(vf1342.position)==v96b83.TotalLoadedRows -1) { va4f73.GotoNewRow(vf1342); } else { WGEditEngine.HighlightEditCell(v02135.element); if (wgIsFilterRow(vf1342)) WGEventEngine.EnsureCellVisible(v96b83,v02135.element); if (wgIsColumnSetRow(vf1342)) v02135.element.setActive(); } } if (v02135.rowChanged) { vf1342 =v02135.rowElement; v2e050.type ="Row"; v2e050.element =vf1342; v95c75 =true; if (v02135.element) { vb4168 =true; v3ff12 =v02135.element; } } if (wgIsColumnSetRow(vf1342)) v95d41 =false; } } } } else if (vcae45 =="CellSelect") { var vbfb23 =(vbfb89.element.tagName =="TR" ? vbfb89.element : vbfb89.element.parentElement); if (!v96b83.LastEditObj) { if (vbfb89.cellIndex +1<wgGetCellCount(vbfb23)) { v2e050 =new SelectedObject(vbfb89.tblName,vbfb89.gridId,null); v2e050.cellIndex =vbfb89.cellIndex +1; v2e050.rowIndex =vbfb89.rowIndex; v2e050.type ="Cell"; v2e050.element =wgGetCellByPosition(vbfb23,v2e050.cellIndex); v95c75 =true; } } else { var v8b986 =vbfb89.GetRowElement(); if (wgIsRecordRow(v8b986)&&va4f73.Get("AllowEdit")=="Yes") { var v02135 =wgGetNextEditableCell(v96b83.ActiveEditCell.element,v8b986); if (v02135) { v2e050 =new SelectedObject(vbfb89.tblName,vbfb89.gridId,null); v2e050.cellIndex =v02135.element.cellIndex; v2e050.rowIndex =v8b986.rowIndex; v2e050.type ="Cell"; v2e050.element =v02135.element; } v95c75 =true; } } } vbe815 =true; break; case 38: var v9c024; var vf1342 =vbfb89.element; if (vbfb89.type =="Cell") vf1342 =vf1342.parentElement; if (ve2770.ctrlKey) { v2e050 =wgGetPrevSiblingRow(tbl,vf1342); if (!v2e050) v2e050 =wgGetPrevVisibleRow(tbl,vf1342); } else v2e050 =wgGetPrevVisibleRow(tbl,vf1342); if (va4f73.Get("AllowEdit")=="Yes" &&!wgActiveCellValid(v96b83,vf1342)) { if (!wgIsColumnSetRow(vf1342)) WGEditEngine.ProcessInitialEdit(vf1342); else v95d41 =false; } else { if (wgIsColumnSetRow(vf1342)&&(va4f73.Get("AllowEdit")=="Yes" ||wgIsFilterRow(vf1342))) { var v56960 =v96b83.ActiveEditCell.element; var v6f327 =wgGetCSPrevEditableRow(tbl,v56960,v56960.cs,v56960.c,true); if (v6f327 &&v6f327.element &&v6f327.element.type !="GroupHeader" &&v6f327.element.type !="NewRow") { if (v6f327 &&va4f73.Id ==v6f327.tblName) { if (wgIsSameRow(v6f327.rowElement,vf1342)) { v9c978 =true; vb4168 =true; v95d41 =false; v3ff12 =v6f327.element; v2e050 =new SelectedObject(vbfb89.tblName,vbfb89.gridId,null); v2e050.type ="Row"; v2e050.element =v6f327.rowElement; } else { v95d41 =false; v2e050 =new SelectedObject(vbfb89.tblName,vbfb89.gridId,null); v2e050.type ="Row"; v2e050.element =v6f327.rowElement; if (v6f327.element) { vb4168 =true; v3ff12 =v6f327.element; } } } } else { if (!event.ctrlKey) v2e050 =wgGetPrevVisibleRow(tbl,v56960.parentElement); } } } if (v2e050) { var va6043 =v96b83.Tables[v2e050.tblName].Get("CellClickAction"); if (va6043 =="RowSelect" ||v2e050.element.type =="GroupHeader" ||v2e050.element.type =="NewRow" ||v2e050.element.type =="FilterRow") v2e050.type ="Row"; else if (va6043 =="CellSelect") { v2e050.type ="Cell"; if (vbfb89.tblName ==v2e050.tblName) { v2e050.cellIndex =vbfb89.cellIndex; v2e050.element =wgGetCellByPosition(v2e050.element,v2e050.cellIndex); } else { if (v96b83.Tables[v2e050.tblName].LastAECIndex !=-1) { v2e050.cellIndex =v96b83.Tables[v2e050.tblName].LastAECIndex; v2e050.element =wgGetValidActiveCell(v2e050.element.cells[v2e050.cellIndex]); } else v2e050.element =wgGetCellByPosition(v2e050.element,v2e050.cellIndex); } } v95c75 =true; vbe815 =true; } break; case 40: var v9c024; var vf1342 =vbfb89.element; if (vbfb89.type =="Cell") vf1342 =vf1342.parentElement; if (vbfb89.tblName !=tbl.tblName) tbl =WG50Engine.GetTable(vf1342); if (ve2770.ctrlKey) { v2e050 =wgGetNextSiblingRow(tbl,vf1342); if (!v2e050) v2e050 =wgGetNextVisibleRow(tbl,vf1342); } else v2e050 =wgGetNextVisibleRow(tbl,vf1342); if (va4f73.Get("AllowEdit")=="Yes" &&!wgActiveCellValid(v96b83,vf1342)) { if (!wgIsColumnSetRow(vf1342)) WGEditEngine.ProcessInitialEdit(vf1342); else v95d41 =false; } else { if (wgIsColumnSetRow(vf1342)&&(va4f73.Get("AllowEdit")=="Yes" ||wgIsFilterRow(vf1342))) { var v56960 =v96b83.ActiveEditCell.element; var v6f327 =wgGetCSNextEditableRow(tbl,v56960,v56960.cs,v56960.c,true); if (v6f327 &&v6f327.element &&v6f327.element.type !="GroupHeader" &&v6f327.element.type !="NewRow") { if (v6f327 &&va4f73.Id ==v6f327.tblName) { if (wgIsSameRow(v6f327.rowElement,vf1342)) { v9c978 =true; vb4168 =true; v95d41 =false; v3ff12 =v6f327.element; v2e050 =new SelectedObject(vbfb89.tblName,vbfb89.gridId,null); v2e050.type ="Row"; v2e050.element =v6f327.rowElement; } else { v95d41 =false; v2e050 =new SelectedObject(vbfb89.tblName,vbfb89.gridId,null); v2e050.type ="Row"; v2e050.element =v6f327.rowElement; if (v6f327.element) { vb4168 =true; v3ff12 =v6f327.element; } } } } else { if (!event.ctrlKey) v2e050 =wgGetNextVisibleRow(tbl,v56960.parentElement); } } } if (v2e050) { var va6043 =v96b83.Tables[v2e050.tblName].Get("CellClickAction"); if (va6043 =="RowSelect" ||v2e050.element.type =="GroupHeader" ||v2e050.element.type =="NewRow") v2e050.type ="Row"; else if (va6043 =="CellSelect") { v2e050.type ="Cell"; if (vbfb89.tblName ==v2e050.tblName) { v2e050.cellIndex =vbfb89.cellIndex; v2e050.element =wgGetCellByPosition(v2e050.element,v2e050.cellIndex); } else { if (v96b83.Tables[v2e050.tblName].LastAECIndex !=-1) { v2e050.cellIndex =v96b83.Tables[v2e050.tblName].LastAECIndex; v2e050.element =wgGetValidActiveCell(v2e050.element.cells[v2e050.cellIndex]); } else { v2e050.element =wgGetCellByPosition(v2e050.element,v2e050.cellIndex); } } } v95c75 =true; vbe815 =true; } break; case 46: var vf1342 =vbfb89.element; if (vbfb89.type =="Cell") vf1342 =vf1342.parentElement; if (va4f73.Get("AllowDelete")=="Yes" &&wgIsRecordRow(vf1342)) { var v53a17 =true; if (v96b83.LayoutSettings.PromptBeforeDelete) v53a17 =confirm(v96b83.GetString("MessageBoxText/DeleteRow")); if (v53a17) { WGEditEngine.PrepareDeleteRowInfo(v96b83,vf1342); vbe815 =true; } else { event.cancelBubble =true; } } break; case 107: if (vcae45 =="RowSelect") { var v8b986 =vbfb89.element; if (vbfb89.type =="Cell") v8b986 =v8b986.parentElement; if (wgIsRecordRow(v8b986)) { var v67039; v8b986 =wgGetRootRow(v8b986); for (var v43874=0; v43874<v8b986.cells.length; v43874++) { if (v8b986.cells[v43874].type =="CellExpander") { v67039 =v8b986.cells[v43874]; break; } } if (v67039 &&(v8b986.childExpanded =="True")) { WGHierEngine.ChangeImage(v96b83,v67039,"True"); WGHierEngine.ToggleRow(null,v8b986); } } } vbe815 =true; break; case 109: if (vcae45 =="RowSelect") { var v8b986 =vbfb89.element; if (vbfb89.type =="Cell") v8b986 =v8b986.parentElement; if (wgIsRecordRow(v8b986)) { var v67039; for (var v43874=0; v43874<v8b986.cells.length; v43874++) { if (v8b986.cells[v43874].type =="CellExpander") { v67039 =v8b986.cells[v43874]; break; } } if (v67039 &&(v8b986.childExpanded =="False" ||!v8b986.childExpanded)) { WGHierEngine.ChangeImage(v96b83,v67039,"False"); WGHierEngine.ToggleRow(null,v8b986); } } } vbe815 =true; break; case 27: if (va4f73.Get("AllowAddNew")=="Yes" ||va4f73.Get("AllowEdit")=="Yes" ||wgIsFilterRow(vf1342)) { var v18994 =v96b83.ExitEdit(-1)[0]; if (v18994) v96b83.IsInEditMode =false; } break; case 82: if (ve2770.ctrlKey) { v96b83.Refresh(); ve2770.keyCode =0; vbe815 =true; break; } case 76: if (ve2770.ctrlKey) { wgLoadMore(v96b83.Name); ve2770.keyCode =0; vbe815 =true; break; } case 69: if (ve2770.ctrlKey) { if (typeof (WGMenuEngine.ShowExportMenu)=="function" &&v96b83.LayoutSettings.AllowExport =="Yes") { wgExport(v96b83.Name); } ve2770.keyCode =0; vbe815 =true; break; } case 115: if (ve2770.keyCode ==115) { if (wgIsFilterRow(vf1342)) { WGUIEngine.OnFilterKeyDown(v96b83.ActiveEditCell.element.childNodes[0]); ve2770.keyCode =0; vbe815 =true; } else if (v96b83.ActiveEditCell) { var v8c042 =va4f73.Columns.GetNamedItem(wgGetColNameByCell(v96b83.ActiveEditCell.element)); if (v8c042 &&v8c042.EditType =="Custom") { var va3868 =v96b83.CustomEditors[v8c042.CustomEditorName]; if (va3868.ImplementationObject) va3868.ImplementationObject.OnDropdown(); ve2770.keyCode =0; vbe815 =true; } } } default: if (ve2770.keyCode>=48 &&ve2770.keyCode<=57 ||ve2770.keyCode>=54 &&ve2770.keyCode<=90 ||ve2770.keyCode>=96 &&ve2770.keyCode<=111 ||ve2770.keyCode>=186 &&ve2770.keyCode<=192 ||ve2770.keyCode>=219 &&ve2770.keyCode<=222 ||ve2770.keyCode ==113 ||ve2770.keyCode ==13 ||ve2770.keyCode ==32 ||ve2770.keyCode ==229) { if (!ve2770.ctrlKey) { var vf1342 =vbfb89.element; if (vbfb89.type =="Cell") vf1342 =vf1342.parentElement; if ((va4f73.Get("AllowAddNew")=="Yes" &&vf1342.type =="NewRow")||(va4f73.Get("AllowEdit")=="Yes" &&wgIsRecordRow(vf1342)) ||wgIsFilterRow(vf1342)) { if (ve2770.shiftKey &&ve2770.keyCode ==13) { v96b83.ExitEdit(0,false); vbe815 =true; } else { var v1a56 =WGEditEngine.ActivateEditMode(v96b83,true); if (ve2770.keyCode ==13) vbe815 =true; else if (v1a56) { WGEditEngine.MarkEdit(v96b83); ve2770.cancelBubble =true; } } } else { var v66428 =va4f73.GetRowCheckerColumn(); if (v66428 &&wgIsRecordRow(vf1342)) { WGUIEngine.SetRowCheck(vf1342); vbe815 =true; } } } else { if (ve2770.keyCode ==84) { if (va4f73.Get("AllowFilter")=="Yes" &&va4f73.IsFilterRowVisible()) { v2e050 =new SelectedObject(vbfb89.tblName,vbfb89.gridId,va4f73.GetFilterRow()); v2e050.type ="Row"; v95c75 =true; } vbe815 =true; } else if (ve2770.keyCode ==32) { var v66428 =va4f73.GetRowCheckerColumn(); if (v66428) { WGUIEngine.SetRowCheck(vf1342); vbe815 =true; } } } } } if (vc7718) { var vf1342 =vbfb89.element; if (vcae45 =="RowSelect" ||vbfb89.element.type =="GroupHeader" ||vf1342.type =="NewRow") { if (vbfb89.type =="Cell") vf1342 =vf1342.parentElement; if (vf1342.type =="GroupHeader" &&vf1342.expanded =="False") { WGUIEngine.ChangeImage(v96b83,wgGetCellByPosition(vf1342,0).childNodes[0],vf1342.expanded); WGUIEngine.ToggleGroupRow(null,vf1342); } else if (vf1342.type =="Record") { var v67039; for (var v43874=0; v43874<vf1342.cells.length; v43874++) { if (vf1342.cells[v43874].type =="CellExpander") { v67039 =vf1342.cells[v43874]; break; } } if (v67039 &&(vf1342.childExpanded =="False" ||!vf1342.childExpanded)) { WGHierEngine.ChangeImage(v96b83,v67039,"False"); WGHierEngine.ToggleRow(null,vf1342); } } } } else if (v0bb62) { var vf1342 =vbfb89.element; if (vcae45 =="RowSelect" ||vf1342.type =="GroupHeader" ||vf1342.type =="NewRow") { if (vbfb89.type =="Cell") vf1342 =vf1342.parentElement; if (vf1342.type =="GroupHeader" &&vf1342.expanded =="True") { WGUIEngine.ChangeImage(v96b83,wgGetCellByPosition(vf1342,0).childNodes[0],vf1342.expanded); WGUIEngine.ToggleGroupRow(null,vf1342); } else if (vf1342.type =="Record") { var v67039; for (var v43874=0; v43874<vf1342.cells.length; v43874++) { if (vf1342.cells[v43874].type =="CellExpander") { v67039 =vf1342.cells[v43874]; break; } } if (v67039 &&(vf1342.childExpanded =="True")) { WGHierEngine.ChangeImage(v96b83,v67039,"True"); WGHierEngine.ToggleRow(null,vf1342); } } } } if (v95c75) { var v8aa65 =ISGetObject(v2e050.gridId); var v6e382 =v8aa65.Tables[v2e050.tblName]; var v88272 =v6e382.GetSelRowStyle(); var ve8621 =v6e382.GetFocusCellStyle(); var v8257 =v8aa65.ResolveImagePathEx(v8aa65.LayoutSettings.ImageSettings.CurrentRowImage); if (v96b83.ActiveEditCell ||v96b83.LastEditObj) { if (!wgIsSameRow(vbfb89.GetRowElement(),v2e050.GetRowElement())) { var v18994 =v96b83.ExitEdit(2)[0]; if (!v18994) return; } } if (v2e050.type =="Row") { if (v2e050.element.type =="NewRow") WGEventEngine.CreateNewCells(v8aa65,v2e050.element); if (!v9c978) { WGEventEngine.SelectRow(v2e050.element,v8257); WGEventEngine.HighlightRow(v2e050.element,v88272,ve8621); } if (v95d41) { var v62535 =wgGetCellByPosition(v2e050.element,0); v62535.setActive(); if (v2e050.element.type =="NewRow" ||wgIsFilterRow(v2e050.element) ||(v2e050.element.type =="Record" &&v6e382.Get("AllowEdit")=="Yes")) wgSetLastAEC(v2e050.element); else { WGEventEngine.EnsureCellVisible(v96b83,v62535); v8aa65.ActiveEditCell =null; } } else { if (vb4168) { if (v3ff12.cellIndex ==-1) { if (v2e050.element.type =="NewRow") v3ff12 =wgGetCSFirstEditableCell(v2e050.element); } WGEventEngine.EnsureCellVisible(v96b83,v3ff12); v3ff12.setActive(); } } if (vb4168) { WGEditEngine.HighlightEditCell(v3ff12); } } else if (v2e050.type =="Cell") { if (!wgIsSameRow(vbfb89.GetRowElement(),v2e050.GetRowElement())) { WGEventEngine.SelectRow(v2e050.element.parentElement,v8257); } WGEventEngine.HighlightCell(v2e050.element,v88272,ve8621); v2e050.element.setActive(); WGEventEngine.EnsureCellVisible(v8aa65,v2e050.element); } } if (vbe815) { event.cancelBubble =true; event.returnValue =false; } wg_Global.LastKeyDownProcessed =vbe815; }, EnsureCellVisible: function(v3d337,va5d23) { var v05613 =v3d337.GetRootTable().GetElement(WG40.BODY,WG40.HTMLDIV); var vcb757 =v05613.scrollLeft; var v56a90 =v05613.scrollTop; var vec976 =va5d23.parentElement; var v42150 =WG50Engine.GetTableNameByRow(vec976); var v59228 =v3d337.Tables[v42150]; var v48360 =true; var vca462 =0; var v6459 =false; if (vec976.type =="NewRow" ||vec976.type =="FilterRow") { if (v3d337.Tables[v42150].IsRootTable) { if (v05613.childNodes[0].rows.length ==0) v05613 =WG50Engine.GetTable(vec976).parentElement; } }  if (v59228.IsRootTable &&v3d337.FreezePaneActive) { v48360 =false;  if (v3d337.CacheFrozenWidth ==0) v3d337.CacheFrozenWidth =WGUIEngine.GetFrozenColumnsTotalWidth(v3d337);  vca462 =v3d337.CacheFrozenWidth; } var ve5169 =ISPosLib.getClientLeft(va5d23)+va5d23.offsetWidth +v05613.scrollLeft; var vbf528 =v05613.offsetWidth +v05613.scrollLeft +ISPosLib.getClientLeft(v05613); var v67742 =posLib2.getLeftAbs(v3d337.FrameObj,v3d337); if (vbf528<ve5169) { if (v48360) v05613.scrollLeft +=ve5169 -vbf528 +20; else { var v2ce39 =0;  if (v3d337.FreezeConfig !=null) v2ce39 =v3d337.FreezeConfig[0].length;  WGUIEngine.ScrollFreezePaneAbsolute(v3d337,va5d23); v6459 =true; } } if (v67742 ==0) v67742 =ISPosLib.getClientLeft(v05613); var v0338 =ISPosLib.getClientLeft(va5d23)-v67742; if (v0338 <0 &&v48360) v05613.scrollLeft +=v0338 -20;  if (!v48360 &&v3d337.FreezeConfig !=null) { if (v3d337.FreezeConfig[0].length >0) { var v06d54 =wgGetColNameByCell(va5d23); var v06c99 =v59228.Columns.GetNamedItem(v06d54);  if (v06c99.HiddenFromView) { if (v06c99.Position ==v3d337.GetLastFrozenColumn().Position +1) WGUIEngine.SetFreezeScrollBarPosition(v3d337,0,false,false,true); else WGUIEngine.ScrollFreezePaneToDirection(v3d337,"Left");  v6459 =true; } } }  if (!v6459) { var v39393 =ISPosLib.getClientTop(va5d23); var vc2387 =v39393 +va5d23.offsetHeight +17; var v16e36 =ISPosLib.getClientTop(v05613); var v88f58 =v16e36 +v05613.offsetHeight; if (v39393<v16e36 &&v05613.contains(va5d23)) v05613.scrollTop -=v16e36 -v39393; if (vc2387>v88f58) v05613.scrollTop +=vc2387 -v88f58; if (IS.moz &&(vcb757 !=v05613.scrollLeft ||v56a90 !=v05613.scrollTop)) WG50Engine.OnTableScroll(v3d337); } } };function WebGridEventDestructor(){ delete WGEventEngine; window.detachEvent("onunload",WebGridEventDestructor); IS.RegisterUnloadVariables("WGEventEngine");}window.attachEvent("onunload",WebGridEventDestructor);if (typeof(Sys)!="undefined") Sys.Application.notifyScriptLoaded();