UNPKG

gridweb-spreadsheet

Version:

this is the client js for GridWeb,which is an easy-to-use .net and java web control for display and edit spreadsheet file

113 lines (112 loc) 307 kB
//Copyright (c) 2001-2016 Aspose Pty Ltd. All Rights Reserved. var acw_version="2024.06.06";var ie;var iemv;var firefox;var chrome;var safari;var opera;var clientpageheight=0;var asynctableheight_map=new GridIMap;var acwfontsize_map=new GridIMap;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=true;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 normalizeSpaces(str){if(typeof str==="string")return str.replace(/[ \u00A0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\u200B\u2060\uFEFF\u202A-\u202D\u2061-\u2064\u206A-\u206F\uFFF0-\uFFFF]/g," ");else return str}function setInnerText(span,v){v=normalizeSpaces(v);span.textContent=v;span.innerText=v} function getInnerText(o){var span=o;if(span.children.length>0&&span.tagName=="TD")span=span.children[0];var text_inner="";if(span.children.length===0||span.children.length>=0&&span.children[0].getAttribute("bb")==="1"){var spct=span.textContent;text_inner=span.innerText;if(spct.length>text_inner.length&&spct.indexOf(" ")>=0&&text_inner.indexOf("\n")===-1)text_inner=spct}else{var othernode=[];if(span.children.length>=1&&(span.innerHTML.indexOf("<IMG")>=0||span.innerHTML.indexOf(" msotype=")>=0))for(var i= span.children.length-1;i>=0;i--){var child=span.children[i];if(child.tagName==="IMG"||child.getAttribute("msotype")){othernode.push(child);span.removeChild(child)}}var spct=span.textContent;text_inner=span.innerText;if(spct.length>text_inner.length&&spct.indexOf(" ")>=0&&text_inner.indexOf("\n")===-1)text_inner=spct;for(var i=othernode.length-1;i>=0;i--)span.appendChild(othernode[i])}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{if(op.endsWith("%")){op=op.substr(0,op.length-1);return isNaN(op)?null:(Number(op)/100).toFixed(10)}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 GridIMap; function acwmain(gridweb){if(gridwebinstance.get(gridweb.id)!=null)return;this.gridweb=gridweb;gridweb.handler=this;gridweb.reSetDPI=reSetDPI;gridweb.reSetDPI();gridweb.menuRangeMap=new GridIMap;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)}gridweb.webuniqueid=getattr(gridweb,"webuniqueid"); if(gridweb.ajaxcallpath!=null&&gridweb.ajaxcallpath.endsWith("acw_ajax_call=true"))java_client=true;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"));if(gridweb.freezecol>0);}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.getColumnWidth=getColumnWidth;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.setUpContrlCheckBox=setUpContrlCheckBox;gridweb.setUpContrlTextBox= setUpContrlTextBox;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.adjustSpanCell=adjustSpanCell;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.updateCellFontStyle=updateCellFontStyle;gridweb.updateCellFontName=updateCellFontName; gridweb.updateCellFontSize=updateCellFontSize;gridweb.updateCellFontLine=updateCellFontLine;gridweb.updateCellFontColor=updateCellFontColor;gridweb.updateCellBackGroundColor=updateCellBackGroundColor;gridweb.addCelllink=addCelllink;gridweb.delCelllink=delCelllink;gridweb.getCellRowColumnByCellName=getCellRowColumnByCellName;gridweb.getCellColumnByColumnName=getCellColumnByColumnName;gridweb.rangeupdate=rangeupdate;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.addcomments=addcomments;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 GridIMap;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()",1)}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);acwfontsize_map.clear()} 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.style.display="inline-block";this.editorbox.style.border="1px solid green";this.editorbox.style.height="50px";this.editorbox.style.overflow="hidden";this.editorbox.contentEditable=true;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){var isrichtext=getattr(current_cell,"ufvbb")!=null;if(!current_cell.setLastText){current_cell.setLastText= true;current_cell.lastText=getInnerText(current_cell)}current_cell.hasupdated=true;copywithstyle(current_cell,this.innerText);var indexofcontent=this.innerText.indexOf(CELL_CONTENT_FORMAT_DELIMITER);if(indexofcontent>0)this.innerText=this.innerText.substring(0,indexofcontent);this.mygridweb.editCell2(current_cell,isrichtext?this.innerHTML:this.innerText);if(this.innerText.length>0&&current_cell.firstChild!=null)this.mygridweb.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"));root.appendChild(this.xmlDoc.createElement("OP")); 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=$("#"+this.id+" 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=$("#"+this.id+" 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=$("#"+this.id+" .acwc_ScrollBar");for(var i=0;i<scrollist.length;i++)gridweb.setUpContrlScrollBar(scrollist[i]); scrollist=$("#"+this.id+" .acwc_RadioButton");for(var i=0;i<scrollist.length;i++)gridweb.setUpContrlRadioButton(scrollist[i]);scrollist=$("#"+this.id+" .acwc_CheckBox");for(var i=0;i<scrollist.length;i++)gridweb.setUpContrlCheckBox(scrollist[i]);scrollist=$("#"+this.id+" .acwc_TextBox");for(var i=0;i<scrollist.length;i++)gridweb.setUpContrlTextBox(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(){if(this.removeLoadingGif!=null)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.