//
//	Copyright?2005. FarPoint Technologies.	All rights reserved.
//
var the_fpSpread = new Fpoint_FPSpread();
function FpSpread_EventHandlers(){
var e0=the_fpSpread;
this.TranslateKey=function (event){
e0.TranslateKey(event);
}
this.SetActiveSpread=function (event){
e0.SetActiveSpread(event);
}
this.MouseDown=function (event){
e0.MouseDown(event);
}
this.MouseUp=function (event){
e0.MouseUp(event);
}
this.MouseMove=function (event){
e0.MouseMove(event);
}
this.DblClick=function (event){
e0.DblClick(event);
}
this.HandleFirstKey=function (event){
e0.HandleFirstKey(event);
}
this.DoPropertyChange=function (event){
e0.DoPropertyChange(event);
}
this.CmdbarMouseOver=function (event){
e0.CmdbarMouseOver(event);
}
this.CmdbarMouseOut=function (event){
e0.CmdbarMouseOut(event);
}
this.ScrollViewport=function (event){
e0.ScrollViewport(event);
}
e0.AttachEvent(document,"keydown",this.TranslateKey,true);
e0.AttachEvent(document,"mousedown",this.SetActiveSpread,false);
e0.AttachEvent(document,"keyup",this.HandleFirstKey,true);
e0.AttachEvent(window,"resize",e0.DoResize,false);
this.AttachEvents=function (ss){
e0.AttachEvent(ss,"mousedown",this.MouseDown,false);
e0.AttachEvent(ss,"mouseup",this.MouseUp,false);
e0.AttachEvent(document,"mouseup",this.MouseUp,false);
e0.AttachEvent(ss,"mousemove",this.MouseMove,false);
e0.AttachEvent(ss,"dblclick",this.DblClick,false);
var e1=e0.GetViewport(ss);
if (e1!=null){
e0.AttachEvent(e0.GetViewport(ss).parentNode,"DOMAttrModified",this.DoPropertyChange,true);
e0.AttachEvent(e0.GetViewport(ss).parentNode,"scroll",this.ScrollViewport);
}
var e2=e0.GetCommandBar(ss);
if (e2!=null){
e0.AttachEvent(e2,"mouseover",this.CmdbarMouseOver,false);
e0.AttachEvent(e2,"mouseout",this.CmdbarMouseOut,false);
}
}
this.DetachEvents=function (ss){
e0.DetachEvent(ss,"mousedown",this.MouseDown,false);
e0.DetachEvent(ss,"mouseup",this.MouseUp,false);
e0.DetachEvent(document,"mouseup",this.MouseUp,false);
e0.DetachEvent(ss,"mousemove",this.MouseMove,false);
e0.DetachEvent(ss,"dblclick",this.DblClick,false);
var e1=e0.GetViewport(ss);
if (e1!=null){
e0.DetachEvent(e0.GetViewport(ss).parentNode,"DOMAttrModified",this.DoPropertyChange,true);
e0.DetachEvent(e0.GetViewport(ss).parentNode,"scroll",this.ScrollViewport);
}
var e2=e0.GetCommandBar(ss);
if (e2!=null){
e0.DetachEvent(e2,"mouseover",this.CmdbarMouseOver,false);
e0.DetachEvent(e2,"mouseout",this.CmdbarMouseOut,false);
}
}
}
function Fpoint_FPSpread(){
this.a3=false;
this.a4=false;
this.a5=null;
this.a6=null;
this.a7=null;
this.a8=-1;
this.a9=null;
this.b0=null;
this.b1=null;
this.b2=null;
this.b3=-1;
this.b4=-1;
this.b5=null;
this.b6=null;
this.b7=new Array();
this.error=false;
this.InitFields=function (ss){
if (this.b0==null)
this.b0=new this.Margin();
ss.c5=null;
ss.groupBar=null;
ss.c6=null;
ss.c7=null;
ss.c8=null;
ss.c9=null;
ss.d0=null;
ss.d1=null;
ss.d2=null;
ss.d3=null;
ss.d4="";
ss.d5=null;
ss.d9=false;
ss.slideLeft=0;
ss.slideRight=0;
ss.setAttribute("rowCount",0);
ss.setAttribute("colCount",0);
ss.d6=new Array();
ss.d7=new Array();
ss.d8=new Array();
this.activePager=null;
this.dragSlideBar=false;
ss.allowColMove=(ss.getAttribute("colMove")=="true");
ss.allowGroup=(ss.getAttribute("allowGroup")=="true");
}
this.RegisterSpread=function (ss){
var e3=this.GetTopSpread(ss);
if (e3!=ss)return ;
if (this.spreads==null){
this.spreads=new Array();
}
var e4=this.spreads.length;
for (var e5=0;e5<e4;e5++){
if (this.spreads[e5]==ss)return ;
}
this.spreads.length=e4+1;
this.spreads[e4]=ss;
}
this.Init=function (ss){
if (ss==null)alert("spread is not defined!");
ss.initialized=false;
this.a9=null;
this.b7=new Array();
this.RegisterSpread(ss);
this.InitFields(ss);
this.InitMethods(ss);
ss.b8=document.getElementById(ss.id+"_XMLDATA");
if (ss.b8==null){
ss.b8=document.createElement('XML');
ss.b8.id=ss.id+"_XMLDATA";
ss.b8.style.display="none";
document.body.insertBefore(ss.b8,null);
}
var e6=document.getElementById(ss.id+"_data");
if (e6!=null&&e6.getAttribute("data")!=null){
ss.b8.innerHTML=e6.getAttribute("data");
e6.value="";
}
this.SaveData(ss);
ss.b9=document.getElementById(ss.id+"_viewport");
if (ss.b9!=null){
ss.c0=ss.b9.parentNode;
}
ss.c1=document.getElementById(ss.id+"_corner");
if (ss.c1!=null&&ss.c1.childNodes.length>0){
ss.c1=ss.c1.getElementsByTagName("TABLE")[0];
}
ss.c2=document.getElementById(ss.id+"_rowHeader");
if (ss.c2!=null)ss.c2=ss.c2.getElementsByTagName("TABLE")[0];
ss.c3=document.getElementById(ss.id+"_colHeader");
if (ss.c3!=null)ss.c3=ss.c3.getElementsByTagName("TABLE")[0];
var c4=ss.c4=document.getElementById(ss.id+"_commandBar");
var e7=this.GetViewport(ss);
if (e7!=null){
ss.setAttribute("rowCount",e7.rows.length);
if (e7.rows.length==1)ss.setAttribute("rowCount",0);
ss.setAttribute("colCount",e7.getAttribute("cols"));
}
var d6=ss.d6;
var d8=ss.d8;
var d7=ss.d7;
this.InitSpan(ss,this.GetViewport(ss),d6);
this.InitSpan(ss,this.GetColHeader(ss),d8);
this.InitSpan(ss,this.GetRowHeader(ss),d7);
ss.style.overflow="hidden";
if (this.GetParentSpread(ss)==null){
this.LoadScrollbarState(ss);
var e8=this.GetData(ss);
var e9=e8.getElementsByTagName("root")[0];
var f0=e9.getElementsByTagName("activespread")[0];
if (f0!=null&&f0.innerHTML!=""){
this.SetPageActiveSpread(document.getElementById(this.Trim(f0.innerHTML)));
}
}
this.InitLayout(ss);
ss.d9=true;
if (this.GetPageActiveSpread()==ss&&(ss.getAttribute("AllowInsert")=="false"||ss.getAttribute("IsNewRow")=="true")){
var f1=this.GetCmdBtn(ss,"Insert");
this.UpdateCmdBtnState(f1,true);
f1=this.GetCmdBtn(ss,"Add");
this.UpdateCmdBtnState(f1,true);
}
this.CreateTextbox(ss);
this.CreateFocusBorder(ss);
this.InitSelection(ss);
ss.initialized=true;
if (this.GetPageActiveSpread()==ss)
{
try {
this.Focus(ss);
}catch (e){}
}
this.SaveData(ss);
if (this.handlers==null)
this.handlers=new FpSpread_EventHandlers();
this.handlers.DetachEvents(ss);
this.handlers.AttachEvents(ss);
if (c4!=null&&ss.style.position==""){
c4.parentNode.style.backgroundColor=c4.style.backgroundColor;
c4.parentNode.style.borderTop=c4.style.borderTop;
}
}
this.Dispose=function (ss){
if (this.handlers==null)
this.handlers=new FpSpread_EventHandlers();
this.handlers.DetachEvents(ss);
}
this.CmdbarMouseOver=function (event){
var f2=this.GetTarget(event);
if (f2!=null&&f2.tagName=="IMG"&&f2.getAttribute("disabled")!="true"){
f2.style.backgroundColor="cyan";
}
}
this.CmdbarMouseOut=function (event){
var f2=this.GetTarget(event);
if (f2!=null&&f2.tagName=="IMG"){
f2.style.backgroundColor="";
}
}
this.DoPropertyChange=function (event){
if (event.attrName=="curpos"){
this.ScrollViewport(event);
}else if (this.b1==null&&this.b2==null&&event.attrName=="pageincrement"&&event.ctrlKey){
var f3=this.GetSpread(this.GetTarget(event));
if (f3!=null)
this.SizeAll(this.GetTopSpread(f3));
}
}
this.HandleFirstKey=function (){
var f3=this.GetPageActiveSpread();
if (f3==null)return ;
var e3=this.GetTopSpread(f3);
var f4=document.getElementById(e3.id+"_textBox");
if (f4!=null&&f4.value!=""){
f4.value="";
}
}
this.IsXHTML=function (f3){
var e3=this.GetTopSpread(f3);
var f5=e3.getAttribute("strictMode");
return (f5!=null&&f5=="true");
}
this.GetData=function (f3){
return f3.b8;
}
this.AttachEvent=function (target,event,handler,useCapture){
if (target.addEventListener!=null){
target.addEventListener(event,handler,useCapture);
}else if (target.attachEvent!=null){
target.attachEvent("on"+event,handler);
}
}
this.DetachEvent=function (target,event,handler,useCapture){
if (target.removeEventListener!=null){
target.removeEventListener(event,handler,useCapture);
}else if (target.detachEvent!=null){
target.detachEvent("on"+event,handler);
}
}
this.CancelDefault=function (e){
if (e.preventDefault!=null){
e.preventDefault();
e.stopPropagation();
}else {
e.cancelBubble=false;
e.returnValue=false;
}
return false;
}
this.CreateEvent=function (name){
var f6=document.createEvent("Events")
f6.initEvent(name,true,true);
return f6;
}
this.Refresh=function (f3){
var f2=f3.style.display;
f3.style.display="none";
f3.style.display=f2;
}
this.InitMethods=function (f3){
var e0=this;
f3.Update=function (){e0.Update(this);}
f3.Cancel=function (){e0.Cancel(this);}
f3.Clear=function (){e0.Clear(this);}
f3.Copy=function (){e0.Copy(this);}
f3.Paste=function (){e0.Paste(this);}
f3.Prev=function (){e0.Prev(this);}
f3.Next=function (){e0.Next(this);}
f3.Add=function (){e0.Add(this);}
f3.Insert=function (){e0.Insert(this);}
f3.Delete=function (){e0.Delete(this);}
f3.Print=function (){e0.Print(this);}
f3.StartEdit=function (cell){e0.StartEdit(this,cell);}
f3.EndEdit=function (){e0.EndEdit(this);}
f3.ClearSelection=function (){e0.ClearSelection(this);}
f3.GetSelectedRange=function (){return e0.GetSelectedRange(this);}
f3.SetSelectedRange=function (r,c,rc,cc){e0.SetSelectedRange(this,r,c,rc,cc);}
f3.GetSelectedRanges=function (){return e0.GetSelectedRanges(this);}
f3.AddSelection=function (r,c,rc,cc){e0.AddSelection(this,r,c,rc,cc);}
f3.AddSpan=function (r,c,rc,cc,spans){e0.AddSpan(this,r,c,rc,cc,spans);}
f3.RemoveSpan=function (r,c,spans){e0.RemoveSpan(this,r,c,spans);}
f3.GetActiveRow=function (){var f2=e0.GetRowFromCell(this,this.c8);if (f2<0)return f2;return e0.GetSheetIndex(this,f2);}
f3.GetActiveCol=function (){return e0.GetColFromCell(this,this.c8);}
f3.SetActiveCell=function (r,c){e0.SetActiveCell(this,r,c);}
f3.GetCellByRowCol=function (r,c){return e0.GetCellByRowCol(this,r,c);}
f3.GetValue=function (r,c){return e0.GetValue(this,r,c);}
f3.SetValue=function (r,c,v,noEvent,recalc){e0.SetValue(this,r,c,v,noEvent,recalc);}
f3.GetFormula=function (r,c){return e0.GetFormula(this,r,c);}
f3.SetFormula=function (r,c,f,recalc,clientOnly){e0.SetFormula(this,r,c,f,recalc,clientOnly);}
f3.GetHiddenValue=function (r,colName){return e0.GetHiddenValue(this,r,colName);}
f3.GetSheetRowIndex=function (r){return e0.GetSheetRowIndex(this,r);}
f3.GetSheetColIndex=function (c){return e0.GetSheetColIndex(this,c);}
f3.GetRowCount=function (){return e0.GetRowCount(this);}
f3.GetColCount=function (){return e0.GetColCount(this);}
f3.GetTotalRowCount=function (){return e0.GetTotalRowCount(this);}
f3.GetPageCount=function (){return e0.GetPageCount(this);}
f3.GetParentSpread=function (){return e0.GetParentSpread(this);}
f3.GetChildSpread=function (r,ri){return e0.GetChildSpread(this,r,ri);}
f3.GetChildSpreads=function (){return e0.GetChildSpreads(this);}
f3.GetParentRowIndex=function (){return e0.GetParentRowIndex(this);}
f3.GetSpread=function (f2){return e0.GetSpread(f2);}
f3.UpdatePostbackData=function (){e0.UpdatePostbackData(this);}
f3.SizeToFit=function (c){e0.SizeToFit(this,c);}
f3.SetColWidth=function (c,w){e0.SetColWidth(this,c,w);}
f3.GetPreferredRowHeight=function (r){return e0.GetPreferredRowHeight(this,r);}
f3.SetRowHeight2=function (r,h){e0.SetRowHeight2(this,r,h);}
f3.CallBack=function (cmd,asyncCallBack){e0.SyncData(this.getAttribute("name"),cmd,this,asyncCallBack);}
f3.AddKeyMap=function (keyCode,ctrl,shift,alt,action){e0.AddKeyMap(this,keyCode,ctrl,shift,alt,action);}
f3.MoveToPrevCell=function (){e0.MoveToPrevCell(this);}
f3.MoveToNextCell=function (){e0.MoveToNextCell(this);}
f3.MoveToNextRow=function (){e0.MoveToNextRow(this);}
f3.MoveToPrevRow=function (){e0.MoveToPrevRow(this);}
f3.MoveToFirstColumn=function (){e0.MoveToFirstColumn(this);}
f3.MoveToLastColumn=function (){e0.MoveToLastColumn(this);}
f3.ScrollTo=function (r,c){e0.ScrollTo(this,r,c);}
f3.focus=function (){e0.Focus(this);}
f3.ProcessKeyMap=function (event){
if (this.keyMap!=null){
var e4=this.keyMap.length;
for (var e5=0;e5<e4;e5++){
var f7=this.keyMap[e5];
if (event.keyCode==f7.key&&event.ctrlKey==f7.ctrl&&event.shiftKey==f7.shift&&event.altKey==f7.alt){
eval(f7.action);
return true;
}
}
}
return false;
}
}
this.CreateTextbox=function (f3){
var e3=this.GetTopSpread(f3);
var f4=document.getElementById(e3.id+"_textBox");
if (f4==null)
{
f4=document.createElement('INPUT');
f4.type="text";
f4.setAttribute("autocomplete","off");
f4.style.position="absolute";
f4.style.borderWidth=0;
f4.style.top="-10px";
f4.style.left="-100px";
f4.style.width="0px";
f4.style.height="1px";
if (f3.tabIndex!=null)
f4.tabIndex=f3.tabIndex;
f4.id=f3.id+"_textBox";
f3.insertBefore(f4,f3.firstChild);
}
}
this.CreateLineBorder=function (f3,id){
var f8=document.getElementById(id);
if (f8==null)
{
f8=document.createElement('div');
f8.style.position="absolute";
f8.style.left="-1000px";
f8.style.top="0px";
f8.style.overflow="hidden";
f8.style.border="1px solid black";
if (f3.getAttribute("FocusBorderColor")!=null)
f8.style.borderColor=f3.getAttribute("FocusBorderColor");
if (f3.getAttribute("FocusBorderStyle")!=null)
f8.style.borderStyle=f3.getAttribute("FocusBorderStyle");
f8.id=id;
var f9=this.GetViewport(f3).parentNode;
f9.insertBefore(f8,null);
}
return f8;
}
this.CreateFocusBorder=function (f3){
if (this.GetTopSpread(f3).getAttribute("hierView")=="true")return ;
if (this.GetTopSpread(f3).getAttribute("showFocusRect")=="false")return ;
if (this.GetViewport(f3)==null)return ;
var f8=this.CreateLineBorder(f3,f3.id+"_focusRectT");
f8.style.height=0;
f8=this.CreateLineBorder(f3,f3.id+"_focusRectB");
f8.style.height=0;
f8=this.CreateLineBorder(f3,f3.id+"_focusRectL");
f8.style.width=0;
f8=this.CreateLineBorder(f3,f3.id+"_focusRectR");
f8.style.width=0;
}
this.GetPosIndicator=function (f3){
var g0=f3.posIndicator;
if (g0==null)
g0=this.CreatePosIndicator(f3);
else if (g0.parentNode!=f3)
f3.insertBefore(g0,null);
return g0;
}
this.CreatePosIndicator=function (f3){
var g0=document.createElement("img");
g0.style.position="absolute";
g0.style.top="0px";
g0.style.left="-400px";
g0.style.width="10px";
g0.style.height="10px";
g0.style.zIndex=1000;
g0.id=f3.id+"_posIndicator";
if (f3.getAttribute("clienturl")!=null)
g0.src=f3.getAttribute("clienturl")+"down.gif";
else 
g0.src=f3.getAttribute("clienturlres");
f3.insertBefore(g0,null);
f3.posIndicator=g0;
return g0;
}
this.InitSpan=function (f3,e1,spans){
if (e1!=null){
var g1=0;
if (e1==this.GetViewport(f3))
g1=e1.rows.length;
var g2=e1.rows;
var g3=this.GetColCount(f3);
for (var g4=0;g4<g2.length;g4++){
if (this.IsChildSpreadRow(f3,e1,g4)){
if (e1==this.GetViewport(f3))g1--;
}else {
var g5=g2[g4].cells;
var g6=0;
for (var g7=0;g7<g5.length;g7++){
var g8=g5[g7];
if (g8!=null&&((g8.rowSpan!=null&&g8.rowSpan>1)||(g8.colSpan!=null&&g8.colSpan>1))){
var g9=this.GetRowFromCell(f3,g8);
var h0=g6;
if (h0<g3){
this.AddSpan(f3,g9,h0,g8.rowSpan,g8.colSpan,spans);
}
}
if (g8!=null)g6+=g8.colSpan;
}
}
}
if (e1==this.GetViewport(f3))f3.setAttribute("rowCount",g1);
}
}
this.AddSpan=function (f3,g4,g7,rc,g3,spans){
if (spans==null)spans=f3.d6;
var h1=new this.Range();
this.SetRange(h1,"Cell",g4,g7,rc,g3);
spans.push(h1);
this.PaintFocusRect(f3);
}
this.RemoveSpan=function (f3,g4,g7,spans){
if (spans==null)spans=f3.d6;
for (var e5=0;e5<spans.length;e5++){
var h1=spans[e5];
if (h1.row==g4&&h1.col==g7){
var h2=spans.length-1;
for (var h3=e5;h3<h2;h3++){
spans[h3]=spans[h3+1];
}
spans.length=spans.length-1;
break ;
}
}
this.PaintFocusRect(f3);
}
this.Focus=function (f3){
if (this.a4)return ;
this.SetPageActiveSpread(f3);
if (f3.c8==null&&f3.GetRowCount()>0&&f3.GetColCount()>0){
var h4=this.FireActiveCellChangingEvent(f3,0,0);
if (!h4){
f3.SetActiveCell(0,0);
var f6=this.CreateEvent("ActiveCellChanged");
f6.cmdID=f3.id;
f6.row=f6.Row=0;
f6.col=f6.Col=0;
this.FireEvent(f3,f6);
}
}
var e3=this.GetTopSpread(f3);
var f4=document.getElementById(e3.id+"_textBox");
if (f3.c8!=null){
var h5=this.GetEditor(f3.c8);
if (h5==null){
if (f4!=null){
if (this.b5!=f4){
try {f4.focus();}catch (f6){}
}
}
}else {
if (h5.tagName!="SELECT")h5.focus();
this.SetEditorFocus(h5);
}
}else {
if (f4!=null){
try {f4.focus();}catch (f6){}
}
}
this.EnableButtons(f3);
}
this.GetTotalRowCount=function (f3){
var f2=parseInt(f3.getAttribute("totalRowCount"));
if (isNaN(f2))f2=0;
return f2;
}
this.GetPageCount=function (f3){
var f2=parseInt(f3.getAttribute("pageCount"));
if (isNaN(f2))f2=0;
return f2;
}
this.GetColCount=function (f3){
var f2=parseInt(f3.getAttribute("colCount"));
if (isNaN(f2))f2=0;
return f2;
}
this.GetRowCount=function (f3){
var f2=parseInt(f3.getAttribute("rowCount"));
if (isNaN(f2))f2=0;
return f2;
}
this.GetRowCountInternal=function (f3){
var f2=parseInt(this.GetViewport(f3).rows.length);
if (isNaN(f2))f2=0;
return f2;
}
this.IsChildSpreadRow=function (f3,view,g4){
if (f3==null||view==null)return false;
if (g4>=1&&g4<view.rows.length){
if (view.rows[g4].cells.length>0&&view.rows[g4].cells[0]!=null&&view.rows[g4].cells[0].firstChild!=null){
var f2=view.rows[g4].cells[0].firstChild;
if (f2.nodeName!="#text"&&f2.getAttribute("FpSpread")=="Spread")return true;
}
}
return false;
}
this.GetChildSpread=function (f3,row,rindex){
var h6=this.GetViewport(f3);
if (h6!=null){
var g4=this.GetDisplayIndex(f3,row)+1;
if (typeof(rindex)=="number")g4+=rindex;
if (g4>=1&&g4<h6.rows.length){
if (h6.rows[g4].cells.length>0&&h6.rows[g4].cells[0]!=null&&h6.rows[g4].cells[0].firstChild!=null){
var f2=h6.rows[g4].cells[0].firstChild;
if (f2.nodeName!="#text"&&f2.getAttribute("FpSpread")=="Spread"){
return f2;
}
}
}
}
return null;
}
this.GetChildSpreads=function (f3){
var e5=0;
var h7=new Array();
var h6=this.GetViewport(f3);
if (h6!=null){
for (var g4=1;g4<h6.rows.length;g4++){
if (h6.rows[g4].cells.length>0&&h6.rows[g4].cells[0]!=null&&h6.rows[g4].cells[0].firstChild!=null){
var f2=h6.rows[g4].cells[0].firstChild;
if (f2.nodeName!="#text"&&f2.getAttribute("FpSpread")=="Spread"){
h7.length=e5+1;
h7[e5]=f2;
e5++;
}
}
}
}
return h7;
}
this.GetDisplayIndex=function (f3,row){
if (row<0)return -1;
var e5=0;
var g4=0;
var h6=this.GetViewport(f3);
if (h6!=null){
for (e5=0;e5<h6.rows.length;e5++){
if (this.IsChildSpreadRow(f3,h6,e5))continue ;
if (g4==row)break ;
g4++;
}
}
return e5;
}
this.GetSheetIndex=function (f3,row,b9){
var e5=0
var g4=0;
var h6=b9;
if (h6==null)h6=this.GetViewport(f3);
if (h6!=null){
if (row<0||row>=h6.rows.length)return -1;
for (e5=0;e5<row;e5++){
if (this.IsChildSpreadRow(f3,h6,e5))continue ;
g4++;
}
}
return g4;
}
this.GetParentRowIndex=function (f3){
var h8=this.GetParentSpread(f3);
if (h8==null)return -1;
var h6=this.GetViewport(h8);
if (h6==null)return -1;
var h9=f3.parentNode.parentNode;
var e5=h9.rowIndex-1;
for (;e5>0;e5--){
if (this.IsChildSpreadRow(h8,h6,e5))continue ;
else 
break ;
}
return this.GetSheetIndex(h8,e5,h6);
}
this.CreateTestBox=function (f3){
var i0=document.getElementById(f3.id+"_testBox");
if (i0==null)
{
i0=document.createElement("span");
i0.style.position="absolute";
i0.style.borderWidth=0;
i0.style.top="-500px";
i0.style.left="-100px";
i0.id=f3.id+"_testBox";
f3.insertBefore(i0,f3.firstChild);
}
return i0;
}
this.SizeToFit=function (f3,g7){
if (g7==null||g7<0)g7=0;
var e1=this.GetViewport(f3);
if (e1!=null){
var i0=this.CreateTestBox(f3);
var g2=e1.rows;
var i1=0;
for (var g4=0;g4<g2.length;g4++){
if (!this.IsChildSpreadRow(f3,e1,g4)){
var i2=this.GetCellFromRowCol(f3,g4,g7);
if (i2.colSpan>1)continue ;
var i3=this.GetPreferredCellWidth(f3,i2,i0);
if (i3>i1)i1=i3;
}
}
this.SetColWidth(f3,g7,i1);
}
}
this.GetPreferredCellWidth=function (f3,i2,i0){
if (i0==null)i0=this.CreateTestBox(f3);
var i4=this.GetRender(f3,i2);
if (i4!=null){
i0.style.fontFamily=i4.style.fontFamily;
i0.style.fontSize=i4.style.fontSize;
i0.style.fontWeight=i4.style.fontWeight;
i0.style.fontStyle=i4.style.fontStyle;
}
i0.innerHTML=i2.innerHTML;
var i3=i0.offsetWidth+8;
if (i2.style.paddingLeft!=null&&i2.style.paddingLeft.length>0)
i3+=parseInt(i2.style.paddingLeft);
if (i2.style.paddingRight!=null&&i2.style.paddingRight.length>0)
i3+=parseInt(i2.style.paddingRight);
return i3;
}
this.GetHierBar=function (f3){
if (f3.c5==null)f3.c5=document.getElementById(f3.id+"_hierBar");
return f3.c5;
}
this.GetGroupBar=function (f3){
if (f3.groupBar==null)f3.groupBar=document.getElementById(f3.id+"_groupBar");
return f3.groupBar;
}
this.GetPager1=function (f3){
if (f3.c6==null)f3.c6=document.getElementById(f3.id+"_pager1");
return f3.c6;
}
this.GetPager2=function (f3){
if (f3.c7==null)f3.c7=document.getElementById(f3.id+"_pager2");
return f3.c7;
}
this.SynRowHeight=function (f3,c2,e1,g4,updateParent,header){
if (c2==null||e1==null)return ;
var i5=c2.rows[g4].offsetHeight;
var f9=e1.rows[g4].offsetHeight;
if (i5==f9&&g4>0)return ;
var i6=this.IsXHTML(f3);
if (g4==0&&!i6){
i5+=c2.rows[g4].offsetTop;
f9+=e1.rows[g4].offsetTop;
}
if (i6)e1.rows[g4].style.height="";
var i7=Math.max(i5,f9);
if (c2.rows[g4].style.height=="")c2.rows[g4].style.height=""+i5+"px";
if (e1.rows[g4].style.height=="")e1.rows[g4].style.height=""+f9+"px";
if (this.IsChildSpreadRow(f3,e1,g4)){
c2.rows[g4].style.height=i7;
return ;
}
var i6=this.IsXHTML(f3);
if (i7>0){
if (i6){
if (i7==i5)
e1.rows[g4].style.height=""+(parseInt(e1.rows[g4].style.height)+(i7-f9))+"px";
else 
c2.rows[g4].style.height=""+(parseInt(c2.rows[g4].style.height)+(i7-i5))+"px";
}else {
if (header&&e1.rows.length>=2&&e1.cellSpacing=="0"){
if (g4==0)
if (i7==i5)
e1.rows[g4].style.height=parseInt(e1.rows[g4].style.height)+(i7-f9);
else 
c2.rows[g4].style.height=parseInt(c2.rows[g4].style.height)+(i7-i5);
else 
{
c2.rows[g4].style.height=i7;
e1.rows[g4].style.height=i7;
}
}else {
if (i7==i5)
e1.rows[g4].style.height=parseInt(e1.rows[g4].style.height)+(i7-f9);
else 
c2.rows[g4].style.height=parseInt(c2.rows[g4].style.height)+(i7-i5);
}
}
}
if (updateParent){
var h8=this.GetParentSpread(f3);
if (h8!=null)this.UpdateRowHeight(h8,f3);
}
}
this.SizeAll=function (f3){
var i8=this.GetChildSpreads(f3);
if (i8!=null&&i8.length>0){
for (var e5=0;e5<i8.length;e5++){
this.SizeAll(i8[e5]);
}
}
this.SizeSpread(f3);
if (this.GetParentSpread(f3)!=null)
this.Refresh(f3);
}
this.SizeSpread=function (f3){
var i6=this.IsXHTML(f3);
var b9=this.GetViewport(f3);
if (b9==null)return ;
var c3=this.GetColHeader(f3);
var i9=this.GetColGroup(b9);
var j0=this.GetColGroup(c3);
if (i9!=null&&i9.childNodes.length>0&&j0!=null&&j0.childNodes.length>0){
var j1=-1;
if (this.b1!=null)j1=parseInt(this.b1.getAttribute("index"));
if (this.b1!=null&&j1!=0)
{
i9.childNodes[0].width=(j0.childNodes[0].offsetWidth-i9.childNodes[0].offsetLeft);
}
else 
{
j0.childNodes[0].width=(i9.childNodes[0].offsetLeft+i9.childNodes[0].offsetWidth);
}
}
var c2=this.GetRowHeader(f3);
if (c2!=null){
for (var e5=0;e5<b9.rows.length&&e5<c2.rows.length;e5++){
this.SynRowHeight(f3,c2,b9,e5,false,true);
}
}
var h8=this.GetParentSpread(f3);
if (h8!=null)this.UpdateRowHeight(h8,f3);
var i7=f3.clientHeight;
var j2=this.GetCommandBar(f3);
if (j2!=null)
{
j2.style.width=""+f3.clientWidth+"px";
if (f3.style.position!="absolute"&&f3.style.position!="relative"){
j2.parentNode.style.borderTop="1px solid white";
j2.parentNode.style.backgroundColor=j2.style.backgroundColor;
}
var j3=this.GetElementById(j2,f3.id+"_cmdTable");
if (j3!=null){
if (f3.style.position!="absolute"&&f3.style.position!="relative"&&(j3.style.height==""||parseInt(j3.style.height)<27)){
j3.style.height=""+(j3.offsetHeight+3)+"px";
}
if (!i6&&parseInt(b9.cellSpacing)>0)
j3.parentNode.style.height=""+(j3.offsetHeight+3)+"px";
i7-=Math.max(j3.parentNode.offsetHeight,j3.offsetHeight);
}
if (f3.style.position!="absolute"&&f3.style.position!="relative")
j2.style.position="";
}
var c3=this.GetColHeader(f3);
if (c3!=null)
{
i7-=c3.offsetHeight;
c3.parentNode.style.height=""+(c3.offsetHeight-parseInt(c3.cellSpacing))+"px";
if (i6)
i7+=parseInt(c3.cellSpacing);
}
var c5=this.GetHierBar(f3);
if (c5!=null)
{
i7-=c5.offsetHeight;
}
var j4=this.GetGroupBar(f3);
if (j4!=null){
i7-=j4.offsetHeight;
}
var c6=this.GetPager1(f3);
if (c6!=null)
{
i7-=c6.offsetHeight;
this.InitSlideBar(f3,c6);
}
var j5=(f3.getAttribute("cmdTop")=="true");
var c7=this.GetPager2(f3);
if (c7!=null)
{
c7.style.width=""+(f3.clientWidth-10)+"px";
i7-=Math.max(c7.offsetHeight,28);
this.InitSlideBar(f3,c7);
}
var j6=null;
if (c2!=null)j6=c2.parentNode;
var j7=null;
if (c3!=null)j7=c3.parentNode;
var j8=b9.parentNode;
var c1=this.GetCorner(f3);
if (i6&&j7!=null)
{
j7.style.height=c3.offsetHeight-parseInt(b9.cellSpacing);
if (c1!=null){
c1.parentNode.style.height=j7.style.height;
}
}
if (c1!=null&&!i6)
c1.width=""+(c1.parentNode.offsetWidth+parseInt(b9.cellSpacing))+"px";
if (j8!=null){
if (j6!=null){
j8.style.width=""+Math.max(f3.clientWidth-j6.offsetWidth+parseInt(b9.cellSpacing),1)+"px";
j8.style.height=""+Math.max(i7,1)+"px";
j8.style.width=""+Math.max(f3.clientWidth-j6.offsetWidth+parseInt(b9.cellSpacing),1)+"px";
}else {
j8.style.width=""+Math.max(f3.clientWidth,1)+"px";
j8.style.height=""+Math.max(i7,1)+"px";
j8.style.width=""+Math.max(f3.clientWidth,1)+"px";
}
}
if (j2!=null&&!j5){
if (c7!=null){
if (f3.style.position=="absolute"||f3.style.position=="relative"){
j2.style.position="absolute";
j2.style.top=""+(f3.clientHeight-Math.max(c7.offsetHeight,28)-j2.offsetHeight)+"px";
}else {
j2.style.position="absolute";
j2.style.top=""+(b9.parentNode.offsetTop+b9.parentNode.offsetHeight)+"px";
}
}else {
if (f3.style.position=="absolute"||f3.style.position=="relative"){
j2.style.position="absolute";
j2.style.top=""+(f3.clientHeight-j2.offsetHeight)+"px";
}
}
}
if (c7!=null)
{
if (f3.style.position=="absolute"||f3.style.position=="relative"){
c7.style.position="absolute";
c7.style.top=""+(f3.clientHeight-Math.max(c7.offsetHeight,28))+"px";
}else {
c7.style.position="absolute";
if (j2!=null&&!j5)
c7.style.top=""+(b9.parentNode.offsetTop+b9.parentNode.offsetHeight+j2.offsetHeight)+"px";
else 
c7.style.top=""+(b9.parentNode.offsetTop+b9.parentNode.offsetHeight)+"px";
}
}
if (j6!=null){
j6.style.position="relative";
if (i6)j6.style.height=""+Math.max(j8.offsetHeight,1)+"px";
else j6.style.height=Math.max(j8.offsetHeight,1);
}
if (this.GetParentSpread(f3)==null&&j7!=null){
var i3=0;
if (j6!=null){
i3=Math.max(f3.clientWidth-j6.offsetWidth,1);
}else {
i3=Math.max(f3.clientWidth,1);
}
j7.style.width=i3;
j7.parentNode.style.width=i3;
}
if (i6)
{
if (b9!=null){
b9.style.posTop=-b9.cellSpacing;
var j9=f3.clientWidth;
if (c2!=null)j9-=c2.parentNode.offsetWidth;
b9.parentNode.style.width=""+j9+"px";
}
if (c2!=null){
c2.style.position="relative";
c2.parentNode.style.position="relative";
c2.style.posTop=-b9.cellSpacing;
c2.width=""+(c2.parentNode.offsetWidth)+"px";
}
}else {
if (b9!=null){
var j9=f3.clientWidth;
if (c2!=null){
j9-=c2.parentNode.offsetWidth;
c2.width=""+(c2.parentNode.offsetWidth+parseInt(b9.cellSpacing))+"px";
}
b9.parentNode.style.width=""+j9+"px";
}
}
this.ScrollView(f3);
this.PaintFocusRect(f3);
}
this.InitSlideBar=function (f3,pager){
var k0=this.GetElementById(pager,f3.id+"_slideBar");
if (k0!=null){
var i6=this.IsXHTML(f3);
if (i6)
k0.style.height=Math.max(pager.offsetHeight,28)+"px";
else 
k0.style.height=(pager.offsetHeight-2)+"px";
var f2=pager.getElementsByTagName("TABLE");
if (f2!=null&&f2.length>0){
var k1=f2[0].rows[0];
var h0=k1.cells[0];
var k2=k1.cells[2];
f3.slideLeft=Math.max(107,h0.offsetWidth+1);
if (h0.style.paddingRight!="")f3.slideLeft+=parseInt(h0.style.paddingRight);
f3.slideRight=pager.offsetWidth-k2.offsetWidth-k0.offsetWidth-3;
if (k2.style.paddingRight!="")f3.slideRight-=parseInt(k2.style.paddingLeft);
var k3=parseInt(pager.getAttribute("curPage"));
var k4=parseInt(pager.getAttribute("totalPage"))-1;
if (k4==0)k4=1;
var j9=Math.max(107,f3.slideLeft)+(k3/k4)*(f3.slideRight-f3.slideLeft);
if (pager.id.indexOf("pager1")>=0&&f3.style.position!="absolute"&&f3.style.position!="relative"){
j9+=this.GetOffsetLeft(f3,pager,document);
var k5=(this.GetOffsetTop(f3,h0,pager)+this.GetOffsetTop(f3,pager,document));
k0.style.top=k5+"px";
}
if (j9>f3.slideRight)j9=f3.slideRight;
k0.style.left=j9+"px";
}
}
}
this.InitLayout=function (f3){
this.SizeSpread(f3);
this.SizeSpread(f3);
}
this.GetRowByKey=function (f3,key){
if (key=="-1")
return -1;
var k6=this.GetViewport(f3);
if (k6!=null){
for (var h9=0;h9<k6.rows.length;h9++){
if (k6.rows[h9].getAttribute("FpKey")==key){
return h9;
}
}
}
if (k6!=null)
return 0;
else 
return -1;
}
this.GetColByKey=function (f3,key){
if (key=="-1")
return -1;
var k6=this.GetViewport(f3);
var k7=this.GetColGroup(k6);
if (k7==null||k7.childNodes.length==0)
k7=this.GetColGroup(this.GetColHeader(f3));
if (k7!=null){
for (var g6=0;g6<k7.childNodes.length;g6++){
var f2=k7.childNodes[g6];
if (f2.getAttribute("FpCol")==key){
return g6;
}
}
}
return 0;
}
this.IsRowSelected=function (f3,h9){
var k8=this.GetSelection(f3);
if (k8!=null){
var k9=k8.firstChild;
while (k9!=null){
var g4=parseInt(k9.getAttribute("rowIndex"));
var l0=parseInt(k9.getAttribute("rowcount"));
if (g4<=h9&&h9<g4+l0)
return true;
k9=k9.nextSibling;
}
}
}
this.InitSelection=function (f3){
var g4=0;
var g7=0;
var e8=this.GetData(f3);
var e9=e8.getElementsByTagName("root")[0];
var l1=e9.getElementsByTagName("state")[0];
var k8=l1.getElementsByTagName("selection")[0];
var l2=l1.firstChild;
while (l2!=null&&l2.tagName!="activerow"&&l2.tagName!="ACTIVEROW"){
l2=l2.nextSibling;
}
if (l2!=null)
g4=this.GetRowByKey(f3,l2.innerHTML);
if (g4>=this.GetRowCount(f3))g4=0;
var l3=l1.firstChild;
while (l3!=null&&l3.tagName!="activecolumn"&&l3.tagName!="ACTIVECOLUMN"){
l3=l3.nextSibling;
}
if (l3!=null)
g7=this.GetColByKey(f3,l3.innerHTML);
if (g4<0)g4=0;
if (g4>=0||g7>=0){
var l4=e8;
if (this.GetParentSpread(f3)!=null){
var l5=this.GetTopSpread(f3);
if (l5.initialized)l4=this.GetData(l5);
e9=l4.getElementsByTagName("root")[0];
}
var l6=e9.getElementsByTagName("activechild")[0];
f3.d0=g4;f3.d1=g7;
if ((this.GetParentSpread(f3)==null&&(l6==null||l6.innerHTML==""))||(l6!=null&&f3.id==this.Trim(l6.innerHTML))){
this.UpdateAnchorCell(f3,g4,g7);
}else {
f3.c8=this.GetCellFromRowCol(f3,g4,g7);
}
}
var k9=k8.firstChild;
while (k9!=null){
var g4=this.GetRowByKey(f3,k9.getAttribute("row"));
var g7=this.GetColByKey(f3,k9.getAttribute("col"));
var l0=parseInt(k9.getAttribute("rowcount"));
var g3=parseInt(k9.getAttribute("colcount"));
k9.setAttribute("rowIndex",g4);
k9.setAttribute("colIndex",g7);
this.PaintSelection(f3,g4,g7,l0,g3,true);
k9=k9.nextSibling;
}
this.PaintFocusRect(f3);
}
this.TranslateKey=function (event){
event=this.GetEvent(event);
var l7=this.GetTarget(event);
try {
if (document.readyState!=null&&document.readyState!="complete")return ;
var f3=this.GetPageActiveSpread();
if (f3!=null){
if (event.keyCode==229){
this.CancelDefault(event);
return ;
}
if (!this.IsChild(l7,this.GetTopSpread(f3)))return ;
this.KeyDown(f3,event);
var l8=false;
if (event.keyCode==event.DOM_VK_TAB){
var l9=this.GetProcessTab(f3);
l8=(l9=="true"||l9=="True");
}
if (l8)
this.CancelDefault(event);
}
}catch (f6){}
}
this.KeyAction=function (key,ctrl,shift,alt,action){
this.key=key;
this.ctrl=ctrl;
this.shift=shift;
this.alt=alt;
this.action=action;
}
this.AddKeyMap=function (f3,keyCode,ctrl,shift,alt,action){
if (f3.keyMap==null)f3.keyMap=new Array();
var f7=this.GetKeyAction(f3,keyCode,ctrl,shift,alt);
if (f7!=null){
f7.action=action;
}else {
var e4=f3.keyMap.length;
f3.keyMap.length=e4+1;
f3.keyMap[e4]=new this.KeyAction(keyCode,ctrl,shift,alt,action);
}
}
this.GetKeyAction=function (f3,keyCode,ctrl,shift,alt){
var e4=f3.keyMap.length;
for (var e5=0;e5<e4;e5++){
var f7=f3.keyMap[e5];
if (f7!=null&&f7.key==keyCode&&f7.ctrl==ctrl&&f7.shift==shift&&f7.alt==alt){
return f7;
}
}
return null;
}
this.MoveToPrevCell=function (f3){
var m0=this.EndEdit(f3);
if (!m0)return ;
var g4=f3.GetActiveRow();
var g7=f3.GetActiveCol();
this.MoveLeft(f3,g4,g7);
}
this.MoveToNextCell=function (f3){
var m0=this.EndEdit(f3);
if (!m0)return ;
var g4=f3.GetActiveRow();
var g7=f3.GetActiveCol();
this.MoveRight(f3,g4,g7);
}
this.MoveToNextRow=function (f3){
var m0=this.EndEdit(f3);
if (!m0)return ;
var g4=f3.GetActiveRow();
var g7=f3.GetActiveCol();
this.MoveDown(f3,g4,g7);
}
this.MoveToPrevRow=function (f3){
var m0=this.EndEdit(f3);
if (!m0)return ;
var g4=f3.GetActiveRow();
var g7=f3.GetActiveCol();
if (g4>0)
this.MoveUp(f3,g4,g7);
}
this.MoveToFirstColumn=function (f3){
var m0=this.EndEdit(f3);
if (!m0)return ;
var g4=f3.GetActiveRow();
if (f3.c8.parentNode.rowIndex>=0)
this.UpdateLeadingCell(f3,g4,0);
}
this.MoveToLastColumn=function (f3){
var m0=this.EndEdit(f3);
if (!m0)return ;
var g4=f3.GetActiveRow();
if (f3.c8.parentNode.rowIndex>=0){
g7=this.GetColCount(f3)-1;
this.UpdateLeadingCell(f3,g4,g7);
}
}
this.UpdatePostbackData=function (f3){
this.SaveData(f3);
}
this.PrepareData=function (k9){
var h7="";
if (k9!=null){
if (k9.nodeName=="#text")
h7=k9.nodeValue;
else {
h7=this.GetBeginData(k9);
var f2=k9.firstChild;
while (f2!=null){
var m1=this.PrepareData(f2);
if (m1!="")h7+=m1;
f2=f2.nextSibling;
}
h7+=this.GetEndData(k9);
}
}
return h7;
}
this.GetBeginData=function (k9){
var h7="<"+k9.nodeName.toLowerCase();
if (k9.attributes!=null){
for (var e5=0;e5<k9.attributes.length;e5++){
var m2=k9.attributes[e5];
if (m2.nodeName!=null&&m2.nodeName!=""&&m2.nodeName!="style"&&m2.nodeValue!=null&&m2.nodeValue!="")
h7+=(" "+m2.nodeName+"=\""+m2.nodeValue+"\"");
}
}
h7+=">";
return h7;
}
this.GetEndData=function (k9){
return "</"+k9.nodeName.toLowerCase()+">";
}
this.SaveData=function (f3){
if (f3==null)return ;
try {
var e8=this.GetData(f3);
var e9=e8.getElementsByTagName("root")[0];
var f2=this.PrepareData(e9);
var m3=document.getElementById(f3.id+"_data");
m3.value=encodeURIComponent(f2);
}catch (f6){
alert("e "+f6);
}
}
this.SetActiveSpread=function (event){
try {
event=this.GetEvent(event);
var l7=this.GetTarget(event);
var m4=this.GetSpread(l7,false);
var m5=this.GetPageActiveSpread();
if (this.a4&&(m4==null||m4!=m5)){
if (l7!=this.a5&&this.a5!=null){
if (this.a5.blur!=null)this.a5.blur();
}
var m0=this.EndEdit();
if (!m0)return ;
}
var m6=false;
if (m4==null){
m4=this.GetSpread(l7,true);
m6=(m4!=null);
}
var g8=this.GetCell(l7,true);
if (g8==null&&m5!=null&&m5.d9){
this.SaveData(m5);
m5.d9=false;
}
if (m5!=null&&m5.d9&&(m4!=m5||m4==null||m6)){
this.SaveData(m5);
m5.d9=false;
}
if (m5!=null&&m5.d9&&m4==m5&&l7.tagName=="INPUT"&&(l7.type=="submit"||l7.type=="button"||l7.type=="image")){
this.SaveData(m5);
m5.d9=false;
}
if (m4!=null&&this.GetOperationMode(m4)=="ReadOnly")return ;
var l5=null;
if (m4==null){
if (m5==null)return ;
l5=this.GetTopSpread(m5);
this.SetActiveSpreadID(l5,"",null,false);
this.SetPageActiveSpread(null);
}else {
if (m4!=m5){
if (m5!=null){
l5=this.GetTopSpread(m5);
this.SetActiveSpreadID(l5,"",null,false);
}
if (m6){
l5=this.GetTopSpread(m4);
var m7=this.GetTopSpread(m5);
if (l5!=m7){
this.SetActiveSpreadID(l5,m4.id,m4.id,true);
this.SetPageActiveSpread(m4);
}else {
this.SetActiveSpreadID(l5,m5.id,m5.id,true);
this.SetPageActiveSpread(m5);
}
}else {
l5=this.GetTopSpread(m4);
this.SetPageActiveSpread(m4);
this.SetActiveSpreadID(l5,m4.id,m4.id,false);
}
}
}
}catch (f6){}
}
this.SetActiveSpreadID=function (f3,id,child,m6){
var e8=this.GetData(f3);
var e9=e8.getElementsByTagName("root")[0];
var f0=e9.getElementsByTagName("activespread")[0];
var m8=e9.getElementsByTagName("activechild")[0];
if (f0==null)return ;
if (m6&&m8!=null&&m8.nodeValue!=""){
f0.innerHTML=m8.innerHTML;
}else {
f0.innerHTML=id;
if (child!=null&&m8!=null)m8.innerHTML=child;
}
this.SaveData(f3);
f3.d9=false;
}
this.GetSpread=function (ele,incCmdBar){
var i3=ele;
while (i3!=null&&i3.tagName!="BODY"){
if (typeof(i3.getAttribute)!="function")break ;
var f3=i3.getAttribute("FpSpread");
if (f3==null)f3=i3.FpSpread;
if (f3=="Spread"){
if (!incCmdBar){
var f2=ele;
while (f2!=null&&f2!=i3){
if (f2.id==i3.id+"_commandBar"||f2.id==i3.id+"_pager1"||f2.id==i3.id+"_pager2")return null;
f2=f2.parentNode;
}
}
return i3;
}
i3=i3.parentNode;
}
return null;
}
this.ScrollViewport=function (event){
var f2=this.GetTarget(event);
var f3=this.GetTopSpread(f2);
if (f3!=null)this.ScrollView(f3);
}
this.ScrollTo=function (f3,h9,g6){
var g8=this.GetCellByRowCol(f3,h9,g6);
if (g8==null)return ;
var h6=this.GetViewport(f3).parentNode;
if (h6==null)return ;
h6.scrollTop=g8.offsetTop;
h6.scrollLeft=g8.offsetLeft;
}
this.ScrollView=function (f3){
var m4=this.GetTopSpread(f3);
var c2=this.GetParent(this.GetRowHeader(m4));
var c3=this.GetParent(this.GetColHeader(m4));
var h6=this.GetParent(this.GetViewport(m4));
var m9=false;
if (c2!=null){
m9=(c2.scrollTop!=h6.scrollTop);
c2.scrollTop=h6.scrollTop;
}
if (c3!=null){
if (!m9)m9=(c3.scrollLeft!=h6.scrollLeft);
c3.scrollLeft=h6.scrollLeft;
}
if (this.GetParentSpread(f3)==null)this.SaveScrollbarState(f3,h6.scrollTop,h6.scrollLeft);
if (m9){
var f6=this.CreateEvent("Scroll");
this.FireEvent(f3,f6);
}
if (h6.scrollTop>0&&h6.scrollTop+h6.offsetHeight>=this.GetViewport(m4).offsetHeight){
if (!this.a4&&f3.getAttribute("loadOnDemand")=="true"){
if (f3.LoadState!=null)return ;
f3.LoadState=true;
var l0=this.GetRowCount(f3);
this.SetActiveCell(f3,l0-1,Math.max(f3.d1,0));
this.SaveData(f3);
f3.CallBack("LoadOnDemand",true);
}
}
}
this.SaveScrollbarState=function (f3,scrollTop,scrollLeft){
if (this.GetParentSpread(f3)!=null)return ;
var e8=this.GetData(f3);
var e9=e8.getElementsByTagName("root")[0];
var n0=e9.getElementsByTagName("scrollTop")[0];
var n1=e9.getElementsByTagName("scrollLeft")[0];
if (n0!=null)n0.innerHTML=scrollTop;
if (n1!=null)n1.innerHTML=scrollLeft;
}
this.LoadScrollbarState=function (f3){
if (this.GetParentSpread(f3)!=null)return ;
var e8=this.GetData(f3);
var e9=e8.getElementsByTagName("root")[0];
var n0=e9.getElementsByTagName("scrollTop")[0];
var n1=e9.getElementsByTagName("scrollLeft")[0];
var n2=0;
if (n0!=null&&n0.innerHTML!=""){
n2=parseInt(n0.innerHTML);
}else {
n2=0;
}
var n3=0;
if (n1!=null&&n1.innerHTML!=""){
n3=parseInt(n1.innerHTML);
}else {
n3=0;
}
var h6=this.GetParent(this.GetViewport(f3));
if (h6!=null){
if (!isNaN(n2))h6.scrollTop=n2;
if (!isNaN(n3))h6.scrollLeft=n3;
var c2=this.GetParent(this.GetRowHeader(f3));
var c3=this.GetParent(this.GetColHeader(f3));
if (c2!=null){
c2.scrollTop=h6.scrollTop;
}
if (c3!=null){
c3.scrollLeft=h6.scrollLeft;
}
}
}
this.GetParent=function (f6){
if (f6==null)
return null;
else 
return f6.parentNode;
}
this.GetViewport=function (f3){
return f3.b9;
}
this.GetCommandBar=function (f3){
return f3.c4;
}
this.GetRowHeader=function (f3){
return f3.c2;
}
this.GetColHeader=function (f3){
return f3.c3;
}
this.GetCmdBtn=function (f3,id){
var m4=this.GetTopSpread(f3);
var n4=this.GetCommandBar(m4);
if (n4!=null)
return this.GetElementById(n4,m4.id+"_"+id);
else 
return null;
}
this.Range=function (){
this.type="Cell";
this.row=-1;
this.col=-1;
this.rowCount=0;
this.colCount=0;
}
this.SetRange=function (h1,type,h9,g6,l0,g3){
h1.type=type;
h1.row=h9;
h1.col=g6;
h1.rowCount=l0;
h1.colCount=g3;
if (type=="Row"){
h1.col=h1.colCount=-1;
}else if (type=="Column"){
h1.row=h1.rowCount=-1;
}else if (type=="Table"){
h1.col=h1.colCount=-1;h1.row=h1.rowCount=-1;
}
}
this.Margin=function (left,top,right,bottom){
this.left;
this.top;
this.right;
this.bottom;
}
this.GetRender=function (g8){
var f2=g8;
if (f2.firstChild!=null&&f2.firstChild.tagName!=null&&f2.firstChild.tagName!="BR")
return f2.firstChild;
if (f2.firstChild!=null&&f2.firstChild.value!=null){
f2=f2.firstChild;
}
return f2;
}
this.GetPreferredRowHeight=function (f3,g4){
var i0=this.CreateTestBox(f3);
g4=this.GetDisplayIndex(f3,g4);
var h6=this.GetViewport(f3);
var i1=0;
var n5=h6.rows[g4].offsetHeight;
var e4=h6.rows[g4].cells.length;
for (var e5=0;e5<e4;e5++){
var i2=h6.rows[g4].cells[e5];
var i4=this.GetRender(i2);
if (i4!=null){
i0.style.fontFamily=i4.style.fontFamily;
i0.style.fontSize=i4.style.fontSize;
i0.style.fontWeight=i4.style.fontWeight;
i0.style.fontStyle=i4.style.fontStyle;
}
var g6=this.GetColFromCell(f3,i2);
i0.style.posWidth=this.GetColWidthFromCol(f3,g6);
if (i4!=null&&i4.tagName=="SELECT"){
var f2="";
for (var h3=0;h3<i4.childNodes.length;h3++){
var n6=i4.childNodes[h3];
if (n6.text!=null&&n6.text.length>f2.length)f2=n6.text;
}
i0.innerHTML=f2;
}
else if (i4!=null&&i4.tagName=="INPUT")
i0.innerHTML=i4.value;
else 
{
i0.innerHTML=i2.innerHTML;
}
n5=i0.offsetHeight;
if (n5>i1)i1=n5;
}
return Math.max(0,i1)+3;
}
this.SetRowHeight2=function (f3,g4,height){
if (height<1){
height=1;
}
g4=this.GetDisplayIndex(f3,g4);
var b2=null;
if (this.GetRowHeader(f3)!=null)b2=this.GetRowHeader(f3).rows[g4];
if (b2!=null)b2.style.height=height;
var h6=this.GetViewport(f3);
if (b2!=null){
h6.rows[b2.rowIndex].style.height=b2.style.height;
}else {
if (h6!=null)h6.rows[g4].style.height=height;
b2=h6.rows[g4];
}
var n7=this.AddRowInfo(f3,b2.FpKey);
if (n7!=null){
this.SetRowHeight(f3,n7,b2.style.posHeight);
}
var h8=this.GetParentSpread(f3);
if (h8!=null)h8.UpdateRowHeight(f3);
this.SizeSpread(f3);
}
this.GetRowHeightInternal=function (f3,g4){
var b2=null;
if (this.GetRowHeader(f3)!=null)
b2=this.GetRowHeader(f3).rows[g4];
else if (this.GetViewport(f3)!=null)
b2=this.GetViewport(f3).rows[g4];
if (b2!=null)
return b2.offsetHeight;
else 
return 0;
}
this.GetCell=function (ele,noHeader,event){
var f2=ele;
while (f2!=null){
if (noHeader){
if ((f2.tagName=="TD"||f2.tagName=="TH")&&(f2.parentNode.getAttribute("FpSpread")=="r")){
return f2;
}
}else {
if ((f2.tagName=="TD"||f2.tagName=="TH")&&(f2.parentNode.getAttribute("FpSpread")=="r"||f2.parentNode.getAttribute("FpSpread")=="ch"||f2.parentNode.getAttribute("FpSpread")=="rh")){
return f2;
}
}
f2=f2.parentNode;
}
return null;
}
this.InRowHeader=function (f3,g8){
return (this.IsChild(g8,this.GetRowHeader(f3)));
}
this.InColHeader=function (f3,g8){
return (this.IsChild(g8,this.GetColHeader(f3)));
}
this.IsHeaderCell=function (f3,g8){
return (g8!=null&&(g8.tagName=="TD"||g8.tagName=="TH")&&(g8.parentNode.getAttribute("FpSpread")=="ch"||g8.parentNode.getAttribute("FpSpread")=="rh"));
}
this.GetSizeColumn=function (f3,ele,event){
if (ele.tagName!="TD"||(this.GetColHeader(f3)==null))return null;
var g6=-1;
var f2=ele;
var n3=this.GetViewport(this.GetTopSpread(f3)).parentNode.scrollLeft+window.scrollX;
while (f2!=null&&f2.parentNode!=null&&f2.parentNode!=document.documentElement){
if (f2.parentNode.getAttribute("FpSpread")=="ch"){
var n8=this.GetOffsetLeft(f3,f2);
var n9=n8+f2.offsetWidth;
if (event.clientX+n3<n8+3){
g6=this.GetColFromCell(f3,f2)-1;
}
else if (event.clientX+n3>n9-4){
g6=this.GetColFromCell(f3,f2);
var o0=this.GetSpanCell(f2.parentNode.rowIndex,g6,f3.d8);
if (o0!=null){
g6=o0.col+o0.colCount-1;
}
}else {
g6=this.GetColFromCell(f3,f2);
var o0=this.GetSpanCell(f2.parentNode.rowIndex,g6,f3.d8);
if (o0!=null){
var i3=n8;
g6=-1;
for (var e5=o0.col;e5<o0.col+o0.colCount&&e5<this.GetColCount(f3);e5++){
if (this.IsChild(f2,this.GetColHeader(f3)))
i3+=parseInt(this.GetElementById(this.GetColHeader(f3),f3.id+"col"+e5).width);
if (event.clientX>i3-3&&event.clientX<i3+3){
g6=e5;
break ;
}
}
}else {
g6=-1;
}
}
if (isNaN(g6)||g6<0)return null;
var o1=0;
var o2=this.GetColCount(f3);
var o3=true;
var e1=null;
var g7=g6+1;
while (g7<o2){
var k7=this.GetColGroup(this.GetColHeader(f3));
if (g7<k7.childNodes.length)
o1=parseInt(k7.childNodes[g7].width);
if (o1>1){
o3=false;
break ;
}
g7++;
}
if (o3){
g7=g6+1;
while (g7<o2){
if (this.GetSizable(f3,g7)){
g6=g7;
break ;
}
g7++;
}
}
if (!this.GetSizable(f3,g6))return null;
if (this.IsChild(f2,this.GetColHeader(f3))){
return this.GetElementById(this.GetColHeader(f3),f3.id+"col"+g6);
}
}
f2=f2.parentNode;
}
return null;
}
this.GetColGroup=function (f2){
if (f2==null)return null;
var k7=f2.getElementsByTagName("COLGROUP");
if (k7!=null&&k7.length>0){
if (f2.colgroup!=null)return f2.colgroup;
var m7=new Object();
m7.childNodes=new Array();
for (var e5=0;e5<k7[0].childNodes.length;e5++){
if (k7[0].childNodes[e5]!=null&&k7[0].childNodes[e5].tagName=="COL"){
var e4=m7.childNodes.length;
m7.childNodes.length++;
m7.childNodes[e4]=k7[0].childNodes[e5];
}
}
f2.colgroup=m7;
return m7;
}else {
return null;
}
}
this.GetSizeRow=function (f3,ele,event){
var l0=this.GetRowCount(f3);
if (l0==0)return null;
var g8=this.GetCell(ele);
if (g8==null){
if (ele.getAttribute("FpSpread")=="rowpadding"){
if (event.clientY<3){
var e4=ele.parentNode.rowIndex;
if (e4>1){
var h9=ele.parentNode.parentNode.rows[e4-1];
if (this.GetSizable(f3,h9))
return h9;
}
}
}
var c1=this.GetCorner(f3);
if (c1!=null&&this.IsChild(ele,c1)){
if (event.clientY>ele.offsetHeight-4){
var o4=null;
var e4=0;
o4=this.GetRowHeader(f3);
if (o4!=null){
while (e4<o4.rows.length&&o4.rows[e4].offsetHeight<2&&!this.GetSizable(f3,o4.rows[e4]))
e4++;
if (e4<o4.rows.length&&this.GetSizable(f3,o4.rows[e4])&&o4.rows[e4].offsetHeight<2)
return o4.rows[e4];
}
}else {
}
}
return null;
}
var d7=f3.d7;
var d6=f3.d6;
var f2=g8;
var n2=this.GetViewport(this.GetTopSpread(f3)).parentNode.scrollTop+window.scrollY;
while (f2!=null&&f2!=document.documentElement){
if (f2.getAttribute("FpSpread")=="rh"){
var e4=-1;
var o5=this.GetOffsetTop(f3,f2);
var o6=o5+f2.offsetHeight;
if (event.clientY+n2<o5+3){
if (f2.rowIndex>1)
e4=f2.rowIndex-1;
}
else if (event.clientY+n2>o6-4){
var o0=this.GetSpanCell(this.GetRowFromCell(f3,g8),this.GetColFromCell(f3,g8),d7);
if (o0!=null){
var i7=o5;
for (var e5=o0.row;e5<o0.row+o0.rowCount;e5++){
i7+=parseInt(this.GetRowHeader(f3).rows[e5].style.height);
if (event.clientY>i7-3&&event.clientY<i7+3){
e4=e5;
break ;
}
}
}else {
if (f2.rowIndex>=0)e4=f2.rowIndex;
}
}
else {
break ;
}
var i7=0;
var l0=this.GetRowHeader(f3).rows.length;
var o7=true;
var o4=null;
o4=this.GetRowHeader(f3);
var g4=e4+1;
while (g4<l0){
if (o4.rows[g4].style.height!=null)i7=parseInt(o4.rows[g4].style.height);
else i7=parseInt(o4.rows[g4].offsetHeight);
if (i7>1){
o7=false;
break ;
}
g4++;
}
if (o7){
g4=e4+1;
while (g4<l0){
if (this.GetSizable(f3,this.GetRowHeader(f3).rows[g4])){
e4=g4;
break ;
}
g4++;
}
}
if (e4>=0&&this.GetSizable(f3,o4.rows[e4])){
return o4.rows[e4];
}
else if (event.clientY<3){
while (e4>0&&o4.rows[e4].offsetHeight==0&&!this.GetSizable(f3,o4.rows[e4]))
e4--;
if (e4>=0&&this.GetSizable(f3,o4.rows[e4]))
return o4.rows[e4];
else 
return null;
}
}
f2=f2.parentNode;
}
return null;
}
this.GetElementById=function (h8,id){
if (h8==null)return null;
var f2=h8.firstChild;
while (f2!=null){
if (f2.id==id||(typeof(f2.getAttribute)=="function"&&f2.getAttribute("name")==id))return f2;
var m7=this.GetElementById(f2,id)
if (m7!=null)return m7;
f2=f2.nextSibling;
}
return null;
}
this.GetSizable=function (f3,ele){
if (typeof(ele)=="number"){
var g8=this.GetElementById(this.GetColHeader(f3),f3.id+"col"+ele);
return (g8!=null&&(g8.getAttribute("Sizable")==null||g8.getAttribute("Sizable")=="True"));
}
return (ele!=null&&(ele.getAttribute("Sizable")==null||ele.getAttribute("Sizable")=="True"));
}
this.GetSpanWidth=function (f3,g6,o2){
var i3=0;
var e1=this.GetViewport(f3);
if (e1!=null){
var k7=this.GetColGroup(e1);
if (k7!=null){
for (var e5=g6;e5<g6+o2;e5++){
i3+=parseInt(k7.childNodes[e5].width);
}
}
}
return i3;
}
this.GetCellType=function (g8){
if (g8!=null&&g8.getAttribute("FpCellType")!=null)return g8.getAttribute("FpCellType");
if (g8!=null&&g8.getAttribute("FpRef")!=null){
var f2=document.getElementById(g8.getAttribute("FpRef"));
return f2.getAttribute("FpCellType");
}
if (g8!=null&&g8.getAttribute("FpCellType")!=null)return g8.getAttribute("FpCellType");
return "text";
}
this.GetCellType2=function (g8){
if (g8!=null&&g8.getAttribute("FpRef")!=null){
g8=document.getElementById(g8.getAttribute("FpRef"));
}
var o8=null;
if (g8!=null){
o8=g8.getAttribute("FpCellType");
if (o8=="readonly")o8=g8.getAttribute("CellType");
}
if (o8!=null)return o8;
return "text";
}
this.GetCellEditorID=function (f3,g8){
if (g8!=null&&g8.getAttribute("FpRef")!=null){
var f2=document.getElementById(g8.getAttribute("FpRef"));
return f2.getAttribute("FpEditorID");
}
if (g8.getAttribute("FpEditorID")!=null)
return g8.getAttribute("FpEditorID");
return f3.getAttribute("FpDefaultEditorID");
}
this.EditorMap=function (editorID,a5){
this.id=editorID;
this.a5=a5;
}
this.ValidatorMap=function (validatorID,validator){
this.id=validatorID;
this.validator=validator;
}
this.GetCellEditor=function (f3,editorID,noClone){
var a5=null;
for (var e5=0;e5<this.b7.length;e5++){
var o9=this.b7[e5];
if (o9.id==editorID){
a5=o9.a5;
break ;
}
}
if (a5==null){
a5=document.getElementById(editorID);
this.b7[this.b7.length]=new this.EditorMap(editorID,a5);
}
if (noClone)
return a5;
return a5.cloneNode(true);
}
this.GetCellValidatorID=function (f3,g8){
return null;
}
this.GetCellValidator=function (f3,validatorID){
return null;
}
this.GetTableRow=function (f3,g4){
var e9=this.GetData(f3).getElementsByTagName("root")[0];
var e8=e9.getElementsByTagName("data")[0];
var f2=e8.firstChild;
while (f2!=null){
if (f2.getAttribute("key")==""+g4)return f2;
f2=f2.nextSibling;
}
return null;
}
this.GetTableCell=function (h9,g7){
if (h9==null)return null;
var f2=h9.firstChild;
while (f2!=null){
if (f2.getAttribute("key")==""+g7)return f2;
f2=f2.nextSibling;
}
return null;
}
this.AddTableRow=function (f3,g4){
if (g4==null)return null;
var k9=this.GetTableRow(f3,g4);
if (k9!=null)return k9;
var e9=this.GetData(f3).getElementsByTagName("root")[0];
var e8=e9.getElementsByTagName("data")[0];
if (document.all!=null){
k9=this.GetData(f3).createNode("element","row","");
}else {
k9=document.createElement("row");
k9.style.display="none";
}
k9.setAttribute("key",g4);
e8.appendChild(k9);
return k9;
}
this.AddTableCell=function (h9,g7){
if (h9==null)return null;
var k9=this.GetTableCell(h9,g7);
if (k9!=null)return k9;
if (document.all!=null){
k9=this.GetData(f3).createNode("element","cell","");
}else {
k9=document.createElement("cell");
k9.style.display="none";
}
k9.setAttribute("key",g7);
h9.appendChild(k9);
return k9;
}
this.GetCellValue=function (f3,g8){
if (g8==null)return null;
var g4=this.GetRowKeyFromCell(f3,g8);
var g7=this.GetColKeyFromCell(f3,g8);
var p0=this.AddTableCell(this.AddTableRow(f3,g4),g7);
return p0.innerHTML;
}
this.HTMLEncode=function (s){
var p1=new String(s);
var p2=new RegExp("&","g");
p1=p1.replace(p2,"&amp;");
p2=new RegExp("<","g");
p1=p1.replace(p2,"&lt;");
p2=new RegExp(">","g");
p1=p1.replace(p2,"&gt;");
p2=new RegExp("\"","g");
p1=p1.replace(p2,"&quot;");
return p1;
}
this.HTMLDecode=function (s){
var p1=new String(s);
var p2=new RegExp("&amp;","g");
p1=p1.replace(p2,"&");
p2=new RegExp("&lt;","g");
p1=p1.replace(p2,"<");
p2=new RegExp("&gt;","g");
p1=p1.replace(p2,">");
p2=new RegExp("&quot;","g");
p1=p1.replace(p2,'"');
return p1;
}
this.SetCellValue=function (f3,g8,val,noEvent,recalc){
if (g8==null)return ;
var p3=this.GetCellType(g8);
if (p3=="readonly")return ;
var g4=this.GetRowKeyFromCell(f3,g8);
var g7=this.GetColKeyFromCell(f3,g8);
var p0=this.AddTableCell(this.AddTableRow(f3,g4),g7);
val=this.HTMLEncode(val);
val=this.HTMLEncode(val);
p0.innerHTML=val;
if (!noEvent){
var f6=this.CreateEvent("DataChanged");
f6.cell=g8;
f6.cellValue=val;
f6.row=g4;
f6.col=g7;
this.FireEvent(f3,f6);
}
var f1=this.GetCmdBtn(f3,"Update");
if (f1!=null&&f1.getAttribute("disabled")!=null)
this.UpdateCmdBtnState(f1,false);
f1=this.GetCmdBtn(f3,"Cancel");
if (f1!=null&&f1.getAttribute("disabled")!=null)
this.UpdateCmdBtnState(f1,false);
f3.d9=true;
if (recalc){
this.UpdateValues(f3);
}
}
this.GetSelectedRanges=function (f3){
var k8=this.GetSelection(f3);
var h7=new Array();
var k9=k8.firstChild;
while (k9!=null){
var h1=new this.Range();
this.GetRangeFromNode(f3,k9,h1);
var f2=h7.length;
h7.length=f2+1;
h7[f2]=h1;
k9=k9.nextSibling;
}
return h7;
}
this.GetSelectedRange=function (f3){
var h1=new this.Range();
var k8=this.GetSelection(f3);
var k9=k8.lastChild;
if (k9!=null){
this.GetRangeFromNode(f3,k9,h1);
}
return h1;
}
this.GetRangeFromNode=function (f3,k9,h1){
if (k9==null||f3==null||h1==null)return ;
var g4=this.GetRowByKey(f3,k9.getAttribute("row"));
var g7=this.GetColByKey(f3,k9.getAttribute("col"));
var l0=parseInt(k9.getAttribute("rowcount"));
var g3=parseInt(k9.getAttribute("colcount"));
var h6=this.GetViewport(f3);
if (h6!=null){
var p4=this.GetDisplayIndex(f3,g4);
for (var e5=p4;e5<p4+l0;e5++){
if (this.IsChildSpreadRow(f3,h6,e5))l0--;
}
}
var p5=null;
if (g4<0&&g7<0&&l0!=0&&g3!=0)
p5="Table";
else if (g4<0&&g7>=0&&g3>0)
p5="Column";
else if (g7<0&&g4>=0&&l0>0)
p5="Row";
else 
p5="Cell";
this.SetRange(h1,p5,g4,g7,l0,g3);
}
this.GetSelection=function (f3){
var e8=this.GetData(f3);
var e9=e8.getElementsByTagName("root")[0];
var l1=e9.getElementsByTagName("state")[0];
var p6=l1.getElementsByTagName("selection")[0];
return p6;
}
this.GetRowKeyFromRow=function (f3,g4){
if (g4<0)return null;
var e1=null;
e1=this.GetViewport(f3);
return e1.rows[g4].getAttribute("FpKey");
}
this.GetColKeyFromCol=function (f3,g7){
if (g7<0)return null;
var e1=this.GetViewport(f3);
var k7=this.GetColGroup(e1);
if (k7==null||k7.childNodes.length==0)
k7=this.GetColGroup(this.GetColHeader(f3));
if (k7!=null&&g7>=0&&g7<k7.childNodes.length){
return k7.childNodes[g7].getAttribute("FpCol");
}
return null;
}
this.GetRowKeyFromCell=function (f3,g8){
var g4=g8.parentNode.getAttribute("FpKey");
return g4;
}
this.GetColKeyFromCell=function (f3,g8){
var g6=this.GetColFromCell(f3,g8);
var e1=this.GetViewport(f3);
var k7=this.GetColGroup(e1);
if (k7!=null&&g6>=0&&g6<k7.childNodes.length){
return k7.childNodes[g6].getAttribute("FpCol");
}
return null;
}
this.SetSelection=function (f3,h9,g6,rowcount,colcount,addSelection){
if (!f3.initialized)return ;
var p7=h9;
var p8=g6;
if (h9!=null&&parseInt(h9)>=0){
h9=this.GetRowKeyFromRow(f3,h9);
if (h9!="newRow")
h9=parseInt(h9);
}
if (g6!=null&&parseInt(g6)>=0){
g6=parseInt(this.GetColKeyFromCol(f3,g6));
}
var k9=this.GetSelection(f3);
if (k9==null)return ;
if (addSelection==null)
addSelection=(f3.getAttribute("multiRange")=="true"&&!this.a3);
var p9=k9.lastChild;
if (p9==null||addSelection){
if (document.all!=null){
p9=this.GetData(f3).createNode("element","range","");
}else {
p9=document.createElement('range');
p9.style.display="none";
}
k9.appendChild(p9);
}
p9.setAttribute("row",h9);
p9.setAttribute("col",g6);
p9.setAttribute("rowcount",rowcount);
p9.setAttribute("colcount",colcount);
p9.setAttribute("rowIndex",p7);
p9.setAttribute("colIndex",p8);
f3.d9=true;
this.PaintFocusRect(f3);
var f1=this.GetCmdBtn(f3,"Update");
this.UpdateCmdBtnState(f1,false);
var f6=this.CreateEvent("SelectionChanged");
this.FireEvent(f3,f6);
}
this.CreateSelectionNode=function (f3,h9,g6,rowcount,colcount,p7,p8){
var p9=document.createElement('range');
p9.style.display="none";
p9.setAttribute("row",h9);
p9.setAttribute("col",g6);
p9.setAttribute("rowcount",rowcount);
p9.setAttribute("colcount",colcount);
p9.setAttribute("rowIndex",p7);
p9.setAttribute("colIndex",p8);
return p9;
}
this.AddRowToSelection=function (f3,k9,h9){
var p7=h9;
if (typeof(h9)!="undefined"&&parseInt(h9)>=0){
h9=this.GetRowKeyFromRow(f3,h9);
if (h9!="newRow")
h9=parseInt(h9);
}
if (!this.IsRowSelected(f3,h9))
{
var p9=this.CreateSelectionNode(h9,-1,1,-1,p7,-1);
k9.appendChild(p9);
}
}
this.RemoveSelection=function (f3,h9,g6,rowcount,colcount){
var k9=this.GetSelection(f3);
if (k9==null)return ;
var p9=k9.firstChild;
while (p9!=null){
var g4=parseInt(p9.getAttribute("rowIndex"));
var l0=parseInt(p9.getAttribute("rowcount"));
if (g4<=h9&&h9<g4+l0){
k9.removeChild(p9);
for (var e5=g4;e5<g4+l0;e5++){
if (e5!=h9){
this.AddRowToSelection(f3,k9,e5);
}
}
break ;
}
p9=p9.nextSibling;
}
f3.d9=true;
var f1=this.GetCmdBtn(f3,"Update");
this.UpdateCmdBtnState(f1,false);
var f6=this.CreateEvent("SelectionChanged");
this.FireEvent(f3,f6);
}
this.GetColInfo=function (f3,g7){
var e8=this.GetData(f3);
var e9=e8.getElementsByTagName("root")[0];
var l1=e9.getElementsByTagName("state")[0];
var g6=l1.getElementsByTagName("colinfo")[0];
var f2=g6.firstChild;
while (f2!=null){
if (f2.getAttribute("key")==""+g7)return f2;
f2=f2.nextSibling;
}
return null;
}
this.GetColWidthFromCol=function (f3,g7){
var k7=this.GetColGroup(this.GetViewport(f3));
return parseInt(k7.childNodes[g7].width);
}
this.GetColWidth=function (colInfo){
if (colInfo==null)return null;
var k9=colInfo.getElementsByTagName("width")[0];
if (k9!=null)return k9.innerHTML;
return 0;
}
this.AddColInfo=function (f3,g7){
var k9=this.GetColInfo(f3,g7);
if (k9!=null)return k9;
var e8=this.GetData(f3);
var e9=e8.getElementsByTagName("root")[0];
var l1=e9.getElementsByTagName("state")[0];
var g6=l1.getElementsByTagName("colinfo")[0];
if (document.all!=null){
k9=this.GetData(f3).createNode("element","col","");
}else {
k9=document.createElement('col');
k9.style.display="none";
}
k9.setAttribute("key",g7);
g6.appendChild(k9);
return k9;
}
this.SetColWidth=function (f3,g6,width){
if (g6==null)return ;
g6=parseInt(g6);
var i6=this.IsXHTML(f3);
var q0=null;
if (this.GetViewport(f3)!=null){
var k7=this.GetColGroup(this.GetViewport(f3));
if (k7==null||k7.childNodes.length==0){
k7=this.GetColGroup(this.GetColHeader(f3));
}
q0=this.AddColInfo(f3,k7.childNodes[g6].getAttribute("FpCol"));
if (this.GetViewport(f3).cellSpacing=="0"&&this.GetColCount(f3)>1&&this.GetViewport(f3).rules!="rows"){
if (g6==0)width-=1;
}
if (width==0)width=1;
if (k7!=null)
k7.childNodes[g6].width=width;
this.SetWidthFix(this.GetViewport(f3),g6,width);
}
if (this.GetColHeader(f3)!=null){
if (this.GetViewport(f3)!=null){
if (this.GetViewport(f3).cellSpacing=="0"&&this.GetColCount(f3)>1&&this.GetViewport(f3).rules!="rows"){
if (i6){
if (g6==this.colCount-1)width-=1;
}
}
}
if (width<=0)width=1;
document.getElementById(f3.id+"col"+g6).width=width;
this.SetWidthFix(this.GetColHeader(f3),g6,width);
if (this.GetViewport(f3)!=null){
if (this.GetViewport(f3).cellSpacing=="0"&&this.GetColCount(f3)>1&&this.GetViewport(f3).rules!="rows"){
if (g6==this.GetColCount(f3)-1)width+=1;
}
}
}
var e3=this.GetTopSpread(f3);
this.SizeAll(e3);
this.Refresh(e3);
if (q0!=null){
var k9=q0.getElementsByTagName("width");
if (k9!=null&&k9.length>0)
k9[0].innerHTML=width;
else {
if (document.all!=null){
k9=this.GetData(f3).createNode("element","width","");
}else {
k9=document.createElement('width');
k9.style.display="none";
}
q0.appendChild(k9);
k9.innerHTML=width;
}
}
var f1=this.GetCmdBtn(f3,"Update");
if (f1!=null)this.UpdateCmdBtnState(f1,false);
f3.d9=true;
}
this.SetWidthFix=function (e1,g6,width){
if (e1==null||e1.rows.length==0)return ;
var e5=0;
var q1=0;
var i2=e1.rows[0].cells[0];
var q2=i2.colSpan;
if (q2==null)q2=1;
while (g6>q1+q2){
e5++;
q1=q1+q2;
i2=e1.rows[0].cells[e5];
q2=i2.colSpan;
if (q2==null)q2=1;
}
i2.width=width;
}
this.GetRowInfo=function (f3,g4){
var e8=this.GetData(f3);
var e9=e8.getElementsByTagName("root")[0];
var l1=e9.getElementsByTagName("state")[0];
var h9=l1.getElementsByTagName("rowinfo")[0];
var f2=h9.firstChild;
while (f2!=null){
if (f2.getAttribute("key")==""+g4)return f2;
f2=f2.nextSibling;
}
return null;
}
this.GetRowHeight=function (n7){
if (n7==null)return null;
var q3=n7.getElementsByTagName("height");
if (q3!=null&&q3.length>0)return q3[0].innerHTML;
return 0;
}
this.AddRowInfo=function (f3,g4){
var k9=this.GetRowInfo(f3,g4);
if (k9!=null)return k9;
var e8=this.GetData(f3);
var e9=e8.getElementsByTagName("root")[0];
var l1=e9.getElementsByTagName("state")[0];
var h9=l1.getElementsByTagName("rowinfo")[0];
if (document.all!=null){
k9=this.GetData(f3).createNode("element","row","");
}else {
k9=document.createElement('row');
k9.style.display="none";
}
k9.setAttribute("key",g4);
h9.appendChild(k9);
return k9;
}
this.GetTopSpread=function (f6)
{
if (f6==null)return null;
var h7=this.GetSpread(f6);
if (h7==null)return null;
var f2=h7.parentNode;
while (f2!=null&&f2.tagName!="BODY")
{
if (f2.getAttribute("FpSpread")=="Spread"){
if (f2.getAttribute("hierView")=="true")
h7=f2;
else 
break ;
}
f2=f2.parentNode;
}
return h7;
}
this.GetParentSpread=function (f3)
{
try {
var f2=f3.parentNode;
while (f2!=null&&f2.getAttribute("FpSpread")!="Spread")f2=f2.parentNode;
if (f2!=null&&f2.getAttribute("hierView")=="true")
return f2;
else 
return null;
}catch (f6){
return null;
}
}
this.SetRowHeight=function (f3,n7,height){
if (n7==null)return ;
var k9=n7.getElementsByTagName("height");
if (k9!=null&&k9.length>0)
k9[0].innerHTML=height;
else {
if (document.all!=null){
k9=this.GetData(f3).createNode("element","height","");
}else {
k9=document.createElement('height');
k9.style.display="none";
}
n7.appendChild(k9);
k9.innerHTML=height;
}
var f1=this.GetCmdBtn(f3,"Update");
if (f1!=null)this.UpdateCmdBtnState(f1,false);
f3.d9=true;
}
this.SetActiveRow=function (f3,h9){
if (this.GetRowCount(f3)<1)return ;
if (h9==null)h9=-1;
var e8=this.GetData(f3);
var e9=e8.getElementsByTagName("root")[0];
var l1=e9.getElementsByTagName("state")[0];
var l2=l1.firstChild;
while (l2!=null&&l2.tagName!="activerow"&&l2.tagName!="ACTIVEROW"){
l2=l2.nextSibling;
}
if (l2!=null)
l2.innerHTML=""+h9;
if (h9!=null&&f3.getAttribute("IsNewRow")!="true"&&f3.getAttribute("AllowInsert")=="true"){
var f1=this.GetCmdBtn(f3,"Insert");
this.UpdateCmdBtnState(f1,false);
f1=this.GetCmdBtn(f3,"Add");
this.UpdateCmdBtnState(f1,false);
}else {
var f1=this.GetCmdBtn(f3,"Insert");
this.UpdateCmdBtnState(f1,true);
f1=this.GetCmdBtn(f3,"Add");
this.UpdateCmdBtnState(f1,true);
}
if (h9!=null&&f3.getAttribute("IsNewRow")!="true"&&(f3.getAttribute("AllowDelete")==null||f3.getAttribute("AllowDelete")=="true")){
var f1=this.GetCmdBtn(f3,"Delete");
this.UpdateCmdBtnState(f1,(h9==-1));
}else {
var f1=this.GetCmdBtn(f3,"Delete");
this.UpdateCmdBtnState(f1,true);
}
f3.d9=true;
}
this.SetActiveCol=function (f3,g6){
var e8=this.GetData(f3);
var e9=e8.getElementsByTagName("root")[0];
var l1=e9.getElementsByTagName("state")[0];
var l3=l1.firstChild;
while (l3!=null&&l3.tagName!="activecolumn"&&l3.tagName!="ACTIVECOLUMN"){
l3=l3.nextSibling;
}
if (l3!=null)
l3.innerHTML=""+parseInt(g6);
f3.d9=true;
}
this.GetEditor=function (g8){
if (g8==null)return null;
var p3=this.GetCellType(g8);
if (p3=="readonly")return null;
var h5=g8.getElementsByTagName("INPUT");
if (h5!=null&&h5.length>0){
var f2=h5[0];
while (f2!=null&&f2.getAttribute("FpEditor")==null)f2=f2.parentNode;
return f2;
}
h5=g8.getElementsByTagName("SELECT");
if (h5!=null&&h5.length>0){
var f2=h5[0];
return f2;
}
return null;
}
this.GetPageActiveSpread=function (){
var q4=document.documentElement.getAttribute("FpActiveSpread");
var f2=null;
if (q4!=null)f2=document.getElementById(q4);
return f2;
}
this.SetPageActiveSpread=function (f3){
if (f3==null)
document.documentElement.setAttribute("FpActiveSpread",null);
else 
document.documentElement.setAttribute("FpActiveSpread",f3.id);
}
this.DoResize=function (event){
if (the_fpSpread.spreads==null)return ;
var e4=the_fpSpread.spreads.length;
for (var e5=0;e5<e4;e5++){
if (the_fpSpread.spreads[e5]!=null)the_fpSpread.SizeSpread(the_fpSpread.spreads[e5]);
}
}
this.DblClick=function (event){
var g8=this.GetCell(this.GetTarget(event),true,event);
var f3=this.GetSpread(g8);
if (g8!=null&&!this.IsHeaderCell(g8)&&g8==f3.c8)this.StartEdit(f3,g8);
}
this.GetEvent=function (f6){
if (f6!=null)return f6;
return window.event;
}
this.GetTarget=function (f6){
f6=this.GetEvent(f6);
if (f6.target==document){
if (f6.currentTarget!=null)return f6.currentTarget;
}
if (f6.target!=null)return f6.target;
return f6.srcElement;
}
this.StartEdit=function (f3,editCell){
var q5=this.GetOperationMode(f3);
if (q5=="SingleSelect"||q5=="ReadOnly"||this.a4)return ;
var g8=editCell;
if (g8==null)g8=f3.c8;
if (g8==null)return ;
this.a8=-1;
var h5=this.GetEditor(g8);
if (h5!=null){
this.a4=true;
this.a5=h5;
this.a8=1;
}
var i6=this.IsXHTML(f3);
if (g8!=null){
var g4=this.GetRowFromCell(f3,g8);
var g7=this.GetColFromCell(f3,g8);
var f6=this.CreateEvent("EditStart");
f6.cell=g8;
f6.row=this.GetSheetIndex(f3,g4);
f6.col=g7;
f6.cancel=false;
this.FireEvent(f3,f6);
if (f6.cancel)return ;
var p3=this.GetCellType(g8);
if (p3=="readonly")return ;
if (f3.c8!=g8){
f3.c8=g8;
this.SetActiveRow(f3,this.GetRowKeyFromCell(f3,g8));
this.SetActiveCol(f3,this.GetColKeyFromCell(f3,g8));
}
if (h5==null){
var i4=this.GetRender(g8);
var q6=this.GetValueFromRender(f3,i4);
if (q6==" ")q6="";
this.a6=q6;
this.a7=this.GetFormulaFromCell(g8);
if (this.a7!=null)q6=this.a7;
try {
if (i4!=g8){
i4.style.display="none";
}
else {
i4.innerHTML="";
}
}catch (f6){
return ;
}
var q7=this.GetCellEditorID(f3,g8);
if (q7!=null&&q7.length>0){
this.a5=this.GetCellEditor(f3,q7,true);
this.a5.style.display="inline";
}else {
this.a5=document.createElement("INPUT");
this.a5.type="text";
}
this.a5.style.fontFamily=i4.style.fontFamily;
this.a5.style.fontSize=i4.style.fontSize;
this.a5.style.fontWeight=i4.style.fontWeight;
this.a5.style.fontStyle=i4.style.fontStyle;
this.a5.style.textDecoration=i4.style.textDecoration;
this.a5.style.position="";
if (i6){
var q8=g8.clientWidth-2;
var q9=parseInt(g8.style.paddingLeft);
if (!isNaN(q9))
q8-=q9;
q9=parseInt(g8.style.paddingRight);
if (!isNaN(q9))
q8-=q9;
this.a5.style.width=""+q8+"px";
}
else 
this.a5.style.width=g8.clientWidth-2;
this.SaveMargin(g8);
if (this.a5.tagName=="TEXTAREA")
this.a5.style.height=""+(g8.offsetHeight-4)+"px";
if ((this.a5.tagName=="INPUT"&&this.a5.type=="text")||this.a5.tagName=="TEXTAREA"){
if (this.a5.style.backgroundColor==""||this.a5.backColorSet!=null){
var r0="";
if (document.defaultView!=null&&document.defaultView.getComputedStyle!=null)r0=document.defaultView.getComputedStyle(g8,'').getPropertyValue("background-color");
if (r0!="")
this.a5.style.backgroundColor=r0;
else 
this.a5.style.backgroundColor=g8.bgColor;
this.a5.backColorSet=true;
}
if (this.a5.style.color==""||this.a5.colorSet!=null){
var r1="";
if (document.defaultView!=null&&document.defaultView.getComputedStyle!=null)r1=document.defaultView.getComputedStyle(g8,'').getPropertyValue("color");
this.a5.style.color=r1;
this.a5.colorSet=true;
}
this.a5.style.borderWidth="0px";
this.RestoreMargin(this.a5,false);
}
this.a8=0;
g8.insertBefore(this.a5,g8.firstChild);
this.SetEditorValue(this.a5,q6);
if (this.a5.offsetHeight<g8.clientHeight&&this.a5.tagName!="TEXTAREA"){
if (g8.vAlign=="middle")
this.a5.style.posTop+=(g8.clientHeight-this.a5.offsetHeight)/2;
else if (g8.vAlign=="bottom")
this.a5.style.posTop+=(g8.clientHeight-this.a5.offsetHeight);
}
this.SizeAll(this.GetTopSpread(f3));
}
this.SetEditorFocus(this.a5);
if (f3.getAttribute("EditMode")=="replace"){
if ((this.a5.tagName=="INPUT"&&this.a5.type=="text")||this.a5.tagName=="TEXTAREA")
this.a5.select();
}
this.a4=true;
var f1=this.GetCmdBtn(f3,"Update");
if (f1!=null&&f1.disabled)
this.UpdateCmdBtnState(f1,false);
f1=this.GetCmdBtn(f3,"Copy");
if (f1!=null&&!f1.disabled)
this.UpdateCmdBtnState(f1,true);
f1=this.GetCmdBtn(f3,"Paste");
if (f1!=null&&!f1.disabled)
this.UpdateCmdBtnState(f1,true);
f1=this.GetCmdBtn(f3,"Clear");
if (f1!=null&&!f1.disabled)
this.UpdateCmdBtnState(f1,true);
}
this.ScrollView(f3);
}
this.GetCurrency=function (validator){
var r2=validator.CurrencySymbol;
if (r2!=null)return r2;
var f2=document.getElementById(validator.id+"cs");
if (f2!=null){
return f2.innerText;
}
return "";
}
this.GetValueFromRender=function (f3,rd){
var o8=this.GetCellType2(this.GetCell(rd));
if (o8!=null){
if (o8=="text")o8="TextCellType";
var h4=this.GetFunction(o8+"_getValue");
if (h4!=null){
return h4(rd);
}
}
var f2=rd;
while (f2.firstChild!=null&&f2.firstChild.nodeName!="#text")f2=f2.firstChild;
if (f2.innerHTML=="&nbsp;")return "";
var q6=f2.value;
if (q6==null){
q6=this.ReplaceAll(f2.innerHTML,"&nbsp;"," ");
q6=this.ReplaceAll(q6,"<br>"," ");
q6=this.HTMLDecode(q6);
}
return q6;
}
this.ReplaceAll=function (val,src,dest){
if (val==null)return val;
var r3=val.length;
while (true){
val=val.replace(src,dest);
if (val.length==r3)break ;
r3=val.length;
}
return val;
}
this.GetFormula=function (f3,g4,g7){
g4=this.GetDisplayIndex(f3,g4);
var g8=this.GetCellFromRowCol(f3,g4,g7);
var r4=this.GetFormulaFromCell(g8);
return r4;
}
this.SetFormula=function (f3,g4,g7,h4,recalc,clientOnly){
g4=this.GetDisplayIndex(f3,g4);
var g8=this.GetCellFromRowCol(f3,g4,g7);
g8.setAttribute("FpFormula",h4);
if (!clientOnly)
this.SetCellValue(f3,g8,h4,null,recalc);
}
this.GetFormulaFromCell=function (rd){
var q6=null;
if (rd.getAttribute("FpFormula")!=null){
q6=rd.getAttribute("FpFormula");
}
if (q6!=null)
q6=this.Trim(new String(q6));
return q6;
}
this.IsDouble=function (val,decimalchar,negsign,possign,minimumvalue,maximumvalue){
if (val==null||val.length==0)return true;
val=val.replace(" ","");
if (val.length==0)return true;
if (negsign!=null)val=val.replace(negsign,"-");
if (possign!=null)val=val.replace(possign,"+");
if (val.charAt(val.length-1)=="-")val="-"+val.substring(0,val.length-1);
var r5=new RegExp("^\\s*([-\\+])?(\\d+)?(\\"+decimalchar+"(\\d+))?([eE]([-\\+])?(\\d+))?\\s*$");
var r6=val.match(r5);
if (r6==null)
return false;
var r7="";
if (r6[1]!=null&&r6[1].length>0)r7=r6[1];
if (r6[2]!=null&&r6[2].length>0)
r7+=r6[2];
else 
r7+="0";
if (r6[4]!=null&&r6[4].length>0)
r7+=("."+r6[4]);
if (r6[6]!=null&&r6[6].length>0){
r7+=("E"+r6[6]);
if (r6[7]!=null)
r7+=(r6[7]);
else 
r7+="0";
}
var r8=parseFloat(r7);
if (isNaN(r8))return false;
var f2=true;
if (minimumvalue!=null){
var r9=parseFloat(minimumvalue);
f2=(!isNaN(r9)&&r8>=r9);
}
if (f2&&maximumvalue!=null){
var i1=parseFloat(maximumvalue);
f2=(!isNaN(i1)&&r8<=i1);
}
return f2;
}
this.GetFunction=function (fn){
if (fn==null||fn=="")return null;
try {
var f2=eval(fn);
return f2;
}catch (f6){
return null;
}
}
this.SetValueToRender=function (rd,val,valueonly){
var h4=null;
var o8=this.GetCellType2(this.GetCell(rd));
if (o8!=null){
if (o8=="text")o8="TextCellType";
h4=this.GetFunction(o8+"_setValue");
}
if (h4!=null){
h4(rd,val);
}else {
if (typeof(rd.value)!="undefined"){
if (val==null)val="";
rd.value=val;
}else {
var f2=rd;
while (f2.firstChild!=null&&f2.firstChild.nodeName!="#text")f2=f2.firstChild;
f2.innerHTML=this.ReplaceAll(val," ","&nbsp;");
}
}
if ((valueonly==null||!valueonly)&&rd.getAttribute("FpFormula")!=null){
rd.setAttribute("FpFormula",val);
}
}
this.Trim=function (p4){
var r6=p4.match(new RegExp("^\\s*(\\S+(\\s+\\S+)*)\\s*$"));
return (r6==null)?"":r6[1];
}
this.GetOffsetLeft=function (f3,g8,h8){
var e1=h8;
if (e1==null)e1=this.GetViewportFromCell(f3,g8);
var n8=0;
var f2=g8;
while (f2!=null&&f2!=e1){
n8+=f2.offsetLeft;
f2=f2.offsetParent;
}
return n8;
}
this.GetOffsetTop=function (f3,g8,h8){
var e1=h8;
if (e1==null)e1=this.GetViewportFromCell(f3,g8);
var s0=0;
var f2=g8;
while (f2!=null&&f2!=e1){
s0+=f2.offsetTop;
f2=f2.offsetParent;
}
return s0;
}
this.SetEditorFocus=function (f2){
if (f2==null)return ;
var s1=true;
var g8=this.GetCell(f2,true);
var o8=this.GetCellType(g8);
if (o8!=null){
var h4=this.GetFunction(o8+"_setFocus");
if (h4!=null){
h4(f2);
s1=false;
}
}
if (s1){
try {
f2.focus();
}catch (f6){}
}
}
this.SetEditorValue=function (f2,val){
var g8=this.GetCell(f2,true);
var o8=this.GetCellType(g8);
if (o8!=null){
var h4=this.GetFunction(o8+"_setEditorValue");
if (h4!=null){
h4(f2,val);
return ;
}
}
f2.value=val;
}
this.GetEditorValue=function (f2){
var g8=this.GetCell(f2,true);
var o8=this.GetCellType(g8);
if (o8!=null){
var h4=this.GetFunction(o8+"_getEditorValue");
if (h4!=null){
return h4(f2);
}
}
if (f2.type=="checkbox"){
if (f2.checked)
return "True";
else 
return "False";
}
else 
{
return f2.value;
}
}
this.CreateMsg=function (){
if (this.a9!=null)return ;
var f2=this.a9=document.createElement("div");
f2.style.position="absolute";
f2.style.background="yellow";
f2.style.color="red";
f2.style.border="1px solid black";
f2.style.display="none";
f2.style.width="120px";
}
this.SetMsg=function (msg){
this.CreateMsg();
this.a9.innerHTML=msg;
}
this.ShowMsg=function (show){
this.CreateMsg();
if (show){
this.a9.style.display="block";
}
else 
this.a9.style.display="none";
}
this.EndEdit=function (){
if (this.a5!=null&&this.a5.parentNode!=null){
var g8=this.GetCell(this.a5.parentNode);
var f3=this.GetSpread(g8,false);
if (f3==null)return true;
var s2=this.GetEditorValue(this.a5);
var s3=s2;
if (typeof(s2)=="string")s3=this.Trim(s2);
var s4=(f3.getAttribute("AcceptFormula")=="true"&&s3!=null&&s3.charAt(0)=='=');
var h5=(this.a8!=0);
if (!s4&&!h5){
var s5=null;
var o8=this.GetCellType(g8);
if (o8!=null){
var h4=this.GetFunction(o8+"_isValid");
if (h4!=null){
s5=h4(g8,s2);
}
}
if (s5!=null&&s5!=""){
this.SetMsg(s5);
this.GetViewport(f3).parentNode.insertBefore(this.a9,this.GetViewport(f3).parentNode.firstChild);
this.ShowMsg(true);
this.SetValidatorPos(f3);
this.a5.focus();
return false;
}else {
this.ShowMsg(false);
}
}
if (!h5){
g8.removeChild(this.a5);
this.a5.style.display="none";
this.GetViewport(f3).parentNode.appendChild(this.a5);
var s6=this.GetRender(g8);
if (s6.style.display=="none")s6.style.display="block";
if (this.a7!=null&&this.a7==s2){
this.SetValueToRender(s6,this.a6,true);
}else {
this.SetValueToRender(s6,s2);
}
this.RestoreMargin(g8);
}
if ((this.a7!=null&&this.a7!=s2)||(this.a7==null&&this.a6!=s2)){
this.SetCellValue(f3,g8,s2);
if (s2!=null&&s2.length>0&&s2.indexOf("=")==0)g8.setAttribute("FpFormula",s2);
}
if (!h5)
this.SizeAll(this.GetTopSpread(f3));
this.a5=null;
this.a4=false;
var f6=this.CreateEvent("EditStopped");
f6.cell=g8;
this.FireEvent(f3,f6);
this.Focus(f3);
var s7=f3.getAttribute("autoCalc");
if (s7!="false"){
if ((this.a7!=null&&this.a7!=s2)||(this.a7==null&&this.a6!=s2)){
this.UpdateValues(f3);
}
}
}
this.a8=-1;
return true;
}
this.SetValidatorPos=function (f3){
if (this.a5==null)return ;
var g8=this.GetCell(this.a5.parentNode);
if (g8==null)return ;
var f2=this.a9;
if (f2!=null&&f2.style.display!="none"){
if (f2!=null){
f2.style.left=""+(g8.offsetLeft)+"px";
f2.style.top=""+(g8.offsetTop+g8.offsetHeight)+"px";
if (g8.offsetTop+g8.offsetHeight+f2.offsetHeight+16>f2.parentNode.offsetHeight)
f2.style.top=""+(g8.offsetTop-f2.offsetHeight-1)+"px";
}
}
}
this.SaveMargin=function (editCell){
if (editCell.style.paddingLeft!=null&&editCell.style.paddingLeft!=""){
this.b0.left=editCell.style.paddingLeft;
editCell.style.paddingLeft=0;
}
if (editCell.style.paddingRight!=null&&editCell.style.paddingRight!=""){
this.b0.right=editCell.style.paddingRight;
editCell.style.paddingRight=0;
}
if (editCell.style.paddingTop!=null&&editCell.style.paddingTop!=""){
this.b0.top=editCell.style.paddingTop;
editCell.style.paddingTop=0;
}
if (editCell.style.paddingBottom!=null&&editCell.style.paddingBottom!=""){
this.b0.bottom=editCell.style.paddingBottom;
editCell.style.paddingBottom=0;
}
}
this.RestoreMargin=function (g8,reset){
if (this.b0.left!=null&&this.b0.left!=-1){
g8.style.paddingLeft=this.b0.left;
if (reset==null||reset)this.b0.left=-1;
}
if (this.b0.right!=null&&this.b0.right!=-1){
g8.style.paddingRight=this.b0.right;
if (reset==null||reset)this.b0.right=-1;
}
if (this.b0.top!=null&&this.b0.top!=-1){
g8.style.paddingTop=this.b0.top;
if (reset==null||reset)this.b0.top=-1;
}
if (this.b0.bottom!=null&&this.b0.bottom!=-1){
g8.style.paddingBottom=this.b0.bottom;
if (reset==null||reset)this.b0.bottom=-1;
}
}
this.PaintSelectedCell=function (f3,g8,select){
if (select){
if (g8.bgColor1==null)
g8.bgColor1=g8.style.backgroundColor;
g8.style.backgroundColor=f3.getAttribute("selectedBackColor");
}else {
if (g8.bgColor1!=null)
g8.style.backgroundColor="";
if (g8.bgColor1!=null&&g8.bgColor1!="")
g8.style.backgroundColor=g8.bgColor1;
}
}
this.PaintAnchorCell=function (f3){
var s8=this.GetOperationMode(f3);
if (f3.c8==null||(s8!="Normal"&&s8!="RowMode"))return ;
if (s8=="MultiSelect"||s8=="ExtendedSelect")return ;
if (!this.IsChild(f3.c8,f3))return ;
var s9=(this.GetTopSpread(f3).getAttribute("hierView")!="true");
if (f3.getAttribute("showFocusRect")=="false")s9=false;
if (s9){
this.PaintSelectedCell(f3,f3.c8,false);
this.PaintFocusRect(f3);
return ;
}
var f2=f3.c8.parentNode.cells[0].firstChild;
if (f2!=null&&f2.nodeName!="#text"&&f2.getAttribute("FpSpread")=="Spread")return ;
if (f3.c8.bgColor1==null)
f3.c8.bgColor1=f3.c8.style.backgroundColor;
f3.c8.style.backgroundColor=f3.getAttribute("anchorBackColor");
}
this.ClearSelection=function (f3,thisonly){
var t0=this.GetParentSpread(f3);
if (thisonly==null&&t0!=null&&t0.getAttribute("hierView")=="true"){
this.ClearSelection(t0);
return ;
}
var h6=this.GetViewport(f3);
var g1=this.GetRowCount(f3);
if (h6!=null&&h6.rows.length>g1){
for (var e5=0;e5<h6.rows.length;e5++){
if (h6.rows[e5].cells.length>0&&h6.rows[e5].cells[0]!=null&&h6.rows[e5].cells[0].firstChild!=null&&h6.rows[e5].cells[0].firstChild.nodeName!="#text"){
var f2=h6.rows[e5].cells[0].firstChild;
if (f2.getAttribute("FpSpread")=="Spread"){
this.ClearSelection(f2,true);
}
}
}
}
this.DoclearSelection(f3);
if (f3.c8!=null){
var q5=this.GetOperationMode(f3);
if (q5=="RowMode"||q5=="SingleSelect"||q5=="ExtendedSelect"||q5=="MultiSelect"){
var g9=this.GetRowFromCell(f3,f3.c8);
this.PaintSelection(f3,g9,-1,1,-1,false);
}
this.PaintSelectedCell(f3,f3.c8,false);
}else {
var g8=this.GetCellFromRowCol(f3,1,0);
if (g8!=null)this.PaintSelectedCell(f3,g8,false);
}
this.PaintFocusRect(f3);
f3.d9=true;
}
this.SetSelectedRange=function (f3,g4,g7,l0,g3){
this.ClearSelection(f3);
var g4=this.GetDisplayIndex(f3,g4);
var t1=0;
var t2=l0;
var h6=this.GetViewport(f3);
if (h6!=null){
for (e5=g4;e5<h6.rows.length&&t1<t2;e5++){
if (this.IsChildSpreadRow(f3,h6,e5)){;
l0++;
}else {
t1++;
}
}
}
this.PaintSelection(f3,g4,g7,l0,g3,true);
this.SetSelection(f3,g4,g7,l0,g3);
}
this.AddSelection=function (f3,g4,g7,l0,g3){
var g4=this.GetDisplayIndex(f3,g4);
var t1=0;
var t2=l0;
var h6=this.GetViewport(f3);
if (h6!=null){
for (e5=g4;e5<h6.rows.length&&t1<t2;e5++){
if (this.IsChildSpreadRow(f3,h6,e5)){;
l0++;
}else {
t1++;
}
}
}
this.PaintSelection(f3,g4,g7,l0,g3,true);
this.SetSelection(f3,g4,g7,l0,g3,true);
}
this.SelectRow=function (f3,index,t1,select,ignoreAnchor){
f3.d2=index;
f3.d3=-1;
if (!ignoreAnchor)this.UpdateAnchorCell(f3,index,0,false);
f3.d4="r";
this.PaintSelection(f3,index,-1,t1,-1,select);
if (select)
{
this.SetSelection(f3,index,-1,t1,-1);
}else {
this.RemoveSelection(f3,index,-1,t1,-1);
this.PaintFocusRect(f3);
}
}
this.SelectColumn=function (f3,index,t1,select,ignoreAnchor){
f3.d2=-1;
f3.d3=index;
if (!ignoreAnchor)this.UpdateAnchorCell(f3,0,index,false);
f3.d4="c";
this.PaintSelection(f3,-1,index,-1,t1,select);
if (select)
{
this.SetSelection(f3,-1,index,-1,t1);
}
}
this.SelectTable=function (f3,select){
if (select)this.UpdateAnchorCell(f3,0,0,false);
f3.d4="t";
this.PaintSelection(f3,-1,-1,-1,-1,select);
if (select)
{
this.SetSelection(f3,-1,-1,-1,-1);
}
}
this.GetSpanCell=function (g4,g7,span){
if (span==null){
return null;
}
var t1=span.length;
for (var e5=0;e5<t1;e5++){
var o0=span[e5];
var t3=(o0.row<=g4&&g4<o0.row+o0.rowCount&&o0.col<=g7&&g7<o0.col+o0.colCount);
if (t3)return o0;
}
return null;
}
this.IsCovered=function (f3,g4,g7,span){
var o0=this.GetSpanCell(g4,g7,span);
if (o0==null){
return false;
}else {
if (o0.row==g4&&o0.col==g7)return false;
return true;
}
}
this.IsSpanCell=function (f3,g4,g7){
var d6=f3.d6;
var t1=d6.length;
for (var e5=0;e5<t1;e5++){
var o0=d6[e5];
var t3=(o0.row==g4&&o0.col==g7);
if (t3)return o0;
}
return null;
}
this.SelectRange=function (f3,g4,g7,l0,g3,select){
f3.d4="";
this.UpdateRangeSelection(f3,g4,g7,l0,g3,select);
if (select){
this.SetSelection(f3,g4,g7,l0,g3);
this.PaintAnchorCell(f3);
}
}
this.UpdateRangeSelection=function (f3,g4,g7,l0,g3,select){
var h6=this.GetViewport(f3);
this.UpdateRangeSelection(f3,g4,g7,l0,g3,select,h6);
}
this.GetSpanCells=function (f3,h6){
if (h6==this.GetViewport(f3))
return f3.d6;
else if (h6==this.GetColHeader(f3))
return f3.d8;
else if (h6==this.GetRowHeader(f3))
return f3.d7;
return null;
}
this.UpdateRangeSelection=function (f3,g4,g7,l0,g3,select,h6){
if (h6==null)return ;
for (var e5=g4;e5<g4+l0&&e5<h6.rows.length;e5++){
if (this.IsChildSpreadRow(f3,h6,e5))continue ;
var t4=this.GetCellIndex(f3,e5,g7,this.GetSpanCells(f3,h6));
for (var h3=0;h3<g3;h3++){
if (this.IsCovered(f3,e5,g7+h3,this.GetSpanCells(f3,h6)))continue ;
if (t4<h6.rows[e5].cells.length){
this.PaintSelectedCell(f3,h6.rows[e5].cells[t4],select);
}
t4++;
}
}
}
this.GetColFromCell=function (f3,g8){
if (g8==null)return -1;
var g4=this.GetRowFromCell(f3,g8);
return this.GetColIndex(f3,g4,g8.cellIndex,this.GetSpanCells(f3,g8.parentNode.parentNode.parentNode),false,this.IsChild(g8,this.GetRowHeader(f3)));
}
this.GetRowFromCell=function (f3,g8){
if (g8==null||g8.parentNode==null)return -1;
var g4=g8.parentNode.rowIndex;
return g4;
}
this.GetColIndex=function (f3,e5,cellIndex,span,frozArea,c2){
var t5=false;
var e1=this.GetViewport(f3);
if (e1!=null)t5=e1.parentNode.getAttribute("hiddenCells");
if (t5&&span==f3.d6){
return cellIndex;
}
var t6=0;
var t1=this.GetColCount(f3);
var t7=0;
if (c2){
t7=0;
var k7=null;
if (this.GetRowHeader(f3)!=null)
k7=this.GetColGroup(this.GetRowHeader(f3));
if (k7!=null)
t1=k7.childNodes.length;
}
for (var h3=t7;h3<t1;h3++){
if (this.IsCovered(f3,e5,h3,span))continue ;
if (t6==cellIndex){
return h3;
}
t6++;
}
return t1;
}
this.GetCellIndex=function (f3,e5,p8,span){
var t5=false;
var e1=this.GetViewport(f3);
if (e1!=null)t5=e1.parentNode.getAttribute("hiddenCells");
if (t5&&span==f3.d6){
return p8;
}else {
var t7=0;
var t1=p8;
var t6=0;
for (var h3=0;h3<t1;h3++){
if (this.IsCovered(f3,e5,t7+h3,span))continue ;
t6++;
}
return t6;
}
}
this.NextCell=function (f3,event,key){
if (event.altKey)return ;
var t8=this.GetParent(this.GetViewport(f3));
if (f3.c8==null)return ;
if (event.shiftKey&&key!=event.DOM_VK_TAB){
var n6=this.GetOperationMode(f3);
if (n6=="RowMode"||n6=="SingleSelect"||n6=="MultiSelect")return ;
var o0=this.GetSpanCell(f3.d0,f3.d1,this.GetSpanCells(f3,this.GetViewportFromCell(f3,f3.c8)));
switch (key){
case event.DOM_VK_RIGHT:
var g4=f3.d0;
var g7=f3.d1+1;
if (o0!=null){
g7=o0.col+o0.colCount;
}
if (g7>this.GetColCount(f3)-1)return ;
f3.d1=g7;
f3.c9=this.GetCellFromRowCol(f3,g4,g7);
this.Select(f3,f3.c8,f3.c9);
break ;
case event.DOM_VK_LEFT:
var g4=f3.d0;
var g7=f3.d1-1;
if (o0!=null){
g7=o0.col-1;
}
o0=this.GetSpanCell(g4,g7,this.GetSpanCells(f3,this.GetViewportFromCell(f3,f3.c8)));
if (o0!=null){
if (this.IsSpanCell(f3,g4,o0.col))g7=o0.col;
}
if (g7<0)return ;
f3.d1=g7;
f3.c9=this.GetCellFromRowCol(f3,g4,g7);
this.Select(f3,f3.c8,f3.c9);
break ;
case event.DOM_VK_DOWN:
var g4=f3.d0+1;
var g7=f3.d1;
if (o0!=null){
g4=o0.row+o0.rowCount;
}
g4=this.GetNextRow(f3,g4);
if (g4>this.GetRowCountInternal(f3)-1)return ;
f3.d0=g4;
f3.c9=this.GetCellFromRowCol(f3,g4,g7);
this.Select(f3,f3.c8,f3.c9);
break ;
case event.DOM_VK_UP:
var g4=f3.d0-1;
var g7=f3.d1;
if (o0!=null){
g4=o0.row-1;
}
g4=this.GetPrevRow(f3,g4);
o0=this.GetSpanCell(g4,g7,this.GetSpanCells(f3,this.GetViewportFromCell(f3,f3.c8)));
if (o0!=null){
if (this.IsSpanCell(f3,o0.row,g7))g4=o0.row;
}
if (g4<0)return ;
f3.d0=g4;
f3.c9=this.GetCellFromRowCol(f3,g4,g7);
this.Select(f3,f3.c8,f3.c9);
break ;
case event.DOM_VK_HOME:
if (f3.c8.parentNode.rowIndex>=0){
f3.d1=0;
f3.c9=this.GetCellFromRowCol(f3,f3.d0,f3.d1);
this.Select(f3,f3.c8,f3.c9);
}
break ;
case event.DOM_VK_END:
if (f3.c8.parentNode.rowIndex>=0){
f3.d1=this.GetColCount(f3)-1;
f3.c9=this.GetCellFromRowCol(f3,f3.d0,f3.d1);
this.Select(f3,f3.c8,f3.c9);
}
break ;
case event.DOM_VK_PAGE_DOWN:
if (this.GetViewport(f3)!=null&&f3.c8.parentNode.rowIndex>=0){
g4=0;
for (g4=0;g4<this.GetViewport(f3).rows.length;g4++){
if (this.GetViewport(f3).rows[g4].offsetTop+this.GetViewport(f3).rows[g4].offsetHeight>this.GetViewport(f3).parentNode.offsetHeight+this.GetViewport(f3).parentNode.scrollTop){
break ;
}
}
g4=this.GetNextRow(f3,g4);
if (g4<this.GetViewport(f3).rows.length){
this.GetViewport(f3).parentNode.scrollTop=this.GetViewport(f3).rows[g4].offsetTop;
f3.d0=g4;
}else {
g4=this.GetRowCountInternal(f3)-1;
f3.d0=g4;
}
f3.c9=this.GetCellFromRowCol(f3,f3.d0,f3.d1);
this.Select(f3,f3.c8,f3.c9);
}
break ;
case event.DOM_VK_PAGE_UP:
if (this.GetViewport(f3)!=null&&f3.c8.parentNode.rowIndex>0){
g4=0;
for (g4=0;g4<this.GetViewport(f3).rows.length;g4++){
if (this.GetViewport(f3).rows[g4].offsetTop+this.GetViewport(f3).rows[g4].offsetHeight>this.GetViewport(f3).parentNode.scrollTop){
break ;
}
}
if (g4<this.GetViewport(f3).rows.length){
var i7=0;
while (g4>0){
i7+=this.GetViewport(f3).rows[g4].offsetHeight;
if (i7>this.GetViewport(f3).parentNode.offsetHeight){
break ;
}
g4--;
}
g4=this.GetPrevRow(f3,g4);
if (g4>=0){
this.GetViewport(f3).parentNode.scrollTop=this.GetViewport(f3).rows[g4].offsetTop;
f3.d0=g4;
f3.c9=this.GetCellFromRowCol(f3,f3.d0,f3.d1);
this.Select(f3,f3.c8,f3.c9);
}
}
}
break ;
}
}else {
if (key==event.DOM_VK_TAB){
if (event.shiftKey)key=event.DOM_VK_LEFT;
else key=event.DOM_VK_RIGHT;
}
var t9=f3.c8;
var g4=f3.d0;
var g7=f3.d1;
switch (key){
case event.DOM_VK_RIGHT:
this.MoveRight(f3,g4,g7);
break ;
case event.DOM_VK_LEFT:
this.MoveLeft(f3,g4,g7);
break ;
case event.DOM_VK_DOWN:
this.MoveDown(f3,g4,g7);
break ;
case event.DOM_VK_UP:
this.MoveUp(f3,g4,g7);
break ;
case event.DOM_VK_HOME:
if (f3.c8.parentNode.rowIndex>=0){
this.UpdateLeadingCell(f3,g4,0);
}
break ;
case event.DOM_VK_END:
if (f3.c8.parentNode.rowIndex>=0){
g7=this.GetColCount(f3)-1;
this.UpdateLeadingCell(f3,g4,g7);
}
break ;
case event.DOM_VK_PAGE_DOWN:
if (this.GetViewport(f3)!=null&&f3.c8.parentNode.rowIndex>=0){
g4=0;
for (g4=0;g4<this.GetViewport(f3).rows.length;g4++){
if (this.GetViewport(f3).rows[g4].offsetTop+this.GetViewport(f3).rows[g4].offsetHeight>this.GetViewport(f3).parentNode.offsetHeight+this.GetViewport(f3).parentNode.scrollTop){
break ;
}
}
g4=this.GetNextRow(f3,g4);
if (g4<this.GetViewport(f3).rows.length){
var f2=this.GetViewport(f3).rows[g4].offsetTop;
this.UpdateLeadingCell(f3,g4,f3.d1);
this.GetViewport(f3).parentNode.scrollTop=f2;
}else {
g4=this.GetPrevRow(f3,this.GetRowCount(f3)-1);
this.UpdateLeadingCell(f3,g4,f3.d1);
}
}
break ;
case event.DOM_VK_PAGE_UP:
if (this.GetViewport(f3)!=null&&f3.c8.parentNode.rowIndex>=0){
g4=0;
for (g4=0;g4<this.GetViewport(f3).rows.length;g4++){
if (this.GetViewport(f3).rows[g4].offsetTop+this.GetViewport(f3).rows[g4].offsetHeight>this.GetViewport(f3).parentNode.scrollTop){
break ;
}
}
if (g4<this.GetViewport(f3).rows.length){
var i7=0;
while (g4>=0){
i7+=this.GetViewport(f3).rows[g4].offsetHeight;
if (i7>this.GetViewport(f3).parentNode.offsetHeight){
break ;
}
g4--;
}
g4=this.GetPrevRow(f3,g4);
if (g4>=0){
var f2=this.GetViewport(f3).rows[g4].offsetTop;
this.UpdateLeadingCell(f3,g4,f3.d1);
this.GetViewport(f3).parentNode.scrollTop=f2;
}
}
}
break ;
}
if (t9!=f3.c8){
var f6=this.CreateEvent("ActiveCellChanged");
f6.cmdID=f3.id;
f6.Row=f6.row=this.GetSheetIndex(f3,this.GetRowFromCell(f3,f3.c8));
f6.Col=f6.col=this.GetColFromCell(f3,f3.c8);
this.FireEvent(f3,f6);
}
}
var g8=this.GetCellFromRowCol(f3,f3.d0,f3.d1);
if (key==event.DOM_VK_LEFT&&g8.offsetLeft<t8.scrollLeft){
if (g8.cellIndex>0)
t8.scrollLeft=f3.c8.offsetLeft;
else 
t8.scrollLeft=0;
}else if (g8.cellIndex==0){
t8.scrollLeft=0;
}
if (key==event.DOM_VK_RIGHT&&g8.offsetLeft+g8.offsetWidth>t8.scrollLeft+t8.offsetWidth-10){
t8.scrollLeft+=g8.offsetWidth;
}
if (key==event.DOM_VK_UP&&g8.parentNode.offsetTop<t8.scrollTop){
if (g8.parentNode.rowIndex>1)
t8.scrollTop=g8.parentNode.offsetTop;
else 
t8.scrollTop=0;
}else if (g8.parentNode.rowIndex==1){
t8.scrollTop=0;
}
var u0=this.GetParent(this.GetViewport(f3));
t8=this.GetParent(this.GetViewport(f3));
if (key==event.DOM_VK_DOWN&&this.IsChild(g8,t8)&&g8.offsetTop+g8.offsetHeight>t8.scrollTop+t8.clientHeight){
u0.scrollTop+=g8.offsetHeight;
}
if (g8!=null&&g8.offsetWidth<t8.clientWidth){
if (this.IsChild(g8,t8)&&g8.offsetLeft+g8.offsetWidth>t8.scrollLeft+t8.clientWidth){
u0.scrollLeft=g8.offsetLeft+g8.offsetWidth-t8.clientWidth;
}
}
if (this.IsChild(g8,t8)&&g8.offsetTop+g8.offsetHeight>t8.scrollTop+t8.clientHeight&&g8.offsetHeight<t8.clientHeight){
u0.scrollTop=g8.offsetTop+g8.offsetHeight-t8.clientHeight;
}
if (g8.offsetTop<t8.scrollTop){
u0.scrollTop=g8.offsetTop;
}
this.ScrollView(f3);
this.EnableButtons(f3);
this.SaveData(f3);
if (f3.c8!=null){
var h5=this.GetEditor(f3.c8);
if (h5!=null){
if (h5.tagName!="SELECT")
h5.focus();
if (!h5.disabled&&(h5.type==null||h5.type=="checkbox"||h5.type=="radio"||h5.type=="text"||h5.type=="password")){
this.a4=true;
this.a5=h5;
this.a6=this.GetEditorValue(h5);
}
}
}
this.Focus(f3);
}
this.MoveUp=function (f3,g4,g7){
var l0=this.GetRowCountInternal(f3);
var g3=this.GetColCount(f3);
g4--;
g4=this.GetPrevRow(f3,g4);
if (g4>=0){
f3.d0=g4;
this.UpdateLeadingCell(f3,f3.d0,f3.d1);
}
}
this.MoveDown=function (f3,g4,g7){
var l0=this.GetRowCountInternal(f3);
var g3=this.GetColCount(f3);
var o0=this.GetSpanCell(g4,g7,this.GetSpanCells(f3,this.GetViewportFromCell(f3,f3.c8)));
if (o0!=null){
g4=o0.row+o0.rowCount;
}else {
g4++;
}
g4=this.GetNextRow(f3,g4);
if (g4<l0){
f3.d0=g4;
this.UpdateLeadingCell(f3,f3.d0,f3.d1);
}
}
this.MoveLeft=function (f3,g4,g7){
var l0=this.GetRowCountInternal(f3);
var g3=this.GetColCount(f3);
var o0=this.GetSpanCell(g4,g7,this.GetSpanCells(f3,this.GetViewportFromCell(f3,f3.c8)));
if (o0!=null){
g7=o0.col-1;
}else {
g7--;
}
if (g7<0){
g7=g3-1;
g4--;
if (g4<0){
g4=l0-1;
}
g4=this.GetPrevRow(f3,g4);
f3.d0=g4;
}
this.UpdateLeadingCell(f3,f3.d0,g7);
}
this.MoveRight=function (f3,g4,g7){
var l0=this.GetRowCountInternal(f3);
var g3=this.GetColCount(f3);
var o0=this.GetSpanCell(g4,g7,this.GetSpanCells(f3,this.GetViewportFromCell(f3,f3.c8)));
if (o0!=null){
g7=o0.col+o0.colCount;
}else {
g7++;
}
if (g7>=g3){
g7=0;
g4++;
if (g4>=l0)g4=0;
f3.d0=this.GetNextRow(f3,g4);
}
this.UpdateLeadingCell(f3,f3.d0,g7);
}
this.UpdateLeadingCell=function (f3,g4,g7){
var h4=this.FireActiveCellChangingEvent(f3,g4,g7);
if (!h4){
this.ClearSelection(f3);
f3.d1=g7;
f3.d0=g4;
f3.d3=g7;
f3.d2=g4;
this.UpdateAnchorCell(f3,g4,g7);
}
}
this.GetPrevRow=function (f3,g4){
if (g4<0)return 0;
var h6=this.GetViewport(f3);
if (h6!=null){
while (g4>0&&h6.rows[g4].cells.length>0){
if (this.IsChildSpreadRow(f3,h6,g4))
g4--;
else 
break ;
}
}
return g4;
}
this.GetNextRow=function (f3,g4){
var h6=this.GetViewport(f3);
while (h6!=null&&g4<h6.rows.length){
if (this.IsChildSpreadRow(f3,h6,g4))g4++;
else 
break ;
}
return g4;
}
this.FireActiveCellChangingEvent=function (f3,h9,g6){
var f6=this.CreateEvent("ActiveCellChanging");
f6.cancel=false;
f6.cmdID=f3.id;
f6.row=this.GetSheetIndex(f3,h9);
f6.col=g6;
this.FireEvent(f3,f6);
return f6.cancel;
}
this.GetSheetRowIndex=function (f3,g4){
g4=this.GetDisplayIndex(f3,g4);
if (g4<0)return -1;
var k1=this.GetViewport(f3).rows[g4];
if (k1!=null){
return k1.getAttribute("FpKey");
}else {
return -1;
}
}
this.GetSheetColIndex=function (f3,g7){
var g6=-1;
var k7=null;
var u1=this.GetColHeader(f3);
if (u1!=null&&u1.rows.length>0){
k7=this.GetColGroup(u1);
}else {
var e1=this.GetViewport(f3);
if (e1!=null&&e1.rows.length>0){
k7=this.GetColGroup(e1);
}
}
if (k7!=null&&g7>=0&&g7<k7.childNodes.length){
g6=k7.childNodes[g7].getAttribute("FpCol");
}
return g6;
}
this.GetCellByRowCol=function (f3,g4,g7){
g4=this.GetDisplayIndex(f3,g4);
return this.GetCellFromRowCol(f3,g4,g7);
}
this.GetHeaderCellFromRowCol=function (f3,g4,g7,c3){
if (g4<0||g7<0)return null;
var e1=null;
if (c3){
e1=this.GetColHeader(f3);
}else {
e1=this.GetRowHeader(f3);
}
var o0=this.GetSpanCell(g4,g7,this.GetSpanCells(f3,e1));
if (o0!=null){
g4=o0.row;
g7=o0.col;
}
var u2=this.GetCellIndex(f3,g4,g7,this.GetSpanCells(f3,e1));
return e1.rows[g4].cells[u2];
}
this.GetCellFromRowCol=function (f3,g4,g7,prevCell){
if (g4<0||g7<0)return null;
var e1=null;
{
e1=this.GetViewport(f3);
}
var d6=f3.d6;
var o0=this.GetSpanCell(g4,g7,d6);
if (o0!=null){
g4=o0.row;
g7=o0.col;
}
var u2=0;
var t5=false;
if (e1!=null)t5=e1.parentNode.getAttribute("hiddenCells");
if (prevCell!=null&&!t5){
if (prevCell.cellIndex<prevCell.parentNode.cells.length-1)
u2=prevCell.cellIndex+1;
}
else 
{
u2=this.GetCellIndex(f3,g4,g7,d6);
}
if (g4>=0&&g4<e1.rows.length)
return e1.rows[g4].cells[u2];
else 
return null;
}
this.GetHiddenValue=function (f3,g4,colName){
if (colName==null)return ;
g4=this.GetDisplayIndex(f3,g4);
var q6=null;
var e1=null;
e1=this.GetViewport(f3);
if (e1!=null&&g4>=0&&g4<e1.rows.length){
var k1=e1.rows[g4];
q6=k1.getAttribute("hv"+colName);
}
return q6;
}
this.GetValue=function (f3,g4,g7){
g4=this.GetDisplayIndex(f3,g4);
var g8=this.GetCellFromRowCol(f3,g4,g7);
var i4=this.GetRender(g8);
var q6=this.GetValueFromRender(f3,i4);
if (q6!=null)q6=this.Trim(q6.toString());
return q6;
}
this.SetValue=function (f3,g4,g7,s2,noEvent,recalc){
g4=this.GetDisplayIndex(f3,g4);
if (s2!=null&&typeof(s2)!="string")s2=new String(s2);
var g8=this.GetCellFromRowCol(f3,g4,g7);
if (this.ValidateCell(f3,g8,s2)){
this.SetCellValueFromView(g8,s2);
if (s2!=null){
this.SetCellValue(f3,g8,""+s2,noEvent,recalc);
}else {
this.SetCellValue(f3,g8,"",noEvent,recalc);
}
}else {
if (f3.getAttribute("lcidMsg")!=null)
alert(f3.getAttribute("lcidMsg"));
else 
alert("Can't set the data into the cell. The data type is not correct for the cell.");
}
}
this.SetActiveCell=function (f3,g4,g7){
this.ClearSelection(f3,true);
g4=this.GetDisplayIndex(f3,g4);
this.UpdateAnchorCell(f3,g4,g7);
this.ResetLeadingCell(f3);
}
this.GetOperationMode=function (f3){
var s8=f3.getAttribute("OperationMode");
return s8;
}
this.SetOperationMode=function (f3,s8){
f3.setAttribute("OperationMode",s8);
}
this.UpdateAnchorCell=function (f3,g4,g7,select){
if (g4<0||g7<0)return ;
f3.c8=this.GetCellFromRowCol(f3,g4,g7);
if (f3.c8==null)return ;
this.SetActiveRow(f3,this.GetRowKeyFromCell(f3,f3.c8));
this.SetActiveCol(f3,this.GetColKeyFromCell(f3,f3.c8));
if (select==null||select){
var s8=this.GetOperationMode(f3);
if (s8=="RowMode"||s8=="SingleSelect"||s8=="ExtendedSelect"||s8=="MultiSelect")
this.SelectRow(f3,g4,1,true,true);
else 
this.SelectRange(f3,g4,g7,1,1,true);
}
}
this.ResetLeadingCell=function (f3){
if (f3.c8==null||!this.IsChild(f3.c8,f3))return ;
f3.d0=this.GetRowFromCell(f3,f3.c8);
f3.d1=this.GetColFromCell(f3,f3.c8);
this.SelectRange(f3.d0,f3.d1,1,1,true);
}
this.Update=function (f3){
if (this.a4)return ;
this.SaveData(f3);
var q4=f3.getAttribute("name");
__doPostBack(q4,"Update");
}
this.Cancel=function (f3){
var f2=document.getElementById(f3.id+"_data");
f2.value="";
this.SaveData(f3);
var q4=f3.getAttribute("name");
var u3=(f3.getAttribute("ajax")!="false");
if (u3)
this.SyncData(q4,"Cancel",f3);
else 
__doPostBack(q4,"Cancel");
}
this.Add=function (f3){
if (this.a4)return ;
var q4=null;
var m5=this.GetPageActiveSpread();
if (m5!=null){
q4=m5.getAttribute("name");
}else {
q4=f3.getAttribute("name");
}
var u3=(f3.getAttribute("ajax")!="false");
if (u3)
this.SyncData(q4,"Add",f3);
else 
__doPostBack(q4,"Add");
}
this.Insert=function (f3){
if (this.a4)return ;
var q4=null;
var m5=this.GetPageActiveSpread();
if (m5!=null){
q4=m5.getAttribute("name");
}else {
q4=f3.getAttribute("name");
}
var u3=(f3.getAttribute("ajax")!="false");
if (u3)
this.SyncData(q4,"Insert",f3);
else 
__doPostBack(q4,"Insert");
}
this.Delete=function (f3){
if (this.a4)return ;
var q4=null;
var m5=this.GetPageActiveSpread();
if (m5!=null){
q4=m5.getAttribute("name");
}else {
q4=f3.getAttribute("name");
}
var u3=(f3.getAttribute("ajax")!="false");
if (u3)
this.SyncData(q4,"Delete",f3);
else 
__doPostBack(q4,"Delete");
}
this.Print=function (f3){
if (this.a4)return ;
this.SaveData(f3);
if (document.printSpread==null){
var f2=document.createElement("IFRAME");
f2.name="printSpread";
f2.style.position="absolute";
f2.style.left="-10px";
f2.style.width="0px";
f2.style.height="0px";
document.printSpread=f2;
document.body.insertBefore(f2,null);
f2.addEventListener("load",the_fpSpread.PrintSpread,false);
}
var u4=this.GetForm(f3);
if (u4==null)return ;
{
var h4=u4;
h4.__EVENTTARGET.value=f3.getAttribute("name");
h4.__EVENTARGUMENT.value="Print";
var u5=h4.target;
h4.target="printSpread";
h4.submit();
h4.target=u5;
}
}
this.PrintSpread=function (){
document.printSpread.contentWindow.focus();
document.printSpread.contentWindow.print();
window.focus();
var m5=this.GetPageActiveSpread();
if (m5!=null)this.Focus(m5);
}
this.GotoPage=function (f3,e4){
if (this.a4)return ;
var q4=f3.getAttribute("name");
var u3=(f3.getAttribute("ajax")!="false");
if (u3)
this.SyncData(q4,"Page,"+e4,f3);
else 
__doPostBack(q4,"Page,"+e4);
}
this.Next=function (f3){
if (this.a4)return ;
var q4=f3.getAttribute("name");
var u3=(f3.getAttribute("ajax")!="false");
if (u3)
this.SyncData(q4,"Next",f3);
else 
__doPostBack(q4,"Next");
}
this.Prev=function (f3){
if (this.a4)return ;
var q4=f3.getAttribute("name");
var u3=(f3.getAttribute("ajax")!="false");
if (u3)
this.SyncData(q4,"Prev",f3);
else 
__doPostBack(q4,"Prev");
}
this.GetViewportFromCell=function (f3,i2){
if (i2!=null){
var f2=i2;
while (f2!=null){
if (f2.tagName=="TABLE")break ;
f2=f2.parentNode;
}
if (f2==this.GetViewport(f3))
return f2;
}
return null;
}
this.IsChild=function (g8,h8){
if (g8==null||h8==null)return false;
var f2=g8.parentNode;
while (f2!=null){
if (f2==h8)return true;
f2=f2.parentNode;
}
return false;
}
this.GetCorner=function (f3){
return f3.c1;
}
this.Select=function (f3,cl1,cl2){
if (this.GetSpread(cl1)!=f3||this.GetSpread(cl2)!=f3)return ;
var g9=f3.d2;
var h0=f3.d3;
var u6=this.GetRowFromCell(f3,cl2);
var k2=0;
if (f3.d4=="r"){
k2=-1;
if (this.IsChild(cl2,this.GetColHeader(f3)))
u6=0;
}else if (f3.d4=="c"){
if (this.IsChild(cl2,this.GetRowHeader(f3)))
k2=0;
else 
k2=this.GetColFromCell(f3,cl2);
u6=-1;
}
else {
if (this.IsChild(cl2,this.GetColHeader(f3))){
u6=0;k2=this.GetColFromCell(f3,cl2);
}else if (this.IsChild(cl2,this.GetRowHeader(f3))){
k2=0;
}else {
k2=this.GetColFromCell(f3,cl2);
}
}
if (f3.d4=="t"){
h0=k2=g9=u6=-1;
}
var f2=Math.max(g9,u6);
g9=Math.min(g9,u6);
u6=f2;
f2=Math.max(h0,k2);
h0=Math.min(h0,k2);
k2=f2;
var h1=null;
var k8=this.GetSelection(f3);
var k9=k8.lastChild;
if (k9!=null){
var g4=this.GetRowByKey(f3,k9.getAttribute("row"));
var g7=this.GetColByKey(f3,k9.getAttribute("col"));
var l0=parseInt(k9.getAttribute("rowcount"));
var g3=parseInt(k9.getAttribute("colcount"));
h1=new this.Range();
this.SetRange(h1,"cell",g4,g7,l0,g3);
}
if (h1!=null&&h1.col==-1&&h1.row==-1)return ;
if (h1!=null&&h1.col==-1&&h1.row>=0){
if (h1.row>u6||h1.row+h1.rowCount-1<g9){
this.PaintSelection(f3,h1.row,h1.col,h1.rowCount,h1.colCount,false);
this.PaintSelection(f3,g9,h0,u6-g9+1,k2-h0+1,true);
}else {
if (g9>h1.row){
var f2=g9-h1.row;
this.PaintSelection(f3,h1.row,h1.col,f2,h1.colCount,false);
if (u6<h1.row+h1.rowCount-1){
this.PaintSelection(f3,u6,h1.col,h1.row+h1.rowCount-u6,h1.colCount,false);
}else {
this.PaintSelection(f3,h1.row+h1.rowCount,h1.col,u6-h1.row-h1.rowCount+1,h1.colCount,true);
}
}else {
this.PaintSelection(f3,g9,h1.col,h1.row-g9,h1.colCount,true);
if (u6<h1.row+h1.rowCount-1){
this.PaintSelection(f3,u6+1,h1.col,h1.row+h1.rowCount-u6-1,h1.colCount,false);
}else {
this.PaintSelection(f3,h1.row+h1.rowCount,h1.col,u6-h1.row-h1.rowCount+1,h1.colCount,true);
}
}
}
}else if (h1!=null&&h1.row==-1&&h1.col>=0){
if (h1.col>k2||h1.col+h1.colCount-1<h0){
this.PaintSelection(f3,h1.row,h1.col,h1.rowCount,h1.colCount,false);
this.PaintSelection(f3,g9,h0,u6-g9+1,k2-h0+1,true);
}else {
if (h0>h1.col){
this.PaintSelection(f3,h1.row,h1.col,h1.rowCount,h0-h1.col,false);
if (k2<h1.col+h1.colCount-1){
this.PaintSelection(f3,h1.row,k2,h1.rowCount,h1.col+h1.colCount-k2,false);
}else {
this.PaintSelection(f3,h1.row,h1.col+h1.colCount,h1.rowCount,k2-h1.col-h1.colCount,true);
}
}else {
this.PaintSelection(f3,h1.row,h0,h1.rowCount,h1.col-h0,true);
if (k2<h1.col+h1.colCount-1){
this.PaintSelection(f3,h1.row,k2+1,h1.rowCount,h1.col+h1.colCount-k2-1,false);
}else {
this.PaintSelection(f3,h1.row,h1.col+h1.colCount,h1.rowCount,k2-h1.col-h1.colCount+1,true);
}
}
}
}else if (h1!=null&&h1.row>=0&&h1.col>=0){
this.ExtendSelection(f3,h1,g9,h0,u6-g9+1,k2-h0+1);
}else {
this.PaintSelection(f3,g9,h0,u6-g9+1,k2-h0+1,true);
}
this.SetSelection(f3,g9,h0,u6-g9+1,k2-h0+1,h1==null);
}
this.ExtendSelection=function (f3,h1,newRow,newCol,newRowCount,newColCount)
{
var n8=Math.max(h1.col,newCol);
var n9=Math.min(h1.col+h1.colCount-1,newCol+newColCount-1);
var s0=Math.max(h1.row,newRow);
var u7=Math.min(h1.row+h1.rowCount-1,newRow+newRowCount-1);
if (h1.row<s0){
this.PaintSelection(f3,h1.row,h1.col,s0-h1.row,h1.colCount,false);
}
if (h1.col<n8){
this.PaintSelection(f3,h1.row,h1.col,h1.rowCount,n8-h1.col,false);
}
if (h1.row+h1.rowCount-1>u7){
this.PaintSelection(f3,u7+1,h1.col,h1.row+h1.rowCount-u7-1,h1.colCount,false);
}
if (h1.col+h1.colCount-1>n9){
this.PaintSelection(f3,h1.row,n9+1,h1.rowCount,h1.col+h1.colCount-n9-1,false);
}
if (newRow<s0){
this.PaintSelection(f3,newRow,newCol,s0-newRow,newColCount,true);
}
if (newCol<n8){
this.PaintSelection(f3,newRow,newCol,newRowCount,n8-newCol,true);
}
if (newRow+newRowCount-1>u7){
this.PaintSelection(f3,u7+1,newCol,newRow+newRowCount-u7-1,newColCount,true);
}
if (newCol+newColCount-1>n9){
this.PaintSelection(f3,newRow,n9+1,newRowCount,newCol+newColCount-n9-1,true);
}
}
this.PaintSelection=function (f3,g4,g7,l0,g3,select){
if (g4<0&&g7<0){
this.PaintCornerSelection(f3,select);
}
var u8=false;
if (g4<0){
g4=0;
l0=this.GetRowCountInternal(f3);
u8=true;
}
if (g7<0){
g7=0;
g3=this.GetColCount(f3);
if (this.GetRowHeader(f3)!=null)this.PaintHeaderSelection(f3,g4,g7,l0,g3,select,false);
}
if (u8)
this.PaintHeaderSelection(f3,g4,g7,l0,g3,select,true);
this.PaintViewportSelection(f3,g4,g7,l0,g3,select);
this.PaintAnchorCell(f3);
}
this.PaintFocusRect=function (f3){
var f8=document.getElementById(f3.id+"_focusRectT");
if (f8==null)return ;
var u9=this.GetSelectedRange(f3);
if (f3.c8==null&&(u9==null||(u9.rowCount==0&&u9.colCount==0))){
f8.style.left="-1000px";
var q4=f3.id;
f8=document.getElementById(q4+"_focusRectB");
f8.style.left="-1000px";
f8=document.getElementById(q4+"_focusRectL");
f8.style.left="-1000px";
f8=document.getElementById(q4+"_focusRectR");
f8.style.left="-1000px";
return ;
}
var v0=this.GetOperationMode(f3);
if (v0=="RowMode"||v0=="SingleSelect"||v0=="MultiSelect"||v0=="ExtendedSelect"){
var g4=f3.GetActiveRow();
u9=new this.Range();
this.SetRange(u9,"Row",g4,-1,1,-1);
}else if (u9==null||(u9.rowCount==0&&u9.colCount==0)){
var g4=f3.GetActiveRow();
var g7=f3.GetActiveCol();
u9=new this.Range();
this.SetRange(u9,"Cell",g4,g7,f3.c8.rowSpan,f3.c8.colSpan);
}
if (u9.row<0){
u9.row=0;
u9.rowCount=this.GetRowCountInternal(f3);
}
if (u9.col<0){
u9.col=0;
u9.colCount=this.GetColCount(f3);
}
var g8=this.GetCellFromRowCol(f3,u9.row,u9.col);
if (g8==null)return ;
if (u9.rowCount==1&&u9.colCount==1){
u9.rowCount=g8.rowSpan;
u9.colCount=g8.colSpan;
if (g8.colSpan>1){
var v1=parseInt(g8.getAttribute("col"));
if (v1!=u9.col&&!isNaN(v1))u9.col=v1;
}
}
var f2=this.GetOffsetTop(f3,g8);
var v2=this.GetOffsetLeft(f3,g8);
if (g8.rowSpan>1){
u9.row=g8.parentNode.rowIndex;
var h0=this.GetCellFromRowCol(f3,u9.row,u9.col+u9.colCount-1);
if (h0!=null&&h0.parentNode.rowIndex>g8.parentNode.rowIndex){
f2=this.GetOffsetTop(f3,h0);
}
}
if (g8.colSpan>1){
var h0=this.GetCellFromRowCol(f3,u9.row+u9.rowCount-1,u9.col);
var m7=this.GetOffsetLeft(f3,h0);
if (m7>v2){
v2=m7;
g8=h0;
}
}
var i7=0;
var g2=this.GetViewport(f3).rows;
for (var g4=u9.row;g4<u9.row+u9.rowCount&&g4<g2.length;g4++){
i7+=g2[g4].offsetHeight;
if (g4>u9.row)i7+=parseInt(this.GetViewport(f3).cellSpacing);
}
var i3=0;
var k7=this.GetColGroup(this.GetViewport(f3));
if (k7.childNodes==null||k7.childNodes.length==0)return ;
for (var g7=u9.col;g7<u9.col+u9.colCount&&g7<k7.childNodes.length;g7++){
i3+=k7.childNodes[g7].offsetWidth;
if (g7>u9.col)i3+=parseInt(this.GetViewport(f3).cellSpacing);
}
if (u9.col>g8.cellIndex&&u9.type=="Column"){
var k2=parseInt(g8.getAttribute("col"));
for (var g7=k2;g7<u9.col;g7++){
v2+=k7.childNodes[g7].offsetWidth;
if (g7>k2)v2+=parseInt(this.GetViewport(f3).cellSpacing);
}
}
if (u9.row>0)f2-=2;
else i7-=2;
if (u9.col>0)v2-=2;
else i3-=2;
if (parseInt(this.GetViewport(f3).cellSpacing)>0){
f2+=1;v2+=1;
}else {
i3+=1;
i7+=1;
}
f8.style.left=""+v2+"px";
f8.style.top=""+f2+"px";
f8.style.width=""+i3+"px";
f8=document.getElementById(f3.id+"_focusRectB");
f8.style.left=""+v2+"px";
f8.style.top=""+(f2+i7)+"px";
f8.style.width=""+i3+"px";
f8=document.getElementById(f3.id+"_focusRectL");
f8.style.left=""+v2+"px";
f8.style.top=""+f2+"px";
f8.style.height=""+i7+"px";
f8=document.getElementById(f3.id+"_focusRectR");
f8.style.left=""+(v2+i3)+"px";
f8.style.top=""+f2+"px";
f8.style.height=""+i7+"px";
}
this.PaintCornerSelection=function (f3,select){
var k6=this.GetCorner(f3);
if (k6!=null&&k6.rows.length>0){
for (var e5=0;e5<k6.rows.length;e5++){
for (var h3=0;h3<k6.rows[0].cells.length;h3++){
this.PaintSelectedCell(f3,k6.rows[e5].cells[h3],select);
}
}
}
}
this.PaintHeaderSelection=function (f3,g4,g7,l0,g3,select,c3){
var v3=this.GetRowCountInternal(f3);
var v4=this.GetColCount(f3);
if (c3){
if (this.GetColHeader(f3)==null)return ;
g4=0;
l0=v3=this.GetColHeader(f3).rows.length;
}else {
if (this.GetRowHeader(f3)==null)return ;
g7=0;
g3=v4=this.GetColGroup(this.GetRowHeader(f3)).childNodes.length;
}
var v5=c3?f3.d8:f3.d7;
for (var e5=g4;e5<g4+l0&&e5<v3;e5++){
if (!c3&&this.IsChildSpreadRow(f3,this.GetViewport(f3),e5))continue ;
for (var h3=g7;h3<g7+g3&&h3<v4;h3++){
if (this.IsCovered(f3,e5,h3,v5))continue ;
var g8=this.GetHeaderCellFromRowCol(f3,e5,h3,c3);
if (g8!=null)this.PaintSelectedCell(f3,g8,select);
}
}
}
this.PaintViewportSelection=function (f3,g4,g7,l0,g3,select){
var v3=this.GetRowCountInternal(f3);
var v4=this.GetColCount(f3);
for (var e5=g4;e5<g4+l0&&e5<v3;e5++){
if (this.IsChildSpreadRow(f3,this.GetViewport(f3),e5))continue ;
var g8=null;
for (var h3=g7;h3<g7+g3&&h3<v4;h3++){
if (this.IsCovered(f3,e5,h3,f3.d6))continue ;
g8=this.GetCellFromRowCol(f3,e5,h3,g8);
this.PaintSelectedCell(f3,g8,select);
}
}
}
this.Copy=function (f3){
var m5=this.GetPageActiveSpread();
if (m5!=null&&m5!=f3&&this.GetTopSpread(m5)==f3){
this.Copy(m5);
return ;
}
var k8=this.GetSelection(f3);
var k9=k8.lastChild;
if (k9!=null){
var g4=this.GetRowByKey(f3,k9.getAttribute("row"));
var g7=this.GetColByKey(f3,k9.getAttribute("col"));
var l0=parseInt(k9.getAttribute("rowcount"));
var g3=parseInt(k9.getAttribute("colcount"));
if (g4<0){
g4=0;
l0=this.GetRowCountInternal(f3);
}
if (g7<0){
g7=0;
g3=this.GetColCount(f3);
}
var e8="";
for (var e5=g4;e5<g4+l0;e5++){
if (this.IsChildSpreadRow(f3,this.GetViewport(f3),e5))continue ;
var g8=null;
for (var h3=g7;h3<g7+g3;h3++){
if (this.IsCovered(f3,e5,h3,f3.d6))
e8+="";
else 
{
g8=this.GetCellFromRowCol(f3,e5,h3,g8);
var o8=this.GetCellType(g8);
if (o8=="TextCellType"&&g8.getAttribute("password")!=null)
e8+="";
else 
e8+=this.GetCellValueFromView(f3,g8);
}
if (h3+1<g7+g3)e8+="\t";
}
e8+="\r\n";
}
this.b6=e8;
}else {
if (f3.c8!=null){
var e8=this.GetCellValueFromView(f3,f3.c8);
this.b6=e8;
}
}
}
this.GetCellValueFromView=function (f3,g8){
var s2=null;
if (g8!=null){
var v6=this.GetRender(g8);
s2=this.GetValueFromRender(f3,v6);
if (s2==null||s2==" ")s2="";
}
return s2;
}
this.SetCellValueFromView=function (g8,s2,ignoreLock){
if (g8!=null){
var v6=this.GetRender(g8);
var p3=this.GetCellType(g8);
if ((p3!="readonly"||ignoreLock)&&v6!=null&&v6.getAttribute("FpEditor")!="Button")
this.SetValueToRender(v6,s2);
}
}
this.Paste=function (f3){
var m5=this.GetPageActiveSpread();
if (m5!=null&&m5!=f3&&this.GetTopSpread(m5)==f3){
this.Paste(m5);
return ;
}
if (f3.c8==null)return ;
var e8=this.b6;
if (e8==null)return ;
var e1=this.GetViewportFromCell(f3,f3.c8);
var g4=this.GetRowFromCell(f3,f3.c8);
var g7=this.GetColFromCell(f3,f3.c8);
var g3=this.GetColCount(f3);
var l0=this.GetRowCountInternal(f3);
var v7=g4;
var t4=g7;
var v8=new String(e8);
if (v8.length==0)return ;
var e4=v8.lastIndexOf("\r\n");
if (e4>=0&&e4==v8.length-2)v8=v8.substring(0,e4);
var v9=0;
var w0=v8.split("\r\n");
for (var e5=0;e5<w0.length&&v7<l0;e5++){
if (typeof(w0[e5])=="string"){
w0[e5]=w0[e5].split("\t");
if (w0[e5].length>v9)v9=w0[e5].length;
}
v7++;
}
v7=this.GetSheetIndex(f3,g4);
for (var e5=0;e5<w0.length&&v7<l0;e5++){
var w1=w0[e5];
if (w1!=null){
t4=g7;
var g8=null;
var u6=this.GetDisplayIndex(f3,v7);
for (var h3=0;h3<w1.length&&t4<g3;h3++){
if (!this.IsCovered(f3,u6,t4,f3.d6)){
g8=this.GetCellFromRowCol(f3,u6,t4,g8);
if (g8==null)return ;
var w2=w1[h3];
if (!this.ValidateCell(f3,g8,w2)){
if (f3.getAttribute("lcidMsg")!=null)
alert(f3.getAttribute("lcidMsg"));
else 
alert("Can't set the data into the cell. The data type is not correct for the cell.");
return ;
}
}
t4++;
}
}
v7++;
}
if (w0.length==0)return ;
v7=this.GetSheetIndex(f3,g4);
for (var e5=0;e5<w0.length&&v7<l0;e5++){
t4=g7;
var w1=w0[e5];
var g8=null;
var u6=this.GetDisplayIndex(f3,v7);
for (var h3=0;h3<v9&&t4<g3;h3++){
if (!this.IsCovered(f3,u6,t4,f3.d6)){
g8=this.GetCellFromRowCol(f3,u6,t4,g8);
var p3=this.GetCellType(g8);
var v6=this.GetRender(g8);
if (p3!="readonly"&&v6.getAttribute("FpEditor")!="Button"){
var w2=null;
if (w1!=null&&h3<w1.length)w2=w1[h3];
this.SetCellValueFromView(g8,w2);
if (w2!=null){
this.SetCellValue(f3,g8,""+w2);
}else {
this.SetCellValue(f3,g8,"");
}
}
}
t4++;
}
v7++;
}
var s7=f3.getAttribute("autoCalc");
if (s7!="false"){
this.UpdateValues(f3);
}
var e3=this.GetTopSpread(f3);
var f4=document.getElementById(e3.id+"_textBox");
if (f4!=null){
f4.blur();
}
this.Focus(f3);
}
this.UpdateValues=function (f3){
if (f3.d5==null&&this.GetParentSpread(f3)==null&&f3.getAttribute("rowFilter")!="true"&&f3.getAttribute("hierView")!="true"&&f3.getAttribute("IsNewRow")!="true"){
this.SaveData(f3);
this.StorePostData(f3);
this.SyncData(f3.getAttribute("name"),"UpdateValues",f3);
}
}
this.ValidateCell=function (f3,g8,s2){
if (g8==null||s2==null||s2=="")return true;
var s5=null;
var o8=this.GetCellType(g8);
if (o8!=null){
var h4=this.GetFunction(o8+"_isValid");
if (h4!=null){
s5=h4(g8,s2);
}
}
return (s5==null||s5=="");
}
this.DoclearSelection=function (f3){
var k8=this.GetSelection(f3);
var k9=k8.firstChild;
while (k9!=null){
var g4=this.GetRowByKey(f3,k9.getAttribute("row"));
var g7=this.GetColByKey(f3,k9.getAttribute("col"));
var l0=parseInt(k9.getAttribute("rowcount"));
var g3=parseInt(k9.getAttribute("colcount"));
this.PaintSelection(f3,g4,g7,l0,g3,false);
k8.removeChild(k9);
k9=k8.firstChild;
}
}
this.Clear=function (f3){
var m5=this.GetPageActiveSpread();
if (m5!=null&&m5!=f3&&this.GetTopSpread(m5)==f3){
this.Clear(m5);
return ;
}
var p3=this.GetCellType(f3.c8);
if (p3=="readonly")return ;
var k8=this.GetSelection(f3);
var k9=k8.lastChild;
if (this.AnyReadOnlyCell(f3,k9)){
return ;
}
this.Copy(f3);
if (k9!=null){
var g4=this.GetRowByKey(f3,k9.getAttribute("row"));
var g7=this.GetColByKey(f3,k9.getAttribute("col"));
var l0=parseInt(k9.getAttribute("rowcount"));
var g3=parseInt(k9.getAttribute("colcount"));
if (g4<0){
g4=0;
l0=this.GetRowCountInternal(f3);
}
if (g7<0){
g7=0;
g3=this.GetColCount(f3);
}
for (var e5=g4;e5<g4+l0;e5++){
if (this.IsChildSpreadRow(f3,this.GetViewport(f3),e5))continue ;
var g8=null;
for (var h3=g7;h3<g7+g3;h3++){
if (!this.IsCovered(f3,e5,h3,f3.d6)){
g8=this.GetCellFromRowCol(f3,e5,h3,g8);
var p3=this.GetCellType(g8);
if (p3!="readonly"){
var w3=this.GetEditor(g8);
if (w3!=null&&w3.getAttribute("FpEditor")=="Button")continue ;
this.SetCellValueFromView(g8,null);
this.SetCellValue(f3,g8,"");
}
}
}
}
var s7=f3.getAttribute("autoCalc");
if (s7!="false"){
this.UpdateValues(f3);
}
}
}
this.AnyReadOnlyCell=function (f3,k9){
if (k9!=null){
var g4=this.GetRowByKey(f3,k9.getAttribute("row"));
var g7=this.GetColByKey(f3,k9.getAttribute("col"));
var l0=parseInt(k9.getAttribute("rowcount"));
var g3=parseInt(k9.getAttribute("colcount"));
if (g4<0){
g4=0;
l0=this.GetRowCountInternal(f3);
}
if (g7<0){
g7=0;
g3=this.GetColCount(f3);
}
for (var e5=g4;e5<g4+l0;e5++){
if (this.IsChildSpreadRow(f3,this.GetViewport(f3),e5))continue ;
var g8=null;
for (var h3=g7;h3<g7+g3;h3++){
if (!this.IsCovered(f3,e5,h3,f3.d6)){
g8=this.GetCellFromRowCol(f3,e5,h3,g8);
var p3=this.GetCellType(g8);
if (p3=="readonly"){
return true;
}
}
}
}
}
return false;
}
this.MouseMove=function (event){
if (window.fpPostOn!=null)return ;
event=this.GetEvent(event);
var l7=this.GetTarget(event);
if (l7!=null&&l7.tagName=="scrollbar")
return ;
var f3=this.GetSpread(l7,true);
if (f3!=null&&this.dragSlideBar)
{
if (this.activePager!=null){
var k0=this.GetElementById(this.activePager,f3.id+"_slideBar");
var f2=0;
if (f3.style.position!="absolute"&&f3.style.position!="relative"){
f2=(event.clientX+window.scrollX-8);
}else {
f2=(event.clientX-this.GetOffsetLeft(f3,f3,document.body)+window.scrollX-8);
}
if (f2<f3.slideLeft)f2=f3.slideLeft;
if (f2>f3.slideRight)f2=f3.slideRight;
k0.style.left=f2+"px";
var k4=parseInt(this.activePager.getAttribute("totalPage"))-1;
var w4=parseInt(((f2-f3.slideLeft)/(f3.slideRight-f3.slideLeft))*k4)+1;
var w5=this.GetElementById(this.activePager,f3.id+"_posIndicator");
w5.innerHTML=this.activePager.getAttribute("pageText")+w4;
}
return ;
}
if (this.a3)f3=this.GetSpread(this.b5);
if (f3==null||(!this.a3&&this.HitCommandBar(l7)))return ;
if (f3.getAttribute("OperationMode")=="ReadOnly")return ;
var i6=this.IsXHTML(f3);
if (this.a3){
if (this.dragCol!=null&&this.dragCol>=0){
var w6=this.GetMovingCol(f3);
if (w6!=null){
if (w6.style.display=="none")w6.style.display="";
if (f3.style.position!="absolute"&&f3.style.position!="relative"){
w6.style.top=""+(event.clientY+window.scrollY)+"px";
w6.style.left=""+(event.clientX+window.scrollX+5)+"px";
}else {
w6.style.top=""+(event.clientY-this.GetOffsetTop(f3,f3,document.body)+window.scrollY)+"px";
w6.style.left=""+(event.clientX-this.GetOffsetLeft(f3,f3,document.body)+window.scrollX+5)+"px";
}
}
var e1=this.GetViewport(f3);
var w7=document.body;
var w8=this.GetGroupBar(f3);
var f2=-1;
var j9=event.clientX;
var s0=0;
var n8=0;
if (f3.style.position!="absolute"&&f3.style.position!="relative"){
s0=this.GetOffsetTop(f3,f3,document.body)-e1.parentNode.scrollTop;
n8=this.GetOffsetLeft(f3,f3,document.body)-e1.parentNode.scrollLeft;
j9+=Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);
}else {
j9-=(this.GetOffsetLeft(f3,f3,document.body)-Math.max(document.body.scrollLeft,document.documentElement.scrollLeft));
}
var w9=false;
var i6=this.IsXHTML(f3);
var x0=i6?document.body.parentNode.scrollTop:document.body.scrollTop;
if (this.GetPager1(f3)!=null)x0-=this.GetPager1(f3).offsetHeight;
if (w8!=null&&event.clientY<this.GetOffsetTop(f3,f3,document.body)-e1.parentNode.scrollTop+w8.offsetHeight-x0){
if (f3.style.position!="absolute"&&f3.style.position!="relative")
n8=this.GetOffsetLeft(f3,f3,document.body);
s0+=10;
w9=true;
var x1=w8.getElementsByTagName("TABLE")[0];
if (x1!=null){
for (var e5=0;e5<x1.rows[0].cells[0].childNodes.length;e5++){
var i3=x1.rows[0].cells[0].childNodes[e5].offsetWidth;
if (i3==null)continue ;
if (n8<=j9&&j9<n8+i3){
f2=e5;
break ;
}
n8+=i3;
}
}
if (f2==-1&&j9>=n8)f2=-2;
f3.targetCol=f2;
}else {
if (f3.style.position=="absolute"||f3.style.position=="relative")
n8=-e1.parentNode.scrollLeft;
if (this.GetRowHeader(f3)!=null)n8+=this.GetRowHeader(f3).offsetWidth;
if (w8!=null)s0+=w8.offsetHeight;
if (j9<n8){
f2=0;
}else {
var k7=this.GetColGroup(this.GetColHeader(f3));
if (k7!=null){
for (var e5=0;e5<k7.childNodes.length;e5++){
var i3=k7.childNodes[e5].offsetWidth;
if (i3==null)continue ;
if (n8<=j9&&j9<n8+i3){
f2=e5;
break ;
}
n8+=i3;
}
}
}
if (f2>=0&&f2!=this.dragViewCol){
if (this.dragViewCol<f2){
f2++;
if (f2<k7.childNodes.length)
n8+=i3;
}
}
n8-=5;
var x2=parseInt(this.GetSheetColIndex(f3,f2));
if (x2<0)x2=f2;
f3.targetCol=x2;
}
if (this.GetPager1(f3)!=null)s0+=this.GetPager1(f3).offsetHeight;
var w5=this.GetPosIndicator(f3);
w5.style.left=""+n8+"px";
w5.style.top=""+s0+"px";
if (w8!=null&&w9&&w8.getElementsByTagName("TABLE").length==0){
w5.style.display="none";
}else {
if (w9||f3.allowColMove)
w5.style.display="";
else 
w5.style.display="none";
}
return ;
}
if (this.b1==null&&this.b2==null){
if (f3.c8!=null){
var h6=this.GetParent(this.GetViewport(f3));
if (h6!=null){
var p5=f3.offsetTop+h6.offsetTop+h6.offsetHeight-10;
if (event.clientY>p5){
h6.scrollTop=h6.scrollTop+10;
this.ScrollView(f3);
}else if (event.clientY<f3.offsetTop+h6.offsetTop+5){
h6.scrollTop=h6.scrollTop-10;
this.ScrollView(f3);
}
var x3=f3.offsetLeft+h6.offsetLeft+h6.offsetWidth-20;
if (event.clientX>x3){
h6.scrollLeft=h6.scrollLeft+10;
this.ScrollView(f3);
}else if (event.clientX<f3.offsetLeft+h6.offsetLeft+5){
h6.scrollLeft=h6.scrollLeft-10;
this.ScrollView(f3);
}
}
var g8=this.GetCell(l7,null,event);
if (g8!=null&&g8!=f3.c9){
var v0=this.GetOperationMode(f3);
if (v0!="MultiSelect"){
if (v0=="SingleSelect"||v0=="RowMode"){
this.ClearSelection(f3);
var g9=this.GetRowFromCell(f3,g8);
this.UpdateAnchorCell(f3,g9,0);
this.SelectRow(f3,g9,1,true,true);
}else {
this.Select(f3,f3.c8,g8);
}
f3.c9=g8;
}
}
}
}else if (this.b1!=null){
var x4=event.clientX-this.b3;
var x5=parseInt(this.b1.width)+x4;
var r9=0;
var x6=(x5>r9);
if (x6){
this.b1.width=x5;
var j1=parseInt(this.b1.getAttribute("index"));
this.SetWidthFix(this.GetColHeader(f3),j1,x5);
this.b3=event.clientX;
}
}else if (this.b2!=null){
var x4=event.clientY-this.b4;
var x7=parseInt(this.b2.style.height)+x4;
var r9=0;
var x6=(r9<x7);
if (x6){
this.b2.style.height=""+(parseInt(this.b2.style.height)+x4)+"px";
this.b4=event.clientY;
}
}
}else {
this.b5=l7;
if (this.b5==null||this.GetSpread(this.b5)!=f3)return ;
var l7=this.GetSizeColumn(f3,this.b5,event);
if (l7!=null){
this.b1=l7;
this.b5.style.cursor=this.GetResizeCursor(false);
}else {
var l7=this.GetSizeRow(f3,this.b5,event);
if (l7!=null){
this.b2=l7;
if (this.b5!=null&&this.b5.style!=null)this.b5.style.cursor=this.GetResizeCursor(true);
}else {
if (this.b5!=null&&this.b5.style!=null){
var g8=this.GetCell(this.b5);
if (g8!=null&&this.IsHeaderCell(f3,g8))this.b5.style.cursor="default";
}
}
}
}
}
this.GetResizeCursor=function (h9){
if (h9){
return "n-resize";
}else {
return "w-resize";
}
}
this.HitCommandBar=function (l7){
var f2=l7;
var f3=this.GetTopSpread(this.GetSpread(f2,true));
if (f3==null)return false;
var n4=this.GetCommandBar(f3);
while (f2!=null&&f2!=f3){
if (f2==n4)return true;
f2=f2.parentNode;
}
return false;
}
this.OpenWaitMsg=function (f3){
var h4=document.getElementById(f3.id+"_waitmsg");
if (h4==null)return ;
var i3=f3.offsetWidth;
var i7=f3.offsetHeight;
var i0=this.CreateTestBox(f3);
i0.style.fontFamily=h4.style.fontFamily;
i0.style.fontSize=h4.style.fontSize;
i0.style.fontWeight=h4.style.fontWeight;
i0.style.fontStyle=h4.style.fontStyle;
i0.innerHTML=h4.innerHTML;
h4.style.width=""+(i0.offsetWidth+2)+"px";
var v2=Math.max(10,(i3-parseInt(h4.style.width))/2);
var f2=Math.max(10,(i7-parseInt(h4.style.height))/2);
if (f3.style.position!="absolute"&&f3.style.position!="relative"){
v2+=f3.offsetLeft;
f2+=f3.offsetTop;
}
h4.style.top=""+f2+"px";
h4.style.left=""+v2+"px";
h4.style.display="block";
}
this.CloseWaitMsg=function (f3){
var h4=document.getElementById(f3.id+"_waitmsg");
if (h4==null)return ;
h4.style.display="none";
this.Focus(f3);
}
this.MouseDown=function (event){
if (window.fpPostOn!=null)return ;
event=this.GetEvent(event);
var l7=this.GetTarget(event);
var f3=this.GetSpread(l7,true);
var x8=this.GetPageActiveSpread();
if (x8!=null&&x8!=f3&&!this.IsChild(x8,f3)&&!this.IsChild(f3,x8))this.ClearSelection(x8);
if (this.GetViewport(f3)==null)return ;
if (f3!=null&&l7.parentNode!=null&&l7.parentNode.getAttribute("name")==f3.id+"_slideBar"){
if (this.IsChild(l7,this.GetPager1(f3)))
this.activePager=this.GetPager1(f3);
else if (this.IsChild(l7,this.GetPager2(f3)))
this.activePager=this.GetPager2(f3);
if (this.activePager!=null){
this.dragSlideBar=true;
}
return this.CancelDefault(event);
}
if (this.GetOperationMode(f3)=="ReadOnly")return ;
var i6=false;
if (f3!=null)i6=this.IsXHTML(f3);
if (this.a4){
var f2=this.GetCell(l7);
if (f2!=f3.c8){
var m0=this.EndEdit();
if (!m0)return ;
}else 
return ;
}
if (l7==this.GetParent(this.GetViewport(f3))){
if (this.GetTopSpread(x8)!=f3){
if (f3.c8!=null)this.SelectRange(this.GetRowFromCell(f3,f3.c8),this.GetColFromCell(f3,f3.c8),1,1,true);
if (x8!=null&&x8!=f3)this.ClearSelection(x8);
this.SetActiveSpread(event);
}
return ;
}
var x9=(x8==f3);
this.SetActiveSpread(event);
x8=this.GetPageActiveSpread();
if (this.HitCommandBar(l7))return ;
if (event.button==2)return ;
if (this.IsChild(l7,this.GetGroupBar(f3))){
var h0=parseInt(l7.id.replace(f3.id+"_group",""));
if (!isNaN(h0)){
this.dragCol=h0;
this.dragViewCol=this.GetColByKey(f3,h0);
var w6=this.GetMovingCol(f3);
w6.innerHTML=l7.innerHTML;
w6.style.width=""+Math.max(this.GetPreferredCellWidth(f3,l7),80)+"px";
if (f3.getAttribute("DragColumnCssClass")==null)
w6.style.backgroundColor=l7.style.backgroundColor;
w6.style.top="-50px";
w6.style.left="-100px";
this.a3=true;
f3.dragFromGroupbar=true;
this.CancelDefault(event);
return ;
}
}
this.b1=this.GetSizeColumn(f3,l7,event);
if (this.b1!=null){
this.a3=true;
this.b3=this.b4=event.clientX;
if (this.b1.style!=null)this.b1.style.cursor=this.GetResizeCursor(false);
this.b5=l7;
}else {
this.b2=this.GetSizeRow(f3,l7,event);
if (this.b2!=null){
this.a3=true;
this.b3=this.b4=event.clientY;
this.b2.style.cursor=this.GetResizeCursor(true);
this.b5=l7;
}else {
var y0=this.GetCell(l7,null,event);
if (y0==null){
var c1=this.GetCorner(f3);
if (c1!=null&&this.IsChild(l7,c1)){
if (this.GetOperationMode(f3)=="Normal")
this.SelectTable(f3,true);
}
return ;
}
if (y0.parentNode.getAttribute("FpSpread")=="ch"&&this.GetColFromCell(f3,y0)>=this.GetColCount(f3))return ;
if (y0.parentNode.getAttribute("FpSpread")=="rh"&&this.IsChildSpreadRow(f3,this.GetViewport(f3),y0.parentNode.rowIndex))return ;
if (y0.parentNode.getAttribute("FpSpread")=="ch"&&(this.GetOperationMode(f3)=="RowMode"||this.GetOperationMode(f3)=="SingleSelect"||this.GetOperationMode(f3)=="ExtendedSelect")){
if (!f3.allowColMove&&!f3.allowGroup)
return ;
}else {
var l8=this.FireActiveCellChangingEvent(f3,this.GetRowFromCell(f3,y0),this.GetColFromCell(f3,y0));
if (l8)return ;
var s8=this.GetOperationMode(f3);
var e3=this.GetTopSpread(f3);
if (!event.ctrlKey||f3.getAttribute("multiRange")!="true"||e3.getAttribute("hierView")=="true"){
if (s8!="MultiSelect"){
this.ClearSelection(f3);
}
}else {
if (s8!="ExtendedSelect"&&s8!="MultiSelect"){
if (f3.c8!=null)this.PaintSelectedCell(f3,f3.c8,true);
}
}
}
f3.c8=y0;
var g8=f3.c8;
var t8=this.GetParent(this.GetViewport(f3));
if (t8!=null&&!this.IsControl(l7)&&(l7!=null&&l7.tagName!="scrollbar")){
if (this.IsChild(g8,t8)&&g8.offsetLeft+g8.offsetWidth>t8.scrollLeft+t8.clientWidth){
t8.scrollLeft=g8.offsetLeft+g8.offsetWidth-t8.clientWidth;
}
if (this.IsChild(g8,t8)&&g8.offsetTop+g8.offsetHeight>t8.scrollTop+t8.clientHeight&&g8.offsetHeight<t8.clientHeight){
t8.scrollTop=g8.offsetTop+g8.offsetHeight-t8.clientHeight;
}
if (g8.offsetTop<t8.scrollTop){
t8.scrollTop=g8.offsetTop;
}
if (g8.offsetLeft<t8.scrollLeft){
t8.scrollLeft=g8.offsetLeft;
}
this.ScrollView(f3);
}
if (y0.parentNode.getAttribute("FpSpread")!="ch")this.SetActiveRow(f3,this.GetRowKeyFromCell(f3,f3.c8));
if (y0.parentNode.getAttribute("FpSpread")=="rh")
this.SetActiveCol(f3,0);
else {
this.SetActiveCol(f3,this.GetColKeyFromCell(f3,f3.c8));
}
var s8=this.GetOperationMode(f3);
if (f3.c8.parentNode.getAttribute("FpSpread")=="r"){
if (s8=="ExtendedSelect"||s8=="MultiSelect"){
var y1=this.IsRowSelected(f3,this.GetRowFromCell(f3,f3.c8));
if (y1)
this.SelectRow(f3,this.GetRowFromCell(f3,f3.c8),1,false,true);
else 
this.SelectRow(f3,this.GetRowFromCell(f3,f3.c8),1,true,true);
}
else if (s8=="RowMode"||s8=="SingleSelect")
this.SelectRow(f3,this.GetRowFromCell(f3,f3.c8),1,true,true);
else {
this.SelectRange(f3,this.GetRowFromCell(f3,f3.c8),this.GetColFromCell(f3,f3.c8),1,1,true);
}
f3.d2=this.GetRowFromCell(f3,f3.c8);
f3.d3=this.GetColFromCell(f3,f3.c8);
}else if (f3.c8.parentNode.getAttribute("FpSpread")=="ch"){
if (l7.tagName=="INPUT"||l7.tagName=="TEXTAREA"||l7.tagName=="SELECT")
return ;
var p8=this.GetColFromCell(f3,f3.c8);
if (f3.allowColMove||f3.allowGroup)
{
if (s8=="Normal"||s8=="ReadOnly")
this.SelectColumn(f3,p8,1,true);
this.dragCol=parseInt(this.GetSheetColIndex(f3,p8));
this.dragViewCol=p8;
var w6=this.GetMovingCol(f3);
if (f3.getAttribute("DragColumnCssClass")==null)
w6.style.backgroundColor=y0.style.backgroundColor;
w6.style.top="0px";
w6.style.left="-1000px";
w6.style.display="";
w6.innerHTML=y0.innerHTML;
w6.style.width=""+Math.max(this.GetPreferredCellWidth(f3,y0),80)+"px";
w6.style.height=""+y0.offsetHeight+"px";
}else {
if (s8=="Normal"||s8=="ReadOnly"){
this.SelectColumn(f3,p8,1,true);
}
else 
return ;
}
}else if (f3.c8.parentNode.getAttribute("FpSpread")=="rh"){
if (l7.tagName=="INPUT"||l7.tagName=="TEXTAREA"||l7.tagName=="SELECT")
return ;
if (s8=="ExtendedSelect"||s8=="MultiSelect"){
if (this.IsRowSelected(f3,this.GetRowFromCell(f3,f3.c8)))
this.SelectRow(f3,this.GetRowFromCell(f3,f3.c8),1,false,true);
else 
this.SelectRow(f3,this.GetRowFromCell(f3,f3.c8),1,true,true);
}else {
this.SelectRow(f3,this.GetRowFromCell(f3,f3.c8),1,true);
}
}
if (f3.c8!=null){
var f6=this.CreateEvent("ActiveCellChanged");
f6.cmdID=f3.id;
f6.Row=f6.row=this.GetSheetIndex(f3,this.GetRowFromCell(f3,f3.c8));
f6.Col=f6.col=this.GetColFromCell(f3,f3.c8);
this.FireEvent(f3,f6);
}
f3.c9=f3.c8;
if (f3.c8!=null){
f3.d0=this.GetRowFromCell(f3,f3.c8);
f3.d1=this.GetColFromCell(f3,f3.c8);
}
this.b5=l7;
this.a3=true;
}
}
this.EnableButtons(f3);
if (!this.a4&&this.b2==null&&this.b1==null){
if (f3.c8!=null&&this.IsChild(f3.c8,f3)&&!this.IsHeaderCell(this.GetCell(l7))){
var h5=this.GetEditor(f3.c8);
if (h5!=null){
if (h5.type=="submit")this.SaveData(f3);
this.a4=(h5.type!="button"&&h5.type!="submit");
this.a5=h5;
this.a6=this.GetEditorValue(h5);
h5.focus();
}
}
}
if (!this.IsControl(l7)){
if (f3!=null)this.UpdatePostbackData(f3);
return this.CancelDefault(event);
}
}
this.GetMovingCol=function (f3){
var w6=document.getElementById(f3.id+"movingCol");
if (w6==null){
w6=document.createElement("DIV");
w6.style.display="none";
w6.style.position="absolute";
w6.style.top="0px";
w6.style.left="0px";
w6.id=f3.id+"movingCol";
w6.align="center";
f3.insertBefore(w6,null);
if (f3.getAttribute("DragColumnCssClass")!=null)
w6.className=f3.getAttribute("DragColumnCssClass");
else 
w6.style.border="1px solid black";
w6.style.MozOpacity=0.50;
}
return w6;
}
this.IsControl=function (f2){
return (f2!=null&&(f2.tagName=="INPUT"||f2.tagName=="TEXTAREA"||f2.tagName=="SELECT"||f2.tagName=="OPTION"));
}
this.EnableButtons=function (f3){
var p3=this.GetCellType(f3.c8);
var k8=this.GetSelection(f3);
var k9=k8.lastChild;
var q5=f3.getAttribute("OperationMode");
var y2=q5=="ReadOnly"||q5=="SingleSelect"||p3=="readonly";
if (!y2){
y2=this.AnyReadOnlyCell(f3,k9);
}
if (y2){
var f1=this.GetCmdBtn(f3,"Copy");
this.UpdateCmdBtnState(f1,k9==null);
var e8=this.b6;
f1=this.GetCmdBtn(f3,"Paste");
this.UpdateCmdBtnState(f1,(k9==null||e8==null));
f1=this.GetCmdBtn(f3,"Clear");
this.UpdateCmdBtnState(f1,true);
}else {
var f1=this.GetCmdBtn(f3,"Copy");
this.UpdateCmdBtnState(f1,k9==null);
var e8=this.b6;
f1=this.GetCmdBtn(f3,"Paste");
this.UpdateCmdBtnState(f1,(k9==null||e8==null));
f1=this.GetCmdBtn(f3,"Clear");
this.UpdateCmdBtnState(f1,k9==null);
}
}
this.CellClicked=function (g8){
var f3=this.GetSpread(g8);
if (f3!=null){
this.SaveData(f3);
}
}
this.UpdateCmdBtnState=function (f1,disabled){
if (f1==null)return ;
if (f1.tagName=="INPUT"){
var f2=f1.disabled;
if (f2==disabled)return ;
f1.disabled=disabled;
}else {
var f2=f1.getAttribute("disabled");
if (f2==disabled)return ;
f1.setAttribute("disabled",disabled);
}
if (f1.tagName=="IMG"){
var y3=f1.getAttribute("disabledImg");
if (disabled&&y3!=null&&y3!=""){
if (f1.src.indexOf(y3)<0)f1.src=y3;
}else {
var y4=f1.getAttribute("enabledImg");
if (f1.src.indexOf(y4)<0)f1.src=y4;
}
}
}
this.MouseUp=function (event){
if (window.fpPostOn!=null)return ;
event=this.GetEvent(event);
var l7=this.GetTarget(event);
var f3=this.GetSpread(l7,true);
if (f3==null&&!this.a3){
return ;
}
if (this.dragSlideBar&&f3!=null)
{
this.dragSlideBar=false;
if (this.activePager!=null){
var k0=this.GetElementById(this.activePager,f3.id+"_slideBar");
var f2=parseInt(k0.style.left);
if (f2<f3.slideLeft)f2=f3.slideLeft;
if (f2>f3.slideRight)f2=f3.slideRight;
k0.style.left=f2+"px";
var k4=parseInt(this.activePager.getAttribute("totalPage"))-1;
var w4=parseInt(((f2-f3.slideLeft)/(f3.slideRight-f3.slideLeft))*k4);
this.activePager=null;
this.GotoPage(f3,w4);
}
return ;
}
if (this.a3&&(this.b1!=null||this.b2!=null)){
if (this.b1!=null)
f3=this.GetSpread(this.b1);
else 
f3=this.GetSpread(this.b2);
}
if (f3==null)return ;
if (this.GetViewport(f3)==null)return ;
var q5=this.GetOperationMode(f3);
if (q5=="ReadOnly")return ;
var h4=true;
if (this.a3){
this.a3=false;
if (this.dragCol!=null&&this.dragCol>=0){
var y5=(this.IsChild(l7,this.GetGroupBar(f3))||l7==this.GetGroupBar(f3));
if (!y5&&this.GetGroupBar(f3)!=null){
var y6=event.clientX;
var y7=event.clientY;
var n8=f3.offsetLeft;
var s0=f3.offsetTop;
var y8=this.GetGroupBar(f3).offsetWidth;
var y9=this.GetGroupBar(f3).offsetHeight;
var n3=window.scrollX;
var n2=window.scrollY;
if (this.GetPager1(f3)!=null)n2-=this.GetPager1(f3).offsetHeight;
y5=(n8<=n3+y6&&n3+y6<=n8+y8&&s0<=n2+y7&&n2+y7<=s0+y9);
}
if (f3.dragFromGroupbar){
if (y5){
if (f3.targetCol>0)
this.Regroup(f3,this.dragCol,parseInt((f3.targetCol+1)/2));
else 
this.Regroup(f3,this.dragCol,f3.targetCol);
}else {
this.Ungroup(f3,this.dragCol,f3.targetCol);
}
}else {
if (y5){
if (f3.allowGroup){
if (f3.targetCol>0)
this.Group(f3,this.dragCol,parseInt((f3.targetCol+1)/2));
else 
this.Group(f3,this.dragCol,f3.targetCol);
}
}else if (f3.allowColMove){
if (f3.targetCol!=null){
var f6=this.CreateEvent("ColumnDragMove");
f6.cancel=false;
f6.col=this.dragViewCol;
this.FireEvent(f3,f6);
if (!f6.cancel){
this.MoveCol(f3,this.dragCol,f3.targetCol);
var f6=this.CreateEvent("ColumnDragMoveCompleted");
f6.col=this.dragViewCol;
this.FireEvent(f3,f6);
}
}
}
}
var w6=this.GetMovingCol(f3);
if (w6!=null)
w6.style.display="none";
this.dragCol=-1;
this.dragViewCol=-1;
var w5=this.GetPosIndicator(f3);
if (w5!=null)
w5.style.display="none";
f3.dragFromGroupbar=false;
f3.targetCol=null;
this.b1=this.b2=null;
}
if (this.b1!=null){
h4=false;
var x4=event.clientX-this.b3;
var x5=parseInt(this.b1.width);
var z0=x5;
if (isNaN(x5))x5=0;
x5+=x4;
if (x5<1)x5=1;
var j1=parseInt(this.b1.getAttribute("index"));
var z1=this.GetColGroup(this.GetViewport(f3));
if (z1!=null&&z1.childNodes.length>0){
z0=parseInt(z1.childNodes[j1].width);
}else {
z0=1;
}
if (this.GetViewport(f3).rules!="rows"){
if (j1==0)z0+=1;
if (j1==parseInt(this.colCount)-1)z0-=1;
}
if (x5!=z0&&event.clientX!=this.b4)
{
this.SetColWidth(f3,j1,x5);
var f6=this.CreateEvent("ColWidthChanged");
f6.col=j1;
f6.width=x5;
this.FireEvent(f3,f6);
}
this.ScrollView(f3);
this.PaintFocusRect(f3);
}else if (this.b2!=null){
h4=false;
var x4=event.clientY-this.b4;
var x7=this.b2.offsetHeight+x4;
if (x7<1){
x7=1;
x4=1-this.b2.offsetHeight;
}
this.b2.style.height=""+x7+"px";
this.b2.style.cursor="auto";
var h6=null;
h6=this.GetViewport(f3);
if (h6.rows.length>=2&&h6.cellSpacing=="0"){
if (this.b2.rowIndex==0)
h6.rows[0].style.height=""+(parseInt(this.b2.style.height)-1)+"px";
else if (this.b2.rowIndex==h6.rows.length-1)
h6.rows[this.b2.rowIndex].style.height=""+(parseInt(this.b2.style.height)+1)+"px";
else 
h6.rows[this.b2.rowIndex].style.height=this.b2.style.height;
}else {
h6.rows[this.b2.rowIndex].style.height=this.b2.style.height;
}
var n7=this.AddRowInfo(f3,this.b2.getAttribute("FpKey"));
if (n7!=null){
this.SetRowHeight(f3,n7,parseInt(this.b2.style.height));
}
if (this.b3!=event.clientY){
var f6=this.CreateEvent("RowHeightChanged");
f6.row=this.GetRowFromCell(f3,this.b2.cells[0]);
f6.height=this.b2.offsetHeight;
this.FireEvent(f3,f6);
}
var h8=this.GetParentSpread(f3);
if (h8!=null)this.UpdateRowHeight(h8,f3);
var e3=this.GetTopSpread(f3);
this.SizeAll(e3);
this.Refresh(e3);
this.ScrollView(f3);
this.PaintFocusRect(f3);
}else {
}
if (this.b5!=null){
this.b5=null;
}
}
if (h4)h4=!this.IsControl(l7);
if (h4&&this.HitCommandBar(l7))return ;
var z2=false;
var k8=this.GetSelection(f3);
if (k8!=null){
var k9=k8.firstChild;
var h1=new this.Range();
if (k9!=null){
h1.row=this.GetRowByKey(f3,k9.getAttribute("row"));
h1.col=this.GetColByKey(f3,k9.getAttribute("col"));
h1.rowCount=parseInt(k9.getAttribute("rowcount"));
h1.colCount=parseInt(k9.getAttribute("colcount"));
}
switch (f3.d4){
case "":
var g2=this.GetViewport(f3).rows;
for (var e5=h1.row;e5<h1.row+h1.rowCount&&e5<g2.length;e5++){
if (g2[e5].cells.length>0&&g2[e5].cells[0].firstChild!=null&&g2[e5].cells[0].firstChild.nodeName!="#text"){
if (g2[e5].cells[0].firstChild.getAttribute("FpSpread")=="Spread"){
z2=true;
break ;
}
}
}
break ;
case "c":
var h6=this.GetViewport(f3);
for (var e5=0;e5<h6.rows.length;e5++){
if (this.IsChildSpreadRow(f3,h6,e5)){
z2=true;
break ;
}
}
break ;
case "r":
var h6=this.GetViewport(f3);
var t1=h1.rowCount;
for (var e5=h1.row;e5<h1.row+t1&&e5<h6.rows.length;e5++){
if (this.IsChildSpreadRow(f3,h6,e5)){
z2=true;
break ;
}
}
}
}
if (z2){
var f1=this.GetCmdBtn(f3,"Copy");
this.UpdateCmdBtnState(f1,true);
f1=this.GetCmdBtn(f3,"Paste");
this.UpdateCmdBtnState(f1,true);
f1=this.GetCmdBtn(f3,"Clear");
this.UpdateCmdBtnState(f1,true);
}
var e3=this.GetTopSpread(f3);
var f4=document.getElementById(e3.id+"_textBox");
if (f4!=null){
f4.style.top=event.clientY-f3.offsetTop;
f4.style.left=event.clientX-f3.offsetLeft;
}
if (h4)this.Focus(f3);
}
this.UpdateRowHeight=function (h8,child){
var k1=child.parentNode;
while (k1!=null){
if (k1.tagName=="TR")break ;
k1=k1.parentNode;
}
var i6=this.IsXHTML(h8);
if (k1!=null){
var e4=k1.rowIndex;
if (this.GetRowHeader(h8)!=null){
var n5=0;
if (this.GetColHeader(child)!=null)n5=this.GetColHeader(child).offsetHeight;
if (this.GetRowHeader(child)!=null)n5+=this.GetRowHeader(child).offsetHeight;
if (!i6)n5-=this.GetViewport(h8).cellSpacing;
if (this.GetViewport(h8).cellSpacing==0){
this.GetRowHeader(h8).rows[e4].style.height=""+(n5+1)+"px";
if (this.GetParentSpread(h8)!=null){
this.GetRowHeader(h8).parentNode.style.height=""+this.GetRowHeader(h8).offsetHeight+"px";
}
}
else 
this.GetRowHeader(h8).rows[e4].style.height=""+(n5+2)+"px";
this.GetViewport(h8).rows[e4].style.height=""+n5+"px";
child.style.height=""+n5+"px";
}
}
var z3=this.GetParentSpread(h8);
if (z3!=null)
this.UpdateRowHeight(z3,h8);
}
this.MouseOut=function (){
if (!this.a3&&this.b1!=null&&this.b1.style!=null)this.b1.style.cursor="auto";
}
this.KeyDown=function (f3,event){
if (window.fpPostOn!=null)return ;
if (f3.ProcessKeyMap(event))return ;
var h5=false;
if (this.a4&&this.a5!=null){
var z4=this.GetEditor(this.a5);
h5=(z4!=null);
}
if (event.keyCode!=event.DOM_VK_RETURN&&event.keyCode!=event.DOM_VK_TAB&&(this.a4&&!h5)&&this.a5.tagName=="SELECT")return ;
switch (event.keyCode){
case event.DOM_VK_LEFT:
case event.DOM_VK_RIGHT:
if (h5&&this.a5.getAttribute("FpEditor")!="RadioButton"){
this.EndEdit();
}
if (!this.a4){
this.NextCell(f3,event,event.keyCode);
}
break ;
case event.DOM_VK_UP:
case event.DOM_VK_DOWN:
case event.DOM_VK_RETURN:
if (this.a5!=null&&this.a5.tagName=="TEXTAREA")return ;
if (event.keyCode==event.DOM_VK_RETURN)this.CancelDefault(event);
if (this.a4){
var m0=this.EndEdit();
if (!m0)return ;
}
this.NextCell(f3,event,event.keyCode);
var e3=this.GetTopSpread(f3);
var f4=document.getElementById(e3.id+"_textBox");
if (event.DOM_VK_RETURN==event.keyCode)f4.focus();
break ;
case event.DOM_VK_TAB:
if (this.a4){
var m0=this.EndEdit();
if (!m0)return ;
}
var l9=this.GetProcessTab(f3);
var z5=(l9=="true"||l9=="True");
if (z5)this.NextCell(f3,event,event.keyCode);
break ;
case event.DOM_VK_SHIFT:
break ;
case event.DOM_VK_HOME:
case event.DOM_VK_END:
case event.DOM_VK_PAGE_UP:
case event.DOM_VK_PAGE_DOWN:
if (!this.a4){
this.NextCell(f3,event,event.keyCode);
}
break ;
default :
var z6=window.navigator.userAgent;
var z7=(z6.indexOf("Firefox/2.")>=0);
if (z7){
if (event.keyCode==67&&event.ctrlKey&&(!this.a4||h5))this.Copy(f3);
else if (event.keyCode==86&&event.ctrlKey&&(!this.a4||h5))this.Paste(f3);
else if (event.keyCode==88&&event.ctrlKey&&(!this.a4||h5))this.Clear(f3);
else if (!this.a4&&f3.c8!=null&&!this.IsHeaderCell(f3.c8)&&!event.ctrlKey&&!event.altKey){
this.StartEdit(f3,f3.c8);
}
}else {
if (event.charCode==99&&event.ctrlKey&&(!this.a4||h5))this.Copy(f3);
else if (event.charCode==118&&event.ctrlKey&&(!this.a4||h5))this.Paste(f3);
else if (event.charCode==120&&event.ctrlKey&&(!this.a4||h5))this.Clear(f3);
else if (!this.a4&&f3.c8!=null&&!this.IsHeaderCell(f3.c8)&&!event.ctrlKey&&!event.altKey){
this.StartEdit(f3,f3.c8);
}
}
break ;
}
}
this.GetProcessTab=function (f3){
return f3.getAttribute("ProcessTab");
}
this.ExpandRow=function (f3,h9){
var q4=f3.getAttribute("name");
var u3=(f3.getAttribute("ajax")!="false");
if (u3)
this.SyncData(q4,"ExpandView,"+h9,f3);
else 
__doPostBack(q4,"ExpandView,"+h9);
}
this.SortColumn=function (f3,column){
var q4=f3.getAttribute("name");
var u3=(f3.getAttribute("ajax")!="false");
if (u3)
this.SyncData(q4,"SortColumn,"+column,f3);
else 
__doPostBack(q4,"SortColumn,"+column);
}
this.Filter=function (event,f3){
var l7=this.GetTarget(event);
var f2=l7.value;
if (l7.tagName=="SELECT")
f2=l7[l7.selectedIndex].text;
var u3=(f3.getAttribute("ajax")!="false");
if (u3)
this.SyncData(l7.name,f2,f3);
else 
__doPostBack(l7.name,f2);
}
this.MoveCol=function (f3,from,to){
var q4=f3.getAttribute("name");
var u3=(f3.getAttribute("ajax")!="false");
if (u3)
this.SyncData(q4,"MoveCol,"+from+","+to,f3);
else 
__doPostBack(q4,"MoveCol,"+from+","+to);
}
this.Group=function (f3,g6,toCol){
var q4=f3.getAttribute("name");
var u3=(f3.getAttribute("ajax")!="false");
if (u3)
this.SyncData(q4,"Group,"+g6+","+toCol,f3);
else 
__doPostBack(q4,"Group,"+g6+","+toCol);
}
this.Ungroup=function (f3,g6,toCol){
var q4=f3.getAttribute("name");
var u3=(f3.getAttribute("ajax")!="false");
if (u3)
this.SyncData(q4,"Ungroup,"+g6+","+toCol,f3);
else 
__doPostBack(q4,"Ungroup,"+g6+","+toCol);
}
this.Regroup=function (f3,fromCol,toCol){
var q4=f3.getAttribute("name");
var u3=(f3.getAttribute("ajax")!="false");
if (u3)
this.SyncData(q4,"Regroup,"+fromCol+","+toCol,f3);
else 
__doPostBack(q4,"Regroup,"+fromCol+","+toCol);
}
this.ProcessData=function (){
try {
var z8=this;
z8.removeEventListener("load",the_fpSpread.ProcessData,false);
var l7=window.srcfpspread;
l7=l7.split(":").join("_");
var z9=window.fpcommand;
var aa0=document;
var aa1=aa0.getElementById(l7+"_buff");
if (aa1==null){
aa1=aa0.createElement("iframe");
aa1.id=l7+"_buff";
aa1.style.display="none";
aa0.body.appendChild(aa1);
}
var f3=aa0.getElementById(l7);
the_fpSpread.CloseWaitMsg(f3);
if (aa1==null)return ;
var aa2=z8.responseText;
aa1.contentWindow.document.body.innerHTML=aa2;
var l9=aa1.contentWindow.document.getElementById(l7+"_values");
if (l9!=null){
var q3=l9.getElementsByTagName("data")[0];
var k9=q3.firstChild;
the_fpSpread.error=false;
while (k9!=null){
var g4=the_fpSpread.GetRowByKey(f3,k9.getAttribute("r"));
var g7=the_fpSpread.GetColByKey(f3,k9.getAttribute("c"));
var u5=the_fpSpread.GetValue(f3,g4,g7);
if (k9.innerHTML!=u5){
var h4=the_fpSpread.GetFormula(f3,g4,g7);
var i2=the_fpSpread.GetCellByRowCol(f3,g4,g7);
the_fpSpread.SetCellValueFromView(i2,k9.innerHTML,true);
i2.setAttribute("FpFormula",h4);
}
k9=k9.nextSibling;
}
the_fpSpread.ClearCellData(f3);
}else {
the_fpSpread.UpdateSpread(aa0,aa1,l7,aa2,z9);
}
var u4=the_fpSpread.GetForm(f3);
u4.__EVENTTARGET.value="";
u4.__EVENTARGUMENT.value="";
var u5=aa0.getElementsByName("__VIEWSTATE")[0];
var f2=aa1.contentWindow.document.getElementsByName("__VIEWSTATE")[0];
if (u5!=null&&f2!=null)u5.value=f2.value;
u5=aa0.getElementsByName("__EVENTVALIDATION");
f2=aa1.contentWindow.document.getElementsByName("__EVENTVALIDATION");
if (u5!=null&&f2!=null&&u5.length>0&&f2.length>0)
u5[0].value=f2[0].value;
aa1.contentWindow.document.location="about:blank";
window.fpPostOn=null;
d5=null;
}catch (f6){
window.fpPostOn=null;
d5=null;
}
var f3=the_fpSpread.GetTopSpread(aa0.getElementById(l7));
var f6=the_fpSpread.CreateEvent("CallBackStopped");
f6.command=z9;
the_fpSpread.FireEvent(f3,f6);
};
this.UpdateSpread=function (aa0,aa1,l7,aa2,z9){
var f3=the_fpSpread.GetTopSpread(aa0.getElementById(l7));
var p4=aa1.contentWindow.document.getElementById(f3.id);
if (p4!=null){
the_fpSpread.error=(p4.getAttribute("error")=="true");
if (z9=="LoadOnDemand"&&!the_fpSpread.error){
var aa3=this.GetElementById(f3,f3.id+"_data");
var aa4=this.GetElementById(p4,f3.id+"_data");
if (aa3!=null&&aa4!=null)aa3.setAttribute("data",aa4.getAttribute("data"));
var aa5=p4.getElementsByTagName("style");
if (aa5!=null){
for (var e5=0;e5<aa5.length;e5++){
if (aa5[e5]!=null&&aa5[e5].innerHTML!=null&&aa5[e5].innerHTML.indexOf(f3.id+"msgStyle")<0)
f3.appendChild(aa5[e5].cloneNode(true));
}
}
var aa6=this.GetElementById(f3,f3.id+"_LoadInfo");
var aa7=this.GetElementById(p4,f3.id+"_LoadInfo");
if (aa6!=null&&aa7!=null)aa6.value=aa7.value;
var aa8=false;
var aa9=this.GetElementById(p4,f3.id+"_rowHeader");
if (aa9!=null){
aa9=aa9.firstChild;
aa8=(aa9.rows.length>1);
var i5=this.GetRowHeader(f3);
this.LoadRows(i5,aa9,true);
}
var ab0=this.GetElementById(p4,f3.id+"_viewport");
if (ab0!=null){
aa8=(ab0.rows.length>0);
var e1=this.GetViewport(f3);
this.LoadRows(e1,ab0,false);
}
the_fpSpread.Init(f3);
the_fpSpread.LoadScrollbarState(f3);
the_fpSpread.Focus(f3);
if (aa8)
f3.LoadState=null;
else 
f3.LoadState="complete";
}else {
f3.innerHTML=p4.innerHTML;
the_fpSpread.CopySpreadAttrs(p4,f3);
var ab1=aa1.contentWindow.document.getElementById(f3.id+"_initScript");
eval(ab1.value);
}
}else {
the_fpSpread.error=true;
}
}
this.LoadRows=function (e1,ab0,isHeader){
if (e1==null||ab0==null)return ;
var ab2=e1.tBodies[0];
var t1=ab0.rows.length;
var ab3=null;
if (isHeader){
t1--;
if (ab2.rows.length>0)ab3=ab2.rows[ab2.rows.length-1];
}
for (var e5=0;e5<t1;e5++){
var ab4=ab0.rows[e5].cloneNode(false);
ab2.insertBefore(ab4,ab3);
ab4.innerHTML=ab0.rows[e5].innerHTML;
}
if (!isHeader){
for (var e5=0;e5<ab0.parentNode.childNodes.length;e5++){
var u1=ab0.parentNode.childNodes[e5];
if (u1!=ab0){
e1.parentNode.insertBefore(u1.cloneNode(true),null);
}
}
}
}
this.CopySpreadAttrs=function (v3,dest){
dest.setAttribute("totalRowCount",v3.getAttribute("totalRowCount"));
dest.setAttribute("pageCount",v3.getAttribute("pageCount"));
dest.setAttribute("loadOnDemand",v3.getAttribute("loadOnDemand"));
dest.setAttribute("allowGroup",v3.getAttribute("allowGroup"));
dest.setAttribute("colMove",v3.getAttribute("colMove"));
dest.setAttribute("showFocusRect",v3.getAttribute("showFocusRect"));
dest.setAttribute("FocusBorderColor",v3.getAttribute("FocusBorderColor"));
dest.setAttribute("FocusBorderStyle",v3.getAttribute("FocusBorderStyle"));
dest.setAttribute("FpDefaultEditorID",v3.getAttribute("FpDefaultEditorID"));
dest.setAttribute("hierView",v3.getAttribute("hierView"));
dest.setAttribute("IsNewRow",v3.getAttribute("IsNewRow"));
dest.setAttribute("cmdTop",v3.getAttribute("cmdTop"));
dest.setAttribute("ProcessTab",v3.getAttribute("ProcessTab"));
dest.setAttribute("AcceptFormula",v3.getAttribute("AcceptFormula"));
dest.setAttribute("EditMode",v3.getAttribute("EditMode"));
dest.setAttribute("AllowInsert",v3.getAttribute("AllowInsert"));
dest.setAttribute("AllowDelete",v3.getAttribute("AllowDelete"));
dest.setAttribute("error",v3.getAttribute("error"));
dest.setAttribute("ajax",v3.getAttribute("ajax"));
dest.setAttribute("autoCalc",v3.getAttribute("autoCalc"));
dest.setAttribute("multiRange",v3.getAttribute("multiRange"));
dest.setAttribute("rowFilter",v3.getAttribute("rowFilter"));
dest.setAttribute("OperationMode",v3.getAttribute("OperationMode"));
dest.setAttribute("selectedForeColor",v3.getAttribute("selectedForeColor"));
dest.setAttribute("selectedBackColor",v3.getAttribute("selectedBackColor"));
dest.setAttribute("anchorBackColor",v3.getAttribute("anchorBackColor"));
dest.tabIndex=v3.tabIndex;
if (dest.style!=null&&v3.style!=null){
if (dest.style.width!=v3.style.width)dest.style.width=v3.style.width;
if (dest.style.height!=v3.style.height)dest.style.height=v3.style.height;
if (dest.style.border!=v3.style.border)dest.style.border=v3.style.border;
}
}
this.Clone=function (j9){
var f2=document.createElement(j9.tagName);
f2.id=j9.id;
var g7=j9.firstChild;
while (g7!=null){
var m7=this.Clone(g7);
f2.appendChild(m7);
g7=g7.nextSibling;
}
return f2;
}
this.FireEvent=function (f3,f6){
if (f3==null||f6==null)return ;
var e3=this.GetTopSpread(f3);
if (e3!=null){
f6.spread=f3;
e3.dispatchEvent(f6);
}
}
this.GetForm=function (f3)
{
var h4=f3.parentNode;
while (h4!=null&&h4.tagName!="FORM")h4=h4.parentNode;
return h4;
}
this.SyncData=function (q4,z9,f3,asyncCallBack){
if (window.fpPostOn!=null){
return ;
}
this.a4=false;
var f6=this.CreateEvent("CallBackStart");
f6.cancel=false;
f6.command=z9;
if (asyncCallBack==null)asyncCallBack=false;
f6.async=asyncCallBack;
if (f3==null){
var m7=q4.split(":").join("_");
f3=document.getElementById(m7);
}
if (f3!=null){
var e3=this.GetTopSpread(f3);
this.FireEvent(f3,f6);
}
if (f6.cancel){
the_fpSpread.ClearCellData(f3);
return ;
}
if (z9!=null&&(z9.indexOf("SelectView,")==0||z9=="Next"||z9=="Prev"||z9.indexOf("Group,")==0||z9.indexOf("Page,")==0))
f3.LoadState=null;
var ab5=f6.async;
if (ab5){
this.OpenWaitMsg(f3);
}
window.fpPostOn=true;
if (this.error)z9="update";
try {
var u4=this.GetForm(f3);
if (u4==null)return ;
u4.__EVENTTARGET.value=q4;
u4.__EVENTARGUMENT.value=encodeURIComponent(z9);
var ab6=u4.action;
var f2;
if (ab6.indexOf("?")>-1){
f2="&";
}
else 
{
f2="?";
}
ab6=ab6+f2;
var e8=this.CollectData(f3);
var aa2="";
var z8=(window.XMLHttpRequest)?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP");
if (z8==null)return ;
z8.open("POST",ab6,ab5);
z8.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
if (f3!=null)
window.srcfpspread=f3.id;
else 
window.srcfpspread=q4;
window.fpcommand=z9;
this.AttachEvent(z8,"load",the_fpSpread.ProcessData,false);
z8.send(e8);
}catch (f6){
window.fpPostOn=false;
d5=null;
}
};
this.CollectData=function (f3){
var u4=this.GetForm(f3);
var f2;
var h7="fpcallback=true&";
for (var e5=0;e5<u4.elements.length;e5++){
f2=u4.elements[e5];
var ab7=f2.tagName.toLowerCase();
if (ab7=="input"){
var ab8=f2.type;
if (ab8=="hidden"||ab8=="text"||ab8=="password"||((ab8=="checkbox"||ab8=="radio")&&f2.checked)){
h7+=(f2.name+"="+encodeURIComponent(f2.value)+"&");
}
}else if (ab7=="select"){
if (f2.childNodes!=null){
for (var h3=0;h3<f2.childNodes.length;h3++){
var n6=f2.childNodes[h3];
if (n6!=null&&n6.tagName!=null&&n6.tagName.toLowerCase()=="option"&&n6.selected){
h7+=(f2.name+"="+encodeURIComponent(n6.value)+"&");
}
}
}
}else if (ab7=="textarea"){
h7+=(f2.name+"="+encodeURIComponent(f2.value)+"&");
}
}
return h7;
};
this.ClearCellData=function (f3){
var e8=this.GetData(f3);
var ab9=e8.getElementsByTagName("root")[0];
var e9=ab9.getElementsByTagName("data")[0];
if (e9==null)return null;
if (f3.d5!=null){
var h9=f3.d5.firstChild;
while (h9!=null){
var g4=h9.getAttribute("key");
var ac0=h9.firstChild;
while (ac0!=null){
var g7=ac0.getAttribute("key");
var ac1=e9.firstChild;
while (ac1!=null){
var g9=ac1.getAttribute("key");
if (g4==g9){
var ac2=false;
var ac3=ac1.firstChild;
while (ac3!=null){
var h0=ac3.getAttribute("key");
if (g7==h0){
ac1.removeChild(ac3);
ac2=true;
break ;
}
ac3=ac3.nextSibling;
}
if (ac2)break ;
}
ac1=ac1.nextSibling;
}
ac0=ac0.nextSibling;
}
h9=h9.nextSibling;
}
}
f3.d5=null;
var f1=this.GetCmdBtn(f3,"Cancel");
if (f1!=null)
this.UpdateCmdBtnState(f1,true);
}
this.StorePostData=function (f3){
var e8=this.GetData(f3);
var e9=e8.getElementsByTagName("root")[0];
var w2=e9.getElementsByTagName("data")[0];
if (w2!=null)f3.d5=w2.cloneNode(true);
}
}
function CheckBoxCellType_setFocus(g8){
var h5=g8.getElementsByTagName("INPUT");
if (h5!=null&&h5.length>0&&h5[0].type=="checkbox"){
h5[0].focus();
}
}
function CheckBoxCellType_getCheckBoxEditor(g8){
var h5=g8.getElementsByTagName("INPUT");
if (h5!=null&&h5.length>0&&h5[0].type=="checkbox"){
return h5[0];
}
return null;
}
function CheckBoxCellType_isValid(g8,s2){
if (s2==null)return "";
s2=the_fpSpread.Trim(s2);
if (s2=="")return "";
if (s2.toLowerCase()=="true"||s2.toLowerCase()=="false")
return "";
else 
return "invalid value";
}
function CheckBoxCellType_getValue(s6,f3){
return CheckBoxCellType_getEditorValue(s6,f3);
}
function CheckBoxCellType_getEditorValue(s6,f3){
var g8=the_fpSpread.GetCell(s6);
var h5=CheckBoxCellType_getCheckBoxEditor(g8);
if (h5!=null&&h5.checked){
return "true";
}
return "false";
}
function CheckBoxCellType_setValue(s6,s2){
var g8=the_fpSpread.GetCell(s6);
var h5=CheckBoxCellType_getCheckBoxEditor(g8);
if (h5!=null){
h5.checked=(s2!=null&&s2.toLowerCase()=="true");
return ;
}
}
function IntegerCellType_getValue(s6){
var f2=s6;
while (f2.firstChild!=null&&f2.firstChild.nodeName!="#text")f2=f2.firstChild;
if (f2.innerHTML=="&nbsp;")return "";
var q6=f2.innerHTML;
s6=the_fpSpread.GetCell(s6);
if (s6.getAttribute("FpRef")!=null)s6=document.getElementById(s6.getAttribute("FpRef"));
var ac4=s6.getAttribute("groupchar");
if (ac4==null)ac4=",";
var r3=q6.length;
while (true){
q6=q6.replace(ac4,"");
if (q6.length==r3)break ;
r3=q6.length;
}
if (q6.charAt(0)=='('&&q6.charAt(q6.length-1)==')'){
var ac5=s6.getAttribute("negsign");
if (ac5==null)ac5="-";
q6=ac5+q6.substring(1,q6.length-1);
}
q6=the_fpSpread.ReplaceAll(q6,"&nbsp;"," ");
return q6;
}
function IntegerCellType_isValid(g8,s2){
if (s2==null||s2.length==0)return "";
s2=s2.replace(" ","");
if (s2.length==0)return "";
var ac6=g8;
var ac7=g8.getAttribute("FpRef");
if (ac7!=null)ac6=document.getElementById(ac7);
var ac5=ac6.getAttribute("negsign");
var ac8=ac6.getAttribute("possign");
if (ac5!=null)s2=s2.replace(ac5,"-");
if (ac8!=null)s2=s2.replace(ac8,"+");
if (s2.charAt(s2.length-1)=="-")s2="-"+s2.substring(0,s2.length-1);
var r5=new RegExp("^\\s*[-\\+]?\\d+\\s*$");
var m0=(s2.match(r5)!=null);
if (m0)m0=!isNaN(s2);
if (m0){
var r9=ac6.getAttribute("MinimumValue");
var i1=ac6.getAttribute("MaximumValue");
var r8=parseInt(s2);
if (r9!=null){
r9=parseInt(r9);
m0=(!isNaN(r9)&&r8>=r9);
}
if (m0&&i1!=null){
i1=parseInt(i1);
m0=(!isNaN(i1)&&r8<=i1);
}
}
if (!m0){
if (ac6.getAttribute("error")!=null)
return ac6.getAttribute("error");
else 
return "Integer";
}
return "";
}
function DoubleCellType_isValid(g8,s2){
var ac6=g8;
if (g8.getAttribute("FpRef")!=null)ac6=document.getElementById(g8.getAttribute("FpRef"));
var ac9=ac6.getAttribute("decimalchar");
if (ac9==null)ac9=".";
var ac5=ac6.getAttribute("negsign");
var ac8=ac6.getAttribute("possign");
var r9=ac6.getAttribute("MinimumValue");
var i1=ac6.getAttribute("MaximumValue");
var m0=the_fpSpread.IsDouble(s2,ac9,ac5,ac8,r9,i1);
if (!m0){
if (ac6.getAttribute("error")!=null)
return ac6.getAttribute("error");
else 
return "Double";
}
return "";
}
function DoubleCellType_getValue(s6){
var f2=s6;
while (f2.firstChild!=null&&f2.firstChild.nodeName!="#text")f2=f2.firstChild;
if (f2.innerHTML=="&nbsp;")return "";
var q6=f2.innerHTML;
s6=the_fpSpread.GetCell(s6);
if (s6.getAttribute("FpRef")!=null)s6=document.getElementById(s6.getAttribute("FpRef"));
var ac4=s6.getAttribute("groupchar");
if (ac4==null)ac4=",";
var r3=q6.length;
while (true){
q6=q6.replace(ac4,"");
if (q6.length==r3)break ;
r3=q6.length;
}
if (q6.charAt(0)=='('&&q6.charAt(q6.length-1)==')'){
var ac5=s6.getAttribute("negsign");
if (ac5==null)ac5="-";
q6=ac5+q6.substring(1,q6.length-1);
}
q6=the_fpSpread.ReplaceAll(q6,"&nbsp;"," ");
return q6;
}
function CurrencyCellType_isValid(g8,s2){
if (s2!=null){
var ac6=g8;
if (g8.getAttribute("FpRef")!=null)ac6=document.getElementById(g8.getAttribute("FpRef"));
var r2=ac6.getAttribute("currencychar");
if (r2==null)r2="$";
s2=s2.replace(r2,"");
var ac4=ac6.getAttribute("groupchar");
if (ac4==null)ac4=",";
var r3=s2.length;
while (true){
s2=s2.replace(ac4,"");
if (s2.length==r3)break ;
r3=s2.length;
}
var ac9=ac6.getAttribute("decimalchar");
if (ac9==null)ac9=".";
var ac5=ac6.getAttribute("negsign");
var ac8=ac6.getAttribute("possign");
var r9=ac6.getAttribute("MinimumValue");
var i1=ac6.getAttribute("MaximumValue");
var m0=the_fpSpread.IsDouble(s2,ac9,ac5,ac8,r9,i1);
if (!m0){
if (ac6.getAttribute("error")!=null)
return ac6.getAttribute("error");
else 
return "Currency ("+r2+"100"+ac9+"10) ";
}
}
return "";
}
function CurrencyCellType_getValue(s6){
var f2=s6;
while (f2.firstChild!=null&&f2.firstChild.nodeName!="#text")f2=f2.firstChild;
if (f2.innerHTML=="&nbsp;")return "";
var q6=f2.innerHTML;
s6=the_fpSpread.GetCell(s6);
if (s6.getAttribute("FpRef")!=null)s6=document.getElementById(s6.getAttribute("FpRef"));
var r2=s6.getAttribute("currencychar");
if (r2!=null){
var ad0=document.createElement("SPAN");
ad0.innerHTML=r2;
r2=ad0.innerHTML;
}
if (r2==null)r2="$";
var ac4=s6.getAttribute("groupchar");
if (ac4==null)ac4=",";
q6=q6.replace(r2,"");
var r3=q6.length;
while (true){
q6=q6.replace(ac4,"");
if (q6.length==r3)break ;
r3=q6.length;
}
var ac5=s6.getAttribute("negsign");
if (ac5==null)ac5="-";
if (q6.charAt(0)=='('&&q6.charAt(q6.length-1)==')'){
q6=ac5+q6.substring(1,q6.length-1);
}
q6=the_fpSpread.ReplaceAll(q6,"&nbsp;"," ");
return q6;
}
function RegExpCellType_isValid(g8,s2){
if (s2==null||s2=="")
return "";
var ac6=g8;
if (g8.getAttribute("FpRef")!=null)ac6=document.getElementById(g8.getAttribute("FpRef"));
var ad1=new RegExp(ac6.getAttribute("fpexpression"));
var r6=s2.match(ad1);
var k6=(r6!=null&&r6.length>0&&s2==r6[0]);
if (!k6){
if (ac6.getAttribute("error")!=null)
return ac6.getAttribute("error");
else 
return "invalid";
}
return "";
}
function PercentCellType_getValue(s6){
var f2=s6;
while (f2.firstChild!=null&&f2.firstChild.nodeName!="#text")f2=f2.firstChild;
if (f2.innerHTML=="&nbsp;")return "";
f2=f2.innerHTML;
var g8=the_fpSpread.GetCell(s6);
var ac6=g8;
if (g8.getAttribute("FpRef")!=null)ac6=document.getElementById(g8.getAttribute("FpRef"));
var ad2=ac6.getAttribute("percentchar");
if (ad2==null)ad2="%";
f2=f2.replace(ad2,"");
var ac4=ac6.getAttribute("groupchar");
if (ac4==null)ac4=",";
var r3=f2.length;
while (true){
f2=f2.replace(ac4,"");
if (f2.length==r3)break ;
r3=f2.length;
}
var ac5=ac6.getAttribute("negsign");
var ac8=ac6.getAttribute("possign");
f2=the_fpSpread.ReplaceAll(f2,"&nbsp;"," ");
var h7=f2;
if (ac5!=null)
f2=f2.replace(ac5,"-");
if (ac8!=null)
f2=f2.replace(ac8,"+");
var ac9=ac6.getAttribute("decimalchar");
if (ac9!=null)
f2=f2.replace(ac9,".");
if (!isNaN(f2))
return h7;
else 
return s6.innerHTML;
}
function PercentCellType_setValue(s6,s2){
var f2=s6;
while (f2.firstChild!=null&&f2.firstChild.nodeName!="#text")f2=f2.firstChild;
s6=f2;
if (s2!=null&&s2!=""){
var ac6=the_fpSpread.GetCell(s6);
if (ac6.getAttribute("FpRef")!=null)ac6=document.getElementById(ac6.getAttribute("FpRef"));
var ad2=ac6.getAttribute("percentchar");
if (ad2==null)ad2="%";
s2=s2.replace(" ","");
s2=s2.replace(ad2,"");
s6.innerHTML=s2+ad2;
}else {
s6.innerHTML="";
}
}
function PercentCellType_isValid(g8,s2){
if (s2!=null){
var ac6=the_fpSpread.GetCell(g8);
if (ac6.getAttribute("FpRef")!=null)ac6=document.getElementById(ac6.getAttribute("FpRef"));
var ad2=ac6.getAttribute("percentchar");
if (ad2==null)ad2="%";
s2=s2.replace(ad2,"");
var ac4=ac6.getAttribute("groupchar");
if (ac4==null)ac4=",";
var r3=s2.length;
while (true){
s2=s2.replace(ac4,"");
if (s2.length==r3)break ;
r3=s2.length;
}
var ad3=s2;
var ac5=ac6.getAttribute("negsign");
var ac8=ac6.getAttribute("possign");
if (ac5!=null)s2=s2.replace(ac5,"-");
if (ac8!=null)s2=s2.replace(ac8,"+");
var ac9=ac6.getAttribute("decimalchar");
if (ac9!=null)
s2=s2.replace(ac9,".");
var m0=!isNaN(s2);
if (m0){
var ad4=ac6.getAttribute("MinimumValue");
var ad5=ac6.getAttribute("MaximumValue");
if (ad4!=null||ad5!=null){
var r9=parseFloat(ad4);
var i1=parseFloat(ad5);
m0=!isNaN(r9)&&!isNaN(i1);
if (m0){
if (ac9==null)ac9=".";
m0=the_fpSpread.IsDouble(ad3,ac9,ac5,ac8,r9*100,i1*100);
}
}
}
if (!m0){
if (ac6.getAttribute("error")!=null)
return ac6.getAttribute("error");
else 
return "Percent:(ex,10"+ad2+")";
}
}
return "";
}
function ListBoxCellType_getValue(s6){
var f2=s6.getElementsByTagName("TABLE");
if (f2.length>0)
{
var g2=f2[0].rows;
for (var h3=0;h3<g2.length;h3++){
var g8=g2[h3].cells[0];
if (g8.selected=="true")
{
var ad6=g8;
while (ad6.firstChild!=null)ad6=ad6.firstChild;
var ac6=ad6.nodeValue;
return ac6;
}
}
}
return "";
}
function ListBoxCellType_setValue(s6,s2){
var f2=s6.getElementsByTagName("TABLE");
if (f2.length>0)
{
f2[0].style.width=(s6.clientWidth-6)+"px";
var g2=f2[0].rows;
for (var h3=0;h3<g2.length;h3++){
var g8=g2[h3].cells[0];
var ad6=g8;
while (ad6.firstChild!=null)ad6=ad6.firstChild;
var ac6=ad6.nodeValue;
if (ac6==s2){
g8.selected="true";
if (f2[0].parentNode.getAttribute("selectedBackColor")!="undefined")
g8.style.backgroundColor=f2[0].parentNode.getAttribute("selectedBackColor");
if (f2[0].parentNode.getAttribute("selectedForeColor")!="undefined")
g8.style.color=f2[0].parentNode.getAttribute("selectedForeColor");
}else {
g8.style.backgroundColor="";
g8.style.color="";
g8.selected="";
g8.bgColor="";
}
}
}
}
function TextCellType_getValue(s6){
var g8=the_fpSpread.GetCell(s6,true);
if (g8.getAttribute("password")!=null){
if (g8!=null&&g8.getAttribute("value")!=null)
return g8.getAttribute("value");
else 
return "";
}else {
var f2=s6;
while (f2.firstChild!=null&&f2.firstChild.nodeName!="#text")f2=f2.firstChild;
if (f2.innerHTML=="&nbsp;")return "";
var f2=the_fpSpread.ReplaceAll(f2.innerHTML,"&nbsp;"," ");
var f2=the_fpSpread.ReplaceAll(f2,"<br>","\n");
return f2;
}
}
function TextCellType_setValue(s6,s2){
var g8=the_fpSpread.GetCell(s6,true);
if (g8==null)return ;
var f2=s6;
while (f2.firstChild!=null&&f2.firstChild.nodeName!="#text")f2=f2.firstChild;
s6=f2;
if (g8.getAttribute("password")!=null){
if (s2!=null&&s2!=""){
s2=s2.replace(" ","");
s6.innerHTML="";
for (var e5=0;e5<s2.length;e5++)
s6.innerHTML+="*";
g8.setAttribute("value",s2);
}else {
s6.innerHTML="";
g8.setAttribute("value","");
}
}else {
s2=the_fpSpread.ReplaceAll(s2,"\n","<br>");
s6.innerHTML=the_fpSpread.ReplaceAll(s2," ","&nbsp;");
}
}
function RadioButtonListCellType_getValue(s6){
var g8=the_fpSpread.GetCell(s6,true);
if (g8==null)return ;
var ad7=g8.getElementsByTagName("INPUT");
for (var e5=0;e5<ad7.length;e5++){
if (ad7[e5].tagName=="INPUT"&&ad7[e5].checked){
return ad7[e5].value;
}
}
return "";
}
function RadioButtonListCellType_getEditorValue(s6){
return RadioButtonListCellType_getValue(s6);
}
function RadioButtonListCellType_setValue(s6,s2){
var g8=the_fpSpread.GetCell(s6,true);
if (g8==null)return ;
if (s2!=null)s2=the_fpSpread.Trim(s2);
var ad7=g8.getElementsByTagName("INPUT");
for (var e5=0;e5<ad7.length;e5++){
if (ad7[e5].tagName=="INPUT"&&s2==the_fpSpread.Trim(ad7[e5].value)){
ad7[e5].checked=true;
break ;
}else {
if (ad7[e5].checked)ad7[e5].checked=false;
}
}
}
function RadioButtonListCellType_setFocus(s6){
var g8=the_fpSpread.GetCell(s6,true);
if (g8==null)return ;
var h5=g8.getElementsByTagName("INPUT");
if (h5==null)return ;
for (var e5=0;e5<h5.length;e5++){
if (h5[e5].type=="radio"&&h5[e5].checked){
h5[e5].focus();
return ;
}
}
}
