You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/packages/Aspose.Cells.19.7.0/acw_client/acwmain.js

671 lines
285 KiB
JavaScript

//Copyright (c) 2001-2016 Aspose Pty Ltd. All Rights Reserved.
var acw_version="v2018.09.06";var ie;var iemv;var firefox;var chrome;var safari;var opera;var clientpageheight=0;var asynctableheight_map=new Map;var scrollTimeout=null;var scrollendDelay=500;var removeloadinggifDelay=6E4;var PERCOLUMNNUMBER=32;var PERROWNUMBER=32;var HCELL=19;var WCELL=79;var CELL_CONTENT_ROW_DELIMITER="#_@row@_#";var CELL_CONTENT_COL_DELIMITER="#_@col@_#";var CELL_CONTENT_FORMAT_DELIMITER="#_@class@_#";var CELL_CONTENT_SMALL_DELIMITER="#_@_S_@_#";var MSEXCEL_ROW_DELIMITER="\n";
var MSEXCEL_COL_DELIMITER="\t";var global_gridwebkeyevent=false;var java_client=false;var needInitAlignmentAdjust=false;var focusinside=true;var copy_with_style=false;var useESCAsLeave=false;var needValidateall=false;var scrollToInvalidate=true;var current_gridweb=null;var current_cell=null;var current_copy_content=null;var actualcolnumber=0;var actualrownumber=0;var selectrowheader=false;var selectcolheader=false;var lastselcolnumber=0;var lastselrownumber=0;var shiftclick=false;
var afterajaxaction=null;var inajaxupdating=false;var haveanyupdate=true;var firstgrid=null;var col_row_cache_index=new Array;var asyncbeforepostpredata=null;var asyncbeforepostafterdata=null;var enableasynccache=true;var ajaxgoon=true;var cell_attributes_array=["nowrap","align","valign","vtype","isrequired","listmenu","validationoperator","validationvalue1","validationvalue2"];initAcwGlobal();
function UperCaseExceptInsideQuote(s){var arr=new Array;var insidequote=false;var str=arr.join("");var ccchar;for(var i=0;i<s.length;i++){ccchar=s.charAt(i);if(ccchar=='"')insidequote=!insidequote;if(ccchar=='"'||insidequote)arr[i]=ccchar;else arr[i]=ccchar.toUpperCase()}return arr.join("")}
if(ie){function MsXmlDoc(d){this.xmlDoc=d}MsXmlDoc.prototype.getFirstChild=function(){return this.xmlDoc.firstChild};MsXmlDoc.prototype.getLastChild=function(){return this.xmlDoc.lastChild};MsXmlDoc.prototype.getChildNodes=function(){var ret=this.xmlDoc.childNodes;if(ret!=null){var nodes=new Array;for(var i=0;i<ret.length;i++)nodes.push(new MsXmlDoc(ret[i]));return nodes}else return null};MsXmlDoc.prototype.getXML=function(){return this.xmlDoc.xml};MsXmlDoc.prototype.setXML=function(s){this.xmlDoc.xml=
s};MsXmlDoc.prototype.loadXML=function(s){return this.xmlDoc.loadXML(s)};MsXmlDoc.prototype.selectNodes=function(s){return this.xmlDoc.selectNodes(s)};MsXmlDoc.prototype.appendChild=function(s){return this.xmlDoc.appendChild(s)};MsXmlDoc.prototype.hasChildNodes=function(){return this.xmlDoc.hasChildNodes()};MsXmlDoc.prototype.removeChild=function(s){return this.xmlDoc.removeChild(s)};MsXmlDoc.prototype.getAttribute=function(n){var ret=this.xmlDoc.getAttribute(n);if(ret==null)ret=this.xmlDoc.getAttribute(n.toUpperCase());
return ret};MsXmlDoc.prototype.setAttribute=function(n,v){return this.xmlDoc.setAttribute(n,v)};MsXmlDoc.prototype.removeAttribute=function(n){return this.xmlDoc.removeAttribute(n)};MsXmlDoc.prototype.createElement=function(s){return this.xmlDoc.createElement(s)};MsXmlDoc.prototype.selectSingleNode=function(s){var ret=this.xmlDoc.selectSingleNode(s);if(ret)return new MsXmlDoc(ret);else{ret=this.xmlDoc.selectSingleNode(UperCaseExceptInsideQuote(s));if(ret)return new MsXmlDoc(ret);else return null}}}
function keydown_act(e){if(firefox&&e.keyCode==9)e.preventDefault();setgoonkeyevent_onkeypress();if(global_gridwebkeyevent)if(current_cell!=null&&!current_gridweb.focusonoutereditor)current_gridweb.mOnKeyDown(e,current_cell)}function mytestmousedown(e){current_gridweb.focusonoutereditor=true}
function setgoonkeyevent_onkeypress(){var active_nodeName=document.activeElement.nodeName;if(ie)if(active_nodeName=="TD"||active_nodeName=="SPAN")global_gridwebkeyevent=true;else global_gridwebkeyevent=false;else if(active_nodeName=="BODY"||active_nodeName=="SPAN")global_gridwebkeyevent=true;else global_gridwebkeyevent=false}function mykeypress(e){if(global_gridwebkeyevent)if(current_cell!=null&&!current_gridweb.focusonoutereditor)current_gridweb.mOnKeyPress(e)}
function mykeyup(e){if(global_gridwebkeyevent)if(current_cell!=null&&!current_gridweb.focusonoutereditor)current_gridweb.mOnKeyUp(e)}
function initAcwGlobal(){document.onkeydown=keydown_act;document.onkeypress=mykeypress;document.onkeyup=mykeyup;var s=window.navigator.userAgent;var i=s.indexOf("MSIE");if(i>=0){ie=true;iemv=parseInt(s.substring(i+5),10)}else if(s.indexOf("Trident/7.0")>0){ie=true;iemv=11}else if(s.indexOf("Firefox")>=0){firefox=true;HTMLElement.prototype.__defineGetter__("innerText",function(){var anyString="";var childS=this.childNodes;for(var i=0;i<childS.length;i++)if(childS[i].nodeType==1)anyString+=childS[i].tagName==
"BR"?"\n":childS[i].innerText;else if(childS[i].nodeType==3)anyString+=childS[i].nodeValue;return anyString});HTMLElement.prototype.__defineSetter__("innerText",function(sText){if(sText==null){this.textContent="";return}var str=sText+"";var items=str.split("\n");str="";for(var i=0;i<items.length;i++)if(i!=items.length-1)str+=items[i]+"<br>";else str+=items[i];this.innerHTML=str});HTMLElement.prototype.__defineGetter__("currentStyle",function(){return getComputedStyle(this,null)});HTMLElement.prototype.__defineSetter__("outerHTML",
function(sHTML){var r=this.ownerDocument.createRange();r.setStartBefore(this);var df=r.createContextualFragment(sHTML);this.parentNode.replaceChild(df,this);return sHTML});HTMLElement.prototype.__defineGetter__("outerHTML",function(){var attr;var attrs=this.attributes;var str="<"+this.tagName.toLowerCase();for(var i=0;i<attrs.length;i++){attr=attrs[i];if(attr.specified)str+=" "+attr.name+'="'+attr.value+'"'}if(!this.canHaveChildren)return str+">";return str+">"+this.innerHTML+"</"+this.tagName.toLowerCase()+
">"});HTMLElement.prototype.__defineGetter__("canHaveChildren",function(){switch(this.tagName.toLowerCase()){case "area":case "base":case "basefont":case "col":case "frame":case "hr":case "img":case "br":case "input":case "isindex":case "link":case "meta":case "param":return false}return true});HTMLElement.prototype.__defineSetter__("unselectable",function(s){if(s=="on")this.style.MozUserSelect="none"})}else if(s.indexOf("Chrome")>=0){chrome=true;HTMLElement.prototype.__defineGetter__("currentStyle",
function(){return getComputedStyle(this,null)})}else if(s.indexOf("Safari")>=0){safari=true;HTMLElement.prototype.__defineGetter__("currentStyle",function(){return getComputedStyle(this,null)})}else if(s.indexOf("Opera")>=0)opera=true;else alert("unknown browser.")}if(!ie){HTMLElement.prototype.contains=function(ele){return this.compareDocumentPosition(ele)&16};HTMLElement.prototype.setActive=function(){return this.focus()}}
function Stylesheet(ss){if(typeof ss=="number")ss=document.styleSheets[ss];this.ss=ss}Stylesheet.prototype.getRules=function(){return this.ss.cssRules?this.ss.cssRules:this.ss.rules};Stylesheet.prototype.getRule=function(s){var rules=this.getRules();if(!rules)return null;if(typeof s=="number")return rules[s];s=s.toLowerCase();for(var i=rules.length-1;i>=0;i--)if(rules[i].selectorText.toLowerCase()==s)return rules[i];return null};
Stylesheet.prototype.getStyles=function(s){var rule=this.getRule(s);if(rule&&rule.style)return rule.style;else return null};Stylesheet.prototype.getStyleText=function(s){var rule=this.getRule(s);if(rule&&rule.style&&rule.style.cssText)return rule.style.cssText;else return""};
Stylesheet.prototype.addRule=function(selector,styles,n){if(n==undefined){var rules=this.getRules();n=rules.length}if(this.ss.insertRule)this.ss.insertRule(selector+"{"+styles+"}",n);else if(this.ss.addRule)this.ss.addRule(selector,styles,n)};
Stylesheet.prototype.deleteRule=function(s){if(s==undefined){var rules=this.getRules();s=rules.length-1}if(typeof s!="number"){s=s.toLowerCase();var rules=this.getRules();for(var i=rules.length-1;i>=0;i--)if(rules[i].selectorText.toLowerCase()==s){s=i;break}if(i==-1)return}if(this.ss.deleteRule)this.ss.deleteRule(s);else if(this.ss.removeRule)this.ss.removeRule(s)};
function Event(e){if(window.event){this.e=window.event;return}if(e!=null){this.e=e;return}var func=Event.caller;while(func!=null){var arg0=func.arguments[0];if(arg0)if(arg0.constructor==Event||arg0.constructor==MouseEvent||typeof arg0=="object"&&arg0.preventDefault&&arg0.stopPropagation){this.e=arg0;return}func=func.caller}}Event.prototype.getTarget=function(){return this.e.srcElement||this.e.target};
Event.prototype.getFromElement=function(){if(window.event)return this.e.fromElement;var node;if(this.e.type=="mouseover")node=this.e.relatedTarget;else if(this.e.type=="mouseout")node=this.e.target;if(!node)return;while(node.nodeType!=1)node=node.parentNode;return node};
Event.prototype.getToElement=function(){if(window.event)return this.e.toElement;var node;if(this.e.type=="mouseout")node=this.e.relatedTarget;else if(this.e.type=="mouseover")node=this.e.target;if(!node)return;while(node.nodeType!=1)node=node.parentNode;return node};Event.prototype.getOffset=function(){if(window.event){var offset={offsetX:this.e.offsetX,offsetY:this.e.offsetY};return offset}else{var offset={offsetX:this.e.layerX,offsetY:this.e.layerY};return offset}};
function getClient(o){var left=0;var top=0;while(o.offsetParent){left+=o.offsetLeft;top+=o.offsetTop;if(o.offsetParent.scrollLeft)left-=o.offsetParent.scrollLeft;if(o.offsetParent.scrollTop)top-=o.offsetParent.scrollTop;o=o.offsetParent}return{cx:left,cy:top}}function HTMLEncode(str){var s="";if(str.length==0)return"";s=str.replace(/&/g,"&amp;");s=s.replace(/</g,"&lt;");s=s.replace(/>/g,"&gt;");s=s.replace(/\"/g,"&quot;");return s}
function HTMLDecode(str){var s="";if(str.length==0)return"";s=str.replace(/&amp;/g,"&");s=s.replace(/&lt;/g,"<");s=s.replace(/&gt;/g,">");s=s.replace(/&quot;/g,'"');return s}
function getXMLDocument(element){var src=element.innerHTML;if(src==null||src.length==0)if(!ie)src=element.xml;if(opera){arr=src.match(/\'[^\']*\'/g);if(arr!=null)for(var i=0;i<arr.length;i++){var str=arr[i].substring(1,arr[i].length-1);src=src.replace(arr[i],'"'+HTMLEncode(str)+'"')}}if(ie){var progIDs=["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.3.0"];for(var i=0;i<progIDs.length;i++)try{var xmlDoc=new ActiveXObject(progIDs[i]);xmlDoc=new MsXmlDoc(xmlDoc);xmlDoc.loadXML(src);return xmlDoc}catch(ex){}alert("unsupport browser,please using chrome/safari/firefox or IE");
return null}else{var parser=new DOMParser;return parser.parseFromString(src,"text/xml")}}
if(!ie){XMLDocument.prototype.loadXML=function(xmlString){var childNodes=this.childNodes;for(var i=childNodes.length-1;i>=0;i--)this.removeChild(childNodes[i]);var dp=new DOMParser;var newDOM=dp.parseFromString(xmlString,"text/xml");var newElt=this.importNode(newDOM.documentElement,true);this.appendChild(newElt)};XMLDocument.prototype.__proto__.__defineGetter__("xml",function(){try{return(new XMLSerializer).serializeToString(this)}catch(ex){var d=document.createElement("div");d.appendChild(this.cloneNode(true));
return d.innerHTML}});Element.prototype.__proto__.__defineGetter__("xml",function(){try{return(new XMLSerializer).serializeToString(this)}catch(ex){var d=document.createElement("div");d.appendChild(this.cloneNode(true));return d.innerHTML}});XMLDocument.prototype.__proto__.__defineGetter__("text",function(){return this.firstChild.textContent});Element.prototype.__proto__.__defineGetter__("text",function(){return this.textContent});XMLDocument.prototype.getXML=Element.prototype.getXML=function(){try{return(new XMLSerializer).serializeToString(this)}catch(ex){var d=
document.createElement("div");d.appendChild(this.cloneNode(true));return d.innerHTML}};XMLDocument.prototype.getChildNodes=Element.prototype.getChildNodes=function(){return this.childNodes};XMLDocument.prototype.getFirstChild=Element.prototype.getFirstChild=function(){return this.firstChild};XMLDocument.prototype.getLastChild=Element.prototype.getLastChild=function(){return this.lastChild};XMLDocument.prototype.selectSingleNode=Element.prototype.selectSingleNode=function(xpath){var x=this.selectNodes(xpath);
if(!x||x.length<1)return null;return x[0]};XMLDocument.prototype.selectNodes=Element.prototype.selectNodes=function(xpath){var xpe=new XPathEvaluator;var nsResolver=xpe.createNSResolver(this.ownerDocument==null?this.documentElement:this.ownerDocument.documentElement);var result=xpe.evaluate(xpath,this,nsResolver,0,null);var found=[];var res;while(res=result.iterateNext())found.push(res);return found}}
function getattr(o,name){if(o==null)return null;if(ie&&iemv<8)return o[name];if(o.attributes){var attri=o.getAttribute(name);if(attri!=null)return attri;else return o[name]}}function setInnerText(span,v){span.innerText=v}
function getInnerText(o){var span=o;if(span.children.length>0){span=span.children[0];if(span.childNodes.length>0)if(span.childNodes[0].nodeType==3)return span.childNodes[0].nodeValue;else if(span.childNodes[0].tagName="span")span=span.childNodes[0];else return""}var text_inner=span.innerText;if(chrome)return text_inner.replace(/\n$/,"");else if(ie&&o.myInnerText)return o.myInnerText.replace(/\n$/,"");else return text_inner}
function getPercentageLength(str){if(str.endsWith("%"))return Number(str.substring(0,str.length-1))/100;else return null}
function parseLength(str,xy){reSetDPI();var len=str.length;if(str==null||str==""||str.charAt(len-1)=="%")return null;var nval=new Number(str);if(!isNaN(nval))return nval;var pfx=str.substring(len-2,len).toLowerCase();var val=str.substring(0,len-2);var nval=new Number(val);if(isNaN(nval))return null;var d;if(xy=="x")d=screen.deviceXDPI;else d=screen.deviceYDPI;if(d==null)d=96;switch(pfx){case "px":return nval;case "in":return nval*d;case "cm":return nval/2.54*d;case "mm":return nval/25.4*d;case "pt":return nval/
72*d;case "pc":return nval/6*d;default:return null}}function getlang(){if(typeof ACWLang!="undefined"&&ACWLang!=null)return ACWLang;else return def_lang}
var def_lang={TipCellNoValue:"<NULL>",TipCellFormula:"<FORMULA>",TipCellIsRequired:"<REQUIRED>",TipCellAnyValue:"<ANY VALUE>",TipCellList:"<SELECT FROM LIST>",TipCellDropDownList:"<SELECT FROM LIST>",TipCellFreeList:"<SELECT FROM LIST OR INPUT>",TipCellRegex:"<REGEX>",TipCellBoolean:"<BOOLEAN>",TipCellDate:"<DATE>",TipCellDateTime:"<DATETIME>",TipCellNumber:"<NUMBER>",TipCellInteger:"<INTEGER>",TipCellCustomFunction:"<CUSTOM FUNCTION>",TipCellCustomServerFunction:"<CUSTOM SERVER FUNCTION>",TipCellCustomString:"<CUSTOM STRING>",
TipCellTime:"<TIME>",TipCellTextLength:"<TEXT LENGTH>",TipCellCheckbox:"<CHECKBOX>",TipCellFilter:"<AUTO FILTER>",TipCellComment:"<COMMENT>",MenuItemCopy:"Copy",MenuItemCut:"Cut",MenuItemPaste:"Paste",MenuItemFreeze:"Freeze",MenuItemUnfreeze:"Unfreeze",MenuItemAddRow:"Add Row",MenuItemInsertRow:"Insert Row",MenuItemDeleteRow:"Delete Row",MenuItemAddColumn:"Add Column",MenuItemInsertColumn:"Insert Column",MenuItemDeleteColumn:"Delete Column",MenuItemMergeCells:"Merge Cells",MenuItemUnmergeCells:"Unmerge Cells",
MenuItemDelComment:"Delete Comment",MenuItemFormat:"Format Cell...",MenuItemFind:"Find...",MenuItemReplace:"Replace...",MenuItemFilterAll:"(ALL)",TipListMenuButton:"Click to show the list values.",TipCalendarButton:"Click to show the calendar.",TipScrollLeftButton:"Scroll tab bar to the left.",TipScrollRightButton:"Scroll tab bar to the right.",TipSubmitButton:"Submit edit result and recalculate all formulas.",TipSaveButton:"Save edit result.",TipUndoButton:"Cancel edit result.",TipTab:"Change worksheet.",
TipClientSideMenu:"Client side menu.",TipExpandChildButton:"Expand or collapse the child view.",TipExpandGroupRowButton:"Expand or collapse the group rows.",TipExpandGroupColButton:"Expand or collapse the group columns.",TipSortHeader:"Click to sort.",TipFilterButton:"Click to show the filter values.",TipPasteTooMuchRows:"The rows of the copy content is more than the paste rows .",DialogBoxLoading:"Loading, please wait..."};
function getVTypeString(vtype){if(vtype==null)return null;var vstring=null;if(typeof ACWLang!="undefined"&&ACWLang!=null)switch(vtype){case "any":vstring=ACWLang.TipCellAnyValue;break;case "list":vstring=ACWLang.TipCellList;break;case "dlist":vstring=ACWLang.TipCellDropDownList;break;case "flist":vstring=ACWLang.TipCellFreeList;break;case "regex":vstring=ACWLang.TipCellRegex;break;case "bool":vstring=ACWLang.TipCellBoolean;break;case "number":vstring=ACWLang.TipCellNumber;break;case "int":vstring=
ACWLang.TipCellInteger;break;case "date":vstring=ACWLang.TipCellDate;break;case "datetime":vstring=ACWLang.TipCellDateTime;break;case "time":vstring=ACWLang.TipCellTime;break;case "textlength":vstring=ACWLang.TipCellTextLength;break;case "customstring":vstring=ACWLang.TipCellCustomString;break;case "customfunction":vstring=ACWLang.TipCellCustomFunction;break;case "customserverfunction":vstring=ACWLang.TipCellCustomServerFunction;break;case "checkbox":vstring=ACWLang.TipCellCheckbox;break;case "filter":vstring=
ACWLang.TipCellFilter;break}if(vstring==null)vstring=vtype.toUpperCase();return vstring}
function validatorConvert(op,dataType,noneedconvert){var num,cleanInput,m,exp;if(dataType=="int"){exp=/^\s*[-\+]?\d+\s*$/;if(op.match(exp)==null)return null;num=parseInt(op,10);return isNaN(num)?null:num}else if(dataType=="number"){if(noneedconvert)cleanInput=op;else{var decimalpoint=getattr(this,"decimalpoint");if(decimalpoint==null)decimalpoint=".";exp=new RegExp("^\\s*([-\\+])?(\\d+)?(\\"+decimalpoint+"(\\d+))?\\s*$");m=op.match(exp);if(m==null)return null;cleanInput=(m[1]!=null?m[1]:"")+(m[2].length>
0?m[2]:"0")+"."+m[4]}num=parseFloat(cleanInput);return isNaN(num)?null:num}else if(dataType=="date"){var yearFirstExp=/^(\d{4})[\/|-](\d{1,2})[\/|-](\d{1,2})$/;m=op.match(yearFirstExp);var day,month,year;if(m!=null){year=m[1];month=m[2];day=m[3]}else{yearFirstExp=/^(\d{1,2})[\/|-](\d{1,2})[\/|-](\d{4})$/;m=op.match(yearFirstExp);if(m!=null){year=m[3];month=m[1];day=m[2]}else return null}month-=1;var date=new Date(year,month,day);return typeof date=="object"&&year==date.getFullYear()&&month==date.getMonth()&&
day==date.getDate()?date.valueOf():null}else if(dataType=="datetime"){var yearFirstExp=/^(\d{4})[\/|-](\d{1,2})[\/|-](\d{1,2}) (\d+)\:(\d+)\:(\d+)$/;m=op.match(yearFirstExp);var day,month,year,hour,minu,sec;if(m!=null){year=m[1];month=m[2];day=m[3];hour=m[4];minu=m[5];sec=m[6]}else{yearFirstExp=/^(\d{4})[\/|-](\d{1,2})[\/|-](\d{1,2}) (\d+)\:(\d+)$/;m=op.match(yearFirstExp);if(m!=null){year=m[1];month=m[2];day=m[3];hour=m[4];minu=m[5];sec=0}else{yearFirstExp=/^(\d{1,2})[\/|-](\d{1,2})[\/|-](\d{4}) (\d+)\:(\d+)\:(\d+)$/;
m=op.match(yearFirstExp);if(m!=null){year=m[3];month=m[1];day=m[2];hour=m[4];minu=m[5];sec=m[6]}else{yearFirstExp=/^(\d{1,2})[\/|-](\d{1,2})[\/|-](\d{4}) (\d+)\:(\d+)$/;m=op.match(yearFirstExp);if(m!=null){year=m[3];month=m[1];day=m[2];hour=m[4];minu=m[5];sec=0}else return null}}}month-=1;var date=new Date(year,month,day,hour,minu,sec);return typeof date=="object"&&year==date.getFullYear()&&month==date.getMonth()&&day==date.getDate()&&hour==date.getHours()&&minu==date.getMinutes()&&sec==date.getSeconds()?
date.valueOf():null}else if(dataType=="time"){var yearFirstExp=/^(\d+)\:(\d+)\:(\d+)$/;m=op.match(yearFirstExp);var hour,minu,sec;if(m!=null){hour=m[1];minu=m[2];sec=m[3]}else{yearFirstExp=/^(\d+)\:(\d+)$/;m=op.match(yearFirstExp);var hour,minu;if(m!=null){hour=m[1];minu=m[2];sec="00"}else return null}if(Number(hour)>=0&&Number(hour)<=23&&Number(minu)>=0&&Number(minu)<=59&&Number(sec)>=0&&Number(sec)<=59)return addprefixfortime(hour)+":"+addprefixfortime(minu)+":"+addprefixfortime(sec);else return null}else return op.toString()}
function addprefixfortime(value){if(value.length==1)value="0"+value;return value}var gridwebinstance=new Map;
function acwmain(gridweb){if(gridwebinstance.get(gridweb.id)!=null)return;this.gridweb=gridweb;gridweb.handler=this;gridweb.reSetDPI=reSetDPI;gridweb.reSetDPI();gridweb.menuRangeMap=new Map;gridweb._selections=new Selections(gridweb);gridweb.Dragging=null;gridweb.DraggingMode=0;gridweb.DragCell=null;gridweb.DragEndCell=null;gridweb.ActiveCell=null;gridweb.ResizeIcon=null;gridweb.StartX=null;gridweb.StartY=null;gridweb.StartWidth=null;gridweb.StartHeight=null;gridweb.StartWidth1=null;gridweb.StartHeight1=
null;gridweb.ResizingHD=null;gridweb.resizeType=null;gridweb.resizePanel=null;gridweb.ListMenu=null;gridweb.validations=null;gridweb.dataFilters=null;gridweb.xmlDoc=null;gridweb.xmlDoc1=null;gridweb.lmDoc=null;gridweb.ContextMenu=null;gridweb.Calendar=null;gridweb.xmlData=null;gridweb.vmark=null;gridweb.fastEdit=null;gridweb.bottomTable=null;gridweb.topPanel=null;gridweb.leftTopPanel=null;gridweb.leftPanel=null;gridweb.viewPanel=null;gridweb.viewPanel01=null;gridweb.viewPanel10=null;gridweb.tabPanel=
null;gridweb.eventBtn=null;gridweb.viewTable=null;gridweb.viewTable00=null;gridweb.viewTable01=null;gridweb.viewTable10=null;gridweb.vsBar=null;gridweb.hsBar=null;gridweb.frameTab=null;gridweb.fRow=null;gridweb.fCol=null;gridweb.fRowH=null;gridweb.fColH=null;gridweb.viewRow=null;gridweb.CD=null;gridweb.CD0=null;gridweb.CD1=null;gridweb.pageSelect=null;gridweb.cidregex=null;gridweb.xTable=null;gridweb.ltable0=null;gridweb.ltable1=null;gridweb.topTable=null;gridweb.topTable0=null;gridweb.sBody=null;
gridweb.loadingBox=null;gridweb.blockcover=null;gridweb.pendingNodes=null;gridweb.ajaxXmlHttp=null;gridweb.ajaxtimeout=null;gridweb.ajaxsendtimeout=null;gridweb.ajaxupdatingcells=null;gridweb.contentInit=false;gridweb.donotneedscroll=false;gridweb.isshowformula=false;if(!ie||iemv>8){gridweb.acw_client_path=getattr(gridweb,"acw_client_path");gridweb.image_file_path=getattr(gridweb,"image_file_path");gridweb.activerow=getattr(gridweb,"activerow");gridweb.activecol=getattr(gridweb,"activecol");gridweb.ajaxcallpath=
getattr(gridweb,"ajaxcallpath");gridweb.asynccallpath=getattr(gridweb,"asynccallpath");gridweb.acbcolor=getattr(gridweb,"acbcolor");gridweb.accolor=getattr(gridweb,"accolor");gridweb.scbcolor=getattr(gridweb,"scbcolor");gridweb.sccolor=getattr(gridweb,"sccolor");gridweb.ahbcolor=getattr(gridweb,"ahbcolor");gridweb.ahcolor=getattr(gridweb,"ahcolor");gridweb.aminrow=getattr(gridweb,"aminrow");gridweb.amaxrow=getattr(gridweb,"amaxrow");gridweb.minrow=getattr(gridweb,"minrow");gridweb.maxrow=getattr(gridweb,
"maxrow");gridweb.amincol=getattr(gridweb,"amincol");gridweb.amaxcol=getattr(gridweb,"amaxcol");gridweb.mincol=getattr(gridweb,"mincol");gridweb.maxcol=getattr(gridweb,"maxcol");gridweb.asynctoprows=getattr(gridweb,"asynctoprows");gridweb.visiblerows=getattr(gridweb,"visiblerows");gridweb.asyncrows=getattr(gridweb,"asyncrows");gridweb.forcevalid=getattr(gridweb,"forcevalid");if(!ie&&!getattr(gridweb,"tabIndex"))gridweb.setAttribute("tabIndex",0)}if(gridweb.ajaxcallpath!=null&&gridweb.ajaxcallpath.endsWith("acw_ajax_call=true")){java_client=
true;gridweb.webuniqueid=getattr(gridweb,"webuniqueid")}gridweb.xhtmlmode=getattr(gridweb,"xhtmlmode")=="1";gridweb.editmode=getattr(gridweb,"editmode")=="1";gridweb.freeze=getattr(gridweb,"freeze")=="1";gridweb.noscroll=getattr(gridweb,"noscroll")=="1";gridweb.async=getattr(gridweb,"async")=="1";gridweb.isUseClientPageHeight=getattr(gridweb,"useclientpageheight")=="1";gridweb.aminrow=parseInt(gridweb.aminrow);gridweb.amaxrow=parseInt(gridweb.amaxrow);gridweb.minrow=parseInt(gridweb.minrow);gridweb.maxrow=
parseInt(gridweb.maxrow);gridweb.amincol=parseInt(gridweb.amincol);gridweb.amaxcol=parseInt(gridweb.amaxcol);if(gridweb.asynctoprows!=null)gridweb.asynctoprows=parseInt(gridweb.asynctoprows);if(gridweb.visiblerows!=null)gridweb.visiblerows=parseInt(gridweb.visiblerows);if(gridweb.asyncrows!=null)gridweb.asyncrows=parseInt(gridweb.asyncrows);if(gridweb.activerow!=null)gridweb.activerow=parseInt(gridweb.activerow);if(gridweb.activecol!=null)gridweb.activecol=parseInt(gridweb.activecol);if(gridweb.freeze){gridweb.freezerow=
parseInt(getattr(gridweb,"freezerow"));gridweb.freezecol=parseInt(getattr(gridweb,"freezecol"))}gridweb.acttab=getattr(gridweb,"acttab");gridweb.vsTimeout=null;gridweb.autoDraggingId=null;gridweb.dropDownListFlg=false;gridweb.selectedOptionVal="";gridweb.dropdownListLoadedFlg=false;gridweb.dropdownListShowedFlg=false;gridweb.activateNextOrPreviCellFlg=false;gridweb.shiftAndTabKeyPressedFlg=false;gridweb.currentIMGWidth=0;gridweb.scrolledFlg=false;gridweb.leftKeyPressedFlg=false;gridweb.previClickedCell=
null;gridweb.rotationCss=null;gridweb.pasteObject=null;gridweb.preventKeyPress=false;gridweb.calendarAppended=false;gridweb.isDataChanged=isDataChanged;gridweb.updateData=updateData;gridweb.validateAll=validateAll;gridweb.submit=submit;gridweb.getCellValue=getCellValue;gridweb.setCellValue=setCellValue;gridweb.getActiveRow=getActiveRow;gridweb.getActiveColumn=getActiveColumn;gridweb.setActiveCellBasic=setActiveCellBasic;gridweb.setActiveCell=setActiveCell;gridweb.tryInitSetActiveCell=tryInitSetActiveCell;
gridweb.setActiveCellNoadjust=setActiveCellNoadjust;gridweb.getSelectedCells=getSelectedCells;gridweb.resizeColumnToFit=resizeColumnToFit;gridweb.getActiveCell=getActiveCell;gridweb.setActiveCellByCell=setActiveCellByCell;gridweb.getCell=getCell;gridweb.getLocateCell=getLocateCell;gridweb.getCellRow=getCellRow;gridweb.recalculateCellRowNumberOnCurrentCell=recalculateCellRowNumberOnCurrentCell;gridweb.recalculateCellColNumberOnCurrentCell=recalculateCellColNumberOnCurrentCell;gridweb.getCellColumn=
getCellColumn;gridweb.getColumn=getColumn;gridweb.getCellColumnName=getCellColumnName;gridweb.getCellName=getCellName;gridweb.getCellValueByCell=getCellValueByCell;gridweb.setCellValueByCell=setCellValueByCell;gridweb.print=print;gridweb.getClientPageHeight=getClientPageHeight;gridweb.setActiveTab=setActiveTab;gridweb.adjustXSize=adjustXSize;gridweb.adjustXSizeX=adjustXSizeX;gridweb.initXTable=initXTable;gridweb.adjustXhtmlTopRow=adjustXhtmlTopRow;gridweb.adjustXhtmlRows=adjustXhtmlRows;gridweb.adjustXhtml2_p=
adjustXhtml2_p;gridweb.adjustNoScroll=adjustNoScroll;gridweb.adjustFreeze=adjustFreeze;gridweb.adjustScroll=adjustScroll;gridweb.adjustSizes=adjustSizes;gridweb.adjustBVScroll=adjustBVScroll;gridweb.adjustAsyncScrollBar=adjustAsyncScrollBar;gridweb.setUpContrlScrollBar=setUpContrlScrollBar;gridweb.setUpContrlRadioButton=setUpContrlRadioButton;gridweb.mOnResize=mOnResize;gridweb.mOnScroll=mOnScroll;gridweb.mOnScroll1=mOnScroll1;gridweb.mOnScroll2=mOnScroll2;gridweb.mOnVScroll=mOnVScroll;gridweb.mOnHScroll=
mOnHScroll;gridweb.mOnSubmit=mOnSubmit;gridweb.mOnError=mOnError;gridweb.mOnCalendarChange=mOnCalendarChange;gridweb.mOnContextMenuClick=mOnContextMenuClick;gridweb.mOnListMenuClick=mOnListMenuClick;gridweb.mOnPageChange=mOnPageChange;gridweb.selectPageIndex=selectPageIndex;gridweb.mOnSelectCell=mOnSelectCell;gridweb.mOnSelectCellAjaxCallBack=mOnSelectCellAjaxCallBack;gridweb.mOnUnselectCell=mOnUnselectCell;gridweb.mOnDoubleClickCell=mOnDoubleClickCell;gridweb.mOnDoubleClickRow=mOnDoubleClickRow;
gridweb.mOnCellError=mOnCellError;gridweb.mOnCellUpdated=mOnCellUpdated;gridweb.updateMenuReferenceOnCellUpdated=updateMenuReferenceOnCellUpdated;gridweb.mOnEmbededGridSubmit=mOnEmbededGridSubmit;gridweb.createLoadingBox=createLoadingBox;gridweb.validateInput=validateInput;gridweb.setValid=setValid;gridweb.setInvalid=setInvalid;gridweb.validateServerFunction=validateServerFunction;gridweb.searchv=searchv;gridweb.searchValidations=searchValidations;gridweb.isCell=isCell;gridweb.clearSelections=clearSelections;
gridweb.clearSelectionAsyncCache=clearSelectionAsyncCache;gridweb.setSelectRange=setSelectRange;gridweb.getSelectRange=getSelectRange;gridweb.doRangeSelect=doRangeSelect;gridweb.editCell=editCell;gridweb.editCell2=editCell2;gridweb.endEdit=endEdit;gridweb.endEditfromEditorBox=endEditfromEditorBox;gridweb.endEditBase=endEditBase;gridweb.EscCancelEdit=EscCancelEdit;gridweb.deleteCells=deleteCells;gridweb.selectCellBasic=selectCellBasic;gridweb.selectCell=selectCell;gridweb.selectCellNoadjust=selectCellNoadjust;
gridweb.enterSelect=enterSelect;gridweb.enterEdit=enterEdit;gridweb.endSelect=endSelect;gridweb.setCellActive=setCellActive;gridweb.getSpan=getSpan;gridweb.getO=getO;gridweb.endDrag=endDrag;gridweb.update=update;gridweb.updateCellFontColor=updateCellFontColor;gridweb.updateCellBackGroundColor=updateCellBackGroundColor;gridweb.setCellTitle=setCellTitle;gridweb.createtip=createtip;gridweb.showtip_cmnt=showtip_cmnt;gridweb.showtip_imsg=showtip_imsg;gridweb.hidetip=hidetip;gridweb.postBack=postBack;gridweb.copy=
copy;gridweb.cut=cut;gridweb.CopyOrCut=CopyOrCut;gridweb.paste=paste;gridweb.doPaste=doPaste;gridweb.doMyPasteAction=doMyPasteAction;gridweb.doMyCopyAction=doMyCopyAction;gridweb.requestFocusToGetCopyContentForPaste=requestFocusToGetCopyContentForPaste;gridweb.hideUpdatingImage=hideUpdatingImage;gridweb.updateSelect=updateSelect;gridweb.updatePagePosition=updatePagePosition;gridweb.updateAsync=updateAsync;gridweb.postAsyncW=postAsyncW;gridweb.postAsyncH=postAsyncH;gridweb.mouseOut=mouseOut;gridweb.mouseUp=
mouseUp;gridweb.autoDragging=autoDragging;gridweb.VscrollEndHandler=VscrollEndHandler;gridweb.HscrollEndHandler=HscrollEndHandler;gridweb.ajaxupdate=ajaxupdate;gridweb.ajaxcall=ajaxcall;gridweb.ajaxcallback=ajaxcallback;gridweb.ajaxcallback2=ajaxcallback2;gridweb.ajaxsendfail=ajaxsendfail;gridweb.ajaxcall_onselectcell=ajaxcall_onselectcell;gridweb.ajaxcall_onselectcell_start=ajaxcall_onselectcell_start;gridweb.ajaxcallback_onselectcell=ajaxcallback_onselectcell;gridweb.gridajaxupdate=gridajaxupdate;
gridweb.gridajaxcall=gridajaxcall;gridweb.gridajaxcallback=gridajaxcallback;gridweb.gridajaxcallback2=gridajaxcallback2;gridweb.gridajaxsendfail=gridajaxsendfail;gridweb.gridajaxupdateStyles=gridajaxupdateStyles;gridweb.createLoadingByChart=createLoadingByChart;gridweb.addImagePreLoadingGif=addImagePreLoadingGif;gridweb.adjustImageButton=adjustImageButton;gridweb.doSelectShiftCellRange=doSelectShiftCellRange;gridweb.pressKeyGoUpOnCell=pressKeyGoUpOnCell;gridweb.pressKeyGoDownOnCell=pressKeyGoDownOnCell;
gridweb.pressKeyGoLeftOnCell=pressKeyGoLeftOnCell;gridweb.pressKeyGoRightOnCell=pressKeyGoRightOnCell;gridweb.findcurrentCell=findcurrentCell;gridweb.findLeftUpMostCell=findLeftUpMostCell;gridweb.findUpMostCell=findUpMostCell;gridweb.findLeftMostCell=findLeftMostCell;gridweb.validateContent=validateContent;gridweb.validatorConvert=validatorConvert;gridweb.getNextValidCell=getNextValidCell;gridweb.getPreviousValidCell=getPreviousValidCell;gridweb.getUndersideValidRow=getUndersideValidRow;gridweb.getUpsideValidRow=
getUpsideValidRow;gridweb.GetUpListItem=GetUpListItem;gridweb.GetDownListItem=GetDownListItem;gridweb.getchartimg=getchartimg;gridweb.isHeader=isHeader;gridweb.setResizeCursor=setResizeCursor;gridweb.resizeHeaderbar=resizeHeaderbar;gridweb.enterResize=enterResize;gridweb.endResize=endResize;gridweb.fontDialog=fontDialog;gridweb.closeFontDialog=closeFontDialog;gridweb.fillTableCellsToArray=fillTableCellsToArray;gridweb.showDropDownList=showDropDownList;gridweb.getViewTableByRowHeader=getViewTableByRowHeader;
gridweb.getViewTableByColHeader=getViewTableByColHeader;gridweb.getViewTableByCell=getViewTableByCell;gridweb.getFirstCell=getFirstCell;gridweb.getLastCell=getLastCell;gridweb.getFormulaValidation=getFormulaValidation;gridweb.fontdialognext=fontdialognext;gridweb.vsBarSetPosion=vsBarSetPosion;gridweb.hsBarSetPosion=hsBarSetPosion;gridweb.initGridWebByClientPageHeight=initGridWebByClientPageHeight;gridweb.resize=resize;gridweb.ajacsendcmd=ajacsendcmd;gridweb.delcomment=delcomment;gridweb.delcomments=
delcomments;gridweb.delcommentlocal=delcommentlocal;gridweb.collapseRow=collapseRow;gridweb.expandRow=expandRow;gridweb.setRowDisplayExtrForMergedAreaAbove=setRowDisplayExtrForMergedAreaAbove;gridweb.setRowDisplayExtrForMergedAreaBelow=setRowDisplayExtrForMergedAreaBelow;gridweb.collapseCol=collapseCol;gridweb.expandCol=expandCol;gridweb.setColDisplay=setColDisplay;gridweb.setColDisplayBasic=setColDisplayBasic;gridweb.getContentRowById=getContentRowById;gridweb.getContentColById=getContentColById;
gridweb.getLeftPartRowById=getLeftPartRowById;gridweb.getRightPartRowById=getRightPartRowById;gridweb.getHeadRowById=getHeadRowById;gridweb.getRowVisible=getRowVisible;gridweb.getVisibleRowCount=getVisibleRowCount;gridweb.setRowCollpaseStatus=setRowCollpaseStatus;gridweb.setColCollpaseStatus=setColCollpaseStatus;gridweb.setupGroupMatch=setupGroupMatch;gridweb.setupGroupMatchRow=setupGroupMatchRow;gridweb.setupGroupMatchCol=setupGroupMatchCol;gridweb.findNextMaxRow=findNextMaxRow;gridweb.findNextMinRow=
findNextMinRow;gridweb.initContent=initContent;gridweb.initContent();gridweb.oncontextmenu=mOnContextMenu;gridweb.onmouseover=mOnMouseOver;gridweb.onmouseout=mOnMouseOut;gridweb.onmousemove=mOnMouseMove;gridweb.onmouseup=mOnMouseUp;gridweb.onmousedown=mOnMouseDown;gridweb.onclick=mOnClick;gridweb.ondblclick=mOnDblClick;gridweb.mOnKeyDown=mOnKeyDown;gridweb.mOnKeyPress=mOnKeyPress;gridweb.mOnKeyUp=mOnKeyUp;gridweb.rowSpanMap=new Map;gridweb.adjustTableCellSpanHeight=adjustTableCellSpanHeight;gridweb.switchFormulaDisplay=
switchFormulaDisplay;gridweb.getCellsArray=getCellsArray;gridweb.refreshdataview=refreshdataview;gridweb.showloadingbox=showloadingbox;gridweb.hideloadingbox=hideloadingbox;gridweb.tryfindcachePrepare=tryfindcachePrepare;gridweb.callgridajaxcallback2=callgridajaxcallback2;gridweb.parseRespWebHTML=parseRespWebHTML;gridweb.clearAsyncCache=clearAsyncCache;gridwebinstance.put(gridweb.id,gridweb);if(firstgrid==null)firstgrid=gridweb;if(needInitAlignmentAdjust){firstgrid.showloadingbox();setTimeout("adjustTableCellSpanHeightForAll()",
3E3)}setTimeout("adjustEditorWidthForAll()",2E3)}
function initGridWebByClientPageHeight(){var mypageheight=Math.max(Math.max(document.body.offsetHeight,document.documentElement.offsetHeight),Math.max(document.body.clientHeight,document.documentElement.clientHeight));mypageheight=mypageheight-13;var collpase=getattr(this,"grp_collapse_col");if(collpase!=null)if(ie)mypageheight-=31;else mypageheight-=30;clientpageheight=mypageheight;var percentagevalue=getPercentageLength(this.style.height);if(percentagevalue!=null)mypageheight=mypageheight*percentagevalue;
this.leftPanel.style.height=mypageheight-47+"px";this.viewPanel.style.height=mypageheight-47+"px"}function getClientPageHeight(){if(this.isUseClientPageHeight)return clientpageheight;else return this.offsetHeight}
function resize(){var ie_percent_height=null;if(ie){var percentagevalue=getPercentageLength(this.style.height);if(percentagevalue!=null)ie_percent_height=this.style.height}if(this.async)asynctableheight_map.remove(this.acttab);this.initGridWebByClientPageHeight();this.adjustXhtmlRows();if(this.freeze)this.adjustSizes();if(ie){this.viewPanel.parentNode.parentNode.style.height=this.viewPanel.style.height;this.leftPanel.parentNode.parentNode.style.height=this.leftPanel.style.height;if(this.viewPanel10!=
null)this.viewPanel10.parentNode.parentNode.style.height=this.viewPanel10.style.height;if(ie_percent_height!=null)this.style.height=ie_percent_height}this.mOnScroll();this.adjustImageButton();doIE7AsyncScrllBar(this)}function setActiveTab(tabindex){this.postBack("TAB:"+tabindex,false);this.clearAsyncCache();gridwebinstance.remove(this.id)}function clearAsyncCache(){if(this.async&&enableasynccache){col_row_cache_index=[];last_row_v_info=null;last_asyncrows=0;last_direction=-1}}
function initContent(){this.cidregex=new RegExp("^\\d+#\\d+$");this.contentInit=true;if(!this.xhtmlmode)this.sBody=document.body;else this.sBody=document.documentElement;if(getattr(this,"onacwsubmit")!=null)try{this.onacwsubmit=eval(getattr(this,"onacwsubmit"))}catch(ex){}if(getattr(this,"onacwerror")!=null)try{this.onacwerror=eval(getattr(this,"onacwerror"))}catch(ex){}if(getattr(this,"onacwselectcell")!=null)try{this.onacwselectcell=eval(getattr(this,"onacwselectcell"))}catch(ex){}if(getattr(this,
"onacwselectcellajaxcallback")!=null)try{this.onacwselectcellajaxcallback=eval(getattr(this,"onacwselectcellajaxcallback"))}catch(ex){}if(getattr(this,"onacwunselectcell")!=null)try{this.onacwunselectcell=eval(getattr(this,"onacwunselectcell"))}catch(ex){}if(getattr(this,"onacwdoubleclickcell")!=null)try{this.onacwdoubleclickcell=eval(getattr(this,"onacwdoubleclickcell"))}catch(ex){}if(getattr(this,"onacwdoubleclickrow")!=null)try{this.onacwdoubleclickrow=eval(getattr(this,"onacwdoubleclickrow"))}catch(ex){}if(getattr(this,
"onacwcellerror")!=null)try{this.onacwcellerror=eval(getattr(this,"onacwcellerror"))}catch(ex){}if(getattr(this,"onacwcellupdate")!=null)try{this.onacwcellupdate=eval(getattr(this,"onacwcellupdate"))}catch(ex){}if(getattr(this,"onajaxcallfinished")!=null)try{this.onajaxcallfinished=eval(getattr(this,"onajaxcallfinished"))}catch(ex){}if(getattr(this,"onacwinit")!=null)try{this.onacwinit=eval(getattr(this,"onacwinit"))}catch(ex){}if(getattr(this,"onacwpagechange")!=null)try{this.onacwpagechange=eval(getattr(this,
"onacwpagechange"))}catch(ex){}this.xmlData=document.getElementById(this.id+"_XMLDATA");this.vmark=document.getElementById(this.id+"_VMARK");this.frameTab=document.getElementById(this.id+"_FRAMETAB");this.topPanel=document.getElementById(this.id+"_topPanel");this.leftTopPanel=document.getElementById(this.id+"_leftTopPanel");this.leftPanel=document.getElementById(this.id+"_leftPanel");this.viewPanel=document.getElementById(this.id+"_viewPanel");this.viewTable=document.getElementById(this.id+"_viewTable");
this.viewRow=document.getElementById(this.id+"_viewRow");this.bottomTable=document.getElementById(this.id+"_bottomTable");this.tabPanel=document.getElementById(this.id+"_tabPanel");this.eventBtn=document.getElementById(this.id+"_EVENTBTN");this.xTable=document.getElementById(this.id+"_xTable");this.ltable1=document.getElementById(this.id+"_leftTab");this.topTable=document.getElementById(this.id+"_topTab");this.vsBar=document.getElementById(this.id+"_vsBar");this.hsBar=document.getElementById(this.id+
"_hsBar");this.pastediv=document.getElementById(this.id+"_divforpaste");this.editorcellname=document.getElementById(this.id+"_celleditorname");this.focusonoutereditor=false;this.editorbox=document.getElementById(this.id+"_celleditorcontent");if(this.editorbox!=null){this.editorbox.mygridweb=this;this.adjustEditorWidth=adjustEditorWidth;this.editorbox.onclick=function(){this.mygridweb.fastedit=false;this.mygridweb.focusonoutereditor=true};this.editorbox.onfocus=function(){this.mygridweb.fastedit=false;
this.mygridweb.focusonoutereditor=true};this.editorbox.onblur=function(){this.mygridweb.focusonoutereditor=false;if(current_cell.hasupdated)this.mygridweb.endEditfromEditorBox(current_cell)};this.editorbox.onkeyup=function(){if(current_cell!=null){if(!current_cell.setLastText){current_cell.setLastText=true;current_cell.lastText=getInnerText(current_cell)}current_cell.hasupdated=true;copywithstyle(current_cell,this.value);var indexofcontent=this.value.indexOf(CELL_CONTENT_FORMAT_DELIMITER);if(indexofcontent>
0)this.value=this.value.substring(0,indexofcontent);this.mygridweb.editCell2(current_cell,this.value);if(this.value.length>0&&current_cell.firstChild!=null)adjustSpanCell(current_cell.parentNode,current_cell)}}}if(this.freeze){this.viewPanel01=document.getElementById(this.id+"_viewPanel01");this.viewPanel10=document.getElementById(this.id+"_viewPanel10");this.viewTable00=document.getElementById(this.id+"_viewTable00");this.viewTable01=document.getElementById(this.id+"_viewTable01");this.viewTable10=
document.getElementById(this.id+"_viewTable10");this.ltable0=document.getElementById(this.id+"_leftTable0");this.topTable0=document.getElementById(this.id+"_topTable0");this.fRow=document.getElementById(this.id+"_FROW");this.fCol=document.getElementById(this.id+"_FCOL");this.fRowH=document.getElementById(this.id+"_FROWH");this.fColH=document.getElementById(this.id+"_FCOLH")}this.xmlDoc=getXMLDocument(document.getElementById(this.id+"_XML1"));var root=this.xmlDoc.selectSingleNode("data");root.appendChild(this.xmlDoc.createElement("SELECT"));
root.appendChild(this.xmlDoc.createElement("CELLS"));root.appendChild(this.xmlDoc.createElement("SIZES"));root.appendChild(this.xmlDoc.createElement("POSITION"));root.appendChild(this.xmlDoc.createElement("ASYNC"));this.xmlDoc1=getXMLDocument(document.getElementById(this.id+"_XML2"));this.lmDoc=getXMLDocument(document.getElementById(this.id+"_XML3"));var gridweb=this;this.ContextMenu=document.getElementById(this.id+"_CMENU");if(this.ContextMenu!=null){new acwmenu(this.ContextMenu);this.initContextMenu=
initContextMenu;this.initContextMenu()}this.ListMenu=document.getElementById(this.id+"_LMENU");if(this.ListMenu!=null){new acwmenu(this.ListMenu);this.ListMenu.onItemClick=function(menuValue,menuId,menuContext){gridweb.mOnListMenuClick(menuValue,menuId,menuContext)};this.ListMenu.gridContext=gridweb}var templistmenusnode=this.lmDoc.selectSingleNode("listmenus");if(templistmenusnode!=null){var menunodes=templistmenusnode.getChildNodes();for(var i=0;i<menunodes.length;i++){var id=menunodes[i].getAttribute("id");
var range=menunodes[i].getAttribute("range");if(range!=null)this.menuRangeMap.put(id,range)}}if(getattr(this,"paging")=="1"){this.pageSelect=document.getElementById(this.id+"_PAGE");if(this.pageSelect!=null)this.pageSelect.onchange=function(){gridweb.mOnPageChange()}}if(this.isUseClientPageHeight)this.initGridWebByClientPageHeight();this.viewPanel.onscroll=function(){if(!gridweb.donotneedscroll)gridweb.mOnScroll()};if(this.style.position==null||this.style.position.toUpperCase()!="ABSOLUTE")this.style.position=
"relative";this.validations=new Array;this.dataFilters=new Array;if(getattr(this,"embeded")!="1"){var eh=parseLength(this.style.height,"y");if(this.xhtmlmode){if(ie&&iemv<8)this.adjustXhtmlTopRow();if(!this.noscroll)this.adjustXhtmlRows()}if(this.noscroll)this.adjustNoScroll();else if(this.freeze)this.adjustFreeze();if(this.xTable!=null){this.initXTable();if(this.noscroll)this.adjustNoScroll();else if(this.freeze)this.adjustFreeze()}if((chrome||safari)&&this.async){var vsCol=document.getElementById(this.id+
"_vsCol");if(vsCol!=null){vsCol.style.display="";vsCol.style.width="1px"}}if(this.async)if(last_asyncrows>0)this.asyncrows=last_asyncrows;this.setupGroupMatch();this.adjustBVScroll();if(getattr(this,"acwpopupcw")=="1")try{if(this.ListMenu!=null){this.ListMenu.addItem("This application is using");this.ListMenu.addItem("an EVALUATION COPY of");this.ListMenu.addItem("Aspose.Cells.GridWeb control!");this.ListMenu.showXY(0,0,this);this.ListMenu.showXY(this.viewPanel.clientWidth-this.ListMenu.offsetWidth,
this.viewPanel.clientHeight-this.ListMenu.offsetHeight,this);this.viewPanel.appendChild(this.ListMenu)}}catch(ex){}this.createLoadingBox();if(typeof this.onacwinit=="function")this.onacwinit(this);if(this.Calendar==null){this.Calendar=document.createElement("SPAN");this.Calendar.id=this.id+"_CALENDAR";this.Calendar.style.position="absolute";this.Calendar.style.width="280px";this.Calendar.style.height="150px";this.Calendar.style.zIndex=99999999;this.Calendar.style.display="none";new acwcalendar(this.Calendar);
if(document.createEventObject)this.Calendar.onpropertychange=function(){gridweb.mOnCalendarChange()};else this.Calendar.addEventListener("onpropertychange",function(e){gridweb.mOnCalendarChange(e)},false)}}this.tryInitSetActiveCell();doIE7AsyncScrllBar(this);setTimeout(function(){gridweb.searchv()},0);if(typeof jQuery=="undefined");else{var shapelist=$("img[id^='asposeshape_']");var length=shapelist.length;var d=(new Date).getTime();for(var i=0;i<length;i++)this.addImagePreLoadingGif(shapelist,d,
i,true);var piclist=$("img[id^='asposepic_']");var length=piclist.length;var d=(new Date).getTime();for(var i=0;i<length;i++)this.addImagePreLoadingGif(piclist,d,i,true);var scrollist=$(".acwc_ScrollBar");for(var i=0;i<scrollist.length;i++)gridweb.setUpContrlScrollBar(scrollist[i]);scrollist=$(".acwc_RadioButton");for(var i=0;i<scrollist.length;i++)gridweb.setUpContrlRadioButton(scrollist[i])}}
function addImagePreLoadingGif(chartarray,date,i,isfirsttimeloading){if(chartarray[i]==null)return;var chartnewsrc="";if(chartarray[i].src.indexOf("data:image/gif")!=0)if(!java_client)chartnewsrc=chartarray[i].src.split("?")[0]+"?"+date;else{var temparr=chartarray[i].src.split("?");var tempparams=temparr[1].split("&");if(tempparams.length==3)chartnewsrc=temparr[0]+"?"+tempparams[0]+"&"+tempparams[1]+"&t="+date;else chartnewsrc=chartarray[i].src+"&t="+date}else chartnewsrc=chartarray[i].src;var imgob=
new Image;imgob.iid=i;imgob.removeLoadingGif=function(chartarray){var lastChild=chartarray[this.iid].parentNode.lastChild;if(lastChild.isgif){chartarray[this.iid].parentNode.removeChild(lastChild);chartarray[this.iid].src=this.src}this.removeLoadingGif=null};imgob.onload=function(){this.removeLoadingGif(chartarray)};imgob.src=chartnewsrc;setTimeout(function(){if(imgob.removeLoadingGif!=null)imgob.removeLoadingGif(chartarray)},removeloadinggifDelay);this.createLoadingByChart(chartarray[i],isfirsttimeloading)}
function createLoadingByChart(chart,isfirsttimeloading){img=document.createElement("IMG");img.src=this.image_file_path+"updating.gif";img.style.position="absolute";img.style.left=chart.style.left;img.style.top=chart.style.top;img.style.width="16px";img.style.height="16px";img.style.zIndex=chart.style.zIndex;img.id="loading"+chart.id;img.onload=chart.onload;img.isgif=true;chart.parentNode.appendChild(img);if(isfirsttimeloading)chart.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg=="}
function doIE7AsyncScrllBar(who){if(who.viewPanel.offsetHeight==0)setTimeout(function(){doIE7AsyncScrllBar(who)},300);else who.adjustAsyncScrollBar()}
function reSetDPI(){if(ie&&iemv==7);else if(ie&&iemv==8);else{var dpi;if(!document.getElementById("dpi")){dpi=document.createElement("div");dpi.setAttribute("id","dpi");dpi.setAttribute("style","width:1in;height:1in;visible:hidden;padding:0px");this.appendChild(dpi)}else{dpi=document.getElementById("dpi");dpi.setAttribute("style","width:1in;height:1in;visible:hidden;padding:0px")}screen.deviceXDPI=dpi.offsetWidth;screen.deviceYDPI=dpi.offsetHeight;dpi.setAttribute("style","width:1in;height:1in;visible:hidden;padding:0px;display:none");
return screen}}
function initContextMenu(){this.ContextMenu.clear();this.ContextMenu.addItem(getlang().MenuItemCopy,"Copy");if(this.editmode){this.ContextMenu.addItem(getlang().MenuItemCut,"Cut");this.ContextMenu.addItem(getlang().MenuItemPaste,"Paste");this.ContextMenu.addItem(getlang().MenuItemDelComment,"delcmmt");if(getattr(this,"clientfrz")=="1"){this.ContextMenu.addSeparator();this.ContextMenu.addItem(getlang().MenuItemFreeze,"Freeze");if(this.freeze)this.ContextMenu.addItem(getlang().MenuItemUnfreeze,"Unfreeze")}if(getattr(this,
"clientro")=="1"){this.ContextMenu.addSeparator();this.ContextMenu.addItem(getlang().MenuItemAddRow,"Add Row");if(getattr(this,"bindingsrc")!="1")this.ContextMenu.addItem(getlang().MenuItemInsertRow,"Insert Row");this.ContextMenu.addItem(getlang().MenuItemDeleteRow,"Delete Row")}if(getattr(this,"clientco")=="1"){this.ContextMenu.addSeparator();this.ContextMenu.addItem(getlang().MenuItemAddColumn,"Add Column");this.ContextMenu.addItem(getlang().MenuItemInsertColumn,"Insert Column");this.ContextMenu.addItem(getlang().MenuItemDeleteColumn,
"Delete Column")}if(getattr(this,"clientmo")=="1"){this.ContextMenu.addSeparator();this.ContextMenu.addItem(getlang().MenuItemMergeCells,"Merge Cells");this.ContextMenu.addItem(getlang().MenuItemUnmergeCells,"Unmerge Cells")}if(getattr(this,"stdb")=="1"){this.ContextMenu.addSeparator();this.ContextMenu.addItem(getlang().MenuItemFormat,"Format")}}this.ContextMenu.addSeparator();this.ContextMenu.addItem(getlang().MenuItemFind,"Find");if(this.editmode)this.ContextMenu.addItem(getlang().MenuItemReplace,
"Replace");var mnode=this.lmDoc.selectSingleNode('listmenus/menu[@id="custmenu"]');if(mnode!=null){var mv=mnode.getAttribute("value");this.ContextMenu.addSeparator();this.ContextMenu.loadItems(mv);this.ContextMenu.addOKCancel()}this.ContextMenu.hideTopSeparator();var gridweb=this;this.ContextMenu.onItemClick=function(menuValue,menuId,menuContext){gridweb.mOnContextMenuClick(menuValue,menuId,menuContext)};var onacwcontextmenushow=getattr(this,"onacwcontextmenushow");if(onacwcontextmenushow!=null)try{this.ContextMenu.onShow=
eval(onacwcontextmenushow)}catch(ex){}}
function mOnContextMenu(e){if(this.ContextMenu!=null){var o=window.event?event.srcElement:e.target;if(o.tagName=="SPAN"&&(o.className.indexOf("acwxc")>-1||o.className.indexOf("rotation")>-1))o=o.parentNode;var t=this.isCell(o);if(t){if(t=="TD"){if((this.ActiveCell==null||this.ActiveCell!=o)&&!this._selections.contains(o)){this.clearSelections();this.selectCell(o)}this.ContextMenu.menuContext=o}else{this.endEdit(this.ActiveCell);this.ContextMenu.menuContext=this.ActiveCell}this.ContextMenu.show(e)}}return false}
function mOnContextMenuClick(menuValue,menuId,menuContext){switch(menuValue){case "Format":if(menuContext!=null)this.fontDialog(menuContext);break;case "Copy":if(menuContext!=null)this.copy(menuContext);break;case "Cut":if(menuContext!=null)this.cut(menuContext);break;case "Paste":if(menuContext!=null)this.paste(menuContext);break;case "Freeze":if(menuContext!=null){var vleft=this.viewPanel.scrollLeft;var vtop=this.async&&this.vsBar!=null?this.vsBar.scrollTop:this.viewPanel.scrollTop;this.postBack("FREEZE:"+
getfirstViewRow(this.viewTable,vtop)+":"+getfirstViewCol(this.topTable,vleft),false)}break;case "Unfreeze":this.postBack("UNFREEZE",false);break;case "Add Row":this.postBack("ADDROW",false);break;case "Insert Row":if(menuContext!=null)this.postBack("INSERTROW",false);break;case "Delete Row":if(menuContext!=null)this.postBack("DELETEROW",false);break;case "Add Column":if(menuContext!=null)this.postBack("ADDCOLUMN",false);break;case "Insert Column":if(menuContext!=null)this.postBack("INSERTCOLUMN",
false);break;case "Delete Column":if(menuContext!=null)this.postBack("DELETECOLUMN",false);break;case "Merge Cells":if(menuContext!=null)this.postBack("MERGE",false);break;case "Unmerge Cells":if(menuContext!=null)this.postBack("UNMERGE",false);break;case "delcmmt":if(menuContext!=null)this.delcomments();break;case "Find":showFindReplaceDlg(this,menuContext,0);break;case "Replace":showFindReplaceDlg(this,menuContext,1);break;default:if(menuValue.indexOf("CCMD:")==0)this.postBack(menuValue,false);
break}}function mOnListMenuClick(menuValue,menuId,menuContext){var context=menuContext;if(context!=null&&context.id!=null)if(context.id.indexOf(this.id+"_FTR")==0);else{this.editCell(context,menuValue);context.removeAttribute("needvalidateforlistitems")}}function mOnPageChange(){this.postBack("PAGE:"+this.pageSelect.selectedIndex,false);if(typeof this.onacwpagechange=="function")this.onacwpagechange(this.pageSelect.selectedIndex);gridwebinstance.remove(this.id)}
function selectPageIndex(index){this.showloadingbox();this.pageSelect.selectedIndex=index;this.postBack("PAGE:"+index,false);gridwebinstance.remove(this.id)}
function mOnMouseMove(e){if(this.focusonoutereditor)return;if(!this.contentInit)return;if(getattr(this,"clientresize")=="1")this.setResizeCursor(e);if(this.ResizingHD!=null){this.resizeHeaderbar(e);if(window.event){event.returnValue=false;return}else return false}var o=window.event?event.srcElement:e.target;if(this.isCell(o)!="SPAN")if(window.event){event.returnValue=false;return}else return false}
function mOnMouseDown(e){if(this.focusonoutereditor)return;if(!this.contentInit)return;var o;var button;var shiftKey,ctrlKey;var returnValue=true;if(ie){o=event.srcElement;button=event.button;if(iemv>=11)if(button==0)button=1;else button=0;shiftKey=event.shiftKey;ctrlKey=event.ctrlKey}else{o=e.target;if(e.button==0)button=1;else button=0;shiftKey=e.shiftKey;ctrlKey=e.ctrlKey;returnValue=false}if(o.tagName=="DIV")o=o.parentNode;if(o.tagName=="SPAN"&&(o.getAttribute("bb")!=null||!o.hasAttributes()))o=
o.parentNode;if(o.tagName=="SPAN"&&(o.className.indexOf("acwxc")>-1||o.className.indexOf("rotation")>-1))o=o.parentNode;if(o.id==this.id+"_LMENU_ROW"||o.id==this.id+"_LMENU_ITEM")return;if(this.ContextMenu!=null&&this.ContextMenu.isShown)this.ContextMenu.hide();if(this.ListMenu!=null&&this.ListMenu.isShown)this.ListMenu.hide();if(this.Calendar!=null&&this.Calendar.style.display!="none")this.Calendar.style.display="none";var ct=this.isCell(o);if(ct!="SPAN")if(this.ActiveCell!=null&&this.getSpan(this.ActiveCell)!=
null)this.endEdit(this.ActiveCell);if(button==1){if(selectrowheader&&!shiftclick)lastselrownumber=actualrownumber;if(selectcolheader&&!shiftclick)lastselcolnumber=actualcolnumber;selectrowheader=false;selectcolheader=false;if(ct!=null){if(!ctrlKey&&!shiftKey)this.clearSelections();this.Dragging=true;if(ct=="TD")if(ctrlKey||!shiftKey||this.ActiveCell==null||o==this.ActiveCell){this.DragCell=o;if(this.ActiveCell!=null&&o!=this.ActiveCell)this.endSelect()}else{this.DragCell=this.ActiveCell;this.DragEndCell=
o;this.doRangeSelect()}else if(ct=="SPAN")if(o.tagName=="SPAN"){this.DragCell=o.parentNode;if(o.insideedit)this.Dragging=false}else this.Dragging=false}else{if(this.ResizeIcon){this.enterResize(e);if(returnValue){event.returnValue=false;return}else return false}var ht=this.isHeader(o);if(ht=="ROW"){actualrownumber=o.parentNode.rowIndex+1;if(this.ltable0!=null&&o.parentNode.parentNode.parentNode==this.ltable1)actualrownumber+=this.ltable0.rows.length;selectrowheader=true;selectcolheader=false;if(!ctrlKey&&
!shiftKey)this.clearSelections();this.Dragging=true;this.DraggingMode=1;if(ctrlKey||!shiftKey||this.ActiveCell==null){var fstCell=this.findUpMostCell(actualrownumber-1,0);var lstCell=null;if(this.viewTable00==null)lstCell=this.findcurrentCell(actualrownumber-1,this.topTable.rows[0].cells.length-1);else lstCell=this.findcurrentCell(actualrownumber-1,this.topTable0.rows[0].cells.length+this.topTable.rows[0].cells.length-1);if(fstCell!=null&&lstCell!=null){if(this.ActiveCell!=null&&fstCell!=this.ActiveCell)this.endSelect();
this.DragCell=fstCell;this.DragEndCell=lstCell;this.doRangeSelect()}else this.Dragging=false}else if(this.viewTable00==null){this.DragCell=this.getFirstCell(this.ActiveCell.parentNode.cells);var vtable=this.getViewTableByRowHeader(o);var cells=vtable.rows[o.parentNode.rowIndex].cells;var lstCell=this.getLastCell(cells);if(lstCell!=null){this.DragEndCell=lstCell;this.doRangeSelect(true)}}else{var vtable=this.getViewTableByCell(this.ActiveCell);var lefttable=this.viewTable00;if(vtable==this.viewTable||
vtable==this.viewTable10)lefttable=this.viewTable10;if(lefttable.rows.length<1||lefttable.rows[0].cells.length==0)lefttable=vtable;vtable=this.getViewTableByRowHeader(o);this.DragCell=this.getFirstCell(lefttable.rows[this.ActiveCell.parentNode.rowIndex].cells);var cells=vtable.rows[o.parentNode.rowIndex].cells;this.DragEndCell=this.getLastCell(cells);this.doRangeSelect(true)}}else if(ht=="COL"){selectrowheader=false;selectcolheader=true;actualcolnumber=o.cellIndex+1;if(this.topTable0!=null&&o.parentNode.parentNode.parentNode==
this.topTable)actualcolnumber+=this.topTable0.rows[0].cells.length;if(!ctrlKey&&!shiftKey)this.clearSelections();this.Dragging=true;this.DraggingMode=2;if(ctrlKey||!shiftKey||this.ActiveCell==null){var fstCell=this.findLeftMostCell(0,actualcolnumber-1);var lstCell=null;if(this.viewTable00==null)lstCell=this.findcurrentCell(this.ltable1.rows.length-1,actualcolnumber-1);else lstCell=this.findcurrentCell(this.ltable0.rows.length+this.ltable1.rows.length-1,actualcolnumber-1);if(fstCell!=null&&lstCell!=
null){if(this.ActiveCell!=null&&fstCell!=this.ActiveCell)this.endSelect();this.DragCell=fstCell;this.DragEndCell=lstCell;this.doRangeSelect()}else this.Dragging=false}else if(this.viewTable00==null){var vtable=this.viewTable;this.DragCell=vtable.rows[1].cells[this.ActiveCell.cellIndex];this.DragEndCell=vtable.rows[vtable.rows.length-1].cells[o.cellIndex];if(this.DragCell!=null&&this.DragEndCell!=null)this.doRangeSelect(true);else this.Dragging=false}else{var toptable=this.getViewTableByCell(this.ActiveCell);
if(toptable==this.viewTable10)toptable=this.viewTable00;else if(toptable==this.viewTable)toptable=this.viewTable01;if(toptable==this.viewTable00){if(toptable.rows.length<2)toptable=this.viewTable10}else if(toptable.rows.length<2)toptable=this.viewTable;var fstCell=toptable.rows[1].cells[this.ActiveCell.cellIndex];var vtable=null;toptable=this.getViewTableByColHeader(o);if(toptable==this.viewTable00){if(toptable.rows.length<2)toptable=this.viewTable10;vtable=this.viewTable10}else{if(toptable.rows.length<
2)toptable=this.viewTable;vtable=this.viewTable}var lstCell=vtable.rows[vtable.rows.length-1].cells[o.cellIndex];if(fstCell!=null&&lstCell!=null){this.DragCell=fstCell;this.DragEndCell=lstCell;this.doRangeSelect(true)}}}else{selectrowheader=false;selectcolheader=false;if(ht=="FSTCELL"){this.clearSelections();this.Dragging=true;this.DraggingMode=3;if(this.viewTable00==null){var vtable=this.viewTable;if(vtable.rows.length>1){var cells=vtable.rows[0].cells;var fstCell=this.getFirstCell(cells);if(fstCell!=
null){cells=vtable.rows[vtable.rows.length-1].cells;var lstCell=this.getLastCell(cells);if(this.ActiveCell!=null&&fstCell!=this.ActiveCell)this.endSelect();this.DragCell=fstCell;this.DragEndCell=lstCell;this.doRangeSelect()}}}else{var vtable=null;if(this.viewTable00.rows.length>1&&this.viewTable00.rows[0].cells.length>0)vtable=this.viewTable00;else if(this.viewTable01.rows.length>1&&this.viewTable01.rows[0].cells.length>0)vtable=this.viewTable01;else if(this.viewTable10.rows.length>1&&this.viewTable10.rows[0].cells.length>
0)vtable=this.viewTable10;else vtable=this.viewTable;this.DragCell=vtable.rows[0].cells[0];var cells=this.viewTable.rows[this.viewTable.rows.length-1].cells;this.DragEndCell=cells[cells.length-1];this.doRangeSelect()}}}}}}function mOnMouseUp(){if(this.focusonoutereditor)return;if(!this.contentInit)return;this.endDrag()}
function mOnClick(e){if(this.focusonoutereditor)return;if(!this.contentInit)return;var evt=new Event(e);var o=evt.getTarget();var offset=evt.getOffset();if(o.tagName=="SPAN"&&(o.getAttribute("bb")!=null||!o.hasAttributes()))o=o.parentNode;if(o.tagName=="SPAN"&&(o.className.indexOf("acwxc")>-1||o.className.indexOf("rotation")>-1))o=o.parentNode;switch(o.id){case this.id+"_LSCROLL":this.tabPanel.scrollLeft-=160;return;case this.id+"_RSCROLL":this.tabPanel.scrollLeft+=160;return}if(o.id==this.id+"_loading"){this.loadingBox.style.display=
"none";this.blockcover.style.display="none";return}else if(o.id.indexOf(this.id+"_COL_GRPB")==0){var expand=getattr(o,"expand")=="1";o.setAttribute("expand",!expand?"1":"0");var col=o.parentNode.parentNode;var colid=getColId(col);if(expand){o.src=this.image_file_path+"collapse.gif";this.expandCol(colid)}else{o.src=this.image_file_path+"expand.gif";this.collapseCol(colid)}}else if(o.id.indexOf(this.id+"_ROW_GRPB")==0){var expand=getattr(o,"expand")=="1";o.setAttribute("expand",!expand?"1":"0");var row=
o.parentNode.parentNode;if(this.xhtmlmode)row=row.parentNode;var rowid=getRowId(row);if(expand){o.src=this.image_file_path+"collapse.gif";this.expandRow(rowid)}else{o.src=this.image_file_path+"expand.gif";this.collapseRow(rowid)}if(this.async){this.hcontent=null;this.lastvisiblerows=PERROWNUMBER*2+1;if(expand){asynctableheight_map.remove(this.acttab);this.asyncrows=null}if(this.reachmax){this.direction=1;this.postAsyncH(this.amaxrow-this.lastvisiblerows,this.amaxrow,false)}else{this.direction=0;this.postAsyncH(this.aminrow,
this.aminrow+this.lastvisiblerows,false)}return}if(this.noscroll)this.adjustNoScroll();else if(this.freeze){this.adjustXhtmlRows();this.adjustFreeze()}this.adjustAsyncScrollBar();this.mOnScroll();this.adjustImageButton();return}else if(o.id.indexOf(this.id+"_PGP")==0){var expand=getattr(o,"expand")=="1";o.setAttribute("expand",!expand?"1":"0");if(expand)o.src=this.image_file_path+"collapse.gif";else o.src=this.image_file_path+"expand.gif";var row=o.parentNode.parentNode;if(this.xhtmlmode)row=row.parentNode;
var rowrange=getattr(o,"range").split(":");for(var i=Number(rowrange[0]);i<=Number(rowrange[1]);i++){var xrow=this.ltable1.rows[i];var xrow2=this.viewTable.rows[i];if(!expand){setRowDisplay(xrow,"none");setRowDisplay(xrow2,"none")}else{setRowDisplay(xrow,"block");setRowDisplay(xrow2,"block")}}if(this.noscroll)this.adjustNoScroll();else if(this.freeze){this.adjustXhtmlRows();this.adjustFreeze()}this.adjustAsyncScrollBar();this.mOnScroll();this.adjustImageButton();return}else if(o.id.indexOf(this.id+
"_FTR")==0){if(document.readyState!="complete")return;if(this.ListMenu!=null){var col=o.getAttribute("ownercolumn");this.ListMenu.menuContext=o;this.ListMenu.ismultiple=true;this.ListMenu.clear();this.ListMenu.addItem(getlang().MenuItemFilterAll,"-1");this.ListMenu.addSeparator();var lmnode=this.lmDoc.selectSingleNode("listmenus");var mnode=lmnode.selectSingleNode('menu[@id="'+getattr(o.filterCell,"listmenu")+'"]');var mv=mnode.getAttribute("value");this.ListMenu.loadItems(mv);this.ListMenu.addOKCancel();
this.ListMenu.doAcwMenuCheckByValue(getattr(o.filterCell,"checked"));this.ListMenu.showNS(e);var left=this.ListMenu.offsetLeft-this.ListMenu.offsetWidth-offset.offsetX-1+15;if(left<0)left=0;var top=this.ListMenu.offsetTop+o.filterCell.offsetHeight-offset.offsetY-1;if(top<0)top=0;this.ListMenu.showXY(left,top,this)}return}else if(o.id.indexOf(this.id+"_PFT")==0){if(document.readyState!="complete")return;if(this.ListMenu!=null){this.ListMenu.menuContext=o;this.ListMenu.ismultiple=true;this.ListMenu.clear();
this.ListMenu.addItem(getlang().MenuItemFilterAll,"-1");this.ListMenu.addSeparator();var lmnode=this.lmDoc.selectSingleNode("listmenus");var mnode=lmnode.selectSingleNode('menu[@id="'+getattr(o.filterCell,"listmenu")+'"]');var mv=mnode.getAttribute("value");this.ListMenu.loadItems(mv);this.ListMenu.addOKCancel();this.ListMenu.doAcwMenuCheckByValue(getattr(o.filterCell,"checked"));this.ListMenu.showNS(e);var left=this.ListMenu.offsetLeft-this.ListMenu.offsetWidth-offset.offsetX-1+15;if(left<0)left=
0;var top=this.ListMenu.offsetTop+o.filterCell.offsetHeight-offset.offsetY-1;if(top<0)top=0;this.ListMenu.showXY(left,top,this)}return}var t=this.isCell(o);if(t=="TD")if(this.DragCell!=null&&this.ActiveCell!=null){try{this.focus()}catch(ex){}try{this.ActiveCell.focus()}catch(ex){}return}else{this.selectCell(o);this.recalculateCellColNumberOnCurrentCell(o);this.recalculateCellRowNumberOnCurrentCell(o);return}else if(t=="SPAN"){this.fastEdit=false;return}if(this.editmode){if(o.id==this.id+"_DB"){if(document.readyState!=
"complete")return;if(this.ListMenu!=null){this.ListMenu.showNS(e);var left=this.ListMenu.offsetLeft-this.ListMenu.offsetWidth-offset.offsetX-1;if(left<0)left=0;var top=this.ListMenu.offsetTop+this.ActiveCell.offsetHeight-offset.offsetY-1;if(top<0)top=0;this.ListMenu.showXY(left,top,this);try{this.focus()}catch(ex){}try{this.ActiveCell.focus()}catch(ex){}}return}if(o.id==this.id+"_DT"&&this.Calendar!=null){if(!this.calendarAppended){document.body.appendChild(this.Calendar);this.calendarAppended=true}this.Calendar.style.display=
"block";this.Calendar.style.left=this.sBody.scrollLeft+evt.e.clientX+"px";this.Calendar.style.top=this.sBody.scrollTop+evt.e.clientY+"px";var left=this.Calendar.offsetLeft-evt.getTarget().offsetWidth-offset.offsetX-1;if(left<0)left=0;var top=this.Calendar.offsetTop+evt.getTarget().offsetHeight-offset.offsetY-1;if(top<0)top=0;this.Calendar.style.left=left+"px";this.Calendar.style.top=top+"px";return}if(o.id==this.id+"_SUBMIT"){if(!inajaxupdating)this.postBack("SUBMIT",false);else afterajaxaction="SUBMIT";
return}if(o.id==this.id+"_SAVE"){if(!inajaxupdating)this.postBack("SAVE",false);else afterajaxaction="SAVE";return}if(o.id==this.id+"_UNDO"){this.postBack("UNDO",true);return}if(!this.xhtmlmode){if(o.tagName=="INPUT"&&o.type!=null&&o.type.toUpperCase()=="CHECKBOX"&&this.isCell(o.parentNode)){this.update(o.parentNode);if(o.parentNode!=this.ActiveCell)this.selectCell(o.parentNode)}}else if(o.tagName=="INPUT"&&o.type!=null&&o.type.toUpperCase()=="CHECKBOX"&&this.isCell(o.parentNode.parentNode)){this.update(o.parentNode.parentNode);
if(o.parentNode.parentNode!=this.ActiveCell)this.selectCell(o.parentNode.parentNode)}}if(o.id.indexOf(this.id+"_TAB")==0){var tabidx=o.id.substring(this.id.length+4,o.id.length);this.setActiveTab(tabidx);return}if(o.id==this.id+"_CC"){var lcontrol=o;var cell=lcontrol.parentNode;if(this.xhtmlmode)cell=cell.parentNode;var cmd=getattr(lcontrol,"cmdvalue");var result=false;if(cmd.indexOf("javascript:")==0)try{result=eval(cmd)}catch(ex){}if(!result){var edata="CELLCMD:"+cmd+":"+cell.id.substring(this.id.length+
1,cell.id.length);this.postBack(edata,lcontrol.discardinput=="1")}return}if(o.id.startWith(this.id+"_CCMD")){var lcontrol=o;var cmd=getattr(lcontrol,"cmdvalue");var edata="CCMD:"+cmd;this.postBack(edata,lcontrol.discardinput=="1");return}if(o.id==this.id+"_XB"){var prow=o.parentNode.parentNode;if(this.xhtmlmode)prow=prow.parentNode;this.postBack("EXP:"+prow.id.substring(this.id.length+3,prow.id.length))}}
function mOnMouseOver(e){if(this.focusonoutereditor)return;if(!this.contentInit)return;var o=window.event?event.srcElement:e.target;if(o.tagName=="SPAN"&&(o.className.indexOf("acwxc")>-1||o.className.indexOf("rotation")>-1))o=o.parentNode;if(!this.Dragging&&(o.title==null||o.title==""))if(o.tagName=="IMG")if(o.id==this.id+"_LSCROLL")o.title=getlang().TipScrollLeftButton;else if(o.id==this.id+"_RSCROLL")o.title=getlang().TipScrollRightButton;else if(o.id==this.id+"_SUBMIT")o.title=getlang().TipSubmitButton;
else if(o.id==this.id+"_SAVE")o.title=getlang().TipSaveButton;else if(o.id==this.id+"_UNDO")o.title=getlang().TipUndoButton;else if(o.id==this.id+"_XB")o.title=getlang().TipExpandChildButton;else if(getattr(o,"name")==this.id+"_ROW_GRPB")o.title=getlang().TipExpandGroupRowButton;else{if(getattr(o,"name")==this.id+"_COL_GRPB")o.title=getlang().TipExpandGroupColButton}else if(o.id!=null&&o.id.indexOf(this.id+"_TAB")==0)o.title=getlang().TipTab;else if(getattr(o,"cmdvalue")!=null&&getattr(o,"cmdvalue").indexOf("_BCSORT#")==
0)o.title=getlang().TipSortHeader;else{var t=this.isCell(o);if(t!=null)this.setCellTitle(o,t)}if(this.DragCell!=null&&this.Dragging){var t=this.isCell(o);if(t!=null)switch(this.DraggingMode){case 0:if(t=="TD")this.DragEndCell=o;else if(t=="SPAN")if(o.tagName=="SPAN")this.DragEndCell=o.parentNode;else this.DragEndCell=o.parentNode.parentNode;if(this.DragEndCell!=this.DragCell)this.doRangeSelect();else this.DragEndCell=null;return;case 3:return;case 1:o=document.getElementById(this.id+"_@"+this.getCellRow(o));
break;case 2:o=document.getElementById(this.id+"_!"+this.getCellColumn(o));break}t=this.isHeader(o);if(t=="ROW")if(this.viewTable00==null){var vtable=this.viewTable;var cells=vtable.rows[o.parentNode.rowIndex].cells;var lstCell=null;if(this.DraggingMode==1)lstCell=this.getLastCell(cells);else lstCell=this.getFirstCell(cells);if(lstCell!=null&&lstCell!=this.DragCell){this.DragEndCell=lstCell;this.doRangeSelect()}}else{var vtable=this.getViewTableByRowHeader(o);var lefttable=this.viewTable00;if(vtable==
this.viewTable)lefttable=this.viewTable10;if(lefttable.rows.length<1||lefttable.rows[0].cells.length==0)lefttable=vtable;if(this.DraggingMode==1)this.DragEndCell=this.getLastCell(vtable.rows[o.parentNode.rowIndex].cells);else this.DragEndCell=this.getFirstCell(lefttable.rows[o.parentNode.rowIndex].cells);this.doRangeSelect()}else if(t=="COL")if(this.viewTable00==null){var vtable=this.viewTable;var lstCell=null;if(this.DraggingMode==2)lstCell=vtable.rows[vtable.rows.length-1].cells[o.cellIndex];else lstCell=
vtable.rows[1].cells[o.cellIndex];if(lstCell!=null&&lstCell!=this.DragCell){this.DragEndCell=lstCell;this.doRangeSelect()}}else{var vtable=null;var toptable=this.getViewTableByColHeader(o);if(toptable==this.viewTable00){if(toptable.rows.length<2)toptable=this.viewTable10;vtable=this.viewTable10}else{if(toptable.rows.length<2)toptable=this.viewTable;vtable=this.viewTable}if(this.DraggingMode==2)this.DragEndCell=vtable.rows[vtable.rows.length-1].cells[o.cellIndex];else this.DragEndCell=toptable.rows[1].cells[o.cellIndex];
this.doRangeSelect()}}}
function mOnMouseOut(e){if(this.focusonoutereditor)return;if(!this.contentInit)return;var evt=new Event(e);var toEle=evt.getToElement();if(this.Dragging)if(toEle==null)this.endDrag();else{if(toEle!=this&&!this.contains(toEle)){var gridweb=this;var clientX=evt.e.clientX;var clientY=evt.e.clientY;this.autoDraggingId=window.setInterval(function(){gridweb.autoDragging(clientX,clientY)},50);this.mouseOut(e)}}else if(this.ResizingHD!=null)if(toEle==null||toEle!=this&&!this.contains(toEle))this.endDrag()}
function mouseOut(e){var evt=new Event(e);var theEle=evt.getTarget();var toEle=evt.getToElement();if(theEle!=this&&!this.contains(theEle)){if(theEle.getAttributeNode("outEleOnMouseUpBk")){theEle.onmouseup=theEle.outEleOnMouseUpBk;theEle.removeAttribute("outEleOnMouseUpBk")}if(theEle.getAttributeNode("outEleOnMouseOutBk")){if(theEle.outEleOnMouseOutBk!=null)if(typeof theEle.outEleOnMouseOutBk=="function")theEle.outEleOnMouseOutBk();else if(typeof theEle.outEleOnMouseOutBk=="string")eval(theEle.outEleOnMouseOutBk);
theEle.onmouseout=theEle.outEleOnMouseOutBk;theEle.removeAttribute("outEleOnMouseOutBk")}}if(toEle!=null&&toEle!=this&&!this.contains(toEle)){var gridweb=this;if(!toEle.getAttributeNode("outEleOnMouseUpBk")){toEle.outEleOnMouseUpBk=toEle.onmouseup;toEle.onmouseup=function(e){gridweb.mouseUp(e)}}if(!toEle.getAttributeNode("outEleOnMouseOutBk")){toEle.outEleOnMouseOutBk=toEle.onmouseout;toEle.onmouseout=function(e){gridweb.mouseOut(e)}}}else{if(this.autoDraggingId!=null){clearInterval(this.autoDraggingId);
this.autoDraggingId=null}if(toEle==null)this.endDrag()}}
function mouseUp(e){if(this.autoDraggingId!=null){clearInterval(this.autoDraggingId);this.autoDraggingId=null}var evt=new Event(e);var theEle=evt.getTarget();if(theEle.getAttributeNode("outEleOnMouseUpBk")){if(theEle.outEleOnMouseUpBk!=null)if(typeof theEle.outEleOnMouseUpBk=="function")theEle.outEleOnMouseUpBk();else if(typeof theEle.outEleOnMouseUpBk=="string")eval(theEle.outEleOnMouseUpBk);theEle.onmouseup=theEle.outEleOnMouseUpBk;theEle.removeAttribute("outEleOnMouseUpBk")}if(theEle.getAttributeNode("outEleOnMouseOutBk")){theEle.onmouseout=theEle.outEleOnMouseOutBk;
theEle.removeAttribute("outEleOnMouseOutBk")}this.endDrag()}
function autoDragging(clientX,clientY){var x,y;var xy=getObjectClientXY(this);x=xy.left;y=xy.top;var o=this.viewPanel;if(clientX<=x){o.scrollLeft-=50;if(clientX<=x-50)o.scrollLeft-=50}if(clientX>=x+this.offsetWidth){o.scrollLeft+=50;if(clientX>=x+this.offsetWidth+50)o.scrollLeft+=50}if(clientY<=y){o.scrollTop-=50;if(clientY<=y-50)o.scrollTop-=50}if(clientY>=y+this.getClientPageHeight()){o.scrollTop+=50;if(clientY>=y+this.getClientPageHeight()+50)o.scrollTop+=50}}
function getObjectClientXY(o){var x=0,y=0;while(o.offsetParent!=null){x+=o.offsetLeft-o.offsetParent.scrollLeft;y+=o.offsetTop-o.offsetParent.scrollTop;o=o.offsetParent}return{left:x,top:y}}function resizeColumnToFit(colIndex,includeHeader){var col=Number(colIndex);var resizeIcon=this.ResizeIcon;this.ResizeIcon=true;var rhd1=document.getElementById(this.id+"_!"+col.toString());if(rhd1!=null)this.mOnDblClick(null,rhd1,includeHeader);this.ResizeIcon=resizeIcon}
function mOnDblClick(e,rhd,includeHeader){if(!this.contentInit)return;if(getattr(this,"clientresize")=="1"&&this.ResizeIcon){if(rhd==null){rhd=window.event?event.srcElement:e.target;includeHeader=true}if(rhd.tagName=="SPAN"&&(rhd.className.indexOf("acwxc")>-1||rhd.className.indexOf("rotation")>-1))rhd=rhd.parentNode;if(this.isHeader(rhd)=="COL"){var table0;var table1;if(rhd.parentNode.parentNode.parentNode.parentNode==this.topPanel){table0=this.viewTable01;table1=this.viewTable}else{table0=this.viewTable00;
table1=this.viewTable10}var colNum=rhd.id.substring(rhd.id.indexOf("!")+1,rhd.id.length);var vtable=table1;if(vtable!=null){var maxWidth=0;var tk=0;var vspan=document.createElement("nobr");vspan.style.position="absolute";vspan.style.left=-1E3+"px";vspan.style.top=-1E3+"px";this.appendChild(vspan);if(includeHeader){vspan.className=rhd.className;setInnerText(vspan,rhd.innerText);maxWidth=vspan.offsetWidth}while(vtable!=null&&tk<=1){var ri,ci;for(ri=0;ri<vtable.rows.length;ri++){var vrow=vtable.rows[ri];
for(ci=0;ci<vrow.cells.length;ci++){var vcell=vrow.cells[ci];if(vcell.colSpan==1&&this.isCell(vcell)){var vcellcol=vcell.id.substring(this.id.length+1,vcell.id.indexOf("#"));if(vcellcol==colNum){vspan.className=vcell.className;vspan.style.fontFamily=vcell.style.fontFamily;vspan.style.fontSize=vcell.style.fontSize;vspan.style.fontWeight=vcell.style.fontWeight;setInnerText(vspan,vcell.innerText);if(vspan.offsetWidth>maxWidth)maxWidth=vspan.offsetWidth;break}}}}vtable=table0;tk++}this.removeChild(vspan);
maxWidth++;if(ie&&iemv<8){var colH=document.getElementById(rhd.id+"C");if(colH!=null)colH.style.width=colH.style.pixelWidth+maxWidth-colH.offsetWidth+"px";var colD=document.getElementById(rhd.id+"CD");if(colD!=null)colD.style.width=colD.style.pixelWidth+maxWidth-colD.offsetWidth+"px";colD=document.getElementById(rhd.id+"CD00");if(colD!=null)colD.style.width=colD.style.pixelWidth+maxWidth-colD.offsetWidth+"px";colD=document.getElementById(rhd.id+"CD01");if(colD!=null)colD.style.width=colD.style.pixelWidth+
maxWidth-colD.offsetWidth+"px";colD=document.getElementById(rhd.id+"CD10");if(colD!=null)colD.style.width=colD.style.pixelWidth+maxWidth-colD.offsetWidth+"px"}else{var colH=document.getElementById(rhd.id+"C");if(colH!=null)colH.style.width=maxWidth+"px";var colD=document.getElementById(rhd.id+"CD");if(colD!=null)colD.style.width=maxWidth+"px";colD=document.getElementById(rhd.id+"CD00");if(colD!=null)colD.style.width=maxWidth+"px";colD=document.getElementById(rhd.id+"CD01");if(colD!=null)colD.style.width=
maxWidth+"px";colD=document.getElementById(rhd.id+"CD10");if(colD!=null)colD.style.width=maxWidth+"px"}if(this.freeze)this.adjustSizes();this.mOnScroll();this.ResizingHD=rhd;this.resizeType="COL";this.endResize()}this.adjustImageButton()}if(window.event){event.returnValue=false;return}else return false}else{var o=window.event?event.srcElement:e.target;if(o.tagName=="SPAN"&&(o.className.indexOf("acwxc")>-1||o.className.indexOf("rotation")>-1))o=o.parentNode;var ct=this.isCell(o);if(ct=="TD")this.mOnDoubleClickCell(o);
else if(ct=="SPAN"&&o.tagName=="SPAN")this.mOnDoubleClickCell(o.parentNode);else if(this.isHeader(o)=="ROW")this.mOnDoubleClickRow(o.id.substring(this.id.length+2,o.id.length));if(getattr(this,"dblclick")=="1"){var ht=this.isHeader(o);if(ht=="ROW")this.postBack("DBLCLICK:R"+o.id.substring(this.id.length+2,o.id.length),false);else if(ht=="COL")this.postBack("DBLCLICK:C"+o.id.substring(this.id.length+2,o.id.length),false);else if(ct=="TD")this.postBack("DBLCLICK:D"+o.id.substring(this.id.length+1,o.id.length),
false);else if(ct=="SPAN"&&o.tagName=="SPAN")this.postBack("DBLCLICK:D"+o.parentNode.id.substring(this.id.length+1,o.parentNode.id.length),false)}}}
function findNextTabCell(o){var newrow=o.parentNode;var newcell=this.getNextValidCell(o);var isc;while(newrow!=null){while(newcell!=null){isc=this.isCell(newcell);if(isc){this.activateNextOrPreviCellFlg=true;this.selectCell(newcell);this.activateNextOrPreviCellFlg=false;break}newcell=newcell.nextSibling}if(isc)break;newrow=this.getUndersideValidRow(o);if(newrow!=null&&newrow.cells.length>0)newcell=newrow.cells[0];else newcell=null}return{newrow:newrow,newcell:newcell}}
function findNextTabCellReverse(o){var newrow=o.parentNode;var newcell=this.getPreviousValidCell(o);var isc;while(newrow!=null){while(newcell!=null){isc=this.isCell(newcell);if(isc){this.shiftAndTabKeyPressedFlg=true;this.selectCell(newcell);this.shiftAndTabKeyPressedFlg=false;break}newcell=newcell.previousSibling}if(isc)break;newrow=this.getUpsideValidRow(o);if(newrow!=null&&newrow.cells.length>0)newcell=newrow.cells[newrow.cells.length-1];else newcell=null}return{newrow:newrow,newcell:newcell}}
function InsertCharInSpan(dcell,decimalpoint){var caretPos=getCaretCharOffsetInDiv(dcell);var text=getInnerText(dcell);setInnerText(dcell,text.substring(0,caretPos)+decimalpoint+text.substring(caretPos));setSelectionRange(dcell,caretPos+1,caretPos+1)}
function mOnKeyDown(e,cell){if(!this.validateContent())return false;if(!this.contentInit)return;if(this.ContextMenu!=null&&this.ContextMenu.isShown)this.ContextMenu.hide();if(this.ListMenu!=null&&this.ListMenu.isShown)this.ListMenu.hide();var evt=new Event(e);var ctrlKey=window.event?event.ctrlKey:e.ctrlKey;var shiftKey=window.event?event.shiftKey:e.shiftKey;var keyCode=window.event?event.keyCode:e.keyCode;var altKey=window.event?event.altKey:e.altKey;var o;if(cell==null){o=evt.getTarget();if(o.tagName==
"SPAN"&&(o.className.indexOf("acwxc")>-1||o.className.indexOf("rotation")>-1))o=o.parentNode;else if(o==this&&this.ActiveCell!=null)o=this.ActiveCell}else o=cell;var returnValue=true;if(ctrlKey){var clikeCell;if(o==this.ActiveCell)clikeCell=o;else if(o.id==this.id+"_AC")clikeCell=o.parentNode;else if(o.id==this.id+"_AS")clikeCell=o.parentNode.parentNode;if(keyCode==70){if(clikeCell!=null&&this.getSpan(clikeCell)!=null)this.endEdit(clikeCell);showFindReplaceDlg(this,clikeCell,0);if(window.event){event.keyCode=
0;event.returnValue=false;return}else return false}else if(keyCode==192)this.switchFormulaDisplay();else if(keyCode==72||keyCode==82)if(this.editmode){if(clikeCell!=null&&this.getSpan(clikeCell)!=null)this.endEdit(clikeCell);showFindReplaceDlg(this,clikeCell,1);if(window.event){event.keyCode=0;event.returnValue=false;return}else return false}else if(window.event){event.cancelBubble=true;event.returnValue=false;return}else{e.stopPropagation();return false}else if(keyCode==67){if(this.fastEdit){if(this.getSpan(o)!=
null)this.endEdit(o);this.copy(o);if(!ie)return;else returnValue=false}}else if(keyCode==86){if(this.fastEdit){if(this.getSpan(o)!=null)this.EscCancelEdit(o);this.paste(o);if(!ie)return;else returnValue=false}}else if(keyCode==88)if(this.fastEdit){if(this.getSpan(o)!=null)this.endEdit(o);this.cut(o);if(!ie)return;else returnValue=false}}if(o==this.ActiveCell&&this.fastEdit){var newcell,newrow,dec;dec=this.DragEndCell;if(dec==null)dec=o;switch(keyCode){case 27:this.clearSelections();if(this.getSpan(o)!=
null){this.EscCancelEdit(o);var oo=this.ActiveCell;try{this.focus()}catch(ex){}try{oo.focus()}catch(ex){}}returnValue=false;break;case 37:this.clearSelections();if(!shiftKey)this.pressKeyGoLeftOnCell(o);else{newcell=this.getPreviousValidCell(dec);if(this.isCell(newcell))dec=newcell;this.doSelectShiftCellRange(o,dec)}returnValue=false;break;case 39:this.clearSelections();if(!shiftKey)this.pressKeyGoRightOnCell(o);else{newcell=this.getNextValidCell(dec);if(this.isCell(newcell))dec=newcell;this.doSelectShiftCellRange(o,
dec)}returnValue=false;break;case 38:this.clearSelections();if(!shiftKey)this.pressKeyGoUpOnCell(o);else{newrow=this.getUpsideValidRow(dec);if(newrow!=null){newcell=newrow.cells[dec.cellIndex];if(this.isCell(newcell))dec=newcell}this.doSelectShiftCellRange(o,dec)}returnValue=false;break;case 40:this.clearSelections();if(!shiftKey)this.pressKeyGoDownOnCell(o);else{newrow=this.getUndersideValidRow(dec);if(newrow!=null){newcell=newrow.cells[dec.cellIndex];if(this.isCell(newcell))dec=newcell}this.doSelectShiftCellRange(o,
dec)}returnValue=false;break;case 9:this.clearSelections();if(!shiftKey){var __ret=findNextTabCell.call(this,o);newrow=__ret.newrow;newcell=__ret.newcell}else{var __ret=findNextTabCellReverse.call(this,o);newrow=__ret.newrow;newcell=__ret.newcell}returnValue=false;break;case 13:this.clearSelections();if(!shiftKey)this.pressKeyGoDownOnCell(o);else this.pressKeyGoUpOnCell(o);returnValue=false;break;case 8:case 46:var span=this.getSpan(o);if(span!=null&&span.insideedit)return;else{if(span!=null)this.EscCancelEdit(o);
this.deleteCells();returnValue=false}break}if(keyCode==110){var span=this.getSpan(o);if(span!=null){var decimalpoint=getattr(this,"decimalpoint");if(decimalpoint!=null){InsertCharInSpan(span,decimalpoint);returnValue=false;e.preventDefault()}}}}else if(o.id==this.id+"_AC"||!this.fastEdit){var newcell,newrow;switch(keyCode){case 38:this.GetUpListItem(e);break;case 40:this.GetDownListItem(e);break;case 13:if(this.dropDownListFlg){var dcell=this.getSpan(this.ActiveCell);if(dcell!=null)setInnerText(dcell,
this.selectedOptionVal);this.ListMenu.hide();newrow=this.getUndersideValidRow(this.ActiveCell);if(newrow!=null){newcell=newrow.cells[this.ActiveCell.cellIndex];if(newcell!=null&&this.isCell(newcell)){if(this.editmode&&getattr(o,"protected")!="1"&&(getattr(newcell,"vtype")=="list"||getattr(newcell,"vtype")=="flist")&&this.ListMenu!=null)this.ListMenu.clear();this.setCellActive(newcell)}}this.dropDownListFlg=false}else if(ie)ieTextEditEnterWay();else return;returnValue=false;break;case 27:this.EscCancelEdit(o);
var oo=this.ActiveCell;try{this.focus()}catch(ex){}try{oo.focus()}catch(ex){}returnValue=false;break;case 9:this.clearSelections();if(!shiftKey){var __ret=findNextTabCell.call(this,o);newrow=__ret.newrow;newcell=__ret.newcell}else{var __ret=findNextTabCellReverse.call(this,o);newrow=__ret.newrow;newcell=__ret.newcell}returnValue=false;break}if(keyCode==110){var dcell=this.getSpan(this.ActiveCell);if(dcell!=null){var decimalpoint=getattr(this,"decimalpoint");if(decimalpoint!=null){InsertCharInSpan(dcell,
decimalpoint);returnValue=false;e.preventDefault()}}}if(!returnValue)if(window.event){event.returnValue=false;return}else{this.preventKeyPress=true;return false}return}if(this.ActiveCell!=null&&getattr(this.ActiveCell,"vtype")!=null&&getattr(this.ActiveCell,"vtype").toUpperCase()=="CHECKBOX"){var needMoveFocus=o.type!=null&&o.type.toUpperCase()=="CHECKBOX";switch(keyCode){case 32:this.ActiveCell.lastChild.checked=!this.ActiveCell.lastChild.checked;returnValue=false;break;case 38:if(needMoveFocus){var newrow=
this.getUpsideValidRow(this.ActiveCell);if(newrow!=null){var newcell=newrow.cells[this.ActiveCell.cellIndex];if(this.isCell(newcell)){this.activateNextOrPreviCellFlg=true;this.selectCell(newcell);this.activateNextOrPreviCellFlg=false}}}break;case 13:case 40:if(needMoveFocus){var newrow=this.getUndersideValidRow(this.ActiveCell);if(newrow!=null){var newcell=newrow.cells[this.ActiveCell.cellIndex];if(newcell!=null&&this.isCell(newcell)){this.activateNextOrPreviCellFlg=true;this.selectCell(newcell);
this.activateNextOrPreviCellFlg=false}}}break;case 37:if(needMoveFocus){var newcell=this.getPreviousValidCell(this.ActiveCell);if(this.isCell(newcell)){this.activateNextOrPreviCellFlg=true;this.selectCell(newcell);this.activateNextOrPreviCellFlg=false}}break;case 39:if(needMoveFocus){var newcell=this.getNextValidCell(this.ActiveCell);if(this.isCell(newcell)){this.activateNextOrPreviCellFlg=true;this.selectCell(newcell);this.activateNextOrPreviCellFlg=false}}break;case 9:if(needMoveFocus)if(shiftKey){var newrow=
this.ActiveCell.parentNode;var newcell=this.ActiveCell.previousSibling;var isc;while(newrow!=null){while(newcell!=null){isc=this.isCell(newcell);if(isc){this.selectCell(newcell);break}newcell=newcell.previousSibling}if(isc)break;newrow=newrow.previousSibling;if(newrow!=null&&newrow.cells.length>0)newcell=newrow.cells[newrow.cells.length-1];else newcell=null}}else{var newrow=this.ActiveCell.parentNode;var newcell=this.ActiveCell.nextSibling;var isc;while(newrow!=null){while(newcell!=null){isc=this.isCell(newcell);
if(isc){this.selectCell(newcell);break}newcell=newcell.nextSibling}if(isc)break;newrow=newrow.nextSibling;if(newrow!=null&&newrow.cells.length>0)newcell=newrow.cells[0];else newcell=null}}returnValue=false;break;case 27:if(this.getSpan(this.ActiveCell)!=null)this.EscCancelEdit(this.ActiveCell);this.endSelect();this.clearSelections();returnValue=false;break}}if(!returnValue)if(window.event)if(ie&&iemv>=11)event.preventDefault();else event.returnValue=false;else{this.preventKeyPress=true;return false}else{this.preventKeyPress=
false;if(keyCode==46)this.deleteCells()}}function mOnKeyPress(e){if(this.preventKeyPress){this.preventKeyPress=false;return false}var ctrlKey=window.event?event.ctrlKey:e.ctrlKey;if(ctrlKey)return false;if(!this.validateContent())return false;if(!this.contentInit)return;var o=this.ActiveCell;if(o!=null&&this.editmode&&getattr(o,"protected")!="1"&&!this.focusonoutereditor)this.enterEdit(o,true,window.event?event.keyCode:e.charCode)}
function accMul(arg1,arg2){var m=0,s1=arg1.toString(),s2=arg2.toString();try{m+=s1.split(".")[1].length}catch(e){}try{m+=s2.split(".")[1].length}catch(e){}return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m)}Number.prototype.mul=function(arg){return accMul(arg,this)};
function mOnKeyUp(e){if(!this.validateContent())return false;var o=this.ActiveCell;if(o!=null&&this.editorbox!=null)$(this.editorbox).val(getInnerText(o));var keyCode=window.event?event.keyCode:e.keyCode;if(keyCode==37||keyCode==38||keyCode==39||keyCode==40||keyCode==13||keyCode==9||keyCode==16||keyCode==8||keyCode==46)return false;if(!this.contentInit)return;if(o!=null&&this.editmode&&getattr(o,"protected")!="1"&&(getattr(o,"vtype")=="list"||getattr(o,"vtype")=="flist")&&this.ListMenu!=null){this.ListMenu.clear();
var lmnode=this.lmDoc.selectSingleNode("listmenus");var mnode=lmnode.selectSingleNode('menu[@id="'+getattr(o,"listmenu")+'"]');var mv=mnode.getAttribute("value");this.ListMenu.filterItemsByValue(getInnerText(o),mv);this.showDropDownList(e);this.dropDownListFlg=true;this.selectedOptionVal=getInnerText(o)}else this.dropDownListFlg=false}
function getCaretCharOffsetInDiv(element){var caretOffset=0;if(typeof window.getSelection!="undefined"){var range=window.getSelection().getRangeAt(0);var preCaretRange=range.cloneRange();preCaretRange.selectNodeContents(element);preCaretRange.setEnd(range.endContainer,range.endOffset);caretOffset=preCaretRange.toString().length}else if(typeof document.selection!="undefined"&&document.selection.type!="Control"){var textRange=document.selection.createRange();var preCaretTextRange=document.body.createTextRange();
preCaretTextRange.moveToElementText(element);preCaretTextRange.setEndPoint("EndToEnd",textRange);caretOffset=preCaretTextRange.text.length}return caretOffset}
function placeCaretAtEnd(el){el.focus();if(typeof window.getSelection!="undefined"&&typeof document.createRange!="undefined"){var range=document.createRange();range.selectNodeContents(el);range.collapse(false);var sel=window.getSelection();sel.removeAllRanges();sel.addRange(range)}else if(typeof document.body.createTextRange!="undefined"){var textRange=document.body.createTextRange();textRange.moveToElementText(el);textRange.collapse(false);textRange.moveEnd("character",1);textRange.select()}}
function getTextNodesIn(node){var textNodes=[];if(node.nodeType==3)textNodes.push(node);else{var children=node.childNodes;for(var i=0,len=children.length;i<len;++i)textNodes.push.apply(textNodes,getTextNodesIn(children[i]))}return textNodes}
function setSelectionRange(el,start,end){if(document.createRange&&window.getSelection){var range=document.createRange();range.selectNodeContents(el);var textNodes=getTextNodesIn(el);var foundStart=false;var charCount=0,endCharCount;for(var i=0,textNode;textNode=textNodes[i++];){endCharCount=charCount+textNode.length;if(!foundStart&&start>=charCount&&(start<endCharCount||start==endCharCount&&i<textNodes.length)){range.setStart(textNode,start-charCount);foundStart=true}if(foundStart&&end<=endCharCount){range.setEnd(textNode,
end-charCount);break}if(!foundStart&&start==endCharCount){range.setStart(textNode,start);range.setEnd(textNode,end);break}charCount=endCharCount}var sel=window.getSelection();sel.removeAllRanges();sel.addRange(range)}else if(document.selection&&document.body.createTextRange){var textRange=document.body.createTextRange();textRange.moveToElementText(el);textRange.collapse(true);textRange.moveEnd("character",end);textRange.moveStart("character",start);textRange.select()}}
function mOnResize(){if(getattr(this,"embeded")!="1"){var eh=parseLength(this.style.height,"y");if(this.xhtmlmode){this.adjustXhtmlTopRow();if(!this.noscroll)this.adjustXhtmlRows()}if(this.noscroll)this.adjustNoScroll();else if(this.freeze)this.adjustFreeze();this.adjustAsyncScrollBar();this.mOnScroll()}}
function mOnScroll(){if(this.topPanel!=null)this.topPanel.scrollLeft=this.viewPanel.scrollLeft;if(this.leftPanel!=null)this.leftPanel.scrollTop=this.viewPanel.scrollTop;if(this.viewPanel01!=null)this.viewPanel01.scrollLeft=this.viewPanel.scrollLeft;if(this.viewPanel10!=null)this.viewPanel10.scrollTop=this.viewPanel.scrollTop}function mOnScroll1(){if(this.topPanel!=null)this.topPanel.scrollLeft=this.viewPanel01.scrollLeft;this.viewPanel.scrollLeft=this.viewPanel01.scrollLeft}
function mOnScroll2(){if(this.leftPanel!=null)this.leftPanel.scrollTop=this.viewPanel10.scrollTop;this.viewPanel.scrollTop=this.viewPanel10.scrollTop}
function mOnVScroll(){if(this.vsBar!=null){if(!this.async){this.viewPanel.scrollTop=this.vsBar.scrollTop;return}var hpanel=this.viewPanel.offsetHeight;var htable=0;if(this.async)htable=asynctableheight_map.get(this.acttab);else htable=this.viewTable.offsetHeight;var asyncTop=(this.aminrow-this.minrow)*HCELL;if(this.asynctoprows!=null)asyncTop=this.asynctoprows*HCELL;var vpMaxScrollTop=htable>hpanel?htable-hpanel:hpanel;var asyncBottom=asyncTop+vpMaxScrollTop+1;var scrollTop=this.vsBar.scrollTop;var ifreachmax=
false;if(scrollTop<asyncTop){var aminrow=Number(this.aminrow);var amaxrow=Number(this.amaxrow);if(this.ltable0!=null)if(aminrow<=this.freezerow-1)aminrow=this.freezerow;this.direction=0;var reqRows=Math.ceil((asyncTop-scrollTop)/HCELL);if(reqRows>=PERROWNUMBER*2){aminrow=Math.max(aminrow-reqRows,0);amaxrow=aminrow+PERROWNUMBER*2-1;if(ifreachmax||amaxrow>this.maxrow){amaxrow=this.maxrow;aminrow=amaxrow+1-PERROWNUMBER*2}}else if(reqRows<=PERROWNUMBER){aminrow=Math.max(aminrow-PERROWNUMBER,0);amaxrow=
aminrow+PERROWNUMBER*2-1;if(ifreachmax||amaxrow>this.maxrow){amaxrow=this.maxrow;aminrow=amaxrow+1-PERROWNUMBER*2}}else{aminrow=Math.max(aminrow-PERROWNUMBER*2,0);amaxrow=aminrow+PERROWNUMBER*2-1;if(ifreachmax||amaxrow>this.maxrow){amaxrow=this.maxrow;aminrow=amaxrow+1-PERROWNUMBER*2}}if(ie){if(this.vsTimeout!=null){clearTimeout(this.vsTimeout);this.vsTimeout=null}var gridweb=this;this.vsTimeout=setTimeout(function(){gridweb.postAsyncH(aminrow,amaxrow,false)},10)}else this.postAsyncH(aminrow,amaxrow,
false)}else if(scrollTop>asyncBottom){var aminrow=Number(this.aminrow);if(this.ltable0!=null)if(aminrow<=this.freezerow-1)aminrow=this.freezerow;this.direction=1;var amaxrow=Number(this.amaxrow);var reqRows=Math.ceil((scrollTop-asyncBottom)/HCELL);if(reqRows>=PERROWNUMBER*2){amaxrow+=reqRows;aminrow=amaxrow-(PERROWNUMBER*2-1);if(ifreachmax||amaxrow>this.maxrow){amaxrow=this.maxrow;aminrow=amaxrow+1-PERROWNUMBER*2}}else if(reqRows<=PERROWNUMBER){amaxrow+=PERROWNUMBER;aminrow=Math.max(amaxrow-(PERROWNUMBER*
2-1),0);if(ifreachmax||amaxrow>this.maxrow){amaxrow=this.maxrow;aminrow=amaxrow+1-PERROWNUMBER*2}}else{amaxrow+=PERROWNUMBER*2;aminrow=Math.max(amaxrow-(PERROWNUMBER*2-1),0);if(ifreachmax||amaxrow>this.maxrow){amaxrow=this.maxrow;aminrow=amaxrow+1-PERROWNUMBER*2}}if(ie){if(this.vsTimeout!=null){clearTimeout(this.vsTimeout);this.vsTimeout=null}var gridweb=this;this.vsTimeout=setTimeout(function(){gridweb.postAsyncH(aminrow,amaxrow,false)},10)}else this.postAsyncH(aminrow,amaxrow,false)}else{if(this.vsTimeout!=
null){clearTimeout(this.vsTimeout);this.vsTimeout=null}this.viewPanel.scrollTop=this.vsBar.scrollTop-asyncTop;if(this.reachmax){if(this.viewpanlscrolltop==null)this.viewpanlscrolltop=0;if(this.viewPanel.scrollTop>this.viewpanlscrolltop)this.viewpanlscrolltop=this.viewPanel.scrollTop;else this.viewPanel.scrollTop=this.viewpanlscrolltop}}}}
function mOnHScroll(){if(this.hsBar!=null&&this.viewPanel.scrollLeft!=this.hsBar.scrollLeft)if(!this.async){this.viewPanel.scrollLeft=this.hsBar.scrollLeft;return}else{var wpanel=this.viewPanel.offsetWidth;var wtable=this.viewTable.offsetWidth;var asyncLeft=(this.amincol-this.mincol)*WCELL;var vpMaxScrollLeft=wtable>wpanel?wtable-wpanel:wpanel;var asyncBottom=asyncLeft+vpMaxScrollLeft+1;var scrollLeft=this.hsBar.scrollLeft;if(scrollLeft<asyncLeft){var amincol=Number(this.amincol);var amaxcol=Number(this.amaxcol);
var reqcols=Math.ceil((asyncLeft-scrollLeft)/WCELL);if(reqcols>=PERCOLUMNNUMBER*2){amincol=Math.max(amincol-reqcols,0);amaxcol=amincol+PERCOLUMNNUMBER-1}else if(reqcols<=PERCOLUMNNUMBER){amincol=Math.max(amincol-PERCOLUMNNUMBER,0);amaxcol=amincol+PERCOLUMNNUMBER*2-1}else{amincol=Math.max(amincol-PERCOLUMNNUMBER*2,0);amaxcol=amincol+PERCOLUMNNUMBER*2-1}if(ie){if(this.vsTimeout!=null){clearTimeout(this.vsTimeout);this.vsTimeout=null}var gridweb=this;this.vsTimeout=setTimeout(function(){gridweb.postAsyncW(amincol,
amaxcol,false)},10)}else this.postAsyncW(amincol,amaxcol,false)}else if(scrollLeft>asyncBottom){var amincol=Number(this.amincol);var amaxcol=Number(this.amaxcol);var reqcols=Math.ceil((scrollLeft-asyncBottom)/WCELL);if(reqcols>=PERCOLUMNNUMBER*2){amaxcol+=reqcols;if(amaxcol>this.maxcol)amaxcol=this.maxcol;amincol=amaxcol-(PERCOLUMNNUMBER-1)}else if(reqcols<=PERCOLUMNNUMBER){amaxcol+=PERCOLUMNNUMBER;if(amaxcol>this.maxcol)amaxcol=this.maxcol;amincol=Math.max(amaxcol-(PERCOLUMNNUMBER*2-1),0)}else{amaxcol+=
PERCOLUMNNUMBER*2;if(amaxcol>this.maxcol)amaxcol=this.maxcol;amincol=Math.max(amaxcol-(PERCOLUMNNUMBER*2-1),0)}if(ie){if(this.vsTimeout!=null){clearTimeout(this.vsTimeout);this.vsTimeout=null}var gridweb=this;this.vsTimeout=setTimeout(function(){gridweb.postAsyncW(amincol,amaxcol,false)},10)}else this.postAsyncW(amincol,amaxcol,false)}else{if(this.vsTimeout!=null){clearTimeout(this.vsTimeout);this.vsTimeout=null}this.viewPanel.scrollLeft=this.hsBar.scrollLeft-asyncLeft}}}
function mOnSubmit(arg,cancel){if(typeof this.onacwsubmit=="function")return this.onacwsubmit(arg,cancel);else return true}function mOnError(){if(typeof this.onacwerror=="function")this.onacwerror()}
function mOnSelectCell(cell){this.fastEdit=true;if(typeof this.onacwselectcell=="function")this.onacwselectcell(cell);var ajxpath=this.ajaxcallpath;if(this.editorbox!=null){this.editorcellname.innerHTML=this.getCellName(cell)+" <br>";var myformula=cell.getAttribute("formula");if(myformula!=null)$(this.editorbox).val(myformula);else{var value=this.getCellValueByCell(cell);$(this.editorbox).val(value)}}if(typeof this.onacwselectcellajaxcallback=="function"&&ajxpath!=null){var row=this.getCellRow(cell);
var col=this.getCellColumn(cell);var value=this.getCellValueByCell(cell);this.eventBtn.acwEventData="cellselect#"+row+"#"+col;this.eventBtn.acwEventValue=value;var gridweb=this;this.ajaxtimeout=setTimeout(function(){gridweb.ajaxcall_onselectcell_start(ajxpath)},0)}}function mOnSelectCellAjaxCallBack(cell,customerdata){if(typeof this.onacwselectcellajaxcallback=="function")this.onacwselectcellajaxcallback(cell,customerdata)}
function mOnUnselectCell(cell){if(typeof this.onacwunselectcell=="function")this.onacwunselectcell(cell)}function mOnDoubleClickCell(cell){if(typeof this.onacwdoubleclickcell=="function")this.onacwdoubleclickcell(cell)}function mOnDoubleClickRow(row){if(typeof this.onacwdoubleclickrow=="function")this.onacwdoubleclickrow(row)}function mOnCellError(cell){if(typeof this.onacwcellerror=="function")this.onacwcellerror(cell)}
function mOnCellUpdated(cell,isOriginal){if(isOriginal==null)isOriginal=true;this.updateMenuReferenceOnCellUpdated(cell);if(typeof this.onacwcellupdate=="function")this.onacwcellupdate(cell,isOriginal)}
function updateMenuReferenceOnCellUpdated(cell){var row=this.getCellRow(cell);var col=this.getCellColumn(cell);var len=this.menuRangeMap.size();var lmnode=this.lmDoc.selectSingleNode("listmenus");for(var i=0;i<len;i++){var k=this.menuRangeMap.keys[i];var rangeSplit=this.menuRangeMap.get(k).split(",");var rangeStartRow=Number(rangeSplit[0]);var rangeStartCol=Number(rangeSplit[1]);var rangeEndRow=rangeStartRow+Number(rangeSplit[2])-1;var rangeEndCol=rangeStartCol+Number(rangeSplit[3])-1;if(row>=rangeStartRow&&
row<=rangeEndRow&&col>=rangeStartCol&&col<=rangeEndCol){var mnode=lmnode.selectSingleNode('menu[@id="'+k+'"]');if(mnode!=null){var postion=rangeStartRow==rangeEndRow?col-rangeStartCol:row-rangeStartRow;var mv=mnode.getAttribute("value");var updatestr=this.ListMenu.getMenuItemUpdateValue(mv,postion,cell.innerText.trim(),getattr(cell,"ufv"));mnode.setAttribute("value",updatestr)}}}}
function mOnCalendarChange(e){if(this.ActiveCell!=null){var evt=new Event(e);if(evt.e.propertyName=="day"){var day=this.Calendar.handler.fnGetDay().toString();if(day.length==1)day="0"+day;var month=this.Calendar.handler.fnGetMonth().toString();if(month.length==1)month="0"+month;var datestr=this.Calendar.handler.fnGetYear().toString()+"-"+month+"-"+day;this.editCell(this.ActiveCell,datestr);this.Calendar.style.display="none"}}else this.Calendar.style.display="none"}
function mOnEmbededGridSubmit(cmd,cancelEdit){return this.postBack(null,cancelEdit)}
function createLoadingBox(){var loadingbox=document.getElementById("grid_loading"+this.id);var loadingcover=document.getElementById("grid_loading_blcov"+this.id);if(loadingbox!=null)this.loadingBox=loadingbox;else{this.loadingBox=document.createElement("div");this.loadingBox.id="grid_loading"+this.id;this.loadingBox.style.backgroundColor="white";this.loadingBox.style.border="2px outset";this.loadingBox.style.width="300px";this.loadingBox.style.height="80px";this.loadingBox.style.position="absolute";
this.loadingBox.style.zIndex=99999999;this.loadingBox.style.left=this.offsetWidth/2-150+"px";this.loadingBox.style.top=this.getClientPageHeight()/2-25+"px";this.loadingBox.style.display="none";var loadingTable=document.createElement("table");loadingTable.style.width="100%";loadingTable.style.height="100%";var loadingTr=loadingTable.insertRow(0);var loadingTd=loadingTr.insertCell(0);loadingTd.id=this.id+"_loading";loadingTd.style.textAlign="center";loadingTd.style.verticalAlign="middle";loadingTd.style.backgroundColor=
"white";loadingTd.style.color="black";loadingTd.style.fontFamily="Arial";loadingTd.style.fontSize="11pt";loadingTd.innerText=getlang().DialogBoxLoading;loadingTr=loadingTable.insertRow(1);loadingTd=loadingTr.insertCell(0);loadingTd.id=this.id+"_loading";loadingTd.style.textAlign="center";loadingTd.style.verticalAlign="middle";loadingTd.style.backgroundColor="white";var img=document.createElement("IMG");img.src=this.image_file_path+"loading.gif";loadingTd.appendChild(img);this.loadingBox.appendChild(loadingTable);
this.appendChild(this.loadingBox)}if(loadingcover!=null)this.blockcover=loadingcover;else{this.blockcover=document.createElement("div");this.blockcover.id="grid_loading_blcov"+this.id;if(ie)this.blockcover.style.cssText="position:absolute; top:0; left:0; right:0; bottom:0; background-color:transparent; z-index:99999998;display:none;";else this.blockcover.setAttribute("style","position:absolute; top:0; left:0; right:0; bottom:0; background-color:transparent; z-index:99999998;display:none;");document.body.appendChild(this.blockcover)}}
function adjustXhtmlTopRow(){if(this.topPanel!=null){var toprowh=this.frameTab.rows[this.viewRow.rowIndex-1].style.height;var newh=parseLength(toprowh,"y");if(newh!=null){newh-=2;if(newh<0)newh=0;var trow=this.topTable.rows[0];trow.style.height=newh+"px";if(this.topTable0!=null){trow=this.topTable0.rows[0];trow.style.height=newh+"px"}}}}
function adjustXhtmlRows(){var vrowh=parseLength(this.style.height,"y");if(vrowh==null){vrowh=this.getClientPageHeight();var percentagevalue=getPercentageLength(this.style.height);if(percentagevalue!=null)vrowh=vrowh*percentagevalue}if(vrowh!=null){if(this.topPanel!=null){var th=parseLength(this.frameTab.rows[this.viewRow.rowIndex-1].style.height,"y");if(th!=null)vrowh-=th}if(this.bottomTable!=null){var bh=parseLength(this.bottomTable.parentNode.parentNode.style.height,"y");if(bh!=null)vrowh-=bh}if(ie&&
iemv>=8&&this.fRow!=null){if(this.viewTable01.offsetHeight>0||this.viewTable01.rows.length==0){if(this.fRow.offsetHeight!=this.viewTable01.offsetHeight)this.fRow.style.height=this.viewTable01.offsetHeight+"px";if(this.fRowH!=null&&this.fRowH.style.height!=this.fRow.style.height)this.fRowH.style.height=this.fRow.style.height}vrowh-=this.fRow.offsetHeight}if(vrowh!=null&&vrowh>=0){var collpase=getattr(this,"grp_collapse_col");if(collpase!=null)vrowh+=11;if(ie&&iemv<8)this.viewRow.style.height=vrowh+
"px";else{if(this.leftPanel!=null)this.leftPanel.style.height=vrowh+"px";this.viewPanel.style.height=vrowh+"px";if(chrome&&this.async){this.viewTable.style.width=this.topTable.offsetWidth+"px";if(this.viewPanel01!=null)this.viewTable01.style.width=this.topTable.offsetWidth+"px"}if(this.viewPanel10!=null)this.viewPanel10.style.height=vrowh+"px"}}}}
function adjustXhtml2_p(){if(this.offsetHeight>0){var vrowh=this.viewRow.offsetHeight-(this.frameTab.offsetHeight-this.getClientPageHeight());this.viewRow.style.height=vrowh+"px"}}
function adjustNoScroll(){var w=this.leftPanel!=null?this.leftPanel.offsetWidth:0;if(this.viewTable!=null&&this.viewTable.rows.length>0)w+=this.viewTable.offsetWidth;else if(this.topPanel!=null&&this.topPanel.childNodes.length>0)w+=this.topPanel.firstChild.offsetWidth;var h=(this.topPanel!=null?this.topPanel.offsetHeight:0)+(this.viewTable!=null?this.viewTable.offsetHeight:0)+(this.bottomTable!=null?this.bottomTable.offsetHeight:0)+(this.xhtmlmode?2:1);this.style.width=w+"px";this.style.height=h+
"px";if(this.xhtmlmode)this.viewRow.style.height=this.viewTable.offsetHeight+"px";this.adjustXhtmlRows()}function adjustFreeze(){var gridweb=this;this.viewPanel.onresize=function(){gridweb.adjustScroll()};this.viewPanel01.onscroll=function(){gridweb.mOnScroll1()};this.viewPanel10.onscroll=function(){gridweb.mOnScroll2()};this.adjustSizes()}function adjustScroll(){}
function adjustSizes(){var tdelay1=true;var tdelay2=true;if(this.viewTable01.offsetHeight>0||this.viewTable01.rows.length==0){if(this.fRow.offsetHeight!=this.viewTable01.offsetHeight)this.fRow.style.height=this.viewTable01.offsetHeight+"px";if(this.fRowH!=null&&this.fRowH.style.height!=this.fRow.style.height)this.fRowH.style.height=this.fRow.style.height;if(this.xhtmlmode&&this.viewRow.offsetHeight>0){var fRow2=this.fRow.nextSibling;var fRowH2=null;if(this.fRowH!=null){fRowH2=this.fRowH.nextSibling;
fRowH2.style.height="0px"}var oheight=fRowH2!=null&&fRowH2.offsetHeight>fRow2.offsetHeight?fRowH2.offsetHeight:fRow2.offsetHeight;var newh=oheight;if(ie)if(this.viewRow.offsetHeight>this.viewRow.style.pixelHeight+5)newh-=this.viewRow.offsetHeight-this.viewRow.style.pixelHeight;else newh=this.viewRow.offsetHeight-this.viewTable01.offsetHeight;else{var oh=this.getClientPageHeight()-this.fRow.offsetHeight;if(this.topPanel!=null)oh-=this.frameTab.rows[this.viewRow.rowIndex-1].offsetHeight;if(this.bottomTable!=
null)oh-=this.bottomTable.parentNode.parentNode.offsetHeight;newh=oh}if(newh<=0)newh=0;fRow2.style.height=newh+"px";if(fRowH2!=null)fRowH2.style.height=newh+"px";if(!ie||ie&&iemv<8){if(this.leftPanel!=null)this.leftPanel.style.height=newh+"px";this.viewPanel.style.height=newh+"px";if(this.viewPanel10!=null)this.viewPanel10.style.height=newh+"px"}}tdelay1=false}if(this.viewTable10.offsetWidth>0||this.viewTable10.rows.length==0||this.viewTable10.rows[0].cells.length==0){this.fCol.style.width=this.viewTable10.offsetWidth+
"px";if(this.fColH!=null)this.fColH.style.width=this.fCol.style.width;tdelay2=false}var delayAdjustSize=tdelay1||tdelay2;this.adjustScroll();if(delayAdjustSize){var gridweb=this;setTimeout(function(){gridweb.adjustSizes()},10)}}
function adjustBVScroll(){var bodyleft=getattr(this,"bodyleft");if(bodyleft!=null)this.sBody.scrollLeft=bodyleft;var bodytop=getattr(this,"bodytop");if(bodytop!=null)this.sBody.scrollTop=bodytop;if(!this.async){var viewleft=getattr(this,"viewleft");if(viewleft!=null)this.viewPanel.scrollLeft=viewleft;var viewtop=getattr(this,"viewtop");if(viewtop!=null)this.viewPanel.scrollTop=viewtop}var tableft=getattr(this,"tableft");if(tableft!=null&&this.tabPanel!=null)this.tabPanel.scrollLeft=tableft;if(this.tabPanel!=
null){var acttab=document.getElementById(this.id+"_TAB"+getattr(this,"acttab"));if(acttab!=null){var tabtd=acttab.parentNode;if(this.tabPanel.scrollLeft>tabtd.offsetLeft||this.tabPanel.scrollLeft+this.tabPanel.clientWidth<tabtd.offsetLeft+tabtd.offsetWidth)this.tabPanel.scrollLeft=tabtd.offsetLeft+tabtd.offsetWidth/2-this.tabPanel.clientWidth/2}}}
function adjustAsyncScrollBar(){if(this.noscroll)return;var WSBAR=18;var tabBarAtBottom=this.bottomTable==null||getattr(this.bottomTable,"attop")!="1";var vsCol=document.getElementById(this.id+"_vsCol");var vsCell=document.getElementById(this.id+"_vsCell");var vsContent=document.getElementById(this.id+"_vsContent");var hsCell=document.getElementById(this.id+"_hsCell");var hsContent=document.getElementById(this.id+"_hsContent");var lowerRight=document.getElementById(this.id+"_lowerRight");var hsRow=
document.getElementById(this.id+"_hsRow");if(true){if(vsCell!=null){var hgrid=this.getClientPageHeight();if(hgrid==0)hgrid=this.offsetHeight;var hpanel=this.viewPanel.offsetHeight;var htable=this.viewTable.offsetHeight;if(this.freeze)htable+=this.viewTable01.offsetHeight;if(this.async){var asynctableheight=asynctableheight_map.get(this.acttab);if(asynctableheight==null)asynctableheight_map.put(this.acttab,htable);else htable=asynctableheight}var asyncRows=this.amaxrow-this.aminrow+1;var async_dif=
0;if(this.asyncrows!=null)async_dif=asyncRows-this.asyncrows;else this.asyncrows=asyncRows;if(this.ltable0!=null){var toprows=this.ltable0.rows.length;asyncRows-=toprows}var totalRows=this.maxrow-this.minrow+1;if(this.visiblerows!=null)totalRows=this.visiblerows;var hcontent=0;if(this.async)if(this.hcontent==null)if(this.maxrow==this.amaxrow){if(async_dif>0)async_dif=0;else;hcontent=(totalRows-asyncRows-async_dif)*HCELL+htable;this.hcontent=hcontent}else hcontent=(totalRows-asyncRows)*HCELL+htable;
else hcontent=this.hcontent;else hcontent=(totalRows-asyncRows)*HCELL+htable;var hbottom=this.bottomTable!=null?this.bottomTable.offsetHeight:0;if(hcontent>hpanel){vsCell.style.display="";vsCell.style.width=WSBAR+"px";this.vsBar.style.width=WSBAR+"px";this.vsBar.style.height=hgrid-hbottom-(ie&&iemv<7?2:0)+"px";vsContent.className=this.viewTable.className;this.vscontentheight=hcontent-hpanel+(hgrid-hbottom);vsContent.style.height=this.vscontentheight+"px";if(this.amaxrow==this.maxrow&&htable>hpanel);
if(vsCol!=null)vsCol.style.width=WSBAR+"px";if(lowerRight!=null){lowerRight.style.display="";if(ie)lowerRight.style.backgroundColor=this.vsBar.style.scrollbarBaseColor!=""?this.vsBar.style.scrollbarBaseColor:"#f0f0f0";else lowerRight.style.backgroundColor="#f0f0f0"}}else{vsCell.style.display="none";if(vsCol!=null)if(chrome||safari)vsCol.style.width="1px";else vsCol.style.width="0px";if(lowerRight!=null)lowerRight.style.display="none"}wpanel=this.viewPanel.offsetWidth}if(hsCell!=null){var wgrid=this.offsetWidth;
var wpanel=this.viewPanel.offsetWidth;var wtable=this.viewTable.offsetWidth;var asyncCols=this.amaxcol-this.amincol+1;if(this.asynccols!=null)asyncCols=this.asynccols;var totalCols=this.maxcol-this.mincol+1;var wcontent=(totalCols-asyncCols)*WCELL+wtable;if(wcontent>wpanel){hsCell.style.display="";hsCell.style.height=WSBAR+"px";this.hsBar.style.height=WSBAR+"px";if(!this.async)hsContent.style.width=wtable-wpanel+this.hsBar.offsetWidth+"px";else hsContent.style.width=wcontent-wpanel+this.hsBar.offsetWidth+
"px"}else hsCell.style.display="none"}}if((chrome||safari)&&vsCell!=null&&vsCol!=null)if(vsCell.style.display=="none"){vsCol.style.display="";vsCol.style.width="1px"}else vsCol.style.display="";var gridweb=this;if(this.hsBar!=null){var viewleft=getattr(this,"viewleft");if(viewleft!=null){viewleft=Number(viewleft);var asyncLeft=(this.amincol-this.mincol)*WCELL;if(this.asynctopcols!=null)asyncLeft=this.asynctopcols*WCELL;this.viewPanel.scrollLeft=viewleft-asyncLeft}this.hsBarSetPosion(viewleft)}if(this.vsBar!=
null){var viewtop=getattr(this,"viewtop");if(viewtop!=null){viewtop=Number(viewtop);var asyncTop=(this.aminrow-this.minrow)*HCELL;if(this.asynctoprows!=null)asyncTop=this.asynctoprows*HCELL;this.viewPanel.scrollTop=viewtop-asyncTop;if(viewtop>hcontent-hpanel){viewtop=hcontent-hpanel-2;this.setAttribute("viewtop",viewtop)}if(this.reachmax){if(this.viewpanlscrolltop==null)this.viewpanlscrolltop=0;if(this.viewPanel.scrollTop>this.viewpanlscrolltop)this.viewpanlscrolltop=this.viewPanel.scrollTop;else this.viewPanel.scrollTop=
this.viewpanlscrolltop}}this.vsBarSetPosion(viewtop);if(!firefox)this.viewTable.onmousewheel=function(){gridweb.vsBar.scrollTop-=event.wheelDelta};else this.viewTable.addEventListener("DOMMouseScroll",function(e){gridweb.vsBar.scrollTop-=e.detail*-120},false)}if(ie){if(this.topTable!=null)this.topTable.style.width="0px"}else{if(this.topTable!=null&&this.topTable.style.width=="100%")this.topTable.style.width="0px";if(this.viewTable.style.width=="0%")this.viewTable.style.width="0px";if(this.viewTable01!=
null)this.viewTable01.style.width="0px"}}function adjustXSize(){if(this.noscroll)this.adjustNoScroll();else if(this.freeze)this.adjustFreeze()}function adjustXSizeX(){if(this.xhtmlmode){if(ie&&iemv<8)this.adjustXhtmlTopRow();if(!this.noscroll)this.adjustXhtmlRows()}}
function initXTable(){var xcol0=document.getElementById(this.id+"_XCOL0");var xcol1=document.getElementById(this.id+"_XCOL");var viewTabWidth=this.viewTable.offsetWidth;var viewTab01Width;if(this.viewTable01!=null)viewTab01Width=this.viewTable01.offsetWidth;for(var i=this.xTable.rows.length-1;i>=0;i--){var xrow=this.xTable.rows[i];var rownum=Number(getattr(xrow,"rowidx"));var table0;var table1;var ltable;var xcol;if(getattr(xrow,"fixrow")=="1"){table0=this.viewTable00;table1=this.viewTable01;ltable=
this.ltable0;xcol=xcol0}else{table0=this.viewTable10;table1=this.viewTable;ltable=this.ltable1;xcol=xcol1}var ghcell=null;var xhcell;if(getattr(this,"grouped")!="1"||this.freeze)xhcell=table1.rows[rownum-1].cells[0];else{ghcell=table1.rows[rownum-1].cells[0];xhcell=table1.rows[rownum-1].cells[1]}var xcell=xrow.cells[0];var xgrid=xcell.firstChild;if(this.rootgrid!=null)xgrid.rootgrid=this.rootgrid;else xgrid.rootgrid=this;var gridweb=this;xgrid.onacwsubmit=function(cmd,cancelEdit){return gridweb.mOnEmbededGridSubmit(cmd,
cancelEdit)};var newrow;var newrow0;var newhrow;newrow=table1.insertRow(rownum);newrow.olv=getattr(table1.rows[rownum-1],"olv");newrow.xtype="1";newrow.setAttribute("olv",newrow.olv);newrow.setAttribute("xtype",newrow.xtype);if(ghcell!=null)ghcell.rowSpan=2;newrow.appendChild(xcell);xhcell.rowSpan=2;xgrid.adjustXSizeX();if(xgrid.xTable!=null)xgrid.initXTable();xgrid.adjustXSize();newrow.style.height=xgrid.offsetHeight+1+"px";if(xcell.clientWidth<xgrid.offsetWidth)if(ie)xcol.style.width=xcol.style.pixelWidth+
xgrid.offsetWidth-xcell.clientWidth+"px";else xcol.style.width=xcol.offsetWidth+xgrid.offsetWidth-xcell.clientWidth+"px";if(table0!=null){newrow0=table0.insertRow(rownum);newrow0.olv=getattr(table0.rows[rownum-1],"olv");newrow0.xtype="1";newrow0.setAttribute("olv",newrow.olv);newrow0.setAttribute("xtype",newrow.xtype);newrow0.style.height=xgrid.offsetHeight+1+"px";var newcell0;if(table0.rows[rownum-1].cells.length>0){newcell0=newrow0.insertCell(0);newcell0.colSpan=table0.rows[rownum-1].cells.length;
setInnerText(newcell0," ");newcell0.className=xcell.className}}if(ltable!=null){var hcell=ltable.rows[rownum-1].cells[0];newhrow=ltable.insertRow(rownum);newhrow.style.height=xgrid.offsetHeight+1+"px";var newhcell=newhrow.insertCell(0);setInnerText(newhcell," ");newhcell.className=hcell.className}}}
function validateInput(o){var valideType=getattr(o,"vtype");if(valideType=="checkbox")return true;var value=getInnerText(o);if(value=="")if(getattr(o,"isrequired")=="1"){this.setInvalid(o);return false}else{this.setValid(o);return true}if(valideType=="any")return true;var formula=getattr(o,"formula");var ufv=getattr(o,"ufv");var nv;var regexpvalue=getattr(o,"regex");if(valideType=="regex"||regexpvalue!=null){var rx=new RegExp(regexpvalue);var matches=rx.exec(value);if(matches==null||value!=matches[0])if(formula!=
null){matches=rx.exec(formula);if(matches==null||formula!=matches[0]){this.setInvalid(o);return false}}else if(ufv!=null){matches=rx.exec(ufv);if(matches==null||ufv!=matches[0]){this.setInvalid(o);return false}}else{this.setInvalid(o);return false}}switch(valideType){case "regex":this.setValid(o);return true;break;case "flist":this.setValid(o);return true;break;case "list":case "dlist":if(o.getAttribute("needvalidateforlistitems")==null)if(o.getAttribute("servervalidate")!=null)return this.validateServerFunction(o,
value);else{this.setValid(o);return true}var lmnode=this.lmDoc.selectSingleNode("listmenus");var mnode=lmnode.selectSingleNode('menu[@id="'+getattr(o,"listmenu")+'"]');var mv=mnode.getAttribute("value");mv=mv.replace(/&lt;/g,"<").replace(/&gt;/g,">");this.xmlDoc1.loadXML(mv);var items=this.xmlDoc1.selectNodes("MENU/ITEM");for(var i=0;i<items.length;i++){var itext=items[i].getAttribute("VALUE");if(itext==null)itext=items[i].getAttribute("TEXT");if(itext!=null)itext=itext.ESCAPE_BACK();if(value==itext||
formula==itext||ufv==itext)if(o.getAttribute("servervalidate")!=null)return this.validateServerFunction(o,value);else{this.setValid(o);return true}}this.setInvalid(o);return false;break;case "bool":var bv=value.toUpperCase();if(bv=="TRUE"||bv=="FALSE"){this.setValid(o);return true}else{this.setInvalid(o);return false}break;case "number":case "int":case "date":case "time":nv=this.validatorConvert(value,valideType);if(nv==null&&ufv!=null)nv=this.validatorConvert(ufv,valideType);if(nv!=null);else{this.setInvalid(o);
return false}break;case "datetime":nv=this.validatorConvert(value,"date");if(nv==null)nv=this.validatorConvert(value,"datetime");if(nv==null&&ufv!=null){nv=this.validatorConvert(ufv,"date");if(nv==null)nv=this.validatorConvert(ufv,"datetime")}if(nv!=null);else{this.setInvalid(o);return false}break;case "customfunction":var cvf;try{cvf=eval("window."+getattr(o,"cvfn"))}catch(ex){}if(typeof cvf!="function"){this.setInvalid(o);return false}var cvfResult=cvf(o,value);if(!cvfResult)if(formula!=null)cvfResult=
cvf(o,formula);else if(ufv!=null)cvfResult=cvf(o,ufv);if(cvfResult){this.setValid(o);return true}else{this.setInvalid(o);return false}break;case "customstring":var ret=this.getFormulaValidation(o,value,"validateformula",getattr(o,"vformula"));if(ret=="true"){this.setValid(o);return true}else{this.setInvalid(o);return false}break;case "customserverfunction":return this.validateServerFunction(o,value);break}var compareOPType=getattr(o,"ValidationOperator");var compareValue1=getattr(o,"ValidationValue1");
var compareValue2=getattr(o,"ValidationValue2");var ufvValue=getattr(o,"ufv");var actualValue=ufvValue==null?value:ufvValue;if(compareOPType!=null){compareOPType=compareOPType.toLowerCase();if(compareValue2==null&&compareOPType=="between")compareOPType="equal";if(compareValue1!=null)compareValue1=this.validatorConvert(compareValue1,valideType,true);if(compareValue2!=null)compareValue2=this.validatorConvert(compareValue2,valideType,true);actualValue=this.validatorConvert(actualValue,valideType);if(compareOPType==
"equal")if(valideType!="textlength"){if(actualValue!=compareValue1){this.setInvalid(o);return false}}else{if(actualValue.length!=Number(compareValue1)){this.setInvalid(o);return false}}else if(compareOPType=="notequal")if(valideType!="textlength"){if(actualValue==compareValue1){this.setInvalid(o);return false}}else{if(actualValue.length==Number(compareValue1)){this.setInvalid(o);return false}}else if(compareOPType=="between")if(valideType!="textlength"){if(actualValue<compareValue1||actualValue>compareValue2){this.setInvalid(o);
return false}}else{if(actualValue.length<Number(compareValue1)||actualValue.length>Number(compareValue2)){this.setInvalid(o);return false}}else if(compareOPType=="notbetween")if(valideType!="textlength"){if(actualValue>=compareValue1&&actualValue<=compareValue2){this.setInvalid(o);return false}}else{if(actualValue.length<=Number(compareValue1)&&actualValue.length<=Number(compareValue2)){this.setInvalid(o);return false}}else if(compareOPType=="lessthan")if(valideType!="textlength"){if(actualValue>=
compareValue1){this.setInvalid(o);return false}}else{if(actualValue.length>=Number(compareValue1)){this.setInvalid(o);return false}}else if(compareOPType=="lessorequal")if(valideType!="textlength"){if(actualValue>compareValue1){this.setInvalid(o);return false}}else{if(actualValue.length>Number(compareValue1)){this.setInvalid(o);return false}}else if(compareOPType=="greaterthan")if(valideType!="textlength"){if(actualValue<=compareValue1){this.setInvalid(o);return false}}else{if(actualValue.length<=
Number(compareValue1)){this.setInvalid(o);return false}}else if(compareOPType=="greaterorequal")if(valideType!="textlength"){if(actualValue<compareValue1){this.setInvalid(o);return false}}else if(actualValue.length<Number(compareValue1)){this.setInvalid(o);return false}}this.setValid(o);return true}
function validateServerFunction(o,value){var ret=this.getFormulaValidation(o,value,"customserverfunction","");if(ret==""){this.setValid(o);return true}else{try{this.validationcallback=eval(getattr(o,"cvfn"))}catch(ex){}if(typeof this.validationcallback!="function")alert("client function not set for sverside validation call back");else{var who=this;setTimeout(function(){who.validationcallback(o,ret)},300)}this.setInvalid(o);return false}}
function setValid(o){if(o.style.backgroundImage!="none"&&o.style.backgroundImage!="")o.style.backgroundImage=""}function setInvalid(o){if(o.style.backgroundImage!="url('"+this.image_file_path+"x.gif')")o.style.backgroundImage="url('"+this.image_file_path+"x.gif')";this.mOnCellError(o)}
function searchv(){this.searchValidations(this.viewTable,this.validations);this.searchValidations(this.viewTable00,this.validations);this.searchValidations(this.viewTable01,this.validations);this.searchValidations(this.viewTable10,this.validations)}
function searchValidations(table,vlist){if(table!=null){var c=vlist.length;var rows=table.rows;var rowslen=rows.length;var i;var x=this.xhtmlmode;var filtered=false;var pivottable=getattr(this,"pivottable")!=null;for(i=0;i<rowslen;i++){var cells=rows[i].cells;var cellslen=cells.length;var j;var rowfilter=false;var cellLeft=-1;var cellTop=-1;for(j=0;j<cellslen;j++){var cell=cells[j];cell.unselectable="on";if(x){var fc=cell.firstChild;if(fc!=null&&fc.nodeType==1){fc.unselectable="on";if(cell.rowSpan>
1&&fc.tagName=="SPAN")if(ie&&iemv<8)fc.style.setExpression("height","parentElement.clientHeight-1")}}if(pivottable){var fieldtype=getattr(cell,"fieldtype");if(fieldtype!=null){var cellWidth=cell.offsetWidth;if(cellLeft<0)cellLeft=cell.offsetLeft;if(cellTop<0)cellTop=cell.offsetTop;var img=createImageButton(cell,cellLeft,cellTop,cellWidth-15);this.dataFilters[this.dataFilters.length]=img;img.id=this.id+"_PFT"+this.getCellColumn(cell);img.src=this.image_file_path+"dropdown.gif";img.title=getlang().TipFilterButton;
img.setAttribute("fieldtype",fieldtype);img.setAttribute("fieldindex",getattr(cell,"fieldindex"));img.setAttribute("pivottableid",getattr(cell,"pivottableid"));var criteria=getattr(this,"criteria");if(criteria!=null)img.title+="\n["+criteria+"]";cellLeft+=cellWidth}else if(getattr(cell,"pgrp")!=null){var img=createImageButton(cell,cell.offsetLeft,cell.offsetTop,0);this.dataFilters[this.dataFilters.length]=img;img.id=this.id+"_PGP"+this.getCellRow(cell);img.src=this.image_file_path+"collapse.gif";
img.title=getlang().TipExpandGroupButton;img.setAttribute("range",getattr(cell,"range"))}}else if(!filtered){var vtype=getattr(cell,"vtype");if(vtype!=null)if(vtype!="filter"){vlist[c]=cell;c++}else{var cellWidth=cell.offsetWidth;if(cellLeft<0)cellLeft=cell.offsetLeft;if(cellTop<0)cellTop=cell.offsetTop;var img=createImageButton(cell,cellLeft,cellTop,cellWidth-15);this.dataFilters[this.dataFilters.length]=img;img.id=this.id+"_FTR"+this.getCellColumn(cell);img.src=this.image_file_path+"dropdown.gif";
img.title=getlang().TipFilterButton;img.setAttribute("ownercolumn",this.getCellColumn(cell));var criteria=getattr(this,"criteria");if(criteria!=null)img.title+="\n["+criteria+"]";cellLeft+=cellWidth;rowfilter=true}}}if(rowfilter)filtered=rowfilter}}}
function createImageButton(cell,cellLeft,cellTop,leftoffset){var img=document.createElement("IMG");cell.offsetParent.offsetParent.appendChild(img);img.style.position="absolute";img.style.top=cellTop+"px";img.style.left=cellLeft+leftoffset+"px";img.leftoffset=leftoffset;if(leftoffset<0)img.style.display="none";img.style.zIndex=9;img.filterCell=cell;return img}
function adjustImageButton(){if(this.dataFilters.length>0)for(var i=0;i<this.dataFilters.length;i++){var img=this.dataFilters[i];var cell=img.filterCell;img.style.top=cell.offsetTop+"px";img.style.left=cell.offsetLeft+img.leftoffset+"px";if(img.leftoffset<0)img.style.display="none";else img.style.display="block"}}
function isCell(o){if(o==null)return null;if(o.tagName=="TD"&&o.id!=null&&o.id.indexOf(this.id)==0&&this.cidregex.exec(o.id.substring(this.id.length+1,o.id.length))!=null)return"TD";else if(o.tagName=="SPAN"&&o.id==this.id+"_AC")return"SPAN";else if(o.tagName=="SELECT"&&o.parentNode.id==this.id+"_AC")return"SPAN";else return null}
function doRangeSelect(shiftKey){shiftclick=shiftKey==true;if(this.ActiveCell!=null){if(this.getSpan(this.ActiveCell)!=null)this.endEdit(this.ActiveCell);if(this.ActiveCell!=this.DragCell&&!shiftKey){this.endSelect();this.enterSelect(this.DragCell)}}else this.enterSelect(this.DragCell);if(this.DragCell!=null&&this.DragEndCell!=null)this._selections.updateRange(this.DragCell,this.DragEndCell);removeSelection()}
function removeSelection(){if(window.getSelection)try{var selection=window.getSelection();selection.removeAllRanges()}catch(ex){}else if(document.selection.createRange)document.selection.empty()}function clearSelections(){this._selections.clear();this.DragCell=null;this.DragEndCell=null}function clearSelectionAsyncCache(){this._selections.forceclear();this.DragCell=null;this.DragEndCell=null}
function setSelectRange(range){this.DragCell=this.getCell(range.startRow,range.startCol);this.DragEndCell=this.getCell(range.endRow,range.endCol);this.doRangeSelect()}function getSelectRange(){return this._selections.last()}
function editCell(o,text){if(getattr(o,"vtype")!="checkbox"){var span=this.getSpan(o);if(span==null){if(getInnerText(o)!=text||o.styleStr!=null&&o.styleStr!=o.orgStyleStr){if(!this.xhtmlmode)setInnerText(o,text);else{var dcell=o.getElementsByTagName("SPAN")[0];if(dcell!=null){var h=o.offsetHeight;setInnerText(dcell,text);if(text.length>0)if(!ie||ie&&iemv>=8)dcell.style.height=h-1+"px"}}o.removeAttribute("formula");o.removeAttribute("ufv");if(ie)o.myInnerText=text;this.update(o)}}else{setInnerText(span,
text);if(ie)o.myInnerText=text}if(text.length>0)adjustSpanCell(o.parentNode,o)}else{var checkbox=o.getElementsByTagName("INPUT")[0];checkbox.checked=text!=null&&text.toUpperCase()=="TRUE";this.update(o)}}
function editCell2(o,text){if(getattr(o,"vtype")!="checkbox"){var span=this.getSpan(o);if(span==null){if(getInnerText(o)!=text){if(!this.xhtmlmode)setInnerText(o,text);else{var dcell=o.getElementsByTagName("SPAN")[0];if(dcell!=null){var h=o.offsetHeight;dcell.innerHTML=text;adjustSpanCell(o.parentNode,o)}}if(ie)o.myInnerText=text}}else if(getattr(o,"formula")==null){setInnerText(span,text);if(ie)o.myInnerText=text}else span.orgText=text}else{var checkbox=o.getElementsByTagName("INPUT")[0];checkbox.checked=
text!=null&&text.toUpperCase()=="TRUE"}}function endEdit(o){if(getattr(o,"vtype")!="checkbox"){var span=this.getSpan(o);this.endEditBase(o,span)}}function endEditfromEditorBox(o){if(getattr(o,"vtype")!="checkbox"){var span=o.firstChild;span.orgText=o.lastText;span.orgClass=span.className;span.orgCellStyle=getattr(span,"style");span.orgStyleStr=span.styleStr;this.endEditBase(o,span)}}
function getchartimg(span){var childs=span.childNodes;var ret=new Array;for(var i=0;i<childs.length;i++)if(childs[i].tagName=="IMG")ret.push(childs[i]);if(ret.length>0)return ret;else return null}
function endEditBase(o,span){span.insideedit=false;if(!focusinside)span.istypefirsttime=null;if(!ie||iemv>8){o.unselectable="on";span.blur()}var innerText;if(getattr(o,"vtype")!="dlist")innerText=getInnerText(span);else{var select=document.getElementById(this.id+"_AS");if(select.options.length>0&&select.selectedIndex>=0){var soption=select.options[select.selectedIndex];if(soption!=null)innerText=soption.value}}var otherchildnode=new Array;if(span.otherchildnode!=null)for(var i=0;i<span.otherchildnode.length;i++)otherchildnode.push(span.otherchildnode[i]);
span.parentNode.removeChild(span);var needUpdate=false;if(getattr(o,"formula")==null&&getattr(o,"ufv")==null&&innerText!=span.orgText||getattr(o,"formula")!=null&&innerText.trim()!=getattr(o,"formula").trim()||getattr(o,"ufv")!=null&&innerText!=getattr(o,"ufv")||o.styleStr!=null&&o.styleStr!=o.orgStyleStr){if(getattr(o,"formula")!=null){if(getattr(o,"formula")!=innerText)o.removeAttribute("formula")}else if(getattr(o,"ufv")!=null)if(getattr(o,"ufv")!=innerText)o.removeAttribute("ufv");needUpdate=
true}if(getattr(o,"formula")!=null)innerText=span.orgText;else if(getattr(o,"ufv")!=null&&getattr(o,"orientation255")==null)innerText=span.orgText;if(!this.xhtmlmode)setInnerText(o,innerText);else{var dcell=document.createElement("SPAN");dcell.className=span.orgClass;if(ie&&iemv==7)dcell.style.setAttribute("cssText",span.orgCellStyle.cssText);else dcell.setAttribute("style",span.orgCellStyle);setInnerText(dcell,innerText);o.appendChild(dcell);for(var i=0;i<otherchildnode.length;i++)dcell.appendChild(otherchildnode[i]);
if(ie)o.myInnerText=innerText;adjustSpanCell(o.parentNode,o)}this.hidetip();if(needUpdate){o.setAttribute("needvalidateforlistitems","1");this.update(o)}}
function EscCancelEdit(o){this.fastEdit=true;if(useESCAsLeave){this.endEdit(o);return}var span=this.getSpan(o);if(span!=null)span.insideedit=false;if(!ie||iemv>8){o.unselectable="on";span.blur()}var img=document.getElementById(this.id+"_DB");if(img!=null)img.parentNode.removeChild(img);span.parentNode.removeChild(span);setInnerText(o,span.orgText);if(this.xhtmlmode){var text=getInnerText(o);while(o.hasChildNodes())o.removeChild(o.firstChild);var dcell=document.createElement("SPAN");if(ie&&iemv==7)dcell.style.setAttribute("cssText",
span.orgCellStyle.cssText);else dcell.setAttribute("style",span.orgCellStyle);dcell.className=span.orgClass;setInnerText(dcell,text);o.appendChild(dcell);if(o.rowSpan>1&&ie&&iemv<8)dcell.style.setExpression("height","parentNode.clientHeight-1")}}
function deleteCells(){if(this.editmode)for(var i=0;i<this._selections.list.length;i++){var range=this._selections.list[i];for(var r=range.startRow;r<=range.endRow;r++)for(var c=range.startCol;c<=range.endCol;c++){var o=this.getCell(r,c);if(o!=null&&getattr(o,"protected")!="1"&&getattr(o,"vtype")!="dlist")this.editCell(o,"")}}}
function endDrag(){if(this.Dragging){this.Dragging=false;this.DraggingMode=0;if(this.ActiveCell!=null&&this.DragCell!=null&&this.DragEndCell!=null)this.mOnSelectCell(this.ActiveCell)}if(this.DragCell==null||this.DragEndCell==null){this.DragCell=null;this.DragEndCell=null}if(this.ResizingHD!=null){this.endResize();if(window.event){event.returnValue=false;return}else return false}}
function getFormulaValidation(o,value,symbol,vformula){if(typeof jQuery=="undefined"){alert("you need to include jquery js lib in your page for input validation .");return"true"}else{var strUrl="",strReturn="";var id=o.id.substring(this.id.length+1,o.id.length);if(!java_client)strUrl=this.ajaxcallpath+"?gid="+this.id;else strUrl=this.ajaxcallpath+"&gid="+this.id+"&gridwebuniqueid="+this.webuniqueid;strUrl+="&kind="+symbol;var gridwebloadingbox=this.loadingBox;var ret=jQuery.ajax({type:"GET",data:{cellcol:this.getCellColumn(o),
cellrow:this.getCellRow(o),cellentervalue:value,vformula:vformula},url:strUrl,cache:false,async:false,beforeSend:function(){gridwebloadingbox.style.display="block"}}).responseText;gridwebloadingbox.style.display="none";return ret}}
function update(o){var xnode;var xv;xnode=this.xmlDoc.selectSingleNode("data/CELLS");var id=o.id.substring(this.id.length+1,o.id.length);xv=xnode.selectSingleNode('C[@ID="'+id+'"]');if(xv==null){xv=this.xmlDoc.createElement("C");xnode.appendChild(xv)}xv.setAttribute("ID",id);if(getattr(o,"vtype")=="checkbox"){var checkbox=o.getElementsByTagName("INPUT")[0];if(checkbox.checked)xv.setAttribute("V","TRUE");else xv.setAttribute("V","FALSE")}else if(getattr(o,"formula")!=null)xv.setAttribute("V",getattr(o,
"formula"));else if(getattr(o,"ufv")!=null&&getattr(o,"orientation255")==null)xv.setAttribute("V",getattr(o,"ufv"));else xv.setAttribute("V",getInnerText(o));if(o.styleStr!=null){o.orgStyleStr=o.styleStr;xv.setAttribute("S",o.styleStr)}if(this.forcevalid&&!this.validateInput(o)){this.vmark.value="FALSE";return}o.title="";if(o.firstChild!=null&&o.style.verticalAlign!="")o.firstChild.style.verticalAlign=o.style.verticalAlign;if(this.ajaxcallpath!=null){if(this.pendingNodes==null)this.pendingNodes=new Array;
if(this.ajaxupdatingcells==null)this.ajaxupdatingcells=new Array;this.pendingNodes[this.pendingNodes.length]=xv;if(ie&&!xv.xml)xv.xml=xv.getXML();xnode=this.xmlDoc.selectSingleNode("data/CELLS");if(xnode!=null)while(xnode.hasChildNodes())xnode.removeChild(xnode.getLastChild());xnode=this.xmlDoc.selectSingleNode("data/SIZES");if(xnode!=null)while(xnode.hasChildNodes())xnode.removeChild(xnode.getLastChild());this.ajaxupdatingcells[this.ajaxupdatingcells.length]=o;if(this.ajaxtimeout==null){inajaxupdating=
true;var gridweb=this;this.ajaxtimeout=setTimeout(function(){gridweb.ajaxupdate()},0)}}else this.mOnCellUpdated(o)}function updateCellFontColor(cell,color){var hex_color=colourNameToHex(color);if(!hex_color)return;cell.styleStr="|||||"+hex_color+"|||||||";this.update(cell)}function updateCellBackGroundColor(cell,color){var hex_color=colourNameToHex(color);if(!hex_color)return;cell.styleStr="||||||"+hex_color+"||||||";this.update(cell)}
function colourNameToHex(colour){if(colour.charAt(0)=="#")return colour;var colours={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",
darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",
ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c","indigo ":"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",
lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",
navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",
silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32",darkgrey:"#a9a9a9",darkslategrey:"#2f4f4f",dimgrey:"#696969",grey:"#808080",lightgray:"#d3d3d3",lightslategrey:"#778899",slategrey:"#708090"};if(typeof colours[colour.toLowerCase()]!=
"undefined")return colours[colour.toLowerCase()];alert("unsupported color:"+colour);return false}
function setCellTitle(o,t){var tip="";if(getattr(this,"disabletip")!="1"){var cvalue;var cformula;var ctype;var cregex;var cisrequired;var c_optype,c_opvalue1,c_opvalue2;var c_msg;var c_validation_inputtitle;var asl=document.getElementById(this.id+"_AS");if(asl==null)if(getattr(o,"ufv")!=null)cvalue=getattr(o,"ufv");else cvalue=getInnerText(o);else cvalue=asl.options[asl.selectedIndex].text;if(t=="TD"){cformula=getattr(o,"formula");ctype=getattr(o,"vtype");cregex=getattr(o,"regex");cisrequired=getattr(o,
"isrequired")=="1";c_optype=getattr(o,"ValidationOperator");if(c_optype!=null)c_optype=c_optype.toLowerCase();c_opvalue1=getattr(o,"ValidationValue1");c_opvalue2=getattr(o,"ValidationValue2");c_msg=getattr(o,"inputmsg");c_validation_inputtitle=getattr(o,"inputtitle")}else{cformula=getattr(o.parentNode,"formula");ctype=getattr(o.parentNode,"vtype");cregex=getattr(o.parentNode,"regex");cisrequired=getattr(o.parentNode,"isrequired")=="1";c_optype=getattr(o.parentNode,"ValidationOperator");if(c_optype!=
null)c_optype=c_optype.toLowerCase();c_opvalue1=getattr(o.parentNode,"ValidationValue1");c_opvalue2=getattr(o.parentNode,"ValidationValue2");c_msg=getattr(o.parentNode,"inputmsg");c_validation_inputtitle=getattr(o.parentNode,"inputtitle")}if(cvalue!=null&&cvalue!="")tip=cvalue;else tip=getlang().TipCellNoValue;if(cformula!=null)tip+="\n"+getlang().TipCellFormula+cformula;if(ctype!=null){if(ctype!="regex")tip+="\n"+getVTypeString(ctype);if(ctype=="regex"||cregex!=null)tip+="\n"+getlang().TipCellRegex+
cregex;if(ctype=="customstring")if(t=="TD")tip+="\n"+getattr(o,"vformula");else tip+="\n"+getattr(o.parentNode,"vformula");if(cisrequired)tip+="\n"+getlang().TipCellIsRequired}if(c_optype!=null&&ctype!="any"){if(ctype=="time"){if(c_opvalue1!=null)c_opvalue1=validatorConvert(c_opvalue1,ctype);if(c_opvalue2!=null)c_opvalue2=validatorConvert(c_opvalue2,ctype)}if(c_opvalue2==null&&c_optype=="between")c_optype="equal";tip+="\n"+getValidOPtypeTips(c_optype)+" "+c_opvalue1;if(c_opvalue2!=null)tip+=" and "+
c_opvalue2}if(c_msg!=null){tip+="\n"+c_msg;this.createtip(o,"imsg")}}var cmnt;if(t=="TD")cmnt=getattr(o,"CMNT_NOTE");else cmnt=getattr(o.parentNode,"CMNT_NOTE");if(cmnt!=null){if(tip!="")tip+="\n";if(getattr(this,"disabletip")!="1")tip+=getlang().TipCellComment+cmnt;else tip+=cmnt;this.createtip(o,"tip")}if(tip!="")o.title=tip;else if(o.title!="")o.title="";if(getattr(o,"data")!=null)o.title+="\n"+getattr(o,"data");if(cmnt!=null||c_msg!=null)o.title=""}
function createtip(t,type){if(t.gridinstance==null)t.gridinstance=this;var div=null;if(t.tipdiv==null&&type=="tip"){var div=document.createElement("div");div.id=t.id+"_tip";t.tipdiv=div;t.parentNode.parentNode.parentNode.appendChild(div)}if(t.msgdiv==null&&type=="imsg"){var div=document.createElement("div");div.id=t.id+"_imsg";t.msgdiv=div;t.parentNode.parentNode.parentNode.appendChild(div)}if(div!=null){div.style.position="absolute";div.style.backgroundColor="cornsilk"}}
function insertafterfind(str,find,value){var index=str.indexOf(find);if(index>=0){index+=find.length;return str.substr(0,index)+value+str.substr(index)}else return str}
function showtip_cmnt(t,tip,w,h){t.tipdiv.style.display="block";t.tipdiv.style.left=t.offsetLeft+t.offsetWidth+20+"px";t.tipdiv.style.top=t.offsetTop-15+"px";t.tipdiv.style.width=w+"px";t.tipdiv.style.height=h+"px";t.tipdiv.style.wordWrap="break-word";t.tipdiv.innerHTML=insertafterfind(tip,"</Font>","<br>");t.tipdiv.style.zIndex=100;this.tipdiv=t.tipdiv}
function showtip_imsg(t,msg,title){var w=0;var h=0;var totalength=msg.length;var delt=Math.sqrt(900+4*42*140*totalength);var widthchars=Math.ceil((30+delt)/84)+1;if(title!=null)if(title.length*102/14+10>widthchars*84/14)widthchars=Math.ceil(title.length*102/84)+2;var heightchars=Math.ceil(totalength/widthchars)+1;if(title!=null)heightchars+=5;w=Math.ceil(widthchars*84/14)+10;h=w*0.7;var heightrequire=heightchars*14+10;h=Math.max(h,heightrequire);t.msgdiv.style.display="block";t.msgdiv.style.left=
t.offsetLeft+t.offsetWidth/2+"px";t.msgdiv.style.top=t.offsetTop+t.offsetHeight+20+"px";t.msgdiv.style.width=w+"px";t.msgdiv.style.height=h+"px";t.msgdiv.style.wordWrap="break-word";t.msgdiv.style.margin="5px";msg="<span style='font-size:8px'>"+msg+"</span>";if(title!=null)t.msgdiv.innerHTML="<span style='font-weight:bold;font-size:8px'>"+title+"</span><br>"+msg;else t.msgdiv.innerHTML=msg;t.msgdiv.style.zIndex=100;this.msgdiv=t.msgdiv}
function hidetip(){if(this.tipdiv!=null)this.tipdiv.style.display="none";if(this.msgdiv!=null)this.msgdiv.style.display="none"}function showtipf(t){var gridinstance=t.gridinstance;if(gridinstance!=null){var cmnthtml=getattr(t,"CMNT_HTML");if(cmnthtml!=null){var note=HTMLDecode(cmnthtml).ESCAPE_BACK();gridinstance.showtip_cmnt(t,note,getattr(t,"CMNT_W"),getattr(t,"CMNT_H"))}var imsg=getattr(t,"inputmsg");if(imsg!=null)gridinstance.showtip_imsg(t,imsg,getattr(t,"inputtitle"))}}
function hidetipf(t){var gridinstance=t.gridinstance;if(gridinstance!=null)gridinstance.hidetip()}
function getValidOPtypeTips(voptype){var ret="";switch(voptype){case "between":ret=getlang().valid_op_between;break;case "notbetween":ret=getlang().valid_op_notbetween;break;case "equal":ret=getlang().valid_op_equal;break;case "notequal":ret=getlang().valid_op_notequal;break;case "lessthan":ret=getlang().valid_op_lessthan;break;case "lessorequal":ret=getlang().valid_op_lessorequal;break;case "greaterthan":ret=getlang().valid_op_greaterthan;break;case "greaterorequal":ret=getlang().valid_op_greaterorequal;
break}return ret}
function postBack(cmd,cancelEdit){if(window.acwFindReplaceDialog!=null){window.acwFindReplaceDialog.close();window.acwFindReplaceDialog=null}if(!this.mOnSubmit(cmd,cancelEdit))return false;var loadasync=cmd=="ASYNC";if(this.editmode){this.updateData(cancelEdit,cmd);if(!cancelEdit&&this.forcevalid=="1"&&needValidateall&&!this.validateAll())return false}else this.updateData(true,cmd);if(cmd!=null){var ajxpath=!loadasync?this.ajaxcallpath:this.asynccallpath;if(ajxpath!=null&&cmd!="SAVE"){this.eventBtn.acwEventData=cmd;
var gridweb=this;this.ajaxtimeout=setTimeout(function(){gridweb.gridajaxupdate(ajxpath)},0)}else{this.eventBtn.acwEventData=cmd;if(ie&&iemv<9)this.eventBtn.fireEvent("onclick",event);else{var evt=document.createEvent("HTMLEvents");evt.initEvent("click",true,true);this.eventBtn.dispatchEvent(evt)}}}this.showloadingbox();return true}
function showloadingbox(){if(getattr(this,"showload")=="1"&&this.loadingBox!=null){var showloadposition=getattr(this,"showloadposition");if(showloadposition!=null&&showloadposition.length>0){var positions=showloadposition.split(",");if(positions.length==2){this.loadingBox.style.left=positions[0]+"px";this.loadingBox.style.top=positions[1]+"px"}}this.loadingBox.style.display="block";this.blockcover.style.display="block"}}
function hideloadingbox(){if(this.loadingBox!=null){this.loadingBox.style.display="none";this.blockcover.style.display="none"}}function VscrollEndHandler(){if(this.vsBar.scrollTop==0)this.viewPanel.scrollTop=0;if(this.async)if(this.vscontentheight!=null&&this.vscontentheight-(this.vsBar.scrollTop+parseInt(this.vsBar.style.height))<=2)this.reachmax=true;else this.reachmax=false;if(Number(getattr(this,"viewtop"))==this.vsBar.scrollTop)return;this.mOnVScroll();scrollTimeout=null}
function HscrollEndHandler(){if(Number(getattr(this,"viewleft"))==this.hsBar.scrollLeft){if(this.hsBar.scrollLeft==0)this.viewPanel.scrollLeft=0;return}this.mOnHScroll();scrollTimeout=null}function selectCell(o){this.selectCellBasic(o,true)}function selectCellNoadjust(o){this.selectCellBasic(o,false)}
function selectCellBasic(o,needadjust){var select=false;if(this.ActiveCell==null){this.enterSelect(o);select=true}else if(!(this.getCellRow(this.ActiveCell)==this.getCellRow(o)&&this.getCellColumn(this.ActiveCell)==this.getCellColumn(o))){if(this.getSpan(this.ActiveCell)!=null)this.endEdit(this.ActiveCell);this.endSelect();this.enterSelect(o);select=true}if(this.editmode&&getattr(o,"protected")!="1")this.enterEdit(o,false);if(needadjust)try{var panel=o.offsetParent.parentNode;var offsetParent=o.offsetParent;
var offsetLeftToBody=o.offsetLeft;var offsetTopToBody=o.offsetTop;do{offsetTopToBody+=offsetParent.offsetTop;offsetLeftToBody+=offsetParent.offsetLeft;offsetParent=offsetParent.offsetParent}while(offsetParent);if(panel.scrollLeft>o.offsetLeft)panel.scrollLeft=o.offsetLeft;else if(panel.scrollLeft+panel.clientWidth<o.offsetLeft+o.offsetWidth)panel.scrollLeft=o.offsetLeft+o.offsetWidth-panel.clientWidth;if(this.sBody.scrollLeft>offsetLeftToBody)this.sBody.scrollLeft=offsetLeftToBody;else if(this.sBody.scrollLeft+
this.sBody.clientWidth<offsetLeftToBody+o.offsetWidth)this.sBody.scrollLeft=offsetLeftToBody+o.offsetWidth-this.sBody.clientWidth;if(panel.scrollTop>o.offsetTop)panel.scrollTop=o.offsetTop;else if(panel.scrollTop+panel.clientHeight<o.offsetTop+o.offsetHeight)panel.scrollTop=o.offsetTop+o.offsetHeight-panel.clientHeight;if(this.sBody.scrollTop>offsetTopToBody-panel.scrollTop)this.sBody.scrollTop=offsetTopToBody-panel.scrollTop;else if(this.sBody.scrollTop+this.sBody.clientHeight<offsetTopToBody-panel.scrollTop+
o.offsetHeight)this.sBody.scrollTop=offsetTopToBody+o.offsetHeight-this.sBody.clientHeight;if(this.vsBar!=null){var topvalue=0;if(!this.async)topvalue=this.viewPanel.scrollTop;else{var asyncTop=(this.aminrow-this.minrow)*HCELL;if(this.asynctoprows!=null)asyncTop=this.asynctoprows*HCELL;topvalue=this.viewPanel.scrollTop+asyncTop}this.vsBarSetPosion(topvalue)}if(this.hsBar!=null){var leftvalue=0;if(!this.async)leftvalue=this.viewPanel.scrollLeft;else{var asyncLeft=(this.amincol-this.mincol)*WCELL;if(this.asynctopcols!=
null)asyncLeft=this.asynctopcols*WCELL;leftvalue=this.viewPanel.scrollLeft+asyncLeft}this.hsBarSetPosion(leftvalue)}}catch(ex){}var t=this.isCell(o);if(t!=null&&(o.title==null||o.title==""))this.setCellTitle(o,t);if(select)this.mOnSelectCell(this.ActiveCell);if(this.previClickedCell!=null&&this.previClickedCell.nextSibling==null&&o.nextSibling!=null&&this.scrolledFlg)this.topPanel.scrollLeft-=this.currentIMGWidth;if(this.viewPanel!=null&&this.scrolledFlg&&(!this.dropdownListLoadedFlg||this.leftKeyPressedFlg))if(o.nextSibling!=
null)this.viewPanel.scrollLeft-=this.currentIMGWidth;else this.topPanel.scrollLeft-=this.currentIMGWidth;this.scrolledFlg=false;if(this.viewPanel!=null&&this.dropdownListLoadedFlg&&!this.leftKeyPressedFlg){var p=o;var clientX=0;while(p){clientX+=p.offsetLeft;p=p.offsetParent}if(!this.activateNextOrPreviCellFlg&&clientX+this.ActiveCell.scrollWidth>=this.viewPanel.clientWidth+this.viewPanel.offsetLeft){this.viewPanel.scrollLeft+=this.currentIMGWidth;this.scrolledFlg=true}var f=parseFloat(this.ActiveCell.currentStyle.borderLeftWidth);
if(isNaN(f))f=0;if(this.activateNextOrPreviCellFlg&&clientX+this.ActiveCell.scrollWidth+this.ActiveCell.clientWidth+f>=this.viewPanel.clientWidth+this.viewPanel.offsetLeft){this.viewPanel.scrollLeft+=this.currentIMGWidth;this.scrolledFlg=true}if(this.shiftAndTabKeyPressedFlg&&this.ActiveCell.offsetLeft>=this.viewPanel.clientWidth){this.viewPanel.scrollLeft+=this.currentIMGWidth;this.scrolledFlg=true}}this.previClickedCell=o;this.ActiveCell=o;current_cell=o;current_gridweb=this}
function vsBarSetPosion(tvalue){this.vsBar.onscroll=null;if(tvalue!=null)this.vsBar.scrollTop=tvalue;var gridweb=this;this.vsBar.onscroll=function(){if(scrollTimeout!=null)clearTimeout(scrollTimeout);scrollTimeout=setTimeout(function(){gridweb.VscrollEndHandler()},scrollendDelay)}}
function hsBarSetPosion(lvalue){this.hsBar.onscroll=null;if(lvalue!=null)this.hsBar.scrollLeft=lvalue;var gridweb=this;this.hsBar.onscroll=function(){if(scrollTimeout!=null)clearTimeout(scrollTimeout);scrollTimeout=setTimeout(function(){gridweb.HscrollEndHandler()},scrollendDelay)}}
function enterSelect(o){this.ActiveCell=o;this._selections.add(o);this.dropdownListLoadedFlg=false;this.dropdownListShowedFlg=false;this.selectedOptionVal=getInnerText(this.ActiveCell);this.ListMenu.clear();if(this.editmode&&getattr(o,"protected")!="1"&&(getattr(o,"vtype")=="list"||getattr(o,"vtype")=="flist")&&this.ListMenu!=null){var img=document.createElement("IMG");o.offsetParent.offsetParent.appendChild(img);img.id=this.id+"_DB";img.src=this.image_file_path+"dropdown.gif";img.title=getlang().TipListMenuButton;
img.style.position="absolute";img.style.top=o.offsetTop+"px";img.style.left=o.offsetLeft+o.offsetWidth+"px";this.ListMenu.menuContext=o;this.ListMenu.ismultiple=false;var lmnode=this.lmDoc.selectSingleNode("listmenus");var mnode=lmnode.selectSingleNode('menu[@id="'+getattr(o,"listmenu")+'"]');if(mnode!=null){var mv=mnode.getAttribute("value");this.ListMenu.loadItems(mv);this.ListMenu.addOKCancel();this.currentIMGWidth=img.width;this.dropdownListLoadedFlg=true}else;}if(this.editmode&&getattr(o,"protected")!=
"1"&&(getattr(o,"vtype")=="date"||getattr(o,"vtype")=="datetime")){var img=document.createElement("IMG");o.offsetParent.offsetParent.appendChild(img);img.id=this.id+"_DT";img.src=this.image_file_path+"dropdown.gif";img.title=getlang().TipCalendarButton;img.style.position="absolute";img.style.top=o.offsetTop+"px";img.style.left=o.offsetLeft+o.offsetWidth+"px"}try{var tmp_val_iem7=0;if(ie){var panel=o.offsetParent.parentNode;tmp_val_iem7=panel.scrollLeft;this.donotneedscroll=true}o.focus();if(ie){o.setActive();
var panel=o.offsetParent.parentNode;panel.scrollLeft=tmp_val_iem7;this.donotneedscroll=false}}catch(ex){}}
function enterEdit(o,fast,keyCode){var span=this.getSpan(o);if(span==null||!span.insideedit)this.fastEdit=fast;if(getattr(o,"vtype")!="checkbox")if(span==null){span=document.createElement("SPAN");span.id=this.id+"_AC";span.style.height=o.clientHeight+"px";span.style.width=o.clientWidth+"px";span.style.display="block";span.orgText=getInnerText(o);var chartimg=null;var otherchildnode=new Array;var firstspan=o.children[0];if(firstspan.className!=null)span.orgClass=firstspan.className;span.orgCellStyle=
getattr(firstspan,"style");chartimg=this.getchartimg(firstspan);for(var i=0;i<firstspan.children.length;i++)if(firstspan.children[i].hasAttributes())otherchildnode.push(firstspan.children[i]);o.removeChild(firstspan);o.appendChild(span);if(!ie){o.style.MozUserSelect="text";span.style.MozUserSelect="text"}if(getattr(o,"vtype")!="dlist"){span.style.overflowX="hidden";span.style.overflowY="auto";span.contentEditable=true;if(!fast)if(getattr(o,"formula")==null)if(getattr(o,"ufvbb")!=null&&this.ajaxcallpath!=
null)setInnerText(span,getattr(o,"ufvbb"));else if(getattr(o,"ufv")==null)setInnerText(span,span.orgText);else{var ufvvalue=getattr(o,"ufv");var decimalpoint=getattr(this,"decimalpoint");if(decimalpoint!=null)ufvvalue=ufvvalue.replace(".",decimalpoint);setInnerText(span,ufvvalue);var numbertype=getattr(o,"nt");if(numbertype!=null&&(numbertype=="9"||numbertype=="10")){var textvalue=span.innerText.trim();if(decimalpoint!=null)textvalue=textvalue.replace(decimalpoint,".");textvalue=Number(textvalue).mul(100).toString();
if(decimalpoint!=null)textvalue=textvalue.replace(".",decimalpoint);setInnerText(span,textvalue+"%");var len=span.innerText.length-1;setSelectionRange(span,len,len)}}else setInnerText(span,getattr(o,"formula"));if(otherchildnode.length>0)span.otherchildnode=otherchildnode}else{span.style.overflow="hidden";var select=document.createElement("SELECT");select.id=this.id+"_AS";if(!this.xhtmlmode)select.style.width=span.clientWidth+"px";else select.style.width=span.style.width;select.style.fontSize="9pt";
var lmnode=this.lmDoc.selectSingleNode("listmenus");var mnode=lmnode.selectSingleNode('menu[@id="'+getattr(o,"listmenu")+'"]');var mv=mnode.getAttribute("value");mv=mv.replace(/&lt;/g,"<").replace(/&gt;/g,">");this.xmlDoc1.loadXML(mv);var items=this.xmlDoc1.selectNodes("MENU/ITEM");var nosel=true;for(var i=0;i<items.length;i++){var item=items[i];var option=document.createElement("OPTION");option.text=item.getAttribute("TEXT");var ivalue=item.getAttribute("VALUE");if(ivalue!=null)option.value=ivalue;
else option.value=option.text;select.options.add(option);if(nosel&&(span.orgText==option.value||getattr(o,"ufv")==option.value||getattr(o,"formula")==option.value)){nosel=false;select.selectedIndex=select.options.length-1}}span.appendChild(select)}}if(!focusinside&&this.fastEdit&&keyCode!=null&&span.istypefirsttime==null){setInnerText(span,"");span.istypefirsttime=true}try{var originleft=this.viewPanel.scrollLeft;var origintop=this.viewPanel.scrollTop;if((focusinside&&!fast||fast)&&(!ie||ie&&!this.refreshdataviewing))span.focus();
this.viewPanel.scrollLeft=originleft;this.viewPanel.scrollTop=origintop}catch(ex){}if(this.fastEdit&&firefox&&!span.insideedit){span.insideedit=true;if(keyCode!=null)sendkeys(span,String.fromCharCode(keyCode))}else span.insideedit=true;if(this.fastEdit&&span.innerText==""){var numbertype=getattr(o,"nt");if(numbertype!=null&&(numbertype=="9"||numbertype=="10")){setInnerText(span,"%");setSelectionRange(span,0,0)}}}
function endSelect(){if(this.ActiveCell!=null){var o=this.ActiveCell;if(this.editmode&&getattr(o,"protected")!="1"&&(getattr(o,"vtype")=="list"||getattr(o,"vtype")=="flist")&&this.ListMenu!=null){var img=document.getElementById(this.id+"_DB");if(img!=null)img.parentNode.removeChild(img)}if(this.editmode&&getattr(o,"protected")!="1"&&(getattr(o,"vtype")=="date"||getattr(o,"vtype")=="datetime")){var img=document.getElementById(this.id+"_DT");if(img!=null)img.parentNode.removeChild(img)}var sel=this.ActiveCell;
this.ActiveCell=null;this.mOnUnselectCell(sel)}}
function setCellActive(o){if(this.ActiveCell!=null&&this.getSpan(this.ActiveCell)!=null)this.endEdit(this.ActiveCell);this.endSelect();this.enterSelect(o);try{var panel=o.offsetParent.parentNode;var offsetParent=o.offsetParent;var offsetLeftToBody=o.offsetLeft;var offsetTopToBody=o.offsetTop;do{offsetTopToBody+=offsetParent.offsetTop;offsetLeftToBody+=offsetParent.offsetLeft;offsetParent=offsetParent.offsetParent}while(offsetParent);if(panel.scrollLeft>o.offsetLeft)panel.scrollLeft=o.offsetLeft;else if(panel.scrollLeft+
panel.clientWidth<o.offsetLeft+o.offsetWidth)panel.scrollLeft=o.offsetLeft+o.offsetWidth-panel.clientWidth;if(this.sBody.scrollLeft>offsetLeftToBody)this.sBody.scrollLeft=offsetLeftToBody;else if(this.sBody.scrollLeft+this.sBody.clientWidth<offsetLeftToBody+o.offsetWidth)this.sBody.scrollLeft=offsetLeftToBody+o.offsetWidth-this.sBody.clientWidth;if(panel.scrollTop>o.offsetTop)panel.scrollTop=o.offsetTop;else if(panel.scrollTop+panel.clientHeight<o.offsetTop+o.offsetHeight)panel.scrollTop=o.offsetTop+
o.offsetHeight-panel.clientHeight;if(this.sBody.scrollTop>offsetTopToBody-panel.scrollTop)this.sBody.scrollTop=offsetTopToBody-panel.scrollTop;else if(this.sBody.scrollTop+this.sBody.clientHeight<offsetTopToBody-panel.scrollTop+o.offsetHeight)this.sBody.scrollTop=offsetTopToBody+o.offsetHeight-this.sBody.clientHeight;if(this.vsBar!=null){this.vsBar.onscroll=null;if(!this.async)this.vsBar.scrollTop=this.viewPanel.scrollTop;else{var asyncTop=(this.aminrow-this.minrow)*HCELL;if(this.asynctoprows!=null)asyncTop=
this.asynctoprows*HCELL;this.vsBar.scrollTop=this.viewPanel.scrollTop+asyncTop}var gridweb=this;this.vsBar.onscroll=function(){if(scrollTimeout!=null)clearTimeout(scrollTimeout);scrollTimeout=setTimeout(function(){gridweb.VscrollEndHandler()},scrollendDelay)}}}catch(ex){}var t=this.isCell(o);if(t!=null&&(o.title==null||o.title==""))this.setCellTitle(o,t);this.mOnSelectCell(this.ActiveCell);if(this.viewPanel!=null&&this.scrolledFlg&&(!this.dropdownListLoadedFlg||this.leftKeyPressedFlg))this.viewPanel.scrollLeft-=
this.currentIMGWidth;this.scrolledFlg=false;if(this.viewPanel!=null&&this.dropdownListLoadedFlg&&!this.leftKeyPressedFlg){var p=o;var clientX=0;while(p){clientX+=p.offsetLeft;p=p.offsetParent}if(!this.activateNextOrPreviCellFlg&&clientX+this.ActiveCell.scrollWidth>=this.viewPanel.clientWidth+this.viewPanel.offsetLeft){this.viewPanel.scrollLeft+=this.currentIMGWidth;this.scrolledFlg=true}var f=parseFloat(this.ActiveCell.currentStyle.borderLeftWidth);if(isNaN(f))f=0;if(this.activateNextOrPreviCellFlg&&
clientX+this.ActiveCell.scrollWidth+this.ActiveCell.clientWidth+f>=this.viewPanel.clientWidth+this.viewPanel.offsetLeft){this.viewPanel.scrollLeft+=this.currentIMGWidth;this.scrolledFlg=true}if(this.shiftAndTabKeyPressedFlg&&this.ActiveCell.offsetLeft>=this.viewPanel.clientWidth){this.viewPanel.scrollLeft+=this.currentIMGWidth;this.scrolledFlg=true}}}
function gotoACWCell(gridId,link){var g=document.getElementById(gridId);var url=getattr(link,"url");if(url.indexOf("!")>0){var edata="TAB:"+url;g.postBack(edata,false);g.clearAsyncCache()}else{var pos=url.split("#");var r=Number(pos[1]);var c=Number(pos[0]);g.setActiveCell(r,c)}}function getSpan(o){var s=document.getElementById(this.id+"_AC");if(s!=null&&s.parentNode==o)return s;else return null}function getO(o){var s=this.getSpan(o);return s!=null?s:o}
function ajaxupdate(s){if(this.ajaxXmlHttp==null){this.ajaxtimeout=null;if(this.vmark.value=="TRUE"||!this.forcevalid||this.forcevalid=="1"&&(!needValidateall||needValidateall&&this.validateAll()))this.ajaxcall(s)}else{var gridweb=this;this.ajaxtimeout=setTimeout(function(){gridweb.ajaxupdate()},1E3)}}
function ajaxcall(str){var xmlstr=null;if(str!=null)xmlstr=str;else{xmlstr="<data><CELLS>";for(var i=0;i<this.pendingNodes.length;i++){var node=this.pendingNodes[i];xmlstr+=node.xml}this.pendingNodes.length=0;xmlstr+="</CELLS></data>"}xmlstr=encodeURIComponent(HTMLEncode(xmlstr));var content=this.xmlData.name+"="+xmlstr;if(ie)try{this.ajaxXmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(ex){}else this.ajaxXmlHttp=new window.XMLHttpRequest;if(!java_client)this.ajaxXmlHttp.open("POST",this.ajaxcallpath+
"?gid="+this.id,true);else this.ajaxXmlHttp.open("POST",this.ajaxcallpath+"&gid="+this.id+"&gridwebuniqueid="+this.webuniqueid,true);this.ajaxXmlHttp.setRequestHeader("content-type","application/x-www-form-urlencoded");var gridweb=this;this.ajaxXmlHttp.onreadystatechange=function(){gridweb.ajaxcallback()};this.ajaxXmlHttp.send(content);var xnode;xnode=this.xmlDoc.selectSingleNode("data/CELLS");if(xnode!=null)while(xnode.hasChildNodes())xnode.removeChild(xnode.getLastChild());xnode=this.xmlDoc.selectSingleNode("data/SIZES");
if(xnode!=null)while(xnode.hasChildNodes())xnode.removeChild(xnode.getLastChild());var img=document.getElementById(this.id+"_UPDATING");if(img==null){img=document.createElement("IMG");img.id=this.id+"_UPDATING";img.src=this.image_file_path+"updating.gif";img.style.position="absolute";img.style.left=this.offsetWidth-20+"px";img.style.top=this.getClientPageHeight()-20+"px";img.style.width=16+"px";img.style.height=16+"px";this.appendChild(img)}img.style.display="block";this.ajaxsendtimeout=setTimeout(function(){gridweb.ajaxsendfail()},
3E4)}
function ajaxcallback_onselectcell(){if(typeof this.onacwselectcellajaxcallback=="function"&&this.ajaxXmlHttp!=null&&this.ajaxXmlHttp.readyState==4){if(this.ajaxsendtimeout!=null){clearTimeout(this.ajaxsendtimeout);this.ajaxsendtimeout=null}var adoc=this.ajaxXmlHttp.responseXML;var nodes=adoc.selectNodes("CELLS/CELL");for(var i=0;i<nodes.length;i++){var node=nodes[i];var cell=this.getCell(node.getAttribute("R"),node.getAttribute("C"));if(cell!=null){var customerdata=node.getAttribute("CUSTOMER");if(customerdata!=
null)this.mOnSelectCellAjaxCallBack(cell,customerdata)}}this.ajaxXmlHttp=null}}function findColorProperty(selector){rules=document.styleSheets[0].cssRules;for(i in rules)if(rules[i].selectorText==selector)return rules[i].style.color;return false}function getOrientation255String(a){var sb="";for(var i=0;i<a.length;i++)sb+=a.charAt(i)+"<br>";return sb}
function ajaxcallback(){if(this.ajaxXmlHttp!=null&&this.ajaxXmlHttp.readyState==4){if(this.ajaxsendtimeout!=null){clearTimeout(this.ajaxsendtimeout);this.ajaxsendtimeout=null}var adoc=this.ajaxXmlHttp.responseXML;var nodes=adoc.selectNodes("CELLS/CELL");var errnode=adoc.selectSingleNode("ERR");if(errnode!=null){if(errnode.getAttribute("R")!=null){var errcell=this.getCell(errnode.getAttribute("R"),errnode.getAttribute("C"));var errcellName=getCellName(errcell);this.setInvalid(errcell)}alert("error happens,please check the below info:\n"+
errnode.getAttribute("MSG"))}for(var i=0;i<nodes.length;i++){var node=nodes[i];var cell=this.getCell(node.getAttribute("R"),node.getAttribute("C"));if(cell!=null){var svalue=node.getAttribute("S");if(cell.getAttribute("orientation255")!=null){cell.setAttribute("ufv",svalue);svalue=getOrientation255String(svalue)}this.editCell2(cell,svalue);if(cell.setLastText){cell.setLastText=true;cell.lastText=node.getAttribute("S")}var f=node.getAttribute("F");if(f!=null){cell.setAttribute("formula",f);if(cell.getAttribute("resultValue")!=
null)cell.setAttribute("resultValue",node.getAttribute("S"))}else if(node.getAttribute("V")!=null)cell.setAttribute("ufv",node.getAttribute("V"));var ufvbb=node.getAttribute("ufvbb");if(ufvbb!=null)cell.setAttribute("ufvbb",ufvbb);var numbertype=node.getAttribute("nt");if(numbertype!=null)cell.setAttribute("nt",numbertype);var color=node.getAttribute("CL");if(color!=null){var childspan=cell.childNodes[0];if(childspan!=null&&childspan.style!=null)childspan.style.color=color}var color=node.getAttribute("BACKCL");
if(color!=null){var childspan=cell.childNodes[0];if(childspan!=null)childspan.style.backgroundColor=color;if(color==""){color="rgba(0,0,0,0)";if(ie&&iemv==8)color="rgb(255,255,255)"}cell.style.backgroundColor=color}var comment=node.getAttribute("CMNT_NOTE");if(comment!=null){cell.setAttribute("CMNT_NOTE",comment);cell.setAttribute("CMNT_AUTHOR",node.getAttribute("CMNT_AUTHOR"));cell.setAttribute("CMNT_VISIBLE",node.getAttribute("CMNT_VISIBLE"));cell.setAttribute("CMNT_HTML",node.getAttribute("CMNT_HTML"));
cell.setAttribute("CMNT_W",node.getAttribute("CMNT_W"));cell.setAttribute("CMNT_H",node.getAttribute("CMNT_H"));cell.setAttribute("onmouseover","showtipf(this)");cell.setAttribute("onmouseout","hidetipf(this)");var childspan=cell.childNodes[0];var childclass=childspan.getAttribute("class");if(childclass.indexOf("acwcmmnt")<0)childspan.setAttribute("class",childclass+" acwcmmnt")}else this.delcommentlocal(cell);var ha=node.getAttribute("HA");if(ha!=null)cell.setAttribute("align",ha=="l"?"left":"right");
setFontAjaxCallBack(node.getAttribute("FT"),cell);cell.title="";var isOriginal=false;if(this.ajaxupdatingcells!=null)for(var j=0;j<this.ajaxupdatingcells.length;j++){var origin=this.ajaxupdatingcells[j];if(origin.id==cell.id){isOriginal=true;break}}this.mOnCellUpdated(cell,isOriginal)}}var nodeids=adoc.selectNodes("CELLS/CHARTIDS");if(nodeids!=null&&nodeids.length>0){var ids=nodeids[0].getAttribute("IDS");var d=(new Date).getTime();var idlist=ids.split(",");var chart=new Array;for(i=0;i<idlist.length;i++){chart[i]=
document.getElementById(idlist[i]);this.addImagePreLoadingGif(chart,d,i,false)}}this.ajaxupdatingcells=null;var gridweb=this;if(typeof this.onajaxcallfinished=="function")this.onajaxcallfinished();setTimeout(function(){gridweb.ajaxcallback2()},200)}}
function setFontAjaxCallBack(ft,cell){if(ft!=null){var ftoptions=ft.split("|");cell.style.fontStyle=ftoptions[0]=="1"?"italic":"normal";cell.style.fontWeight=ftoptions[1]=="1"?"bold":"normal";if(ftoptions[2]=="0")if(ftoptions[3]=="0")cell.style.textDecoration="none";else cell.style.textDecoration="underline";else if(ftoptions[3]=="0")cell.style.textDecoration="line-through";else cell.style.textDecoration="underline line-through";cell.style.fontSize=ftoptions[4];cell.style.fontFamily=ftoptions[5]}}
function ajaxcallback2(){if(this.ajaxXmlHttp!=null){this.ajaxXmlHttp.onreadystatechange=function(){};this.ajaxXmlHttp=null}if(inajaxupdating){inajaxupdating=false;if(afterajaxaction!=null){this.postBack(afterajaxaction,false);afterajaxaction=null}}var img=document.getElementById(this.id+"_UPDATING");img.style.display="none"}
function ajaxsendfail(){this.ajaxsendtimeout=null;if(this.ajaxXmlHttp!=null){this.ajaxXmlHttp.onreadystatechange=function(){};this.ajaxXmlHttp.abort();this.ajaxXmlHttp=null}if(inajaxupdating){inajaxupdating=false;afterajaxaction=null}var img=document.getElementById(this.id+"_UPDATING");img.style.display="none"}
function gridajaxupdate(ajxpath){if(this.ajaxXmlHttp==null){this.ajaxtimeout=null;this.gridajaxcall(ajxpath)}else{var gridweb=this;this.ajaxtimeout=setTimeout(function(){gridweb.gridajaxupdate(ajxpath)},1E3)}}
function gridajaxcall(ajxpath){var cmd=encodeURIComponent(HTMLEncode(this.eventBtn.acwEventData));var content=this.xmlData.name+"="+encodeURIComponent(this.xmlData.value);if(ie)try{this.ajaxXmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(ex){}else this.ajaxXmlHttp=new window.XMLHttpRequest;if(!java_client)this.ajaxXmlHttp.open("POST",ajxpath+"?gid="+this.id+"&cmd="+cmd+"&vmark="+this.vmark.value,true);else this.ajaxXmlHttp.open("POST",ajxpath+"&gid="+this.id+"&cmd="+cmd+"&vmark="+this.vmark.value+
"&gridwebuniqueid="+this.webuniqueid,true);this.ajaxXmlHttp.setRequestHeader("content-type","application/x-www-form-urlencoded");var gridweb=this;this.ajaxXmlHttp.onreadystatechange=function(){gridweb.gridajaxcallback()};this.ajaxXmlHttp.send(content);this.ajaxsendtimeout=setTimeout(function(){gridweb.gridajaxsendfail()},3E4)}
function ajaxcall_onselectcell_start(ajxpath){if(this.ajaxXmlHttp==null){this.ajaxtimeout=null;this.ajaxcall_onselectcell(ajxpath)}else{var gridweb=this;this.ajaxtimeout=setTimeout(function(){gridweb.ajaxcall_onselectcell_start(ajxpath)},1E3)}}
function ajaxcall_onselectcell(ajxpath){var cmd=encodeURIComponent(HTMLEncode(this.eventBtn.acwEventData));var content=this.xmlData.name+"="+encodeURIComponent(this.xmlData.value);if(ie)try{this.ajaxXmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(ex){}else this.ajaxXmlHttp=new window.XMLHttpRequest;if(this.eventBtn.acwEventValue!=null){var eventvalue=encodeURIComponent(HTMLEncode(this.eventBtn.acwEventValue));if(!java_client)this.ajaxXmlHttp.open("POST",ajxpath+"?gid="+this.id+"&customercmd="+
cmd+"&vmark="+this.vmark.value+"&customervalue="+eventvalue,true);else this.ajaxXmlHttp.open("POST",ajxpath+"&gid="+this.id+"&customercmd="+cmd+"&vmark="+this.vmark.value+"&customervalue="+eventvalue+"&gridwebuniqueid="+this.webuniqueid,true);this.ajaxXmlHttp.setRequestHeader("content-type","application/x-www-form-urlencoded");var gridweb=this;this.ajaxXmlHttp.onreadystatechange=function(){gridweb.ajaxcallback_onselectcell()};this.ajaxXmlHttp.send(content);this.ajaxsendtimeout=setTimeout(function(){gridweb.gridajaxsendfail()},
3E4)}}function callgridajaxcallback2(){var gridweb=this;setTimeout(function(){gridweb.gridajaxcallback2()},200)}
function gridajaxcallback(){ajaxgoon=true;if(this.ajaxXmlHttp!=null&&this.ajaxXmlHttp.readyState==4){if(this.ajaxsendtimeout!=null){clearTimeout(this.ajaxsendtimeout);this.ajaxsendtimeout=null}var text=this.ajaxXmlHttp.responseText;text=ltabremove(text);if(text.indexOf('<style id="Style'+this.id+'">')==0){if(this.Calendar!=null&&this.Calendar.parentNode!=null)this.Calendar.parentNode.removeChild(this.Calendar);var id=this.id;var w=this.style.width;var h=this.style.height;var styleEnd=text.indexOf("</style>");
var styleHtml=text.substring(text.indexOf(">")+1,styleEnd-1);var elementHtml=text.substr(styleEnd+"</style>".length);this.gridajaxupdateStyles(styleHtml);try{if(this.parentNode){if(this.async&&enableasynccache&&(asyncbeforepostpredata!=null||asyncbeforepostafterdata!=null)){ajaxgoon=false;var needrenderviewtable10=this.viewTable10!=null&&this.viewTable10.children.length>1;var ret=this.parseRespWebHTML(this.id,elementHtml,styleHtml,needrenderviewtable10);if(asyncbeforepostpredata!=null){ret.headstr=
asyncbeforepostpredata.headstr+ret.headstr;ret.contentstr=asyncbeforepostpredata.contentstr+ret.contentstr;ret.stylestr=mergestyle(asyncbeforepostpredata.stylestr,ret.stylestr);if(needrenderviewtable10)ret.contentstr10=asyncbeforepostpredata.contentstr10+ret.contentstr10;asyncbeforepostpredata=null}if(asyncbeforepostafterdata!=null){ret.headstr+=asyncbeforepostafterdata.headstr;ret.contentstr+=asyncbeforepostafterdata.contentstr;ret.stylestr=mergestyle(ret.stylestr,asyncbeforepostafterdata.stylestr);
if(needrenderviewtable10)ret.contentstr10+=asyncbeforepostafterdata.contentstr10;asyncbeforepostafterdata=null}this.refreshdataview(ret);this.callgridajaxcallback2();return false}this.outerHTML=elementHtml}}catch(e){}if(!ajaxgoon)return;var g=document.getElementById(id);g.style.width=w;g.style.height=h;var scriptStartTag='<script type="text/javascript" language="javascript">';var scriptEndTag="<\/script>";var scriptStart=elementHtml.lastIndexOf(scriptStartTag);var scriptEnd=elementHtml.lastIndexOf(scriptEndTag);
var initScript=elementHtml.substring(scriptStart+scriptStartTag.length+1,scriptEnd-1);gridwebinstance.remove(this.id);if(!firefox)eval(initScript);var messageStartTag="<DIV style='display:none' id='message'>";var messageEndTag="</DIV>";var messageStart=elementHtml.lastIndexOf(messageStartTag);var messageEnd=elementHtml.lastIndexOf(messageEndTag);if(messageStart>0&&messageEnd>0){var message=elementHtml.substring(messageStart+messageStartTag.length,messageEnd);alert(message)}}this.callgridajaxcallback2()}}
function gridajaxcallback2(){if(this.ajaxXmlHttp!=null){this.ajaxXmlHttp.onreadystatechange=function(){};this.ajaxXmlHttp=null}this.hideloadingbox()}function gridajaxsendfail(){this.ajaxsendtimeout=null;if(this.ajaxXmlHttp!=null){this.ajaxXmlHttp.onreadystatechange=function(){};this.ajaxXmlHttp.abort();this.ajaxXmlHttp=null}this.hideloadingbox()}
function gridajaxupdateStyles(styleHtml){var sheet;var style=document.getElementById("Style"+this.id);if(style!=null)style.parentNode.removeChild(style);else{for(i=0;i<document.styleSheets.length;i++){sheet=document.styleSheets[i];if(sheet.title=="Style"+this.id)break}if(sheet!=null)while(sheet.rules.length>0)sheet.removeRule(0)}if(sheet==null)if(ie)if(iemv>8){sheet=document.createElement("style");sheet.setAttribute("id","Style"+this.id);document.getElementsByTagName("head")[0].appendChild(sheet);
sheet=getStyleSheetObject(this.id)}else{sheet=document.createStyleSheet();sheet.title="Style"+this.id}else{style=document.createElement("style");style.type="text/css";style.id="Style"+this.id;document.getElementsByTagName("head").item(0).appendChild(style);style.appendChild(document.createTextNode(styleHtml));document.body.BehaviorStyleSheet=null;return}if(sheet!=null){var rules=styleHtml.split("}");for(i=0;i<rules.length;i++){var rule=rules[i].split("{");if(rule.length==2)sheet.addRule(rule[0],rule[1])}}}
function getStyleSheetObject(id){for(i=0;i<document.styleSheets.length;i++){sheet=document.styleSheets[i];if(sheet.id=="Style"+id)return sheet}return null}function hideUpdatingImage(){var img=document.getElementById(this.id+"_UPDATING");img.style.display="none"}function requestFocusToGetCopyContentForPaste(){if(!ie){this.pastediv.style.display="block";this.pastediv.focus()}}
function doMyCopyAction(content){if(ie)window.clipboardData.setData("Text",content);else{current_copy_content=content;this.pastediv.value=content;this.pastediv.style.display="block";this.pastediv.focus();this.pastediv.select()}}
function doMyPasteAction(){if(ie)return formatCopyStringFromClipboard(window.clipboardData.getData("Text"));else{if(this.pastediv.value.length>0){this.pastediv.blur();current_copy_content=formatCopyStringFromClipboard(this.pastediv.value);this.pastediv.value="";this.pastediv.style.display="none"}return current_copy_content}}
function formatCopyStringFromClipboard(str){var inside=false;var mychar;var start=0;var end=0;var ret="";for(var i=0;i<str.length&&end<str.length;i++){mychar=str.charAt(i);if(mychar=='"')if(!inside){inside=true;if(i>start)ret+=str.substring(start,i);start=i+1;end=i+1;continue}else if(i+1<str.length&&str.charAt(i+1)=='"'){if(i>start)ret+=str.substring(start,i);ret+='"';start=i+2;end=i+2;i++}else{inside=false;if(i>start)ret+=str.substring(start,i);start=i+1;end=i+1}else if(mychar=="\t"){if(i>start)ret+=
str.substring(start,i);ret+=CELL_CONTENT_COL_DELIMITER;start=i+1;end=i+1}else if(mychar=="\n"&&!inside){if(i>start)ret+=str.substring(start,i);ret+=CELL_CONTENT_ROW_DELIMITER;start=i+1;end=i+1}else end++}if(end>start)ret+=str.substring(start,end).replace(/\n/g,CELL_CONTENT_ROW_DELIMITER).replace(/\t/g,CELL_CONTENT_COL_DELIMITER);if(ret.endsWith(CELL_CONTENT_ROW_DELIMITER))ret=ret.substring(0,ret.length-CELL_CONTENT_ROW_DELIMITER.length);return ret}
function converttoMSExcelCopyFormat(str){if(str.indexOf("\n")>-1)return'"'+str.replace(/"/g,'""')+'"';else return str.replace(/"/g,'""')}function mOnPasteEvent(e){alert(e.clipboardData)}function copy(o){this.CopyOrCut(o,false)}function cut(o){this.CopyOrCut(o,true)}
function CopyOrCut(o,isCut){if(this._selections.list.length==0){var o=this.getO(o);this.doMyCopyAction(getInnerText(o)+CELL_CONTENT_STYLE_DELIMITER+getattr(o,"class"));if(isCut)if(this.editmode&&getattr(o,"protected")!="1"&&getattr(o,"vtype")!="dlist")this.editCell(o,"")}else if(this._selections.list.length>1){alert("That command cannot be used on multiple selections.");return}else{var cptxt="";var range=this._selections.last();for(var r=range.startRow;r<=range.endRow;r++){if(r>range.startRow)cptxt+=
MSEXCEL_ROW_DELIMITER;for(var c=range.startCol;c<=range.endCol;c++){if(c>range.startCol)cptxt+=MSEXCEL_COL_DELIMITER;var cell=this.getCell(r,c);if(cell!=null){var o=this.getO(cell);if(getattr(o,"ufv")!=null)cptxt+=converttoMSExcelCopyFormat(getattr(o,"ufv"));else{var celltext=getInnerText(o);cptxt+=converttoMSExcelCopyFormat(celltext)}if(copy_with_style){setStylestr(o);cptxt+=CELL_CONTENT_FORMAT_DELIMITER+getattr(o,"class")+CELL_CONTENT_FORMAT_DELIMITER;cptxt+=replaceStyleColorAndBGColor(o)+CELL_CONTENT_FORMAT_DELIMITER+
o.styleStr;cptxt+=CELL_CONTENT_FORMAT_DELIMITER+addSeperateForAttributeFromarray(o,cell_attributes_array,CELL_CONTENT_SMALL_DELIMITER)}if(isCut)if(this.editmode&&getattr(cell,"protected")!="1"&&getattr(cell,"vtype")!="dlist")this.editCell(cell,"")}}}this.doMyCopyAction(cptxt)}}
function paste(o){var img=document.getElementById(this.id+"_UPDATING");if(img==null){img=document.createElement("IMG");img.id=this.id+"_UPDATING";img.src=this.image_file_path+"updating.gif";img.style.position="absolute";img.style.left=this.offsetWidth-20+"px";img.style.top=this.getClientPageHeight()-20+"px";img.style.width=16+"px";img.style.height=16+"px";this.appendChild(img)}img.style.display="block";this.pasteObject=o;var gridweb=this;this.requestFocusToGetCopyContentForPaste();setTimeout(function(){gridweb.doPaste()},
0)}function getDefaultStyle(el,styleProp){var camelize=function(str){return str.replace(/\-(\w)/g,function(str,letter){return letter.toUpperCase()})};if(el.currentStyle)return el.currentStyle[camelize(styleProp)];else if(document.defaultView&&document.defaultView.getComputedStyle)return document.defaultView.getComputedStyle(el,null).getPropertyValue(styleProp);else return el.style[camelize(styleProp)]}
function addSeperateForAttributeFromarray(o,ar,splitsymbol){var ret="";for(i=0;i<ar.length;i++){var attri=getattr(o,ar[i]);if(attri==null)attri="";if(i==0)ret=attri;else ret+=splitsymbol+attri}return ret}function setAttributeFromSeperatedStr(o,ar,splitsymbol,str){var attri_values=str.split(splitsymbol);for(i=0;i<attri_values.length;i++)if(attri_values[i]!="")o.setAttribute(ar[i],attri_values[i])}
function rgbToHex(color){if(color.substr(0,1)==="#")return color;if(chrome&&color=="rgba(0, 0, 0, 0)")return"";else if(color=="transparent"||color=="")return"";else if(ie&&color.substring(0,3)!="rgb")return color;try{var nums=/(.*?)rgb\((\d+),\s*(\d+),\s*(\d+)\)/i.exec(color),r=parseInt(nums[2],10).toString(16),g=parseInt(nums[3],10).toString(16),b=parseInt(nums[4],10).toString(16);return"#"+((r.length==1?r+"0":r)+(g.length==1?g+"0":g)+(b.length==1?b+"0":b))}catch(err){return color}}
function pxToPt(value_px){return Math.round(parseFloat(value_px.replace("px",""))*0.75)+"pt"}
function replaceStyleColorAndBGColor(o){var mystr=getattr(o,"style");var ret="";if(mystr.substring(0,6)=="color:")ret=mystr.replace(/(color[^;]+;)/i,"color:"+rgbToHex(o.orgColor)+";").replace(/(background-color[^;]+;)/i,"background-color:"+rgbToHex(o.orgBgColor)+";");else ret=mystr.replace(/ (color[^;]+;)/ig," color:"+rgbToHex(o.orgColor)+";").replace(/(background-color[^;]+;)/i,"background-color:"+rgbToHex(o.orgBgColor)+";");return ret}
function setStylestr(acell){acell.styleStr=getDefaultStyle(acell,"font-family");acell.styleStr+="|";var font_weight=getDefaultStyle(acell,"font-weight");if(getDefaultStyle(acell,"font-style")=="normal")if(font_weight=="normal"||font_weight=="400")acell.styleStr+="r|";else acell.styleStr+="b|";else if(font_weight=="normal"||font_weight=="400")acell.styleStr+="i|";else acell.styleStr+="ib|";if(ie)acell.styleStr+=getDefaultStyle(acell,"font-size")+"|";else acell.styleStr+=pxToPt(getDefaultStyle(acell,
"font-size"))+"|";acell.styleStr+=(getDefaultStyle(acell,"text-decoration")=="underline")+"|"+(getDefaultStyle(acell,"text-decoration")=="line-through")+"|";if(ie)acell.styleStr+=rgbToHex(acell.orgColor)+"|"+rgbToHex(acell.orgBgColor)+"|"+getDefaultStyle(acell,"text-align")+"|"+getDefaultStyle(acell,"vertical-align");else acell.styleStr+=rgbToHex(acell.orgColor)+"|"+rgbToHex(acell.orgBgColor)+"|"+getDefaultStyle(acell,"text-align").replace("-webkit-","").replace("-moz-","")+"|"+getDefaultStyle(acell,
"vertical-align");var borderstyle=getDefaultStyle(acell,"border-left-style");var bordersize=getDefaultStyle(acell,"border-left-width");if(borderstyle!="none"&&bordersize!="0px")acell.lbstr=bordersize+" "+borderstyle+" "+rgbToHex(getDefaultStyle(acell,"border-left-color"));borderstyle=getDefaultStyle(acell,"border-right-style");bordersize=getDefaultStyle(acell,"border-right-width");if(borderstyle!="none"&&bordersize!="0px")acell.rbstr=bordersize+" "+borderstyle+" "+rgbToHex(getDefaultStyle(acell,"border-right-color"));
borderstyle=getDefaultStyle(acell,"border-top-style");bordersize=getDefaultStyle(acell,"border-top-width");if(borderstyle!="none"&&bordersize!="0px")acell.tbstr=bordersize+" "+borderstyle+" "+rgbToHex(getDefaultStyle(acell,"border-top-color"));borderstyle=getDefaultStyle(acell,"border-bottom-style");bordersize=getDefaultStyle(acell,"border-bottom-width");if(borderstyle!="none"&&bordersize!="0px")acell.bbstr=bordersize+" "+borderstyle+" "+rgbToHex(getDefaultStyle(acell,"border-bottom-color"));acell.styleStr+=
"|"+(acell.tbstr!=null?acell.tbstr:"")+"|"+(acell.bbstr!=null?acell.bbstr:"")+"|"+(acell.lbstr!=null?acell.lbstr:"")+"|"+(acell.rbstr!=null?acell.rbstr:"")}
function copywithstyle(pcell,copycontent){var content_with_format=copycontent.split(CELL_CONTENT_FORMAT_DELIMITER);if(content_with_format.length==5){pcell.setAttribute("class",content_with_format[1]);pcell.setAttribute("style",content_with_format[2]);pcell.styleStr=content_with_format[3];setAttributeFromSeperatedStr(pcell,cell_attributes_array,CELL_CONTENT_SMALL_DELIMITER,content_with_format[4]);pcell.copycontentvalue=content_with_format[0];if(pcell.orgBgColor!=null)pcell.orgBgColor=pcell.style.backgroundColor;
if(pcell.orgColor!=null)pcell.orgColor=pcell.style.color}else pcell.copycontentvalue=copycontent}
function doPaste(){var o=this.pasteObject;if(this.editmode){var cptxt=this.doMyPasteAction();if(cptxt==null||cptxt.length==0){this.hideUpdatingImage();return}if(this._selections.list.length>1){alert("That command cannot be used on multiple selections.");this.hideUpdatingImage();return}var cprows=cptxt.split(CELL_CONTENT_ROW_DELIMITER);if(this.amaxrow-this.getActiveRow()+1<cprows.length){alert(getlang().TipPasteTooMuchRows);this.hideUpdatingImage();return}if(this._selections.list.length==0){var startxy=
o.id.substring(this.id.length+1,o.id.length).split("#");var startx=Number(startxy[0]);var starty=Number(startxy[1]);var celly=starty;for(var i=0;i<cprows.length;i++){var cprow=cprows[i];if(cprow!=null&&cprow.length>0){var cellx=startx;var cpcells=cprow.split(CELL_CONTENT_COL_DELIMITER);for(var j=0;j<cpcells.length;j++){var cellid=this.id+"_"+cellx+"#"+celly;var pcell=document.getElementById(cellid);if(pcell!=null&&getattr(pcell,"protected")!="1"&&getattr(pcell,"vtype")!="dlist")if(pcell.offsetWidth==
0)j--;else{copywithstyle(pcell,cpcells[j]);this.editCell(pcell,pcell.copycontentvalue)}cellx++}}celly++}}else{var range=this._selections.last();if(cprows.length==1){var cpcells0=cptxt.split(CELL_CONTENT_COL_DELIMITER);var r_endrow=range.endRow;var endcol=range.endCol;if(cpcells0.length>=endcol-range.startCol+1||(endcol-range.startCol+1)%cpcells0.length!=0){endcol=endcol+cpcells0.length-1;for(var r=range.startRow;r<=r_endrow;r++)for(var c=range.startCol;c<=endcol;c++){var cell=this.getCell(r,c);if(cell!=
null&&getattr(cell,"protected")!="1"&&getattr(cell,"vtype")!="dlist"){copywithstyle(cell,cpcells0[c-range.startCol]);this.editCell(cell,cell.copycontentvalue)}}}else for(var r=range.startRow;r<=r_endrow;r++)for(var c=range.startCol;c<=endcol;c++){var cell=this.getCell(r,c);if(cell!=null&&getattr(cell,"protected")!="1"&&getattr(cell,"vtype")!="dlist"){copywithstyle(cell,cpcells0[(c-range.startCol)%cpcells0.length]);this.editCell(cell,cell.copycontentvalue)}}}else{var minR=range.startRow;var minC=range.startCol;
var maxR=minR;var maxC=minC;var r=minR;for(var i=0;i<cprows.length;i++,r++){var c=range.startCol;var cprow=cprows[i];if(cprow!=null){var cpcells=cprow.split(CELL_CONTENT_COL_DELIMITER);for(var j=0;j<cpcells.length;j++,c++){var cell=this.getCell(r,c);if(cell!=null){maxR=r;maxC=c;if(getattr(cell,"protected")!="1"&&getattr(cell,"vtype")!="dlist"){copywithstyle(cell,cpcells[j]);this.editCell(cell,cell.copycontentvalue)}}}}}this.clearSelections();this.DragCell=this.getCell(minR,minC);this.DragEndCell=
this.getCell(maxR,maxC);this.doRangeSelect()}}}this.hideUpdatingImage()}function validateContent(){if(this.viewPanel==null||this.viewPanel.clientWidth==0)return false;return true}function doSelectShiftCellRange(currentCell,endCell){this.DragCell=currentCell;this.DragEndCell=endCell;this.doRangeSelect();this.mOnSelectCell(currentCell)}function recalculateCellColNumberOnCurrentCell(cell){if(cell==null)return;actualcolnumber=this.getCellColumn(cell)+1}
function recalculateCellRowNumberOnCurrentCell(cell){if(cell==null)return;actualrownumber=this.getCellRow(cell)+1}
function pressKeyGoUpOnCell(currentCell){var crow=this.getCellRow(currentCell);var ccol=this.getCellColumn(currentCell);var nextrow=crow-1;var nextcell=this.findLeftUpMostCell(nextrow,actualcolnumber-1);if(nextcell==null)return;var nextcol_right=this.getCellColumn(nextcell)+nextcell.colSpan-1;if(nextcol_right>=actualcolnumber-1)newcell=nextcell;else{ccol=this.getCellColumn(nextcell);crow=this.getCellRow(nextcell);var nextcolumn=ccol+nextcell.colSpan;newcell=this.findUpMostCell(crow,nextcolumn)}if(this.isCell(newcell)){this.activateNextOrPreviCellFlg=
true;this.selectCell(newcell);this.activateNextOrPreviCellFlg=false}this.recalculateCellRowNumberOnCurrentCell(newcell)}function pressKeyGoDownOnCell(currentCell){var crow=this.getCellRow(currentCell);var nextrow=crow+currentCell.rowSpan;newcell=this.findLeftMostCell(nextrow,actualcolnumber-1);if(this.isCell(newcell)){this.activateNextOrPreviCellFlg=true;this.selectCell(newcell);this.activateNextOrPreviCellFlg=false}this.recalculateCellRowNumberOnCurrentCell(newcell)}
function pressKeyGoRightOnCell(currentCell){var ccolumn=this.getCellColumn(currentCell);var nextcolumn=ccolumn+currentCell.colSpan;newcell=this.findUpMostCell(actualrownumber-1,nextcolumn);if(this.isCell(newcell)){this.activateNextOrPreviCellFlg=true;this.selectCell(newcell);this.activateNextOrPreviCellFlg=false}this.recalculateCellColNumberOnCurrentCell(newcell)}
function pressKeyGoLeftOnCell(currentCell){var ccolumn=this.getCellColumn(currentCell);var nextcolumn=ccolumn-1;var nextcell=this.findLeftUpMostCell(actualrownumber-1,nextcolumn);if(nextcell==null)return;var nextcol_right=this.getCellColumn(nextcell)+nextcell.colSpan-1;if(nextcol_right==ccolumn-1)newcell=nextcell;else{ccol=this.getCellColumn(nextcell);crow=this.getCellRow(nextcell);var nextcolumn=ccol+nextcell.colSpan;newcell=this.findUpMostCell(crow,nextcolumn)}if(this.isCell(newcell)){this.leftKeyPressedFlg=
true;this.selectCell(newcell);this.leftKeyPressedFlg=false}this.recalculateCellColNumberOnCurrentCell(newcell)}function findLeftMostCell(newrow,col){var colbundary=0;if(this.topTable0!=null){var lefttablecols=this.topTable0.rows[0].cells.length;if(col>=lefttablecols)colbundary=lefttablecols}var i=col;for(;i>=colbundary&&i>=this.amincol;i--){var o=document.getElementById(this.id+"_"+i+"#"+newrow);if(o!=null)return o}return null}
function findUpMostCell(row,newcol){var rowbundary=0;if(this.ltable0!=null){var toprows=this.ltable0.rows.length;if(row>=toprows)rowbundary=toprows}var i=row;for(;i>=rowbundary&&i>=this.aminrow;i--){var o=document.getElementById(this.id+"_"+newcol+"#"+i);if(o!=null)return o}return null}
function findLeftUpMostCell(newrow,col){var colbundary=0;if(this.topTable0!=null){var lefttablecols=this.topTable0.rows[0].cells.length;if(col>=lefttablecols)colbundary=lefttablecols}var rowbundary=0;if(this.ltable0!=null){var toprows=this.ltable0.rows.length;if(newrow>=toprows)rowbundary=toprows}var j=newrow;for(;j>=rowbundary&&j>=this.aminrow;j--){var i=col;for(;i>=colbundary&&i>=this.amincol;i--){var o=document.getElementById(this.id+"_"+i+"#"+j);if(o!=null)return o}}return null}
function findcurrentCell(row,col){var cell=this.findLeftUpMostCell(row,col);if(cell==null)return null;var nextcol=this.getCellColumn(cell)+cell.colSpan;if(nextcol-1<col)return this.findUpMostCell(row,nextcol);else return cell}function findDirectColumnNumberCell(newrow){var len=newrow.cells.length;var tempcolnumber=0;var i=0;for(;i<len;i++){tempcolnumber+=newrow.cells[i].colSpan;if(tempcolnumber>=actualcolnumber)return newrow.cells[i]}return null}
function ieTextEditEnterWay(){var selectText=document.selection.createRange();if(selectText){if(selectText.text.length>0)selectText.text+="\n";else selectText.text="\n";selectText.select()}}function getNextValidCell(currentCell){var nextCell=currentCell.nextSibling;if(nextCell==null||nextCell.clientWidth>0)return nextCell;else return this.getNextValidCell(nextCell)}
function getPreviousValidCell(currentCell){var previCell=currentCell.previousSibling;if(previCell==null||previCell.clientWidth>0)return previCell;else return this.getPreviousValidCell(previCell)}
function getUndersideValidRow(currentCell){var undersideRow=currentCell.parentNode.nextSibling;var f=0;if(undersideRow!=null&&undersideRow.tagName=="TR"){f=parseFloat(undersideRow.currentStyle.borderBottomWidth);if(isNaN(f))f=0}else return null;if(undersideRow==null||undersideRow.offsetHeight-f>0)return undersideRow;else return this.getUndersideValidRow(undersideRow.cells[currentCell.cellIndex])}
function getUpsideValidRow(currentCell){var upsideRow=currentCell.parentNode.previousSibling;var f=0;if(upsideRow!=null&&upsideRow.tagName=="TR"){f=parseFloat(upsideRow.currentStyle.borderBottomWidth);if(isNaN(f))f=0}else return null;if(upsideRow==null||upsideRow.offsetHeight-f>0)return upsideRow;else return this.getUpsideValidRow(upsideRow.cells[currentCell.cellIndex])}
function GetUpListItem(e){var row=document.getElementById(this.id+"_LMENU_ROW");if(row==null||this.ListMenu==null)return;var rows=row.parentNode.childNodes;if(rows==null||rows.length==0)return;var index=this.ListMenu.currIndex;if(index>0&&index<rows.length){rows[index].childNodes[0].style.backgroundColor="";index--}else index=0;this.ListMenu.currIndex=index;rows[index].childNodes[0].style.backgroundColor="";var item=rows[index].childNodes[0];item.style.backgroundColor="#A9D0F5";this.selectedOptionVal=
getInnerText(item);this.showDropDownList(e)}
function GetDownListItem(e){var row=document.getElementById(this.id+"_LMENU_ROW");if(row==null||this.ListMenu==null)return;var rows=row.parentNode.childNodes;if(rows==null||rows.length==0)return;var index=this.ListMenu.currIndex;if(index<0||index>=rows.length)index=0;else{rows[index].childNodes[0].style.backgroundColor="";index++;if(index==rows.length)index=rows.length-1}this.ListMenu.currIndex=index;rows[index].childNodes[0].style.backgroundColor="";var item=rows[index].childNodes[0];item.style.backgroundColor=
"#A9D0F5";this.selectedOptionVal=getInnerText(item);this.showDropDownList(e)}function isHeader(o){if(o==null)return null;if(o.tagName=="TD"&&o.id!=null)if(o.id.indexOf(this.id+"_@")==0)return"ROW";else if(o.id.indexOf(this.id+"_!")==0)return"COL";else if(o.id==this.id+"_FSTCELL")return"FSTCELL";else return null;else return null}
function setResizeCursor(e){this.ResizeIcon=false;var evt=new Event(e);var o=evt.getTarget();var offset=evt.getOffset();var parent=o;if(o.tagName=="SPAN"&&(o.className.indexOf("acwxc")>-1||o.className.indexOf("rotation")>-1))parent=o.parentNode;if(parent.vAlign!="bottom"||ie)o=parent;var otype=this.isHeader(parent);if(otype&&parent.unselectable!="on")parent.unselectable="on";switch(otype){case "ROW":y=offset.offsetY+o.clientTop;if(!this.Dragging&&y>=o.offsetHeight-3){o.style.cursor="row-resize";this.ResizeIcon=
true}else o.style.cursor="default";break;case "COL":x=offset.offsetX+o.clientLeft;if(!this.Dragging&&x>=o.offsetWidth-3){o.style.cursor="col-resize";this.ResizeIcon=true}else o.style.cursor="default";break}}
function resizeHeaderbar(e){var adj;if(this.xhtmlmode)adj=2;else adj=1;var evt=new Event(e);switch(this.resizeType){case "ROW":var row=this.ResizingHD.parentNode;dy=evt.e.clientY-this.StartY;if(this.StartHeight+dy<=0)dy=adj-this.StartHeight;if(dy==0||this.StartHeight+dy<=0)return;if(this.resizePanel==this.leftPanel){row.style.height=this.StartHeight+dy+"px";for(var i=0;i<row.cells.length;i++){var td=row.cells[i];adjustSpanCell(row,td)}var vrow=this.viewTable.rows[row.rowIndex];vrow.style.height=this.StartHeight+
dy+"px";adjustRowSpanCellByRow(this.viewTable.id,vrow,this);for(var i=0;i<vrow.cells.length;i++){var td=vrow.cells[i];adjustSpanCell(vrow,td)}if(this.viewTable10!=null){vrow=this.viewTable10.rows[row.rowIndex];vrow.style.height=this.StartHeight+dy+"px";adjustRowSpanCellByRow(this.viewTable10.id,vrow,this);for(var i=0;i<vrow.cells.length;i++){var td=vrow.cells[i];adjustSpanCell(vrow,td)}}}else{row.style.height=this.StartHeight+dy+"px";for(var i=0;i<row.cells.length;i++){var td=row.cells[i];adjustSpanCell(row,
td)}if(this.viewTable00!=null){var vrow=this.viewTable00.rows[row.rowIndex];vrow.style.height=this.StartHeight+dy+"px";adjustRowSpanCellByRow(this.viewTable00.id,vrow,this);for(var i=0;i<vrow.cells.length;i++){var td=vrow.cells[i];adjustSpanCell(vrow,td)}}if(this.viewTable01!=null){var vrow=this.viewTable01.rows[row.rowIndex];vrow.style.height=this.StartHeight+dy+"px";adjustRowSpanCellByRow(this.viewTable01.id,vrow,this);for(var i=0;i<vrow.cells.length;i++){var td=vrow.cells[i];adjustSpanCell(vrow,
td)}}}if(this.freeze)this.adjustSizes();this.mOnScroll();break;case "COL":dx=evt.e.clientX-this.StartX;if(this.StartWidth+dx<=0)dx=adj-this.StartWidth;if(this.resizePanel==this.topPanel){var nw=this.StartWidth+dx+"px";this.CD.style.width=nw;this.CD1.style.width=nw;if(this.CD0!=null)this.CD0.style.width=nw}else{var nw;if(dx<0||this.StartWidth1-dx>5)nw=this.StartWidth+dx+"px";else nw=this.StartWidth+"px";this.CD.style.width=nw;this.CD1.style.width=nw;this.CD0.style.width=nw}if(this.freeze)this.adjustSizes();
this.mOnScroll();this.adjustImageButton();break}}
function enterResize(e){var evt=new Event(e);this.ResizingHD=evt.getTarget();if(this.ResizingHD.tagName=="SPAN"&&(this.ResizingHD.className.indexOf("acwxc")>-1||this.ResizingHD.className.indexOf("rotation")>-1))this.ResizingHD=this.ResizingHD.parentNode;this.resizeType=this.isHeader(this.ResizingHD);this.resizePanel=this.ResizingHD.parentNode.parentNode.parentNode.parentNode;this.StartX=evt.e.clientX;this.StartY=evt.e.clientY;switch(this.resizeType){case "ROW":this.StartHeight=this.ResizingHD.parentNode.offsetHeight;
if(this.resizePanel!=this.leftPanel)this.StartHeight1=this.viewPanel.clientHeight;break;case "COL":this.CD=document.getElementById(this.ResizingHD.id+"C");if(ie)this.StartWidth=this.CD.style.pixelWidth;else if(chrome)this.StartWidth=add_px_or_pt(0,this.CD.style.width);else this.StartWidth=this.CD.offsetWidth;if(this.resizePanel==this.topPanel){this.CD0=document.getElementById(this.ResizingHD.id+"CD01");this.CD1=document.getElementById(this.ResizingHD.id+"CD")}else{this.StartWidth1=this.viewPanel.clientWidth;
this.CD0=document.getElementById(this.ResizingHD.id+"CD00");this.CD1=document.getElementById(this.ResizingHD.id+"CD10")}break}}
function endResize(){reSetDPI();if(this.editmode)switch(this.resizeType){case "ROW":var xnode;var xv;var id;xnode=this.xmlDoc.selectSingleNode("data/SIZES");id=this.ResizingHD.id.substr(this.id.length+2);xv=xnode.selectSingleNode('H[@ID="'+id+'"]');if(xv==null){xv=this.xmlDoc.createElement("H");xnode.appendChild(xv)}xv.setAttribute("ID",id);if(!this.xhtmlmode)xv.setAttribute("V",this.ResizingHD.offsetHeight*72/screen.deviceYDPI);else{var rh=this.ResizingHD.clientHeight*72/screen.deviceYDPI;if(rh==
0)rh=0.1;xv.setAttribute("V",rh)}break;case "COL":var xnode;var xv;var id;xnode=this.xmlDoc.selectSingleNode("data/SIZES");id=this.ResizingHD.id.substr(this.id.length+2);xv=xnode.selectSingleNode('W[@ID="'+id+'"]');if(xv==null){xv=this.xmlDoc.createElement("W");xnode.appendChild(xv)}xv.setAttribute("ID",this.ResizingHD.id.substr(this.id.length+2));if(!this.xhtmlmode)xv.setAttribute("V",this.ResizingHD.offsetWidth*72/screen.deviceXDPI);else{var cw=this.ResizingHD.clientWidth*72/screen.deviceXDPI;if(cw==
0)cw=0.1;xv.setAttribute("V",cw)}break}this.ResizingHD=null;this.adjustAsyncScrollBar();if(this.noscroll)this.adjustNoScroll()}
function updateSelect(need){var xnode;var xv;var id;xnode=this.xmlDoc.selectSingleNode("data/SELECT");while(xnode.hasChildNodes())xnode.removeChild(xnode.getFirstChild());if(need){if(this.ActiveCell!=null){id=this.ActiveCell.id.substring(this.id.length+1,this.ActiveCell.id.length);xv=this.xmlDoc.createElement("ACELL");xnode.appendChild(xv);xv.setAttribute("ID",id)}if(this.DragCell!=null&&this.DragEndCell!=null){id=this.DragCell.id.substring(this.id.length+1,this.DragCell.id.length);xv=this.xmlDoc.createElement("DCELL");
xnode.appendChild(xv);xv.setAttribute("ID",id);id=this.DragEndCell.id.substring(this.id.length+1,this.DragEndCell.id.length);xv=this.xmlDoc.createElement("DECELL");xnode.appendChild(xv);xv.setAttribute("ID",id);if(this._selections.list.length!=null){xv=this.xmlDoc.createElement("SCELLS");xnode.appendChild(xv);var str="";for(var i=0;i<this._selections.list.length;i++){var range=this._selections.list[i];str+=range.toString()+";"}xv.setAttribute("RANGES",str)}}}}
function updatePagePosition(need){var xnode;var xv;var id;xnode=this.xmlDoc.selectSingleNode("data/POSITION");while(xnode.hasChildNodes())xnode.removeChild(xnode.getFirstChild());xv=this.xmlDoc.createElement("BODYSCROLL");xnode.appendChild(xv);if(this.tabPanel!=null)xv.setAttribute("TLEFT",this.tabPanel.scrollLeft);xv.setAttribute("LEFT",this.sBody.scrollLeft);xv.setAttribute("TOP",this.sBody.scrollTop);if(this.async&&enableasynccache){this.setAttribute("bodyleft",xv.getAttribute("LEFT"));this.setAttribute("bodytop",
xv.getAttribute("TOP"));this.setAttribute("tableft",xv.getAttribute("TLEFT"))}if(need){xv.setAttribute("VLEFT",this.async&&this.hsBar!=null?this.hsBar.scrollLeft:this.viewPanel.scrollLeft);xv.setAttribute("VTOP",this.async&&this.vsBar!=null?this.vsBar.scrollTop:this.viewPanel.scrollTop);if(this.async&&enableasynccache){this.setAttribute("viewleft",xv.getAttribute("VLEFT"));this.setAttribute("viewtop",xv.getAttribute("VTOP"))}}else{xv.setAttribute("VLEFT",0);xv.setAttribute("VTOP",0);if(this.async&&
enableasynccache){this.setAttribute("viewleft",0);this.setAttribute("viewtop",0)}}}
function updateAsync(need){var xnode;xnode=this.xmlDoc.selectSingleNode("data/ASYNC");xnode.removeAttribute("RASYNCWEBSTART");xnode.removeAttribute("RASYNWEBEND");xnode.removeAttribute("RMIN");xnode.removeAttribute("RMAX");xnode.removeAttribute("CMIN");xnode.removeAttribute("CMAX");if(need){if(this.async){if(this.webstartrow!=null)xnode.setAttribute("RASYNCWEBSTART",this.webstartrow);else xnode.removeAttribute("RASYNCWEBSTART");if(this.webendrow!=null)xnode.setAttribute("RASYNWEBEND",this.webendrow);
else xnode.removeAttribute("RASYNWEBEND")}xnode.setAttribute("RMIN",this.aminrow);xnode.setAttribute("RMAX",this.amaxrow);xnode.setAttribute("CMIN",this.amincol);xnode.setAttribute("CMAX",this.amaxcol)}}
function refreshdataview(data){this.updateData(false,"ASYNC");document.getElementById(this.id+"_leftTab").children[1].innerHTML=data.headstr;document.getElementById(this.id+"_viewTable").children[1].innerHTML=data.contentstr;if(this.viewTable10!=null&&this.viewTable10.children.length>1&&data.contentstr10!=null)document.getElementById(this.id+"_viewTable10").children[1].innerHTML=data.contentstr10;if(data.stylestr.length==0)console.log("err in refreshdataview can't get style----\>"+data.stylestr.length);
this.gridajaxupdateStyles(data.stylestr);this.webstartrow=null;this.webendrow=null;asyncbeforepostpredata=null;asyncbeforepostafterdata=null;this.adjustBVScroll();this.activerow=lastactiverow;this.activecol=lastactivecol;this.refreshdataviewing=true;this.tryInitSetActiveCell();this.refreshdataviewing=false;if(this.row_v_info!=null)for(var rowid=this.aminrow;rowid<=this.amaxrow;rowid++){var display=this.row_v_info[rowid]?"block":"none";var row=this.getContentRowById(rowid);setRowDisplay(row,display);
row=this.getHeadRowById(rowid);setRowDisplay(row,display)}doIE7AsyncScrllBar(this)}var lastactiverow=null;var lastactivecol=null;var last_downmatch_row=null;var last_row_collapse_info=null;var last_row_v_info=null;var last_asyncrows=0;var last_direction=-1;var last_col_collapse_info=null;var last_col_v_info=null;var last_downmatch_col=null;var last_issummaryrowbelow=true;
function postAsyncH(aminrow,amaxrow,cancelEdit){if(this.vsTimeout!=null){clearTimeout(this.vsTimeout);this.vsTimeout=null}this.aminrow=aminrow;this.amaxrow=amaxrow;var is_asyncgrouprows=false;if(this.async&&enableasynccache){if(this.ActiveCell!=null){lastactiverow=this.getCellRow(this.ActiveCell);lastactivecol=this.getCellColumn(this.ActiveCell)}this.clearSelectionAsyncCache();is_asyncgrouprows=this.row_v_info!=null;put_row_data_in_cache(is_asyncgrouprows,this.id,this.amincol,haveanyupdate);if(is_asyncgrouprows)if(this.direction==
0)this.amaxrow=this.findNextMaxRow(aminrow,amaxrow);else this.aminrow=this.findNextMinRow(aminrow,amaxrow)}var needwebrequest=this.tryfindcachePrepare();if(needwebrequest){if(is_asyncgrouprows){last_downmatch_row=this.downmatch_row;last_row_collapse_info=this.row_collapse_info;last_row_v_info=this.row_v_info;last_direction=this.direction;last_issummaryrowbelow=this.issummaryrowbelow}last_asyncrows=this.asyncrows;this.postBack("ASYNC",cancelEdit)}}
function postAsyncW(amincol,amaxcol,cancelEdit){if(this.vsTimeout!=null){clearTimeout(this.vsTimeout);this.vsTimeout=null}var is_asyncgrouprows=false;if(this.async&&enableasynccache){if(this.ActiveCell!=null){lastactiverow=this.getCellRow(this.ActiveCell);lastactivecol=this.getCellColumn(this.ActiveCell)}this.clearSelectionAsyncCache();is_asyncgrouprows=this.row_v_info!=null;put_row_data_in_cache(is_asyncgrouprows,this.id,this.amincol,haveanyupdate);if(is_asyncgrouprows){last_downmatch_row=this.downmatch_row;
last_row_collapse_info=this.row_collapse_info;last_row_v_info=this.row_v_info;last_issummaryrowbelow=this.issummaryrowbelow}last_asyncrows=this.asyncrows}this.amincol=amincol;this.amaxcol=amaxcol;this.postBack("ASYNC",cancelEdit)}
function adjustImagePosition(o,left,top){var parenttd=null;if(o.parentNode!=null)parenttd=o.parentNode.parentNode;if(parenttd==null){setTimeout(function(){adjustImagePosition(o,left,top)},1E3);return}else;if(o.parentNode!=null){if(o.parentNode.style.height.replace(/(^[\\s]*)|([\\s]*$)/g,"")=="")o.parentNode.style.height=o.parentNode.parentNode.parentNode.style.height;if(ie&&iemv==6)o.parentNode.style.overflow="hidden";else o.parentNode.style.overflow="visible";var parent_left=parenttd.offsetLeft;
var parent_top=parenttd.offsetTop;left+=parent_left;top+=parent_top;o.style.position="absolute";o.style.left=left+"px";o.style.top=top+"px"}}
function setUpContrlScrollBar(o){var who=this;var parenttd=null;if(o.parentNode!=null)parenttd=o.parentNode.parentNode;if(parenttd==null){setTimeout(function(){who.setUpContrlScrollBar(o)},1E3);return}var controlinfo=o.getAttribute("ctlinfo");if(controlinfo==null)return;controlinfo="{"+controlinfo+"}";controlinfo=JSON.parse(controlinfo);$(o).slider({max:controlinfo.max,value:controlinfo.v,min:controlinfo.min,orientation:controlinfo.ish==1?"horizontal":"vertical",change:function(event,ui){who.setCellValue(controlinfo.row,
controlinfo.col,ui.value)},create:function(event,ui){},classes:{"ui-slider":"highlight"}});adjustImagePosition(o,controlinfo.l,controlinfo.t);var sliderhandl=$(o).find(".ui-slider-handle");if(controlinfo.ish==1)sliderhandl.height(add_px_or_pt(4,o.style.height));else sliderhandl.width(add_px_or_pt(4,o.style.width))}
function setUpContrlRadioButton(o){var who=this;var controlinfo=o.getAttribute("ctlinfo");if(controlinfo==null)return;controlinfo="{"+controlinfo+"}";controlinfo=JSON.parse(controlinfo);var radiospan=document.createElement("span");radiospan.style.position="inherit";radiospan.style.left="0";o.appendChild(radiospan);var radio=document.createElement("input");radio.type="radio";radio.name=controlinfo.name;radio.value=controlinfo.label;if(controlinfo.value==1)radio.checked="checked";radiospan.appendChild(radio);
radiospan.appendChild(document.createTextNode(controlinfo.label));$(radio).change(function(){if($(radio).is(":checked"))who.setCellValue(controlinfo.row,controlinfo.col,controlinfo.idx.toString())});adjustImagePosition(o,controlinfo.l,controlinfo.t)}
function fontDialog(o){if(this.editmode&&getattr(this,"stdb")=="1"&&(getattr(o,"protected")!="1"||this._selections.list.length>0)){var em=this.getSpan(o)!=null;var param;if(this._selections.list.length==0)param=o;else param=this._selections;if(ie){window.acwDialogWindow=window.showModalDialog(this.acw_client_path+"fontdlg.htm",param,"dialogWidth:430px; dialogHeight:520px; status:no;");this.fontdialognext(o,em)}else{window.acwDialogElement=this;window.operatecell=o;window.operatespan=em;window.acwDialogWindow=
window.open(this.acw_client_path+"fontdlg_l.htm","_blank","height=520,width=430,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no,modal=yes")}}}function fontdialogcallback(){window.acwDialogElement.fontdialognext(window.operatecell,window.operatespan)}
function fontdialognext(o,em){if(!em)if(this._selections.list.length==0){this.update(o);adjustSpanCell(o.parentNode,o)}else for(var i=0;i<this._selections.list.length;i++){var range=this._selections.list[i];for(var r=range.startRow;r<=range.endRow;r++)for(var c=range.startCol;c<=range.endCol;c++){var cell=this.getCell(r,c);if(cell!=null&&getattr(cell,"protected")!="1"){this.update(cell);adjustSpanCell(cell.parentNode,cell)}}}}function closeFontDialog(){}
function ajustLeftHeaderHeight(acell,row){var prefix=acell.id.substring(0,acell.id.lastIndexOf("_"));document.getElementById(prefix+"_$"+row).style.height=acell.parentElement.offsetHeight+"px"}
function showFindReplaceDlg(gridWeb,startCell,callType){if(window.acwFindReplaceDialog==null){window.acwFindReplaceDialog_Element=gridWeb;window.acwFindReplaceDialog_StartCell=startCell;var url=gridWeb.acw_client_path+"findDlg.htm?callType="+callType;if(window.showModelessDialog){var feature="dialogWidth:380px; dialogHeight:190px; status:no;scroll:no;help:no";var dialogArguments=new Array;dialogArguments[0]=window;dialogArguments[1]=gridWeb.fillTableCellsToArray();dialogArguments[2]=getStartCellIndexInArray(startCell,
dialogArguments[1]);window.acwFindReplaceDialog=window.showModelessDialog(url,dialogArguments,feature)}else{var name=this.id+"_findDlg";var feature="chrome=yes,dependent=yes,dialog=yes,modal=yes,alwaysRaised=yes,status=no,width=385px,height=150px";window.acwFindReplaceDialog=window.open(url,name,feature)}}else{window.acwFindReplaceDialog.focus();window.acwFindReplaceDialog._element=gridWeb;window.acwFindReplaceDialog._activeCell=startCell;window.acwFindReplaceDialog._callType=callType;var arrCells=
gridWeb.fillTableCellsToArray();window.acwFindReplaceDialog._arrCells=arrCells;window.acwFindReplaceDialog._cellIndex=getStartCellIndexInArray(startCell,arrCells);window.acwFindReplaceDialog.init()}}
function fillTableCellsToArray(){var arrCells=new Array;var k=0;if(this.freeze){if(this.viewTable00!=null&&this.viewTable01!=null&&this.viewTable10!=null&&this.viewTable!=null){var viewTable00Rows=this.viewTable00.rows;var viewTable00Rowslen=viewTable00Rows.length;var viewTable01Rows=this.viewTable01.rows;var viewTable01Rowslen=viewTable01Rows.length;var viewTable10Rows=this.viewTable10.rows;var viewTable10Rowslen=viewTable10Rows.length;var viewTableRows=this.viewTable.rows;var viewTableRowslen=viewTableRows.length;
var i=0;while(i<viewTable00Rowslen){var viewTable00Cells=viewTable00Rows[i].cells;var viewTable00Cellslen=viewTable00Cells.length;var j;for(j=0;j<viewTable00Cellslen;j++)arrCells[k++]=viewTable00Cells[j];var viewTable01Cells=viewTable01Rows[i].cells;var viewTable01Cellslen=viewTable01Cells.length;for(j=0;j<viewTable01Cellslen;j++)arrCells[k++]=viewTable01Cells[j];i++}i=0;while(i<viewTable10Rowslen){var viewTable10Cells=viewTable10Rows[i].cells;var viewTable10Cellslen=viewTable10Cells.length;var j;
for(j=0;j<viewTable10Cellslen;j++)arrCells[k++]=viewTable10Cells[j];var viewTableCells=viewTableRows[i].cells;var viewTableCellslen=viewTableCells.length;for(j=0;j<viewTableCellslen;j++)arrCells[k++]=viewTableCells[j];i++}}}else if(this.viewTable!=null){var rows=this.viewTable.rows;var rowslen=rows.length;var i;for(i=0;i<rowslen;i++){var cells=rows[i].cells;var cellslen=cells.length;var j;for(j=0;j<cellslen;j++)arrCells[k++]=cells[j]}}return arrCells}
function getStartCellIndexInArray(startCell,arrCells){for(var i=0;i<arrCells.length;i++)if(startCell==arrCells[i])return i;return 0}function showDropDownList(e){if(this.ListMenu!=null){this.ListMenu.showNS(e);var evt=new Event(e);var offset=evt.getOffset();var left=this.ListMenu.offsetLeft-offset.offsetX-1;if(left<0)left=0;var top=this.ListMenu.offsetTop+this.ActiveCell.offsetHeight-offset.offsetY-1;if(top<0)top=0;this.ListMenu.showXY(left,top,this)}this.dropdownListShowedFlg=true}
function ready(fn){if(document.readyState!="loading")fn();else document.addEventListener("DOMContentLoaded",fn)}function setRowCollpaseStatus(row,iscollpase){var o=row.children[0].children[0].children[0];if(o==null)return;o.setAttribute("expand",iscollpase?"1":"0");if(!iscollpase)o.src=this.image_file_path+"collapse.gif";else o.src=this.image_file_path+"expand.gif"}
function setColCollpaseStatus(col,iscollpase){var o=col.children[0].children[0];if(o==null){console.error("col children is null:"+col.id);return}o.setAttribute("expand",iscollpase?"1":"0");if(!iscollpase)o.src=this.image_file_path+"collapse.gif";else o.src=this.image_file_path+"expand.gif"}
function setRowDisplayExtrForMergedAreaAbove(rowid,display){if(display=="none"){var mergecells=new Array;for(var i=this.amincol;i<=this.amaxcol;){var currentCell=this.findUpMostCell(rowid,i);i+=currentCell.colSpan;if(currentCell.rowSpan>1&&rowid!=getRowId(currentCell)){if(currentCell.orignRowSpan==null){currentCell.orignRowSpan=currentCell.rowSpan;currentCell.orignHeight=currentCell.children[0].style.height;currentCell.children[0].style.height=""}currentCell.rowSpan--;mergecells.push(currentCell)}}if(mergecells.length>
0)this.mergecellrecord_upper.put(rowid,mergecells)}else{var mergecells=this.mergecellrecord_upper.get(rowid);if(mergecells!=null)for(var i=0;i<mergecells.length;i++){var currentCell=mergecells[i];if(currentCell.orignRowSpan!=null){currentCell.rowSpan=currentCell.orignRowSpan;currentCell.children[0].style.height=currentCell.orignHeight;currentCell.orignRowSpan=null;currentCell.orignHeight=null}}}}
function setRowDisplayExtrForMergedAreaBelow(row,rowid,display){if(display=="none"){var mergecells=new Array;var lasttd=null;for(var i=this.amincol;i<=this.amaxcol;){var currentCell=this.findUpMostCell(rowid,i);i+=currentCell.colSpan;if(currentCell.orignRowSpan>1){var cell=row.insertCell(i);cell.outerHTML=currentCell.outerHTML;cell.id=this.id+"_"+i+"#"+rowid;cell.rowSpan=currentCell.rowSpan;mergecells.push(i)}}if(mergecells.length>0)this.mergecellrecord_down.put(rowid,mergecells)}else{var mergecells=
this.mergecellrecord_down.get(rowid);if(mergecells!=null)for(var i=0;i<mergecells.length;i++)row.deleteCell(mergecells[i])}}
function setRowDisplay(row,display){if(row==null)return;if(ie&&iemv<9){row.style.display=display;var cells=row.cells;var length=cells.length;for(var i=0;i<length;i++){var cell=cells[i];if(display=="none"){cell.disBorder=cell.style.borderStyle;cell.style.borderStyle="none"}else if(cell.disBorder!=null){cell.style.borderStyle=cell.disBorder;cell.disBorder=null}}}else{if(display=="block")display="table-row";row.style.display=display}}
function attributeString2Array(s,isconverttonumber){var ret=s.substring(0,s.length-1).split(",");if(isconverttonumber)for(var i=0;i<ret.length;i++)ret[i]=Number(ret[i]);return ret}function setupGroupMatch(){this.setupGroupMatchRow();this.setupGroupMatchCol()}
function setupGroupMatchRow(){if(last_row_v_info!=null){this.row_v_info=last_row_v_info;this.row_collapse_info=last_row_collapse_info;this.downmatch_row=last_downmatch_row;this.issummaryrowbelow=last_issummaryrowbelow;var who=this;var f=function(){var entry=who.row_collapse_info.entrys();for(var i=0;i<entry.length;i++){var de=entry[i];var rowid=de.key;var row=who.getContentRowById(rowid);if(row!=null)who.setRowCollpaseStatus(row,de.value)}};ready(f);return}function sortNumber(a,b){return a.a-b.a}
var collpase=getattr(this,"grp_collapse_row");if(collpase!=null){var issummaryrowbelow=getattr(this,"sumbelow");var collpase=attributeString2Array(collpase);var grpupnode=null;var grpdownnode=null;if(issummaryrowbelow!=null){this.issummaryrowbelow=true;var grpdownnode=attributeString2Array(getattr(this,"grp_down_row"),true);var grpupnode=attributeString2Array(getattr(this,"grp_upper_row"),true)}else{this.issummaryrowbelow=false;var grpupnode=attributeString2Array(getattr(this,"grp_down_row"),true);
var grpdownnode=attributeString2Array(getattr(this,"grp_upper_row"),true);for(var i=0;i<grpdownnode.length;i++){var item={};item.a=grpdownnode[i]-1;item.b=grpupnode[i];grpdownnode[i]=item}grpdownnode.sort(sortNumber);for(var i=0;i<grpdownnode.length;i++){var item=grpdownnode[i];grpdownnode[i]=item.a;grpupnode[i]=item.b}}var downmatch=new Map;var row_collapse_info=new Map;this.downmatch_row=downmatch;this.row_collapse_info=row_collapse_info;for(var i=0;i<grpdownnode.length;i++){downmatch.put(grpdownnode[i],
grpupnode[i]);row_collapse_info.put(grpdownnode[i],collpase[i]=="1");var row=this.getContentRowById(grpdownnode[i]);if(row!=null)this.setRowCollpaseStatus(row,collpase[i]=="1")}}var grp_hidden_start=getattr(this,"grp_hidden_start_row");if(grp_hidden_start!=null||collpase!=null){var row_v_info=new Array;this.row_v_info=row_v_info;var maxrow=Number(getattr(this,"maxrow"));if(grp_hidden_start!=null){var hiddenStartRowArry=attributeString2Array(grp_hidden_start,true);var hiddenCountRowArry=attributeString2Array(getattr(this,
"grp_hidden_count_row"),true);var c=0;var i=0;for(var r=0;r<=maxrow;){while(r<hiddenStartRowArry[i])row_v_info[r++]=true;c=0;while(c++<hiddenCountRowArry[i])row_v_info[r++]=false;i++;if(i>=hiddenStartRowArry.length){while(r<=maxrow)row_v_info[r++]=true;break}}}else for(var r=0;r<=maxrow;)row_v_info[r++]=true}}
function setupGroupMatchCol(){if(last_col_v_info!=null){this.col_v_info=last_col_v_info;this.col_collapse_info=last_col_collapse_info;this.downmatch_col=last_downmatch_col;var who=this;var f=function(){var entry=who.col_collapse_info.entrys();for(var i=0;i<entry.length;i++){var de=entry[i];var colid=de.key;var col=who.getContentColById(colid);if(col!=null)who.setColCollpaseStatus(col,de.value)}};ready(f);return}var collpase=getattr(this,"grp_collapse_col");if(collpase!=null){var collpase=attributeString2Array(collpase);
var grpdownnode=attributeString2Array(getattr(this,"grp_down_col"),true);var grpupnode=attributeString2Array(getattr(this,"grp_upper_col"),true);var downmatch=new Map;var col_collapse_info=new Map;this.downmatch_col=downmatch;this.col_collapse_info=col_collapse_info;for(var i=0;i<grpdownnode.length;i++){downmatch.put(grpdownnode[i],grpupnode[i]);col_collapse_info.put(grpdownnode[i],collpase[i]=="1");var col=this.getContentColById(grpdownnode[i]);if(col!=null)this.setColCollpaseStatus(col,collpase[i]==
"1")}}var grp_hidden_start=getattr(this,"grp_hidden_start_col");if(grp_hidden_start!=null||collpase!=null){var col_v_info=new Array;this.col_v_info=col_v_info;var maxcol=Number(getattr(this,"maxcol"));if(grp_hidden_start!=null){var hiddenStartcolArry=attributeString2Array(grp_hidden_start,true);var hiddenCountcolArry=attributeString2Array(getattr(this,"grp_hidden_count_col"),true);var c=0;var i=0;for(var r=0;r<=maxcol;){while(r<hiddenStartcolArry[i])col_v_info[r++]=true;c=0;while(c++<hiddenCountcolArry[i])col_v_info[r++]=
false;i++;if(i>=hiddenStartcolArry.length){while(r<=maxcol)col_v_info[r++]=true;break}}}else for(var r=0;r<=maxcol;)col_v_info[r++]=true}this.mergecellrecord_upper=new Map;this.mergecellrecord_down=new Map}function getRowVisible(row){return this.row_v_info[row]}function getVisibleRowCount(from,to){var ret=0;for(var row=from;row<=to;row++)if(this.getRowVisible(row))ret++;return ret}
function findNextMaxRow(renderMinRow,renderMaxRow){var maxrows=this.maxrow;var alreadyrows=renderMaxRow-renderMinRow+1;var row=renderMinRow;for(var visiblerowscount=0;visiblerowscount<alreadyrows&&row<=maxrows;row++){if(!this.getRowVisible(row))continue;visiblerowscount++}return row-1}
function findNextMinRow(renderMinRow,renderMaxRow){var minrow=this.minrow;var alreadyrows=renderMaxRow-renderMinRow+1;var row=renderMaxRow;for(var visiblerowscount=0;visiblerowscount<alreadyrows&&row>=minrow;row--){if(!this.getRowVisible(row))continue;visiblerowscount++}return row+1}function getContentRowById(id){var rowid=null;if(this.freeze&&this.freezecol==0)rowid=this.id+"_[f_row]"+id;else rowid=this.id+"_[d_row]"+id;return document.getElementById(rowid)}
function getContentColById(id){var colid=this.id+"_tpc_"+id;return document.getElementById(colid)}function getRowId(row){var index=row.id.lastIndexOf("]");return Number(row.id.substr(index+1))}function getSpanRowId(row){var index=row.id.lastIndexOf("#");return Number(row.id.substr(index+1))}function getColId(col){var index=col.id.lastIndexOf("_");return Number(col.id.substr(index+1))}
function getLeftPartRowById(id){var rowid=null;if(this.freezecol==0)rowid=this.id+"_[f_row]"+id;else rowid=this.id+"_[d_row]"+id;return document.getElementById(rowid)}function getRightPartRowById(id){var rowid=null;if(this.freezecol==0){rowid=this.id+"_[d_row]"+id;return document.getElementById(rowid)}else{rowid=this.id+"_"+this.freezecol+"#"+id;return document.getElementById(rowid).parentNode}}function getHeadRowById(id){var rowid=this.id+"_[h_row]"+id;return document.getElementById(rowid)}
function collapseRow(downrow){this.row_collapse_info.put(downrow,true);var upperrow=this.downmatch_row.get(downrow);function setrowdisplaybyid(rowid){this.row_v_info[rowid]=false;var row=null;if(!this.freeze){row=this.getContentRowById(rowid);setRowDisplay(row,"none")}else{row=this.getLeftPartRowById(rowid);setRowDisplay(row,"none");row=this.getRightPartRowById(rowid);setRowDisplay(row,"none")}row=this.getHeadRowById(rowid);setRowDisplay(row,"none");this.setRowDisplayExtrForMergedAreaAbove(rowid,
"none")}if(this.issummaryrowbelow)for(var rowid=upperrow;rowid<downrow;rowid++)setrowdisplaybyid.call(this,rowid);else for(var rowid=upperrow-1;rowid>downrow;rowid--)setrowdisplaybyid.call(this,rowid);row=this.getContentRowById(downrow);this.setRowDisplayExtrForMergedAreaBelow(row,rowid,"none");if(this.async)this.ajacsendcmd("collapserow:"+downrow)}
function expandRow(downrow){this.row_collapse_info.put(downrow,false);var upperrow=this.downmatch_row.get(downrow);function setrowdisplaybyid(rowid){this.row_v_info[rowid]=true;var row=null;if(!this.freeze){row=this.getContentRowById(rowid);setRowDisplay(row,"block")}else{row=this.getLeftPartRowById(rowid);setRowDisplay(row,"block");row=this.getRightPartRowById(rowid);setRowDisplay(row,"block")}row=this.getHeadRowById(rowid);setRowDisplay(row,"block");this.setRowDisplayExtrForMergedAreaAbove(rowid,
"block")}if(this.issummaryrowbelow)for(var rowid=upperrow;rowid<=downrow;rowid++)setrowdisplaybyid.call(this,rowid);else for(var rowid=upperrow;rowid>=downrow;rowid--)setrowdisplaybyid.call(this,rowid);var inside_dwonrow=0;var inside_upperrow=0;var entry=this.downmatch_row.entrys();for(var i=0;i<entry.length;i++){var de=entry[i];inside_dwonrow=de.key;inside_upperrow=de.value;if(inside_dwonrow<downrow&&inside_upperrow>upperrow)if(this.row_collapse_info.get(inside_dwonrow))for(var rowid=inside_upperrow;rowid<
inside_dwonrow;rowid++){this.row_v_info[rowid]=false;var row=null;if(!this.freeze){row=this.getContentRowById(rowid);setRowDisplay(row,"none")}else{row=this.getLeftPartRowById(rowid);setRowDisplay(row,"none");row=this.getRightPartRowById(rowid);setRowDisplay(row,"none")}row=this.getHeadRowById(rowid);setRowDisplay(row,"none");this.setRowDisplayExtrForMergedAreaAbove(rowid,"none")}}row=this.getContentRowById(downrow);this.setRowDisplayExtrForMergedAreaBelow(row,downrow,"block");if(this.async)this.ajacsendcmd("expandrow:"+
downrow)}
function setColDisplay(id,display){var colid=null;var col=null;if(this.freezecol==null){this.setColDisplayBasic(id,"C",display);this.setColDisplayBasic(id,"CD",display)}else if(this.freezecol==0){this.setColDisplayBasic(id,"C",display);this.setColDisplayBasic(id,"CD01",display);this.setColDisplayBasic(id,"CD",display)}else if(id<this.freezecol){this.setColDisplayBasic(id,"C",display);this.setColDisplayBasic(id,"CD00",display);this.setColDisplayBasic(id,"CD10",display)}else{this.setColDisplayBasic(id,"C",
display);this.setColDisplayBasic(id,"CD01",display);this.setColDisplayBasic(id,"CD",display)}}function setColDisplayBasic(id,whichname,display){var colid=this.id+"_!"+id+whichname;var col=document.getElementById(colid);if(display)col.style.width=col.getAttribute("aw")+"px";else col.style.width="0px"}
function collapseCol(downcol){this.col_collapse_info.put(downcol,true);var uppercol=this.downmatch_col.get(downcol);for(var colid=uppercol;colid<downcol;colid++){this.col_v_info[colid]=false;this.setColDisplay(colid,false)}if(this.async);}
function expandCol(downcol){this.col_collapse_info.put(downcol,false);var uppercol=this.downmatch_col.get(downcol);for(var colid=uppercol;colid<=downcol;colid++){this.col_v_info[colid]=true;this.setColDisplay(colid,true)}var inside_dwoncol=0;var inside_uppercol=0;var entry=this.downmatch_col.entrys();for(var i=0;i<entry.length;i++){var de=entry[i];inside_dwoncol=de.key;inside_uppercol=de.value;if(inside_dwoncol<downcol&&inside_uppercol>uppercol)if(this.col_collapse_info.get(inside_dwoncol))for(var colid=
inside_uppercol;colid<inside_dwoncol;colid++){this.col_v_info[colid]=false;this.setColDisplay(colid,false)}}if(this.async);}function ajacsendcmd(cmd){cmdxml="<data><CMDS><CMD V="+cmd+"/></data></CMDS>";if(this.ajaxtimeout==null){inajaxupdating=true;var gridweb=this;this.ajaxtimeout=setTimeout(function(){gridweb.ajaxupdate(cmdxml)},0)}}function delcomment(row,col){this.ajacsendcmd("delcomment:"+row+","+col)}
function delcommentlocal(cell){var childspan=cell.childNodes[0];var childclass=childspan.getAttribute("class");if(childclass!=null&&childclass.indexOf("acwcmmnt")>=0){childspan.setAttribute("class",childclass.replace(" acwcmmnt",""));cell.removeAttribute("CMNT_NOTE");cell.removeAttribute("onmouseover");cell.removeAttribute("onmouseout")}}
function delcomments(){if(this.getSpan(this.ActiveCell)!=null)this.endEdit(this.ActiveCell);var size=this._selections.list.length;var cmd="";for(var i=0;i<=size-1;i++){var range=this._selections.list[i];cmd+=":"+range.startRow+","+range.startCol+","+range.endRow+","+range.endCol}this.ajacsendcmd("delcomment"+cmd)}
function getViewTableByRowHeader(rowHeader){var vtable;if(this.viewTable00==null)vtable=this.viewTable;else{var hpanel=rowHeader.parentNode.parentNode.parentNode.parentNode;if(hpanel==this.leftPanel)vtable=this.viewTable;else vtable=this.viewTable01}return vtable}
function getViewTableByColHeader(colHeader){var vtable;if(this.viewTable00==null)vtable=this.viewTable;else{var hpanel=colHeader.parentNode.parentNode.parentNode.parentNode;if(hpanel==this.topPanel)vtable=this.viewTable01;else vtable=this.viewTable00}return vtable}function getViewTableByCell(cell){return cell.parentNode.parentNode.parentNode}function getFirstCell(cells){for(var i=0;i<cells.length;i++)if(this.isCell(cells[i]))return cells[i];return null}
function getLastCell(cells){for(var i=cells.length-1;i>=0;i--)if(this.isCell(cells[i]))return cells[i];return null}function tryInitSetActiveCell(){if(this.activerow!=null&&this.activecol!=null)if(this.activerow>=this.aminrow&&this.activerow<=this.amaxrow&&this.activecol>=this.amincol&&this.activecol<=this.amaxcol)this.setActiveCellNoadjust(this.activerow?this.activerow:0,this.activecol?this.activecol:0)}function getActiveCell(){return this.ActiveCell}
function setActiveCell(row,column){this.setActiveCellBasic(row,column,true)}function setActiveCellNoadjust(row,column){this.setActiveCellBasic(row,column,false)}
function setActiveCellBasic(row,column,needadjust){this.clearSelections();var o=document.getElementById(this.id+"_"+column+"#"+row);if(o!=null){if(this.ActiveCell!=null){if(this.getSpan(this.ActiveCell)!=null)this.endEdit(this.ActiveCell);if(this.ActiveCell!=o)if(needadjust)this.selectCell(o);else this.selectCellNoadjust(o)}else if(needadjust)this.selectCell(o);else this.selectCellNoadjust(o);actualcolnumber=column+1;actualrownumber=row+1}else if(this.ActiveCell!=null){if(this.getSpan(this.ActiveCell)!=
null)this.endEdit(this.ActiveCell);this.endSelect()}}function isDataChanged(){var xnode=this.xmlDoc.selectSingleNode("data/CELLS");return xnode!=null&&xnode.hasChildNodes()}
function updateData(discardInput,cmd){if(this.ActiveCell!=null)if(this.getSpan(this.ActiveCell)!=null)this.endEdit(this.ActiveCell);if(discardInput){var xnode;xnode=this.xmlDoc.selectSingleNode("data/CELLS");if(xnode!=null)while(xnode.hasChildNodes())xnode.removeChild(xnode.getLastChild());xnode=this.xmlDoc.selectSingleNode("data/SIZES");if(xnode!=null)while(xnode.hasChildNodes())xnode.removeChild(xnode.getLastChild())}this.updateSelect(!cmd.startWith("TAB:"));this.updatePagePosition(!cmd.startWith("TAB:"));
this.updateAsync(cmd=="ASYNC");this.xmlData.value=HTMLEncode(this.xmlDoc.getXML())}function validateAll(){var r=true;if(this.validations!=null){var l=this.validations.length;var i;for(i=0;i<l;i++){var val=this.validations[i];if(val!=null&&!this.validateInput(val)&&r){r=false;if(scrollToInvalidate)val.scrollIntoView()}}}if(r)this.vmark.value="TRUE";else{this.vmark.value="FALSE";this.mOnError()}return r}function submit(arg,discardInput){this.postBack(arg,discardInput)}
function getCellValue(row,column){var o=document.getElementById(this.id+"_"+column+"#"+row);if(o!=null){if(this.getSpan(o)!=null)this.endEdit(o);if(getattr(o,"vtype")=="checkbox"){var checkbox=o.getElementsByTagName("INPUT")[0];return checkbox.checked}else if(getattr(o,"ufv")!=null)return getattr(o,"ufv");else return getInnerText(o)}else return null}
function setCellValue(row,column,value){var o=document.getElementById(this.id+"_"+column+"#"+row);if(o!=null){if(this.getSpan(o)!=null)this.endEdit(o);if(this.editmode&&getattr(o,"protected")!="1")this.editCell(o,value)}}function getActiveRow(){if(this.ActiveCell!=null){var row=this.ActiveCell.id.substring(this.ActiveCell.id.indexOf("#")+1,this.ActiveCell.id.length);return Number(row)}else return null}
function getActiveColumn(){if(this.ActiveCell!=null){var col=this.ActiveCell.id.substring(this.id.length+1,this.ActiveCell.id.indexOf("#"));return Number(col)}else return null}function getSelectedCells(){return this._selections.list}
function setActiveCellByCell(cell){this.clearSelections();if(this.isCell(cell)=="TD")if(this.ActiveCell!=null){if(this.getSpan(this.ActiveCell)!=null)this.endEdit(this.ActiveCell);if(this.ActiveCell!=cell)this.selectCell(cell)}else this.selectCell(cell);else if(this.ActiveCell!=null){if(this.getSpan(this.ActiveCell)!=null)this.endEdit(this.ActiveCell);this.endSelect()}}function getCell(row,column){return document.getElementById(this.id+"_"+column+"#"+row)}
function getLocateCell(row,column){return this.findcurrentCell(row,column)}function getCellRow(cell){if(this.isCell(cell)=="TD"){var row=cell.id.substring(cell.id.indexOf("#")+1,cell.id.length);return Number(row)}else return null}function getColumn(index){return document.getElementById(this.id+"_!"+index)}function getCellColumn(cell){if(this.isCell(cell)=="TD"){var col=cell.id.substring(this.id.length+1,cell.id.indexOf("#"));return Number(col)}else return null}
function getCellColumnName(cell){var column=this.getCellColumn(cell);if(column==null||column<0||column>255)return null;var firstChar=Math.floor(column/26);var secondChar=column%26;if(firstChar>0){var first=String.fromCharCode(firstChar+64);var second=String.fromCharCode(secondChar+65);return first+second}else return String.fromCharCode(secondChar+65)}
function getCellName(cell){var colname=this.getCellColumnName(cell);var row=this.getCellRow(cell);if(colname!=null&&row!=null)return colname+(row+1);else return null}function getCellValueByCell(cell){if(this.isCell(cell)=="TD")if(getattr(cell,"vtype")=="checkbox"){var checkbox=cell.getElementsByTagName("INPUT")[0];return checkbox.checked}else if(getattr(cell,"ufv")!=null)return getattr(cell,"ufv");else return getInnerText(cell);else return null}
function setCellValueByCell(cell,value){if(this.isCell(cell)=="TD"){if(this.getSpan(cell)!=null)this.endEdit(cell);if(this.editmode&&getattr(cell,"protected")!="1")this.editCell(cell,value)}}
function print(zoom){this.endSelect();if(zoom==null)zoom=1;var styleGridWeb=document.getElementById("Style"+this.id);var newWin=window.open("","");if(chrome){newWin.window.focus();newWin.onbeforeunload=function(event){return"Please use the cancel button on the left side of the print preview to close this window.\n"}}newWin.document.writeln("<html><head><title>Print Preview</title>");newWin.document.writeln(styleGridWeb.outerHTML+"</head>");newWin.document.writeln('<body style="zoom:'+zoom+';" onload="window.print();" bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0">');
newWin.document.writeln("<form>");var ghtml;var vt=document.getElementById(this.id+"_viewTable");var fcol=document.getElementById(this.id+"_FCOL");if(fcol==null)ghtml="<TABLE>"+"<TR>"+"<TD>"+vt.outerHTML+"</TD>"+"</TR>"+"</TABLE>";else{var v00=document.getElementById(this.id+"_viewTable00");var v01=document.getElementById(this.id+"_viewTable01");var v10=document.getElementById(this.id+"_viewTable10");var fcolWidth=fcol.style.offsetWidth;ghtml="<TABLE>"+"<COLGROUP>"+"<COL style='WIDTH:"+fcolWidth+
"px'>"+"<COL>"+"</COLGROUP>"+"<TR>"+"<TD>"+v00.outerHTML+"</TD>"+"<TD>"+v01.outerHTML+"</TD>"+"</TR>"+"<TR>"+"<TD>"+v10.outerHTML+"</TD>"+"<TD>"+vt.outerHTML+"</TD>"+"</TR>"+"</TABLE>"}var start=ghtml.indexOf('onload="adjustImagePosition');while(start>0){var end=ghtml.indexOf(";",start);ghtml=ghtml.substr(0,start)+ghtml.substr(end+2);start=ghtml.indexOf('src="',start);end=ghtml.indexOf('"',start+5);ghtml=ghtml.substr(0,start+5)+ghtml.substr(start+5);start=ghtml.indexOf('onload="adjustImagePosition')}newWin.document.writeln(ghtml);
newWin.document.writeln("</form></body></HTML>");if(chrome)newWin.document.close();else newWin.location.reload()}function Range(startRow,startCol,endRow,endCol){var r1=Math.min(startRow,endRow);var r2=Math.max(startRow,endRow);var c1=Math.min(startCol,endCol);var c2=Math.max(startCol,endCol);this.startRow=r1;this.startCol=c1;this.endRow=r2;this.endCol=c2}Range.prototype.contains=function(row,col){return this.startRow<=row&&this.endRow>=row&&this.startCol<=col&&this.endCol>=col};
Range.prototype.getRows=function(){return this.endRow-this.startRow+1};Range.prototype.getCols=function(){return this.endCol-this.startCol+1};Range.prototype.toString=function(){return this.startRow+","+this.startCol+","+this.endRow+","+this.endCol};
function Selections(grid){this.list=new Array;this.g=grid;this.ac=null;this.renderAC=function(range){if(this.ac!=this.g.ActiveCell){if(this.ac!=null){this.ac.style.backgroundColor=this.ac.orgBgColor;this.ac.style.color=this.ac.orgColor;this.ac.removeAttribute("orgBgColor");this.ac.removeAttribute("orgColor");var coord=this.ac.id.substring(this.g.id.length+1,this.ac.id.length);var coords=coord.split("#");var r=Number(coords[1]);var c=Number(coords[0]);if(range!=null&&range.contains(r,c)){if(this.ac.orgBgColor==
null){this.ac.orgBgColor=this.ac.currentStyle.backgroundColor;this.ac.setAttribute("orgBgColor",this.ac.orgBgColor)}if(this.ac.orgColor==null){this.ac.orgColor=this.ac.currentStyle.color;this.ac.setAttribute("orgColor",this.ac.orgColor)}this.ac.style.backgroundColor=this.g.scbcolor;this.ac.style.color=this.g.sccolor}for(var i=r;i<=r+this.ac.rowSpan-1;i++)for(var j=c;j<=c+this.ac.colSpan-1;j++)this.recoverHeader(i,j)}this.ac=this.g.ActiveCell;if(this.ac!=null){if(this.ac.orgBgColor==null){this.ac.orgBgColor=
this.ac.currentStyle.backgroundColor;this.ac.setAttribute("orgBgColor",this.ac.orgBgColor)}if(this.ac.orgColor==null){this.ac.orgColor=this.ac.currentStyle.color;this.ac.setAttribute("orgColor",this.ac.orgColor)}this.ac.style.backgroundColor=this.g.acbcolor;this.ac.style.color=this.g.accolor}}};this.renderRange=function(range){for(var r=range.startRow;r<=range.endRow;r++)for(var c=range.startCol;c<=range.endCol;c++){var o=this.g.getLocateCell(r,c);if(this.ac!=o&&o!=null){if(o.orgBgColor==null){o.orgBgColor=
o.currentStyle.backgroundColor;o.setAttribute("orgBgColor",o.orgBgColor)}if(o.orgColor==null){o.orgColor=o.currentStyle.color;o.setAttribute("orgColor",o.orgColor)}o.style.backgroundColor=this.g.scbcolor;o.style.color=this.g.sccolor}}};this.recoverCell=function(o,r,c){o.style.backgroundColor=o.orgBgColor;o.style.color=o.orgColor;if(o.orgBgColor==null){o.style.backgroundColor=o.getAttribute("orgBgColor");o.style.color=o.getAttribute("orgColor")}o.removeAttribute("orgBgColor");o.removeAttribute("orgColor");
this.recoverHeader(r,c)};this.recoverRange=function(range){if(range!=null)for(var r=range.startRow;r<=range.endRow;r++)for(var c=range.startCol;c<=range.endCol;c++){var o=this.g.getLocateCell(r,c);if(this.ac!=o&&o!=null)this.recoverCell(o,r,c)}};this.forceRecoverRange=function(range){if(range!=null)for(var r=range.startRow;r<=range.endRow;r++)for(var c=range.startCol;c<=range.endCol;c++){var o=this.g.getLocateCell(r,c);if(o!=null)this.recoverCell(o,r,c)}};this.renderRanges=function(){for(var i=0;i<
this.list.length;i++)this.renderRange(this.list[i])};this.renderHeader=function(row,col){var hd=document.getElementById(this.g.id+"_!"+col);if(hd!=null){if(hd.orgColor==null)hd.orgColor=hd.style.color;if(hd.orgBgColor==null)hd.orgBgColor=hd.style.backgroundColor;hd.style.color=this.g.ahcolor;hd.style.backgroundColor=this.g.ahbcolor}hd=document.getElementById(this.g.id+"_@"+row);if(hd!=null){if(hd.orgColor==null)hd.orgColor=hd.style.color;if(hd.orgBgColor==null)hd.orgBgColor=hd.style.backgroundColor;
hd.style.color=this.g.ahcolor;hd.style.backgroundColor=this.g.ahbcolor}};this.recoverHeader=function(row,col){var hd=document.getElementById(this.g.id+"_!"+col);if(hd!=null){hd.style.color=hd.orgColor;hd.style.backgroundColor=hd.orgBgColor;hd.removeAttribute("orgColor");hd.removeAttribute("orgBgColor")}var hd=document.getElementById(this.g.id+"_@"+row);if(hd!=null){hd.style.color=hd.orgColor;hd.style.backgroundColor=hd.orgBgColor;hd.removeAttribute("orgColor");hd.removeAttribute("orgBgColor")}};this.renderHeaders=
function(){for(var i=0;i<this.list.length;i++){var range=this.list[i];for(var r=range.startRow;r<=range.endRow;r++)for(var c=range.startCol;c<=range.endCol;c++)this.renderHeader(r,c)}};this.getRange=function(o1,o2){var r1=Number(o1.id.substring(o1.id.indexOf("#")+1,o1.id.length));var c1=Number(o1.id.substring(this.g.id.length+1,o1.id.indexOf("#")));var r1s=r1+o1.rowSpan-1;var c1s=c1+o1.colSpan-1;var r2=Number(o2.id.substring(o2.id.indexOf("#")+1,o2.id.length));var c2=Number(o2.id.substring(this.g.id.length+
1,o2.id.indexOf("#")));var r2s=r2+o2.rowSpan-1;var c2s=c2+o2.colSpan-1;if(selectcolheader)if(shiftclick)return new Range(Math.min(r1,r2),Math.min(lastselcolnumber-1,actualcolnumber-1),Math.max(r1s,r2s),Math.max(lastselcolnumber-1,actualcolnumber-1));else return new Range(Math.min(r1,r2),actualcolnumber-1,Math.max(r1s,r2s),actualcolnumber-1);else if(selectrowheader)if(shiftclick)return new Range(Math.min(lastselrownumber-1,actualrownumber-1),Math.min(c1,c2),Math.max(lastselrownumber-1,actualrownumber-
1),Math.max(c1s,c2s));else return new Range(actualrownumber-1,Math.min(c1,c2),actualrownumber-1,Math.max(c1s,c2s));else return new Range(Math.min(r1,r2),Math.min(c1,c2),Math.max(r1s,r2s),Math.max(c1s,c2s))};this.add=function(o){var row=Number(o.id.substring(o.id.indexOf("#")+1,o.id.length));var col=Number(o.id.substring(this.g.id.length+1,o.id.indexOf("#")));var range=new Range(row,col,row+o.rowSpan-1,col+o.colSpan-1);var prev=this.last();this.list.push(range);this.renderAC(prev);this.renderRanges();
this.renderHeaders()};this.addRange=function(o1,o2){var prev=this.last();var range=this.getRange(o1,o2);this.list.push(range);this.renderAC(prev);this.renderRanges();this.renderHeaders()};this.updateRange=function(o1,o2){var latest=this.list.pop();this.recoverRange(latest);var range=this.getRange(o1,o2);this.list.push(range);this.renderAC(latest);this.renderRanges();this.renderHeaders()};this.last=function(){var length=this.list.length;if(length>0)return this.list[length-1];else return null};this.clear=
function(){while(this.list.length>0){var latest=this.list.pop();this.recoverRange(latest)}};this.forceclear=function(){while(this.list.length>0){var latest=this.list.pop();this.forceRecoverRange(latest)}};this.contains=function(o){var row=Number(o.id.substring(o.id.indexOf("#")+1,o.id.length));var col=Number(o.id.substring(this.g.id.length+1,o.id.indexOf("#")));for(var i=0;i<this.list.length;i++){var range=this.list[i];if(range.contains(row,col))return true}return false}}
function nextnode(node,root){if(node.firstChild)return node.firstChild;if(node.nextSibling)return node.nextSibling;if(node===root)return null;while(node.parentNode){node=node.parentNode;if(node==root)return null;if(node.nextSibling)return node.nextSibling}return null}
function moveBoundary(rng,n,bStart,el){if(n<=0)return;var node=rng[bStart?"startContainer":"endContainer"];if(node.nodeType==3)n+=rng[bStart?"startOffset":"endOffset"];while(node){if(node.nodeType==3)if(n<=node.nodeValue.length){rng[bStart?"setStart":"setEnd"](node,n);if(n==node.nodeValue.length){for(var next=nextnode(node,el);next&&next.nodeType==3&&next.nodeValue.length==0;next=nextnode(next,el))rng[bStart?"setStartAfter":"setEndAfter"](next);if(next&&next.nodeType==1&&next.nodeName=="BR")rng[bStart?
"setStartAfter":"setEndAfter"](next)}return}else{rng[bStart?"setStartAfter":"setEndAfter"](node);n-=node.nodeValue.length}node=nextnode(node,el)}}
function sendkeys(el,text){var ret=new Object;ret._el=el;ret._bounds=[0,ret._el["text"].length];var rng=document.createRange();rng.selectNodeContents(ret._el);rng.deleteContents();rng.insertNode(document.createTextNode(text));ret._el.normalize();ret._bounds=[ret._bounds[0]+text.length,ret._bounds[0]+text.length];window.getSelection().removeAllRanges();var bounds=[Math.max(0,Math.min(ret._el["text"].length,ret._bounds[0])),Math.max(0,Math.min(ret._el["text"].length,ret._bounds[1]))];moveBoundary(rng,
bounds[0],true,ret._el);rng.collapse(true);moveBoundary(rng,bounds[1]-bounds[0],false,ret._el);window.getSelection().addRange(rng)}function adjustEditorWidthForAll(){var len=gridwebinstance.keys.length;for(var i=0;i<len;i++){var k=gridwebinstance.keys[i];if(gridwebinstance.data[k].editorbox!=null)gridwebinstance.data[k].adjustEditorWidth()}}
function adjustEditorWidth(){if(this.editorbox!=null){var toppanelwidth=this.topPanel.offsetWidth;var lefttoppanelwidth=this.leftTopPanel.offsetWidth;this.editorcellname.style.width=lefttoppanelwidth+"px";var topleftfreezepanel=document.getElementById(this.id+"_topPanel0");if(topleftfreezepanel!=null)toppanelwidth+=topleftfreezepanel.offsetWidth;this.editorbox.style.width=lefttoppanelwidth+toppanelwidth+"px"}}
function adjustTableCellSpanHeightForAll(){var len=gridwebinstance.keys.length;for(var i=0;i<len;i++){var k=gridwebinstance.keys[i];gridwebinstance.data[k].adjustTableCellSpanHeight()}firstgrid.hideloadingbox()}
function adjustTableCellSpanHeight(){adjustTableCellSpanHeightBasic(this.ltable1,this);if(this.freeze)adjustTableCellSpanHeightBasic(this.ltable0,this);adjustTableCellSpanHeightBasic(this.viewTable,this);adjustTableCellSpanHeightBasic(this.viewTable00,this);adjustTableCellSpanHeightBasic(this.viewTable01,this);adjustTableCellSpanHeightBasic(this.viewTable10,this)}
function adjustTableCellSpanHeightBasic(table,who){if(table!=null)for(var i=0,row;row=table.rows[i];i++)for(var j=0,col;col=row.cells[j];j++){adjustSpanCell(row,col);if(col.rowSpan!=null&&col.rowSpan>1)recordRowSpanArrayMap(table.id,i,col,who)}}function getfirstViewRow(table,height){if(table!=null)for(var i=0,row,total=0;row=table.rows[i];i++){total+=row.offsetHeight;if(total>=height)return i}return 0}
function getfirstViewCol(table,width){var nodes;if(ie&&iemv<9)nodes=table.firstChild.children;else nodes=table.firstElementChild.children;if(table!=null)for(var i=0,total=0;i<nodes.length;i++){var node_width=nodes[i].style.width;total=add_px_or_pt(total,node_width);if(total>=width)return i}return 0}
function add_px_or_pt(a_px_value,b_px_or_pt_value){if(b_px_or_pt_value.indexOf("pt")>0)b_px_or_pt_value=(parseInt(b_px_or_pt_value.replace("pt",""))-1)*4/3;else b_px_or_pt_value=parseInt(b_px_or_pt_value.replace("px",""));return a_px_value+b_px_or_pt_value}function getCellsArray(){var ret=new Array;var i=0;i=getCellsFromTable(this.viewTable,ret,i);i=getCellsFromTable(this.viewTable00,ret,i);i=getCellsFromTable(this.viewTable01,ret,i);i=getCellsFromTable(this.viewTable10,ret,i);return ret}
function getCellsFromTable(table,array,count){if(table!=null)for(var i=0,row;row=table.rows[i];i++)for(var j=0,col;col=row.cells[j];j++)array[count++]=col;return count}function getCellsFromTabletest(table,array,count){for(var i=0;i<10;i++)array[count++]=i+"hello";return count}
function switchFormulaDisplay(){this.isshowformula=!this.isshowformula;switchFormulaDisplayBasic(this.ltable1,this);if(this.freeze)switchFormulaDisplayBasic(this.ltable0,this);switchFormulaDisplayBasic(this.viewTable,this);switchFormulaDisplayBasic(this.viewTable00,this);switchFormulaDisplayBasic(this.viewTable01,this);switchFormulaDisplayBasic(this.viewTable10,this)}
function switchFormulaDisplayBasic(table,who){if(table!=null)if(who.isshowformula)for(var i=0,row;row=table.rows[i];i++)for(var j=0,col;col=row.cells[j];j++)switchFormulaSpanCell(row,col);else for(var i=0,row;row=table.rows[i];i++)for(var j=0,col;col=row.cells[j];j++)switchFormulaSpanCellBack(row,col)}
function recordRowSpanArrayMap(tableid,rowid,col,who){var key=tableid+(rowid+col.rowSpan-1);var spanArray=who.rowSpanMap.get(key);if(spanArray==null){spanArray=new Array;spanArray[0]=col;who.rowSpanMap.put(key,spanArray)}else spanArray[spanArray.length]=col}
function adjustSpanCell(row,col){var span=col.firstChild;if(span.style.height!=null){var spanActualHeight=0;if(!chrome&&col.innerText.length>0||chrome&&col.text.length>0){if(ie&&iemv<9){span.style.cssText=span.style.cssText.replace(/(height[^;]+;)|(height[^;]+)/ig,"");span.style.whiteSpace="normal"}else span.style.removeProperty("height");spanActualHeight=span.offsetHeight}else{spanActualHeight=span.style.height;if(spanActualHeight.indexOf("pt")>0)spanActualHeight=(parseInt(spanActualHeight.replace("pt",
""))-1)*4/3;else spanActualHeight=parseInt(spanActualHeight.replace("px",""))}var headHeight_px=0;var myrow=row;var myrowheight=0;for(var k=0;k<col.rowSpan;k++){if(myrow.style.height.indexOf("pt")>0)myrowheight=(parseInt(myrow.style.height.replace("pt",""))-1)*4/3;else myrowheight=parseInt(myrow.style.height.replace("px",""));headHeight_px=headHeight_px+myrowheight;myrow=myrow.nextSibling}if(spanActualHeight>headHeight_px)span.style.height=headHeight_px-1+"px"}}
function switchFormulaSpanCell(row,col){var myformula=col.getAttribute("formula");if(myformula!=null){var span=col.firstChild;col.setAttribute("resultValue",span.innerText);setInnerText(span,col.getAttribute("formula"))}}function switchFormulaSpanCellBack(row,col){var myformula=col.getAttribute("formula");if(myformula!=null){var span=col.firstChild;setInnerText(span,col.getAttribute("resultValue"))}}
function adjustSpanCellFromBottom(row,col){var span=col.firstChild;if(ie&&iemv<9){span.style.height="";span.style.cssText=span.style.cssText.replace(/(height[^;]+;)|(height[^;]+)/ig,"");span.style.whiteSpace="normal"}else span.style.removeProperty("height");var spanActualHeight=span.offsetHeight;var headHeight_px=0;var myrow=row;var myrowheight=0;for(var k=0;k<col.rowSpan;k++){if(myrow.style.height.indexOf("pt")>0)myrowheight=(parseInt(myrow.style.height.replace("pt",""))-1)*4/3;else myrowheight=
parseInt(myrow.style.height.replace("px",""));headHeight_px=headHeight_px+myrowheight;myrow=myrow.previousSibling}if(spanActualHeight>headHeight_px)span.style.height=headHeight_px-1+"px"}function adjustRowSpanCellByRow(tableid,row,who){var key=tableid+row.rowIndex;var spanArray=who.rowSpanMap.get(key);if(spanArray!=null)for(var i=0;i<spanArray.length;i++)adjustSpanCellFromBottom(row,spanArray[i])}function ltabremove(str){return str.LTrim()}
String.prototype.Trim=function(){var str=this.replace(/^\s+/,"");for(var i=str.length-1;i>=0;i--)if(/\S/.test(str.charAt(i))){str=str.substring(0,i+1);break}return str};String.prototype.LTrim=function(){return this.replace(/(^\s*)/g,"")};String.prototype.RTrim=function(){return this.replace(/(\s*$)/g,"")};String.prototype.ESCAPE=function(){return this.replace(/\$/g,"&#36;").replace(/</g,"&#60;").replace(/>/g,"&#62;")};
String.prototype.ESCAPE_BACK=function(){return this.replace(/&#36;/g,"$").replace(/&#60;/g,"<").replace(/&#62;/g,">")};String.prototype.endsWith=function(searchString,position){position=position||this.length;position=position-searchString.length;if(position<0)return false;return this.lastIndexOf(searchString)===position};
String.prototype.startWith=function(str){if(str==null||str==""||this.length==0||str.length>this.length)return false;if(this.substr(0,str.length)==str)return true;else return false;return true};
function Map(){this.keys=[];this.data={};this.put=function(key,value){if(this.data[key]==null)this.keys.push(key);this.data[key]=value};this.get=function(key){return this.data[key]};this.getByIndex=function(i){if(i>=0&&i<this.keys.length)return this.get(this.keys[i]);return null};this.contain=function(key){var value=this.data[key];if(value)return true;else return false};this.remove=function(key){for(var index=0;index<this.keys.length;index++)if(this.keys[index]==key){this.keys.splice(index,1);break}this.data[key]=
null};this.each=function(fn){if(typeof fn!="function")return;var len=this.keys.length;for(var i=0;i<len;i++){var k=this.keys[i];fn(k,this.data[k],i)}};this.entrys=function(){var len=this.keys.length;var entrys=new Array(len);for(var i=0;i<len;i++){var k=this.keys[i];entrys[i]={key:k,value:this.data[k]}}return entrys};this.isEmpty=function(){return this.keys.length==0};this.size=function(){return this.keys.length};this.toString=function(){var s="{";for(var i=0;i<this.keys.length;i++,s+=","){var k=
this.keys[i];s+=k+"="+this.data[k]}s+="}";return s}};function acwcalendar(calendar){this.gaMonthNames=new Array(new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"),new Array("January","February","March","April","May","June","July","August","September","October","November","December"));this.gaDayNames=new Array(new Array("S","M","T","W","T","F","S"),new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat"),new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"));this.gaMonthDays=new Array(31,29,31,
30,31,30,31,31,30,31,30,31);this.StyleInfo=null;this.gaDayCell=new Array;this.goDayTitleRow=null;this.goYearSelect=null;this.goMonthSelect=null;this.goCurrentDayCell=null;this.giStartDayIndex=0;this.giDay=null;this.giMonth=null;this.giYear=null;this.giMonthLength=1;this.giDayLength=1;this.giFirstDay=0;this.gsGridCellEffect="raised";this.gsGridLinesColor="black";this.gbShowDateSelectors=true;this.gbShowDays=true;this.gbShowTitle=true;this.gbShowHorizontalGrid=true;this.gbShowVerticalGrid=true;this.gbValueIsNull=
false;this.gbReadOnly=false;this.giMinYear=1900;this.giMaxYear=2099;this.element=calendar;calendar.handler=this;this.fnGetPropertyDefaults=fnGetPropertyDefaults;this.fnCheckLeapYear=fnCheckLeapYear;this.fnLoadCSSDefault=fnLoadCSSDefault;this.fnCreateCalendarHTML=fnCreateCalendarHTML;this.fnUpdateTitle=fnUpdateTitle;this.fnUpdateDayTitles=fnUpdateDayTitles;this.fnMonthSelectOnChange=fnMonthSelectOnChange;this.fnBuildMonthSelect=fnBuildMonthSelect;this.fnYearSelectOnChange=fnYearSelectOnChange;this.fnFireOnPropertyChange=
fnFireOnPropertyChange;this.fnUpdateMonthSelect=fnUpdateMonthSelect;this.fnUpdateYearSelect=fnUpdateYearSelect;this.fnSetDate=fnSetDate;this.fnBuildYearSelect=fnBuildYearSelect;this.fnFillInCells=fnFillInCells;this.fnGetDay=fnGetDay;this.fnPutDay=fnPutDay;this.fnGetMonth=fnGetMonth;this.fnPutMonth=fnPutMonth;this.fnGetYear=fnGetYear;this.fnPutYear=fnPutYear;this.fnOnClick=fnOnClick;calendar.onclick=function(e){calendar.handler.fnOnClick(e)};this.fnGetPropertyDefaults();this.fnCreateCalendarHTML();
this.fnUpdateTitle();this.fnUpdateDayTitles();this.fnBuildMonthSelect();this.fnBuildYearSelect();this.fnFillInCells()}
function fnGetPropertyDefaults(){var x;var oDate=new Date;this.giDay=oDate.getDate();this.giMonth=oDate.getMonth()+1;this.giYear=oDate.getYear();if(this.giYear<200)this.giYear+=1900;if(this.element.year){if(!isNaN(parseInt(this.element.year)))this.giYear=parseInt(this.element.year);if(this.giYear<this.giMinYear)this.giYear=this.giMinYear;if(this.giYear>this.giMaxYear)this.giYear=this.giMaxYear}this.fnCheckLeapYear(this.giYear);if(this.element.month){if(!isNaN(parseInt(this.element.month)))this.giMonth=
parseInt(this.element.month);if(this.giMonth<1)this.giMonth=1;if(this.giMonth>12)this.giMonth=12}if(this.element.day){if(!isNaN(parseInt(this.element.day)))this.giDay=parseInt(this.element.day);if(this.giDay<1)this.giDay=1;if(this.giDay>this.gaMonthDays[this.giMonth-1])this.giDay=this.gaMonthDays[this.giMonth-1]}if(this.element.monthLength)switch(this.element.monthLength.toLowerCase()){case "short":this.giMonthLength=0;break;case "long":this.giMonthLength=1;break}if(this.element.dayLength)switch(this.element.dayLength.toLowerCase()){case "short":this.giDayLength=
0;break;case "medium":this.giDayLength=1;break;case "long":this.giDayLength=1;break}if(this.element.firstDay)if(this.element.firstDay>=0&&this.element.firstDay<=6)this.giFirstDay=element.firstDay;if(this.element.gridCellEffect)switch(this.element.gridCellEffect.toLowerCase()){case "raised":this.giGridCellEffect="raised";break;case "flat":this.giGridCellEffect="flat";break;case "sunken":this.giGridCellEffect="sunken";break}if(this.element.gridLinesColor)this.gsGridLinesColor=element.gridLinesColor;
if(this.element.showDateSelectors)this.gbShowDateSelectors=this.element.showDateSelectors?true:false;if(this.element.showDays)this.gbShowDays=this.element.showDays?true:false;if(this.element.showTitle)this.gbShowTitle=this.element.showTitle?true:false;if(this.element.showHorizontalGrid)this.gbShowHorizontalGrid=this.element.showHorizontalGrid?true:false;if(this.element.showVerticalGrid)this.gbShowVerticalGrid=this.element.showVerticalGrid?true:false;if(this.element.valueIsNull)this.gbValueIsNull=
this.element.valueIsNull?true:false;if(this.element.name)this.gsName=element.name;if(this.element.readOnly)this.gbReadOnly=this.element.readOnly?true:false}function fnCheckLeapYear(iYear){this.gaMonthDays[1]=!(iYear%4)&&iYear%100||!(iYear%400)?29:28}function fnLoadCSSDefault(sCSSProp,sScriptProp,oStyleRule,sStyleRuleProp){if(this.element.style[sCSSProp])oStyleRule[sStyleRuleProp]=this.element.style[sCSSProp];this.element.style[sScriptProp]=oStyleRule[sStyleRuleProp]}
function fnCreateCalendarHTML(){var row,cell;this.element.innerHTML="<table border=0 class=WholeCalendar> "+" <tr> "+" <td class=TitleCalendar></td> "+" <td class=DateControls> "+" <nobr> <select></select> "+" <select></select> </nobr> </td> "+" </tr> "+" <tr> <td colspan=3> "+" <table class=CalendarTable cellspacing=0 border=0> "+" <tr><td class=DayTitleCalendar></td>"+
" <td class=DayTitleCalendar></td>"+" <td class=DayTitleCalendar></td>"+" <td class=DayTitleCalendar></td>"+" <td class=DayTitleCalendar></td>"+" <td class=DayTitleCalendar></td>"+" <td class=DayTitleCalendar></td></tr>"+" <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>"+" <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>"+" <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>"+
" <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>"+" <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>"+" <tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>"+" </table> "+" </tr> "+"</table> ";this.goDayTitleRow=this.element.children[0].rows[1].cells[0].children[0].rows[0];this.goMonthSelect=this.element.children[0].rows[0].cells[1].children[0].children[0];this.goYearSelect=this.element.children[0].rows[0].cells[1].children[0].children[1];
for(row=1;row<7;row++)for(cell=0;cell<7;cell++)this.gaDayCell[(row-1)*7+cell]=this.element.children[0].rows[1].cells[0].children[0].rows[row].cells[cell]}function fnUpdateTitle(){var oTitleCell=this.element.children[0].rows[0].cells[0];if(this.gbShowTitle)oTitleCell.innerHTML=this.gaMonthNames[this.giMonthLength][this.giMonth-1]+" "+this.giYear;else oTitleCell.innerText=" "}
function fnUpdateDayTitles(){var dayTitleRow=this.element.children[0].rows[1].cells[0].children[0].rows[0];var iCell=0;for(i=this.giFirstDay;i<7;i++)this.goDayTitleRow.cells[iCell++].innerText=this.gaDayNames[this.giDayLength][i];for(i=0;i<this.giFirstDay;i++)this.goDayTitleRow.cells[iCell++].innerText=this.gaDayNames[this.giDayLength][i]}
function fnBuildMonthSelect(){var newMonthSelect;newMonthSelect=document.createElement("SELECT");this.goMonthSelect.parentNode.replaceChild(newMonthSelect,this.goMonthSelect);this.goMonthSelect=newMonthSelect;for(i=0;i<12;i++){e=document.createElement("OPTION");e.text=this.gaMonthNames[this.giMonthLength][i];this.goMonthSelect.options.add(e)}this.goMonthSelect.options[this.giMonth-1].selected=true;var handler=this;this.goMonthSelect.onchange=function(){handler.fnMonthSelectOnChange()}}
function fnMonthSelectOnChange(){iMonth=this.goMonthSelect.selectedIndex+1;this.fnSetDate(this.giDay,iMonth,this.giYear)}
function fnSetDate(iDay,iMonth,iYear){var bValueChange=false;if(this.gbValueIsNull){this.gbValueIsNull=false;this.fnFireOnPropertyChange("propertyName","valueIsNull")}if(iYear<this.giMinYear)iYear=this.giMinYear;if(iYear>this.giMaxYear)iYear=this.giMaxYear;if(this.giYear!=iYear)this.fnCheckLeapYear(iYear);if(iMonth<1)iMonth=1;if(iMonth>12)iMonth=12;if(iDay<1)iDay=1;if(iDay>this.gaMonthDays[this.giMonth-1])iDay=this.gaMonthDays[this.giMonth-1];if(this.giDay==iDay&&this.giMonth==iMonth&&this.giYear==
iYear){this.fnFireOnPropertyChange("propertyName","day");return}else bValueChange=true;if(this.giDay!=iDay){this.giDay=iDay;this.fnFireOnPropertyChange("propertyName","day")}if(this.giYear==iYear&&this.giMonth==iMonth){this.goCurrentDayCell.className="DayCalendar";this.goCurrentDayCell=this.gaDayCell[this.giStartDayIndex+iDay-1];this.goCurrentDayCell.className="DaySelectedCalendar";this.giDay=iDay}else{if(this.giYear!=iYear){this.giYear=iYear;this.fnFireOnPropertyChange("propertyName","year");this.fnUpdateYearSelect()}if(this.giMonth!=
iMonth){this.giMonth=iMonth;this.fnFireOnPropertyChange("propertyName","month");this.fnUpdateMonthSelect()}this.fnUpdateTitle();this.fnFillInCells()}if(bValueChange)this.fnFireOnPropertyChange("propertyName","value")}
function fnBuildYearSelect(){var newYearSelect;newYearSelect=document.createElement("SELECT");this.goYearSelect.parentNode.replaceChild(newYearSelect,this.goYearSelect);this.goYearSelect=newYearSelect;for(i=this.giMinYear;i<=this.giMaxYear;i++){e=document.createElement("OPTION");e.text=i;this.goYearSelect.options.add(e)}this.goYearSelect.options[this.giYear-this.giMinYear].selected=true;var handler=this;this.goYearSelect.onchange=function(){handler.fnYearSelectOnChange()}}
function fnYearSelectOnChange(){iYear=this.goYearSelect.selectedIndex+this.giMinYear;this.fnSetDate(this.giDay,this.giMonth,iYear)}
function fnFillInCells(){var iDayCell=0;var iLastMonthIndex,iNextMonthIndex;var iLastMonthTotalDays;var iStartDay;this.fnCheckLeapYear(this.giYear);iLastMonthDays=this.gaMonthDays[(this.giMonth-1==0?12:this.giMonth-1)-1];iNextMonthDays=this.gaMonthDays[(this.giMonth+1==13?1:this.giMonth+1)-1];iLastMonthYear=this.giMonth==1?this.giYear-1:this.giYear;iLastMonth=this.giMonth==1?12:this.giMonth-1;iNextMonthYear=this.giMonth==12?this.giYear+1:this.giYear;iNextMonth=this.giMonth==12?1:this.giMonth+1;var oDate=
new Date(this.giYear,this.giMonth-1,1);iStartDay=oDate.getDay()-this.giFirstDay;if(iStartDay<1)iStartDay+=7;iStartDay=iLastMonthDays-iStartDay+1;for(i=iStartDay;i<=iLastMonthDays;i++,iDayCell++){this.gaDayCell[iDayCell].innerText=i;if(this.gaDayCell[iDayCell].className!="OffDayCalendar")this.gaDayCell[iDayCell].className="OffDayCalendar";this.gaDayCell[iDayCell].day=i;this.gaDayCell[iDayCell].month=iLastMonth;this.gaDayCell[iDayCell].year=iLastMonthYear}this.giStartDayIndex=iDayCell;for(i=1;i<=this.gaMonthDays[this.giMonth-
1];i++,iDayCell++){this.gaDayCell[iDayCell].innerText=i;if(this.giDay==i){this.goCurrentDayCell=this.gaDayCell[iDayCell];this.gaDayCell[iDayCell].className="DaySelectedCalendar"}else if(this.gaDayCell[iDayCell].className!="DayCalendar")this.gaDayCell[iDayCell].className="DayCalendar";this.gaDayCell[iDayCell].day=i;this.gaDayCell[iDayCell].month=this.giMonth;this.gaDayCell[iDayCell].year=this.giYear}for(i=1;iDayCell<42;i++,iDayCell++){this.gaDayCell[iDayCell].innerText=i;if(this.gaDayCell[iDayCell].className!=
"OffDayCalendar")this.gaDayCell[iDayCell].className="OffDayCalendar";this.gaDayCell[iDayCell].day=i;this.gaDayCell[iDayCell].month=iNextMonth;this.gaDayCell[iDayCell].year=iNextMonthYear}}
function fnFireOnPropertyChange(name,value){if(document.createEventObject){var evt=document.createEventObject();evt.setAttribute(name,value);this.element.fireEvent("onpropertychange",evt)}else{var evt=document.createEvent("HTMLEvents");evt.initEvent("onpropertychange",true,true);eval("evt."+name+' = "'+value+'";');this.element.dispatchEvent(evt)}}function fnUpdateMonthSelect(){this.goMonthSelect.options[this.giMonth-1].selected=true}
function fnUpdateYearSelect(){this.goYearSelect.options[this.giYear-this.giMinYear].selected=true}function fnOnClick(e){var evt=new Event(e);var t=evt.getTarget();if(t.tagName=="TD"){if(this.gbReadOnly||!t.day)return;if(t.year<this.giMinYear||t.year>this.giMaxYear)return;this.fnSetDate(t.day,t.month,t.year)}}function fnGetDay(){return this.gbValueIsNull?null:this.giDay}function fnPutDay(iDay){iDay=parseInt(iDay);if(isNaN(iDay))throw 450;this.fnSetDate(iDay,this.giMonth,this.giYear)}
function fnGetMonth(){return this.gbValueIsNull?null:this.giMonth}function fnPutMonth(iMonth){iMonth=parseInt(iMonth);if(isNaN(iMonth))throw 450;this.fnSetDate(this.giDay,iMonth,this.giYear)}function fnGetYear(){return this.gbValueIsNull?null:this.giYear}function fnPutYear(iYear){iYear=parseInt(iYear);if(isNaN(iYear))throw 450;this.fnSetDate(this.giDay,this.giMonth,iYear)};function acwmenu(menu){this.menu=menu;menu.menuContext=this;menu.isShown=false;menu.ismultiple=false;menu.init=menuinit;menu.show=show;menu.showNS=showNS;menu.showXY=showXY;menu.hide=hide;menu.clear=clear;menu.addItem=addItem;menu.addSeparator=addSeparator;menu.addOKCancel=addOKCancel;menu.doAcwMenuOkClick=doAcwMenuOkClick;menu.doAcwMenuCheckByValue=doAcwMenuCheckByValue;menu.doAcwMenuCancelClick=doAcwMenuCancelClick;menu.doAcwMenuAllClick=doAcwMenuAllClick;menu.checkIFUnsectedAll=checkIFUnsectedAll;
menu.checkIFhasUnselected=checkIFhasUnselected;menu.hideTopSeparator=hideTopSeparator;menu.loadItems=loadItems;menu.getMenuItemUpdateValue=getMenuItemUpdateValue;menu.filterItemsByValue=filterItemsByValue;menu.setItemVisibility=setItemVisibility;menu.adjustHeight=adjustHeight;menu.onItemClick=null;menu.onShow=null;menu.onmouseover=m_onmouseover;menu.onmouseout=m_onmouseout;menu.onclick=m_onclick;menu.oncontextmenu=function(){return false};menu.gridContext=null;menu.currIndex=-1;menu.table=null;menu.tbody=
null;if(getattr(menu,"xhtmlmode")=="1")menu.sBody=document.body;else menu.sBody=document.documentElement;menu.init()}function menuinit(){var xml=document.createElement("XML");this.appendChild(xml);this.xmlData=getXMLDocument(xml);this.className="menu_body";this.table=document.createElement("TABLE");this.table.border=0;this.table.cellSpacing=0;this.appendChild(this.table);this.tbody=document.createElement("TBODY");this.table.appendChild(this.tbody)}
function show(e){if(this.tbody.childNodes.length>0){var evt=new Event(e);var body=this.sBody;if(this.parentNode!=document.body){document.body.appendChild(this);if(!this.id.endsWith("_new")){var bodymenu=document.getElementById(this.id+"_new");if(bodymenu!=null)document.body.removeChild(bodymenu);this.id=this.id+"_new"}}this.isShown=true;this.style.display="block";if(ie){this.style.left=document.documentElement.scrollLeft+body.scrollLeft+evt.e.clientX+"px";this.style.top=document.documentElement.scrollTop+
body.scrollTop+evt.e.clientY+"px"}else{this.style.left=body.scrollLeft+evt.e.clientX+"px";this.style.top=body.scrollTop+evt.e.clientY+"px"}if(ie){if(this.offsetLeft+this.table.offsetWidth>document.documentElement.scrollLeft+body.scrollLeft+body.clientWidth)this.style.left=document.documentElement.scrollLeft+body.scrollLeft+body.clientWidth-this.table.offsetWidth+"px"}else if(this.offsetLeft+this.table.offsetWidth>body.scrollLeft+body.clientWidth)this.style.left=body.scrollLeft+body.clientWidth-this.table.offsetWidth+
"px";if(this.offsetLeft<0)this.style.left="0px";if(ie){if(this.offsetTop+this.table.offsetHeight>document.documentElement.scrollTop+body.scrollTop+body.clientHeight)this.style.top=document.documentElement.scrollTop+body.scrollTop+body.clientHeight-this.table.offsetHeight+"px"}else if(this.offsetTop+this.table.offsetHeight>body.scrollTop+body.clientHeight)this.style.top=body.scrollTop+body.clientHeight-this.table.offsetHeight+"px";if(this.offsetTop<0)this.style.top="0px";if(this.onShow)this.onShow()}}
function showNS(e){if(this.tbody.childNodes.length>0){var body=this.sBody;if(this.parentNode!=document.body){document.body.appendChild(this);if(!this.id.endsWith("_new")){var bodymenu=document.getElementById(this.id+"_new");if(bodymenu!=null)document.body.removeChild(bodymenu);this.id=this.id+"_new"}}var evt=new Event(e);var cx=evt.e.clientX;var cy=evt.e.clientY;if(cx==null){var pos=getClient(e.target);cx=pos.cx;cy=pos.cy}else{cx+=body.scrollLeft;cy+=body.scrollTop}if(ie){cx+=document.documentElement.scrollLeft;
cy+=document.documentElement.scrollTop}this.isShown=true;this.style.display="none";this.style.left="0px";this.style.width="";if(cx>0)this.style.display="block";var activecell=this.menuContext;if(this.menuContext.filterCell!=null)activecell=this.menuContext.filterCell;var menuwidth=this.ismultiple?activecell.offsetWidth+10:activecell.offsetWidth;this.style.left=cx+"px";this.style.top=cy+"px";if(this.ismultiple){if(menuwidth<100)menuwidth=100;this.style.width=menuwidth+"px"}else if(menuwidth>2)this.style.width=
menuwidth-2+"px";else this.style.width=menuwidth+"px"}}
function showXY(x,y,griddiv){if(this.tbody.childNodes.length>0){var body=this.sBody;if(this.parentNode!=document.body){document.body.appendChild(this);if(!this.id.endsWith("_new")){var bodymenu=document.getElementById(this.id+"_new");if(bodymenu!=null)document.body.removeChild(bodymenu);this.id=this.id+"_new"}}this.isShown=true;if(x>0)this.style.display="block";this.style.left=x+"px";var menuheight=Number(this.style.height.replace("px",""));if(y+menuheight>griddiv.viewPanel.offsetHeight)this.style.top=
y-menuheight+"px";else this.style.top=y+"px"}if(this.onShow)this.onShow()}function hide(){this.isShown=false;this.style.display="none"}
function addItem(text,value){var tr=document.createElement("TR");this.tbody.appendChild(tr);var td=document.createElement("TD");if(ie)td.noWrap=true;td.unselectable="on";td.className="menu_out";if(!this.ismultiple)td.innerText=text;else{if(text.trim().length==0)text="(Blanks)";var description=document.createTextNode(text);var checkbox=document.createElement("input");var who=this;checkbox.type="checkbox";checkbox.name="slct[]";checkbox.value=value;checkbox.checked=true;checkbox.onclick=function(){who.checkIFUnsectedAll();
who.checkIFhasUnselected()};td.appendChild(checkbox);td.appendChild(description)}if(!firefox)td.itemValue=value;else td.setAttribute("itemValue",value);tr.appendChild(td);this.adjustHeight()}function setItemVisibility(itemValue,visibility){var items=this.getElementsByTagName("TD");for(var i=0;i<items.length;i++)if(items[i].itemValue!=null&&(items[i].itemValue==itemValue||items[i].itemValue=="CCMD:"+itemValue)){items[i].style.display=visibility;break}}
function addSeparator(){var tr=document.createElement("TR");this.tbody.appendChild(tr);var td=document.createElement("TD");tr.appendChild(td);td.unselectable="on";td.className="menu_separator";td.appendChild(document.createElement("HR"))}
function doAcwMenuOkClick(){var context=this.menuContext;var gridid=this.gridContext.id;if(context.id.indexOf(gridid+"_FTR")==0){var checkboxlist=this.getElementsByTagName("TD");var filtercmd="FILTER:"+context.id.substring(gridid.length+4,context.id.length);if(checkboxlist[0].childNodes[0].checked)this.gridContext.postBack(filtercmd+":"+"-1",false);else{for(var i=1;i<checkboxlist.length;i++)if(checkboxlist[i].className=="menu_out"){var checkboxitem=checkboxlist[i].childNodes[0];if(checkboxitem.checked)filtercmd+=
":"+checkboxitem.value}this.gridContext.postBack(filtercmd,false)}}else if(context.id.indexOf(gridid+"_PFT")==0){var checkboxlist=this.getElementsByTagName("TD");var filtercmd="PIVOTFILTER:"+context.getAttribute("fieldtype")+":"+context.getAttribute("fieldindex")+":"+context.getAttribute("pivottableid");if(checkboxlist[0].childNodes[0].checked)this.gridContext.postBack(filtercmd+":"+"-1",false);else{for(var i=1;i<checkboxlist.length;i++)if(checkboxlist[i].className=="menu_out"){var checkboxitem=checkboxlist[i].childNodes[0];
if(checkboxitem.checked)filtercmd+=":"+checkboxitem.value}this.gridContext.postBack(filtercmd,false)}}}function doAcwMenuCancelClick(){this.hide()}function checkIFUnsectedAll(){var checkboxlist=this.getElementsByTagName("TD");var hasuncheck=false;for(var i=1;i<checkboxlist.length;i++)if(checkboxlist[i].className=="menu_out"){var checkboxitem=checkboxlist[i].childNodes[0];if(checkboxitem.checked){this.okbutton.disabled=false;return true}}this.okbutton.disabled=true;return false}
function checkIFhasUnselected(){var checkboxlist=this.getElementsByTagName("TD");for(var i=1;i<checkboxlist.length;i++)if(checkboxlist[i].className=="menu_out"){var checkboxitem=checkboxlist[i].childNodes[0];if(!checkboxitem.checked){checkboxlist[0].childNodes[0].checked=false;return true}}checkboxlist[0].childNodes[0].checked=true;return false}
function doAcwMenuAllClick(checkedvalue){var checkboxlist=this.getElementsByTagName("TD");for(var i=1;i<checkboxlist.length;i++)if(checkboxlist[i].className=="menu_out"){var checkboxitem=checkboxlist[i].childNodes[0];checkboxitem.checked=checkedvalue}this.okbutton.disabled=!checkedvalue}
function doAcwMenuCheckByValue(valuelist){if(valuelist==null)return;var checkboxlist=this.getElementsByTagName("TD");var checkboxall=checkboxlist[0];checkboxall=checkboxall.childNodes[0];checkboxall.checked=false;for(var i=1;i<checkboxlist.length;i++)if(checkboxlist[i].className=="menu_out"){var checkboxitem=checkboxlist[i].childNodes[0];if(valuelist.indexOf(","+checkboxitem.value+",")>=0)checkboxitem.checked=true;else checkboxitem.checked=false}}
function addOKCancel(){if(!this.ismultiple)return;this.addSeparator();var who=this;var tr=document.createElement("TR");this.tbody.appendChild(tr);var td=document.createElement("TD");tr.appendChild(td);td.unselectable="on";td.className="menu_separator";var button=document.createElement("input");button.type="button";button.value="ok";button.style.paddingRight="10px";button.style.marginRight="10px";button.onclick=function(){who.doAcwMenuOkClick()};td.appendChild(button);this.okbutton=button;button=document.createElement("input");
button.type="button";button.value="cancel";button.onclick=function(){who.doAcwMenuCancelClick()};td.appendChild(button);var checkboxall=this.getElementsByTagName("TD")[0];checkboxall=checkboxall.childNodes[0];checkboxall.onclick=function(){who.doAcwMenuAllClick(checkboxall.checked)}}function hideTopSeparator(){var tr=this.tbody.childNodes[0];if(tr.childNodes[0].className=="menu_separator")tr.parentNode.removeChild(tr)}
function loadItems(xmlStr){xmlStr=xmlStr.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&apos;/g,"'");this.xmlData.loadXML(xmlStr);var items=this.xmlData.selectNodes("MENU/ITEM");for(var i=0;i<items.length;i++){var item=items[i];var text=item.getAttribute("TEXT");var value=item.getAttribute("VALUE");if(text==null||text=="")this.addSeparator();else{text=text.ESCAPE_BACK();if(value!=null)value=value.ESCAPE_BACK();else value=text;this.addItem(text,value)}}this.adjustHeight()}
function getMenuItemUpdateValue(xmlStr,which,text,value){xmlStr=xmlStr.replace(/&lt;/g,"<").replace(/&gt;/g,">");this.xmlData.loadXML(xmlStr);var items=this.xmlData.selectNodes("MENU/ITEM");items[which].setAttribute("TEXT",text.ESCAPE());if(value!=null)items[which].setAttribute("VALUE",value.ESCAPE());else items[which].setAttribute("VALUE",text.ESCAPE());if(!ie){var tmp=document.createElement("helloMENU");for(var i=0;i<items.length;i++)tmp.appendChild(items[i]);return"<MENU>"+tmp.innerHTML+"</MENU>"}else{var ret=
"<MENU>";for(var i=0;i<items.length;i++)ret+=items[i].xml;return ret+"</MENU>"}}
function filterItemsByValue(currentCellValue,xmlStr){xmlStr=xmlStr.replace(/&lt;/g,"<").replace(/&gt;/g,">");this.xmlData.loadXML(xmlStr);var items=this.xmlData.selectNodes("MENU/ITEM");for(var i=0;i<items.length;i++){var item=items[i];var text=item.getAttribute("TEXT");if(text==null||text=="")this.addSeparator();else if(text.toUpperCase().indexOf(currentCellValue.toUpperCase())>=0)this.addItem(text,item.getAttribute("VALUE"))}this.adjustHeight()}
function clear(){var l=this.tbody.childNodes.length;for(var i=0;i<l;i++)this.tbody.removeChild(this.tbody.childNodes[0]);this.currIndex=-1}function m_onmouseover(e){var evt=new Event(e);var o=evt.getTarget();if(o.tagName=="TD"&&o.innerText!="")o.className="menu_over"}function m_onmouseout(e){var evt=new Event(e);var o=evt.getTarget();if(o.tagName=="TD"&&o.innerText!="")o.className="menu_out"}
function m_onclick(e){var evt=new Event(e);var o=evt.getTarget();if(o.tagName=="TD"&&o.innerText!=""){var itemValue=null;if(!firefox)itemValue=o.itemValue;else itemValue=o.getAttribute("itemValue");if(itemValue==null)itemValue=o.innerText;o.className="menu_out";if(!this.ismultiple){this.hide();if(this.onItemClick)this.onItemClick(itemValue,this.id,this.menuContext)}else o.childNodes[0].click()}}
function adjustHeight(){if(this.tbody.childNodes.length<=22){this.style.height="";this.style.overflowY="hidden"}else{this.style.height=105+"px";this.style.overflowY="scroll"}};(function(){function Cache(maxSize,debug,storage){this.maxSize_=maxSize||-1;this.debug_=debug||false;this.storage_=storage||new Cache.BasicCacheStorage;this.fillFactor_=0.75;this.stats_={};this.stats_["hits"]=0;this.stats_["misses"]=0;this.log_("Initialized cache with size "+maxSize)}Cache.Priority={LOW:1,NORMAL:2,HIGH:4};Cache.BasicCacheStorage=function(){this.items_={};this.count_=0};Cache.BasicCacheStorage.prototype.get=function(key){return this.items_[key]};Cache.BasicCacheStorage.prototype.set=
function(key,value){if(typeof this.get(key)==="undefined")this.count_++;this.items_[key]=value};Cache.BasicCacheStorage.prototype.size=function(key,value){return this.count_};Cache.BasicCacheStorage.prototype.remove=function(key){var item=this.get(key);if(typeof item!=="undefined")this.count_--;delete this.items_[key];return item};Cache.BasicCacheStorage.prototype.keys=function(){var ret=[],p;for(p in this.items_)ret.push(p);return ret};Cache.LocalStorageCacheStorage=function(namespace){this.prefix_=
"cache-storage."+(namespace||"default")+".";var escapedPrefix=this.prefix_.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");this.regexp_=new RegExp("^"+escapedPrefix)};Cache.LocalStorageCacheStorage.prototype.get=function(key){var item=window.localStorage[this.prefix_+key];if(item)return JSON.parse(item);return null};Cache.LocalStorageCacheStorage.prototype.set=function(key,value){window.localStorage[this.prefix_+key]=JSON.stringify(value)};Cache.LocalStorageCacheStorage.prototype.size=function(key,value){return this.keys().length};
Cache.LocalStorageCacheStorage.prototype.remove=function(key){var item=this.get(key);delete window.localStorage[this.prefix_+key];return item};Cache.LocalStorageCacheStorage.prototype.keys=function(){var ret=[],p;for(p in window.localStorage)if(p.match(this.regexp_))ret.push(p.replace(this.prefix_,""));return ret};Cache.prototype.getItem=function(key){var item=this.storage_.get(key);if(item!=null)if(!this.isExpired_(item))item.lastAccessed=(new Date).getTime();else{this.removeItem(key);item=null}var returnVal=
item?item.value:null;if(returnVal){this.stats_["hits"]++;this.log_("Cache HIT for key "+key)}else{this.stats_["misses"]++;this.log_("Cache MISS for key "+key)}return returnVal};Cache._CacheItem=function(k,v,o){if(k==null)throw new Error("key cannot be null or empty");this.key=k;this.value=v;o=o||{};if(o.expirationAbsolute)o.expirationAbsolute=o.expirationAbsolute.getTime();if(!o.priority)o.priority=Cache.Priority.NORMAL;this.options=o;this.lastAccessed=(new Date).getTime()};Cache.prototype.setItem=
function(key,value,options){if(this.storage_.get(key)!=null)this.removeItem(key);this.addItem_(new Cache._CacheItem(key,value,options));this.log_("Setting key "+key);if(this.maxSize_>0&&this.size()>this.maxSize_){var that=this;setTimeout(function(){that.purge_.call(that)},0)}};Cache.prototype.clear=function(){var keys=this.storage_.keys();for(var i=0;i<keys.length;i++)this.removeItem(keys[i]);this.log_("Cache cleared")};Cache.prototype.getStats=function(){return this.stats_};Cache.prototype.toHtmlString=
function(){var returnStr=this.size()+" item(s) in cache<br /><ul>";var keys=this.storage_.keys();for(var i=0;i<keys.length;i++){var item=this.storage_.get(keys[i]);returnStr=returnStr+"<li>"+item.key.toString()+" = "+item.value.toString()+"</li>"}returnStr=returnStr+"</ul>";return returnStr};Cache.prototype.resize=function(newMaxSize){this.log_("Resizing Cache from "+this.maxSize_+" to "+newMaxSize);var oldMaxSize=this.maxSize_;this.maxSize_=newMaxSize;if(newMaxSize>0&&(oldMaxSize<0||newMaxSize<oldMaxSize))if(this.size()>
newMaxSize)this.purge_();this.log_("Resizing done")};Cache.prototype.purge_=function(){var tmparray=new Array;var purgeSize=Math.round(this.maxSize_*this.fillFactor_);if(this.maxSize_<0)purgeSize=this.size()*this.fillFactor_;var keys=this.storage_.keys();for(var i=0;i<keys.length;i++){var key=keys[i];var item=this.storage_.get(key);if(this.isExpired_(item))this.removeItem(key);else tmparray.push(item)}if(tmparray.length>purgeSize){tmparray=tmparray.sort(function(a,b){if(a.options.priority!=b.options.priority)return b.options.priority-
a.options.priority;else return b.lastAccessed-a.lastAccessed});while(tmparray.length>purgeSize){var ritem=tmparray.pop();this.removeItem(ritem.key)}}this.log_("Purged cached")};Cache.prototype.addItem_=function(item,attemptedAlready){var cache=this;try{this.storage_.set(item.key,item)}catch(err){if(attemptedAlready){this.log_("Failed setting again, giving up: "+err.toString());throw err;}this.log_("Error adding item, purging and trying again: "+err.toString());this.purge_();this.addItem_(item,true)}};
Cache.prototype.removeItem=function(key){var item=this.storage_.remove(key);this.log_("removed key "+key);if(item&&item.options&&item.options.callback)setTimeout(function(){item.options.callback.call(null,item.key,item.value)},0);return item?item.value:null};Cache.prototype.removeWhere=function(test){var keys=this.storage_.keys();for(var i=0;i<keys.length;i++){var key=keys[i];var item=this.storage_.get(key);if(test(key,item.value)===true)this.removeItem(key)}};Cache.prototype.size=function(){return this.storage_.size()};
Cache.prototype.isExpired_=function(item){var now=(new Date).getTime();var expired=false;if(item.options.expirationAbsolute&&item.options.expirationAbsolute<now)expired=true;if(!expired&&item.options.expirationSliding){var lastAccess=item.lastAccessed+item.options.expirationSliding*1E3;if(lastAccess<now)expired=true}return expired};Cache.prototype.log_=function(msg){if(this.debug_)console.log(msg)};var root=this;if(typeof module!=="undefined"&&module.exports)module.exports=Cache;else if(typeof define==
"function"&&define.amd)define(function(){return Cache});else root.Cache=Cache})();var ASYNC_CACHE_SIZE=500;function put_row_data_in_cache(is_asyncgrouprows,gridid,curcolstart,haveanyupdate){var data=getCurrentDataContentForCache(gridid,is_asyncgrouprows);for(var i=0;i<data.length;i++)put_row_data_in_cache_act(is_asyncgrouprows,data[i],curcolstart,haveanyupdate)}
function put_row_data_in_cache_act(is_asyncgrouprows,data,curcolstart,haveanyupdate){var curminrow=data.startv;var curmaxv=data.maxv;var needAdjustPreAfterForAsyncgrouprow=true;if(data.size!=32&&!is_asyncgrouprows);var cur_row_cache_index_array=col_row_cache_index[curcolstart];if(cur_row_cache_index_array==null){col_row_cache_index[curcolstart]=new Cache(ASYNC_CACHE_SIZE);cur_row_cache_index_array=col_row_cache_index[curcolstart];cur_row_cache_index_array.setItem(curminrow,data)}else{var item=cur_row_cache_index_array.getItem(curminrow);
if(!is_asyncgrouprows){if(haveanyupdate&&item!=null&&item.maxv==data.maxv){cur_row_cache_index_array.setItem(curminrow,data);return}var ret=find_pre_next_incache(is_asyncgrouprows,cur_row_cache_index_array,curminrow,curmaxv,true);if(ret.inside!=null)cur_row_cache_index_array.setItem(curminrow,data);else if(ret.cover!=null){if(haveanyupdate)updateDataCacheContent(cur_row_cache_index_array.getItem(ret.cover),data,curminrow,curmaxv)}else if(ret.pre==null&&ret.after==null)cur_row_cache_index_array.setItem(curminrow,
data);else{if(ret.pre!=null)if(haveanyupdate)updateDataCacheContent(cur_row_cache_index_array.getItem(ret.pre),data,curminrow,ret.premaxv);if(ret.after!=null)if(haveanyupdate)updateDataCacheContent(cur_row_cache_index_array.getItem(ret.after),data,ret.after,curmaxv);if(!(ret.pre!=null&&ret.after!=null&&ret.premaxv+1>=ret.after))cur_row_cache_index_array.setItem(curminrow,data)}}else if(haveanyupdate){var item=cur_row_cache_index_array.getItem(curminrow);if(item!=null&&item.maxv>curmaxv){updateDataCacheContent(item,
data,curminrow,curmaxv);return}else cur_row_cache_index_array.setItem(curminrow,data)}}if(is_asyncgrouprows){var ret=find_pre_next_incache(is_asyncgrouprows,cur_row_cache_index_array,curminrow,curmaxv,true);if(ret.outside!=null){var outsideData=cur_row_cache_index_array.getItem(ret.outside);updateDataCacheContent(outsideData,data,curminrow,curmaxv);cur_row_cache_index_array.removeItem(curminrow)}if(ret.pre!=null&&ret.after!=null){var preData=cur_row_cache_index_array.getItem(ret.pre);preData=getDataCacheContent(preData,
ret.pre,curminrow-1);var afterData=cur_row_cache_index_array.getItem(ret.after);var newdata=null;if(curmaxv+1<afterData.maxv){afterData=getDataCacheContent(afterData,curmaxv+1,afterData.maxv);newdata=combineDataCacheContent(preData,data,afterData)}else newdata=combineDataCacheContent(preData,data);cur_row_cache_index_array.removeItem(curminrow);cur_row_cache_index_array.removeItem(ret.after);cur_row_cache_index_array.setItem(ret.pre,newdata)}else{if(ret.pre!=null){var preData=cur_row_cache_index_array.getItem(ret.pre);
preData=getDataCacheContent(preData,ret.pre,curminrow-1);var newdata=combineDataCacheContent(preData,data);cur_row_cache_index_array.removeItem(curminrow);cur_row_cache_index_array.setItem(ret.pre,newdata)}if(ret.after!=null){var afterData=cur_row_cache_index_array.getItem(ret.after);var newdata=null;if(curmaxv+1<afterData.maxv){afterData=getDataCacheContent(afterData,curmaxv+1,afterData.maxv);var newdata=combineDataCacheContent(data,afterData);cur_row_cache_index_array.setItem(curminrow,newdata)}else;
cur_row_cache_index_array.removeItem(ret.after)}}if(ret.insideArr!=null)for(var id=0;id<ret.insideArr.length;id++)cur_row_cache_index_array.removeItem(ret.insideArr[id].start)}}
function tryfindcachePrepare(){if(this.async&&enableasynccache){var amaxrow=this.amaxrow;var aminrow=this.aminrow;var is_asyncgrouprows=this.row_v_info!=null;if(this.viewTable00!=null)if(aminrow<=this.freezerow-1)aminrow=this.freezerow;var cur_row_cache_index_array=col_row_cache_index[this.amincol];var data=cur_row_cache_index_array.getItem(aminrow);if(!is_asyncgrouprows){if(data!=null)if(data.maxv==amaxrow){this.refreshdataview(data);return false}else if(data.maxv>amaxrow){data=getDataCacheContent(data,
aminrow,amaxrow);this.refreshdataview(data);return false}else if(data.maxv<amaxrow);var ret=find_pre_next_incache(is_asyncgrouprows,cur_row_cache_index_array,aminrow,amaxrow,false);if(ret.pre!=null){this.webstartrow=ret.premaxv+1;asyncbeforepostpredata=getDataCacheContent(cur_row_cache_index_array.getItem(ret.pre),aminrow,ret.premaxv)}else{this.webstartrow=null;asyncbeforepostpredata=null}if(ret.after!=null){this.webendrow=ret.after-1;if(ret.pre!=null&&this.webstartrow>this.webendrow){var afterdata=
getDataCacheContent(cur_row_cache_index_array.getItem(ret.after),this.webstartrow,amaxrow);var data=combineDataCacheContent(asyncbeforepostpredata,afterdata);this.refreshdataview(data);return false}asyncbeforepostafterdata=getDataCacheContent(cur_row_cache_index_array.getItem(ret.after),ret.after,amaxrow);if(ret.pre!=null){var ret2=find_pre_next_incache(is_asyncgrouprows,cur_row_cache_index_array,this.webstartrow,this.webendrow,false);if(ret2.pre!=null)if(ret2.premaxv>=this.webendrow){var mid1=getDataCacheContent(cur_row_cache_index_array.getItem(ret2.pre),
this.webstartrow,this.webendrow);var data=combineDataCacheContent(asyncbeforepostpredata,mid1,asyncbeforepostafterdata);this.refreshdataview(data);return false}else if(ret2.after!=null&&ret2.premaxv+1>=ret2.after){var mid1=getDataCacheContent(cur_row_cache_index_array.getItem(ret2.pre),this.webstartrow,ret2.premaxv);var mid2=getDataCacheContent(cur_row_cache_index_array.getItem(ret2.after),ret2.premaxv+1,this.webendrow);var data=combineDataCacheContent(asyncbeforepostpredata,mid1,mid2,asyncbeforepostafterdata);
this.refreshdataview(data);return false}else if(ret2.after==null){var prenext=getDataCacheContent(cur_row_cache_index_array.getItem(ret2.pre),this.webstartrow,ret2.premaxv);this.webstartrow=ret2.premaxv+1;asyncbeforepostpredata=combineDataCacheContent(asyncbeforepostpredata,prenext)}}}else{this.webendrow=null;asyncbeforepostafterdata=null}return true}else if(data!=null)if(data.maxv>=amaxrow){data=getDataCacheContent(data,aminrow,amaxrow);this.refreshdataview(data);return false}else{var ret=find_pre_next_incache(is_asyncgrouprows,
cur_row_cache_index_array,aminrow,amaxrow,false);if(ret.after!=null)if(ret.after==data.maxv+1){var afterdata=getDataCacheContent(cur_row_cache_index_array.getItem(ret.after),ret.after,amaxrow);data=combineDataCacheContent(data,afterdata);this.refreshdataview(data);return false}else{this.webendrow=ret.after-1;asyncbeforepostafterdata=getDataCacheContent(cur_row_cache_index_array.getItem(ret.after),ret.after,amaxrow)}this.webstartrow=data.maxv+1;asyncbeforepostpredata=data}else{var ret=find_pre_next_incache(is_asyncgrouprows,
cur_row_cache_index_array,aminrow,amaxrow,false);if(ret.outside!=null){data=cur_row_cache_index_array.getItem(ret.outside);data=getDataCacheContent(data,aminrow,amaxrow);this.refreshdataview(data);return false}if(ret.pre!=null&&ret.after!=null)if(cur_row_cache_index_array.getItem(ret.pre).maxv+1==ret.after){var predata=cur_row_cache_index_array.getItem(ret.pre);predata=getDataCacheContent(predata,aminrow,predata.maxv);var afterdata=cur_row_cache_index_array.getItem(ret.after);afterdata=getDataCacheContent(afterdata,
ret.after,amaxrow);data=combineDataCacheContent(predata,afterdata);this.refreshdataview(data);return false}else;if(ret.pre!=null){this.webstartrow=ret.premaxv+1;asyncbeforepostpredata=getDataCacheContent(cur_row_cache_index_array.getItem(ret.pre),aminrow,ret.premaxv)}else{this.webstartrow=null;asyncbeforepostpredata=null}if(ret.after!=null){this.webendrow=ret.after-1;asyncbeforepostafterdata=getDataCacheContent(cur_row_cache_index_array.getItem(ret.after),ret.after,amaxrow)}else{this.webendrow=null;
asyncbeforepostafterdata=null}}}return true}function getLastIndexFromPostion(str,find,postion){var result=false;for(var i=postion-find.length;i>0;i--){result=true;for(var j=0;j<find.length;j++)if(find[j]!=str[i+j]){result=false;break}if(result)return i}return-1}function getindexfromid(str){var i=str.lastIndexOf("]");return Number(str.substring(i+1))}
function parseRespWebHTML(id,resp,stylestr,needrenderviewtable10){var ret={};ret.stylestr=stylestr;var headpatternstart='<table id="'+id+'_leftTab"';var headstart=resp.indexOf(headpatternstart);var tmp=resp.substring(headstart);headpatternstart='<tr id="'+id+"_[h_row]";headstart=tmp.indexOf(headpatternstart);var tmp=tmp.substring(headstart);var headend=tmp.indexOf("</table>");ret.headstr=tmp.substring(0,headend);tmp=tmp.substring(headend);var contentpatternstart10='<table id="'+id+'_viewTable10"';
var contentstart10=tmp.indexOf(contentpatternstart10);if(contentstart10!=-1&&needrenderviewtable10){tmp=tmp.substring(contentstart10);if(this.freezecol>0)contentstart10=tmp.indexOf('<tr id="'+id+"_[d_row]");else contentstart10=tmp.indexOf('<tr id="'+id+"_[f_row]");tmp=tmp.substring(contentstart10);var contentend10=tmp.indexOf("</table>");ret.contentstr10=tmp.substring(0,contentend10)}var contentpatternstart='<table id="'+id+'_viewTable"';var contentstart=tmp.indexOf(contentpatternstart);var tmp=tmp.substring(contentstart);
if(this.freezecol>0){var freezestart='id="'+id+"_"+this.freezecol+"#";contentstart=tmp.indexOf(freezestart);contentstart=getLastIndexFromPostion(tmp,"<tr",contentstart)}else contentstart=tmp.indexOf('<tr id="'+id+"_[d_row]");tmp=tmp.substring(contentstart);var contentend=tmp.indexOf("</table>");ret.contentstr=tmp.substring(0,contentend);return ret}
var DataCacheContent={createNew:function(c){var cat={};cat.gridwebid=c;cat.init=function(){var headcontent=document.getElementById(cat.gridwebid+"_leftTab").children[1];if(headcontent.children[0]==null)console.log("error happend");cat.startv=getindexfromid(headcontent.children[0].id);cat.size=headcontent.children.length;cat.maxv=cat.startv+cat.size-1;if(!ie)cat.stylestr=document.getElementById("Style"+cat.gridwebid).innerHTML;else cat.stylestr=getStyleSheetObject(cat.gridwebid).cssText;cat.headstr=
headcontent.innerHTML;cat.contentstr=document.getElementById(cat.gridwebid+"_viewTable").children[1].innerHTML;var vt10=document.getElementById(cat.gridwebid+"_viewTable10");if(vt10!=null&&vt10.children.length>1)cat.contentstr10=vt10.children[1].innerHTML};cat.getContent=function(start,end){var ret={};ret.getContent=this.getContent;ret.updateContent=this.updateContent;ret.gridwebid=this.gridwebid;ret.startv=start;ret.maxv=end;ret.size=end-start+1;ret.stylestr=this.stylestr;var headpatternstart='<tr id="'+
this.gridwebid+"_[h_row]"+start+'"';var headpatternend='<tr id="'+this.gridwebid+"_[h_row]"+(end+1)+'"';var contentpatternstart='<tr id="'+this.gridwebid+"_[d_row]"+start+'"';var contentpatternend='<tr id="'+this.gridwebid+"_[d_row]"+(end+1)+'"';var contentpatternstart10=contentpatternstart;var contentpatternend10=contentpatternend;var gridwebinstance=document.getElementById(this.gridwebid);if(gridwebinstance.freeze)if(gridwebinstance.freezecol>0){var freezecolnumber=gridwebinstance.freezecol;contentpatternstart=
'id="'+this.gridwebid+"_"+freezecolnumber+"#"+start+'"';contentpatternend='id="'+this.gridwebid+"_"+freezecolnumber+"#"+(end+1)+'"'}else{contentpatternstart10='<tr id="'+this.gridwebid+"_[f_row]"+start+'"';contentpatternend10='<tr id="'+this.gridwebid+"_[f_row]"+(end+1)+'"'}var from=-1;var from2=-1;var from10=-1;if(start==this.startv){from=0;from2=0;from10=0}else{from=this.headstr.indexOf(headpatternstart);from2=this.contentstr.indexOf(contentpatternstart);if(this.contentstr10!=null)from10=this.contentstr10.indexOf(contentpatternstart10)}if(from2>
0&&gridwebinstance.freezecol>0)from2=getLastIndexFromPostion(this.contentstr,"<tr",from2);var to=-1;var to2=-1;var to10=-1;if(end==this.maxv){ret.headstr=this.headstr.substring(from);if(this.contentstr10!=null)ret.contentstr10=this.contentstr10.substring(from10);ret.contentstr=this.contentstr.substring(from2)}else{to=this.headstr.indexOf(headpatternend);to2=this.contentstr.indexOf(contentpatternend);ret.headstr=this.headstr.substring(from,to);if(this.contentstr10!=null){to10=this.contentstr10.indexOf(contentpatternend10);
ret.contentstr10=this.contentstr10.substring(from10,to10);if(to2>0&&gridwebinstance.freezecol>0)to2=getLastIndexFromPostion(this.contentstr,"<tr",to2)}ret.contentstr=this.contentstr.substring(from2,to2)}ret.stylestr=this.stylestr;return ret};cat.updateContent=function(updated,start,end){var updateret=updated.getContent(start,end);var headpatternstart='<tr id="'+this.gridwebid+"_[h_row]"+start+'"';var headpatternend='<tr id="'+this.gridwebid+"_[h_row]"+(end+1)+'"';var contentpatternstart='<tr id="'+
this.gridwebid+"_[d_row]"+start+'"';var contentpatternend='<tr id="'+this.gridwebid+"_[d_row]"+(end+1)+'"';var contentpatternstart10=contentpatternstart;var contentpatternend10=contentpatternend;var from=-1;var from2=-1;var prestr="";var prestr2="";var from10=-1;var prestr10="";var gridwebinstance=document.getElementById(this.gridwebid);if(gridwebinstance.freeze)if(gridwebinstance.freezecol>0){var freezecolnumber=gridwebinstance.freezecol;contentpatternstart='id="'+this.gridwebid+"_"+freezecolnumber+
"#"+start+'"';contentpatternend='id="'+this.gridwebid+"_"+freezecolnumber+"#"+(end+1)+'"'}else{contentpatternstart10='<tr id="'+this.gridwebid+"_[f_row]"+start+'"';contentpatternend10='<tr id="'+this.gridwebid+"_[f_row]"+(end+1)+'"'}if(start!=this.startv){from=this.headstr.indexOf(headpatternstart);from2=this.contentstr.indexOf(contentpatternstart);prestr=this.headstr.substring(0,from);if(this.contentstr10!=null){from10=this.contentstr10.indexOf(contentpatternstart10);prestr10=this.contentstr10.substring(0,
from10);if(from2>0&&gridwebinstance.freezecol>0)from2=getLastIndexFromPostion(this.contentstr,"<tr",from2)}prestr2=this.contentstr.substring(0,from2)}var to=-1;var to2=-1;var endstr="";var endstr2="";var to10=-1;var endstr10="";if(end!=this.maxv){to=this.headstr.indexOf(headpatternend);to2=this.contentstr.indexOf(contentpatternend);endstr=this.headstr.substring(to);if(this.contentstr10!=null){to10=this.contentstr10.indexOf(contentpatternend10);endstr10=this.contentstr10.substring(to10);if(to2>0&&
gridwebinstance.freezecol>0)to2=getLastIndexFromPostion(this.contentstr,"<tr",to2)}endstr2=this.contentstr.substring(to2)}this.headstr=prestr+updateret.headstr+endstr;this.contentstr=prestr2+updateret.contentstr+endstr2;this.stylestr=mergestyle(this.stylestr,updated.stylestr);if(this.contentstr10!=null)this.contentstr10=prestr10+updateret.contentstr10+endstr10};cat.toString=function(){return"cache item startv:"+this.startv+",maxv:"+this.maxv+""};cat.init();return cat}};
function getCurrentDataContentForCache(gridwebid,is_asyncgrouprows){var ret=new Array;var d=DataCacheContent.createNew(gridwebid);if(is_asyncgrouprows)ret[0]=d;else{var len=Math.floor(d.size/PERROWNUMBER);for(var i=0;i<len;i++)ret[i]=d.getContent(d.startv+i*PERROWNUMBER,d.startv+i*PERROWNUMBER+PERROWNUMBER-1)}return ret}function getDataCacheContent(data,start,end){return data.getContent(start,end)}function updateDataCacheContent(data,updated,start,end){data.updateContent(updated,start,end)}
function setAsCacheItem(newdata,olditem,start,max){newdata.startv=start;newdata.maxv=max;newdata.size=max-start+1;newdata.getContent=olditem.getContent;newdata.updateContent=olditem.updateContent;newdata.toString=olditem.toString;newdata.gridwebid=olditem.gridwebid}
function combineDataCacheContent(data1,data2,data3,data4){var ret={};ret.headstr=data1.headstr+data2.headstr;ret.contentstr=data1.contentstr+data2.contentstr;ret.stylestr=mergestyle(data1.stylestr,data2.stylestr);setAsCacheItem(ret,data1,data1.startv,data2.maxv);if(data1.contentstr10!=null)ret.contentstr10=data1.contentstr10+data2.contentstr10;if(data3!=null){ret.headstr+=data3.headstr;ret.contentstr+=data3.contentstr;ret.stylestr=mergestyle(ret.stylestr,data3.stylestr);if(data1.contentstr10!=null)ret.contentstr10+=
data3.contentstr10;ret.maxv=data3.maxv;ret.size=ret.maxv-ret.startv+1}if(data4!=null){ret.headstr+=data4.headstr;ret.contentstr+=data4.contentstr;ret.stylestr=mergestyle(ret.stylestr,data4.stylestr);if(data1.contentstr10!=null)ret.contentstr10+=data4.contentstr10;ret.maxv=data4.maxv;ret.size=ret.maxv-ret.startv+1}return ret}function getlasttrinfo(s){var index=s.lastIndexOf("<tr");return s.substring(index,index+160)}
function gettridinfo(s){var index=s.indexOf("]");s=s.substring(index,index+10);index=s.indexOf('"');s=s.substring(1,index);return Number(s)}function mergestyle(s1,s2){var s1arr=[];var rules=s1.split("}");for(i=0;i<rules.length;i++){var rule=rules[i].split("{");if(rule.length==2)s1arr.push(rule[0])}var rules2=s2.split("}");for(i=0;i<rules2.length;i++){var rule2=rules2[i].split("{");if(rule2.length==2)if(!findinarray(s1arr,rule2[0]))s1+=rule2[0]+"{"+rule2[1]+"}"}return s1}
function findinarray(arr,content){for(var i=0;i<arr.length;i++)if(arr[i]==content)return true;return false}
function find_pre_next_incache(is_asyncgrouprows,cache,curindex,curmaxv,canadjustcache){var k=cache.storage_.keys();var ret={};if(!is_asyncgrouprows){ret.cover=null;ret.inside=null;var pre=-1;var after=-1;var predif=-1;var afterdif=-1;var hasclosepre=false;var hascloseafter=false;for(var i=0;i<k.length;i++){var item=cache.getItem(k[i]);var itemboundary=item.maxv;if(k[i]==curmaxv+1)hascloseafter=true;if(itemboundary+1==curindex)hasclosepre=true;if(k[i]<=curindex&&itemboundary>=curindex){var dif=curindex-
k[i];if(dif>predif){predif=dif;pre=i}}if(k[i]<=curmaxv&&curmaxv<=itemboundary){var dif=itemboundary-curmaxv;if(dif>afterdif){afterdif=dif;after=i}}if(canadjustcache)if(k[i]<=curindex&&curmaxv<=itemboundary){ret.cover=k[i];ret.maxv=itemboundary;return ret}else if(k[i]>=curindex&&curmaxv>=itemboundary){ret.inside=k[i];ret.maxv=itemboundary;cache.removeItem(k[i]);return ret}}if(pre==-1)ret.pre=null;else{ret.pre=k[pre];ret.premaxv=cache.getItem(ret.pre).maxv}if(after==-1)ret.after=null;else{ret.after=
k[after];ret.aftermaxv=cache.getItem(ret.after).maxv}if(canadjustcache){if(hasclosepre)ret.pre=null;if(hascloseafter)ret.after=null;if(pre!=-1||after!=-1)for(var i=0;i<k.length;i++){var item=cache.getItem(k[i]);var itemboundary=item.maxv;if(pre!=-1)if(k[i]<curindex&&itemboundary>curindex)if(i!=pre||hasclosepre)cache.removeItem(k[i]);if(after!=-1)if(k[i]<curmaxv&&curmaxv<itemboundary)if(i!=after||hascloseafter)cache.removeItem(k[i])}}}else{var pre=-1;var after=-1;var insideindex=0;var insideArr=[];
var iteminside={};for(var i=0;i<k.length;i++){var item=cache.getItem(k[i]);var itemboundary=item.maxv;if(k[i]==curindex&&itemboundary==curmaxv)continue;if(k[i]<=curindex&&itemboundary>=curmaxv){ret.outside=Number(k[i]);return ret}if(k[i]>curindex&&itemboundary<=curmaxv){iteminside.start=Number(k[i]);iteminside.maxv=cache.getItem(k[i]).maxv;insideArr[insideindex++]=iteminside}if(k[i]<=curindex&&itemboundary>=curindex){ret.pre=Number(k[i]);ret.premaxv=cache.getItem(ret.pre).maxv}if(k[i]<=curmaxv&&curmaxv<
itemboundary||k[i]>curindex&&curmaxv==itemboundary){ret.after=Number(k[i]);ret.aftermaxv=cache.getItem(ret.after).maxv}}if(insideArr.length>0)ret.insideArr=insideArr}return ret}
function prca(col){var cache=col_row_cache_index[col];if(cache==null){console.log("can't find cache with colindex:"+col);return}var k=cache.storage_.keys();var s="*****************cache info here:cache index is"+col+" ";for(var i=0;i<k.length;i++){var item=cache.getItem(k[i]);s+=",key "+k[i]+":"+item.startv+"->"+item.maxv+"("+item.size+")"}console.log(s)}function putorget(it){if(it)return"put cache ";else return" find in cache "};