var __doc=document;function $(A){return __doc.getElementById(A)}function node(A){return __doc.createElement(A)}function evalJS(e){eval(e.responseText)}function getHTTPObject(){var A=false;if(window.XMLHttpRequest){try{A=new XMLHttpRequest()}catch(B){A=false}}else{if(window.ActiveXObject){try{A=new ActiveXObject("Msxml2.XMLHTTP")}catch(B){try{A=new ActiveXObject("Microsoft.XMLHTTP")}catch(B){A=false}}}}return A}function rm(A){while(A&&A.childNodes.length>0){A.removeChild(A.firstChild)}}function read(D,B,C){var A=getHTTPObject();try{A.open("GET",B,!C);if(!C){A.onreadystatechange=function(){if(A.readyState==4){if(A.status!=200){readRetry(D,B,C);return false}if(D){D(A)}}}}A.send(null);if(C){if(A.status!=200){readRetry(D,B,C);return false}if(D){D(A)}}return true}catch(E){readRetry(D,B,C,E.message);return false}}function readRetry(E,C,D,B){var A=$("retryRead");if(A){if(B){A.em=B}else{A.em="No Error"}A.style.display=""}}var floatingWinUrlFunc;function floatTinyWin(A,B){if(!B){B="null/undefined"}$("floatingTinyWin").style.display="";$("floatingTinyWinContent").innerHTML=B;if(A){$("floatingTinyWin").onclick=A}}function closeGalleryIntro(){$("desc").style.display="";$("floatingTinyWin").style.display="none"}function updateContainer(B,A){if(B){floatingWinUrlFunc=B}$(A).innerHTML='';$(A).style.display="";read(function(C){$(A).innerHTML=C.responseText},floatingWinUrlFunc(),true)}function floatWinPrompt(B,D,E,A){var C=D+"
';floatWin(null,C,E);$("floatWinPromptInput").focus()}function floatWin(A,B,C){ctrl.outOfNUI=true;floatWinMode=null;if(!C){C=" "}if(B){$("floatingWin").style.display="";$("floatingWinContent").innerHTML=B;$("floatingWinHeader").innerHTML=C;if(A){A()}return }if(A){floatingWinUrlFunc=A}$("floatingWinContent").innerHTML="Loading...";$("floatingWin").style.display="";$("floatingWinHeader").innerHTML=C;read(function(D){$("floatingWinContent").innerHTML=D.responseText;if($("floatingWinContent").offsetHeight>document.body.offsetHeight*0.6){$("floatingWinContent").style.height=document.body.offsetHeight*0.6}},floatingWinUrlFunc())}function indexOf(C,B){if(!B||!C){return -1}var A=0;for(;B&&A0){floatWin(null,lm.valueFormatIncorrect+" : "+A);return }floatWin(null,lm.entrySaving);$("nuiform").submit()}function updateShortcut(B,C,A){if($("newInstUrl").value==""||$("newInstName").value==""){floatWin(null,lm.enterDBNameURL);return false}else{if(A){progressBar();read(evalJS,"/sims/copyAp.jsp?a="+B+"&i="+A+"&nn="+encodeURIComponent($("newInstName").value)+"&iu="+encodeURIComponent($("newInstUrl").value))}else{nui._blur();builder.saveServer(true);read(evalJS,"/sims/saveShortcut.jsp?mustFindDesign&a="+B+"&nn="+encodeURIComponent($("newInstName").value)+"&p="+encodeURIComponent($("newInstUrl").value)+C)}}return true}function calculateCost(){var C=$("numOfLicense");var D=$("monthOfExtension");var B=parseInt(C.options[C.selectedIndex].value);var A=parseInt(D.options[D.selectedIndex].value);var G=25*B;if(B>1000){G=2499}else{if(B>150){G=999}else{if(B>23){G=599}}}var E=G*A;$("cost1").value=E;$("cost2").innerHTML=E}function motd(){if(!ctrl.isIE){return }var A=getCookie("motd");if(!A){setCookie("motd","1",3*24*3600*1000)}}function mmailLoadEmail(E){var C=E.split("\n"),B;var A="";for(B=0;B'+D[1]+" "}return A}function setCaretTo(B,C){if(B.createTextRange){var A=B.createTextRange();A.move("character",C);A.select()}else{B.focus();B.setSelectionRange(C,C)}}function switchBanner(){var A=$("customBanner");if(A.style.display=="none"){A.style.display="";removeBannerOff(ap+path)}else{A.style.display="none";setBannerOff(ap+path)}eventWindowResize()}function getBannerOff(D){var C=getCookie("bannerOff");var B=C.split(","),A;for(A=0;A=0;B=B-1){C=A[B];if(C[0].removeEventListener){C[0].removeEventListener(C[1],C[2],C[3])}if(C[1].substring(0,2)!="on"){C[1]="on"+C[1]}if(C[0].detachEvent){C[0].detachEvent(C[1],C[2])}C[0][C[1]]=null}}}}();addEvent(window,"unload",EventCache.flush);var pickedHeader=0;function pickExcelHeader(A){$("headerRow"+pickedHeader).className="";$("headerRow"+A).className="pickedRow";$("pickHeader"+pickedHeader).checked=false;$("pickHeader"+A).checked=true;pickedHeader=A}function pickExcelCell(A){if(A==-1){return }if($("pickCell"+A).checked){$("headerCell"+A).className="";$("pickCell"+A).checked=false}else{$("headerCell"+A).className="pickedCell";$("pickCell"+A).checked=true}}var domainPickerFunc=function(B,A){alert(B)};function updateDomainSelect(B){if(!B){return }var A=B.options[B.selectedIndex].value;floatWin(function(){return"/sims/domainPicker.jsp?a="+ap+"&p="+A})}function domainPicker(A){domainPickerFunc=function(C,B){ctrl.outOfNUI=false;$("floatingWin").style.display="none";A(C,B)};floatWin(function(){return"/sims/domainPicker.jsp?a="+ap+"&p="+encodeURIComponent(path)+"&fn="+encodeURIComponent(sheet)})}var _oldTableHL=new Array();function tableHL(G,A,E){var B=0,D,C=_oldTableHL;for(;B=0){E=D}C="1"}return E}setCookie("tz",calculate_time_zone(),null);function closeUL(C){var A;for(A=0;A=A&&B<=C)?true:false)}function XY(B,A){var C=agent("msie")?{X:event.clientX+document.documentElement.scrollLeft,Y:event.clientY+document.documentElement.scrollTop}:{X:B.pageX,Y:B.pageY};return(A?C[A]:C)}function zero(A){A=parseInt(A);return(!isNaN(A)?A:0)}var maxValue={H:360,S:100,V:100},HSV={H:360,S:100,V:100};var slideHSV={H:360,S:100,V:100},zINDEX=15,stop=1;function HSVslide(K,B,J){function M(R){N=XY(R).Y-P.Y;O=XY(R).X-P.X}function L(S,R,T){return(Math.min(S,Math.max(0,Math.ceil((parseInt(T)/R)*S))))}function G(S,R){if(within(S,0,R)){return(S)}else{if(S>R){return(R)}else{if(S<0){return("-"+H)}}}}function D(U){if(!stop){if(K!="drag"){M(U)}if(K=="SVslide"){C.left=G(O-H,162)+"px";C.top=G(N-H,162)+"px";slideHSV.S=L(100,162,C.left);slideHSV.V=100-L(100,162,C.top);HSVupdate()}else{if(K=="Hslide"){var R=G(N-H,163),T=["H","S","V"],V={};C.top=(R-5)+"px";slideHSV.H=L(360,163,R);for(var S in T){S=T[S];V[S]=(S=="H")?maxValue[S]-L(maxValue[S],163,R):HSV[S]}HSVupdate(V);$S("SV").backgroundColor="#"+color.HSV_HEX({H:HSV.H,S:100,V:100})}else{if(K=="drag"){C.left=XY(U).X+I-A+"px";C.top=XY(U).Y+E-Q+"px"}}}}}if(stop){stop="";var C=$S(K!="drag"?K:B);if(K=="drag"){var I=parseInt(C.left),E=parseInt(C.top),A=XY(J).X,Q=XY(J).Y;$S(B).zIndex=zINDEX++}else{var P=abPos($(B)),O,N,H=(K=="Hslide")?2:4;P.X+=10;P.Y+=22;if(K=="SVslide"){slideHSV.H=HSV.H}}document.onmousemove=D;document.onmouseup=function(){stop=1;document.onmousemove="";document.onmouseup=""};D(J)}}function HSVupdate(A){A=color.HSV_HEX(HSV=A?A:slideHSV);$("plugHEX").innerHTML=A;$S("plugCUR").background="#"+A;clr("#"+A);return(A)}function loadSV(){var B="";for(var A=165;A>=0;A--){B+='

'}$("Hmodel").innerHTML=B}color={};color.cords=function(B){var C=B/2,A=(hsv.H/360)*(Math.PI*2),D=(hsv.S+(100-hsv.V))/100*(C/2);$S("mCur").left=Math.round(Math.abs(Math.round(Math.sin(A)*D)+C+3))+"px";$S("mCur").top=Math.round(Math.abs(Math.round(Math.cos(A)*D)-C-21))+"px"};color.HEX=function(A){A=Math.round(Math.min(Math.max(0,A),255));return("0123456789ABCDEF".charAt((A-A%16)/16)+"0123456789ABCDEF".charAt(A%16))};color.RGB_HEX=function(B){var A=color.HEX;return(A(B.R)+A(B.G)+A(B.B))};color.HSV_RGB=function(I){var M,O,J,E,D,L=I.S/100,K=I.V/100,N=I.H/360;if(L>0){if(N>=1){N=0}N=6*N;F=N-Math.floor(N);J=Math.round(255*K*(1-L));E=Math.round(255*K*(1-(L*F)));D=Math.round(255*K*(1-(L*(1-F))));K=Math.round(255*K);switch(Math.floor(N)){case 0:M=K;O=D;E=J;break;case 1:M=E;O=K;E=J;break;case 2:M=J;O=K;E=D;break;case 3:M=J;O=E;E=K;break;case 4:M=D;O=J;E=K;break;case 5:M=K;O=J;E=E;break}return({R:M?M:0,G:O?O:0,B:E?E:0,A:1})}else{return({R:(K=Math.round(K*255)),G:K,B:K,A:1})}};color.HSV_HEX=function(A){return(color.RGB_HEX(color.HSV_RGB(A)))};var mvpController,mvpBrowse,mvpMode=false,mvpIp;var nuiTemp,biffdataTemp,browseTemp,pathTemp,sheetTemp;function initMVP(A,D,C,B){if(!A||!D){return }if(!C){C=""}if(!B){B=""}modeTemp=mode;mode=BROWSE;ctrl.currentNUI=$("mvp");ctrl.currentNUI_outer=$("mvp_outer");ctrl.currentNUI.style.width=30000;ctrl.currentNUI.style.height=30000;mvpController=new DataController();ctrl.currentController=mvpController;nuiTemp=nui;biffdataTemp=biffdata;pathTemp=path;sheetTemp=sheet;nui=null;biffdata=null;path=A;sheet=D;mvpBrowse=new BrowseController();browseTemp=browse;browse=mvpBrowse;$("mvpWin").style.display="";mvpMode=true;ctrl.currentController.load("&mvpcreate","",function(){if(mode==BROWSE){nui.main.scrollTop=0;browse._init();browse._focus()}})}function clickMVP(D,E){if(mode!=UPDATE){floatWin(null,lm.modEditModeOnly);if(D){D.cancelBubble=true}return }var B=E?E:this.cell.ip;if(B.readOnly){return }var C=B.mvp;if(!C){return }var A=C.split("|");mvpIp=B;initMVP(A[0],A[1])}function callbackMVP(B,A){mvpIp.loadValue(A,false,B);mvpIp.render()}function selectMVP(){var B=browse._getCell();if(!B){return }var A=browse._getCell().ip;if(!A){return }callbackMVP(A.biff.nodeId,A.biff.value);disableMVP()}function disableMVP(){ctrl.currentNUI.innerHTML="";ctrl.currentNUI=$("nui");ctrl.currentNUI_outer=$("nui_outer");mvpController=null;ctrl.currentController=nuiController;nui=nuiTemp;biffdata=biffdataTemp;path=pathTemp;sheet=sheetTemp;browse=browseTemp;mvpBrowse=null;$("mvpWin").style.display="none";mode=modeTemp;if(mode==BROWSE){browse._init();browse._focus()}mvpMode=false;nui._updateFocus()}function openTab(H,E,G,D){var C,B;if(G){for(C=0;C1){G.appendChild(H.parentNode.parentNode)}}function FilterStatus(){this.filterItems=new Array();this.domainListing=null}FilterStatus.prototype.doFilter=function(){if(mode==BUILDER){this.saveFilter();return }var B,A="";for(B=0;B4){this.filterValue=D.substr(2,D.length-4)}else{this.filterValue=D}}var operators=[{id:"8",name:"="},{id:"2",name:">"},{id:"3",name:"<"}];FilterItem.prototype.getFilterv2String=function(){var A=getJSONAttribute(filterStatus.domainListing,this.domainId,"interm");var D=getJSONAttribute(filterStatus.domainListing,this.domainId,"type");var C=(this.operator==8&&(D==SELECTOR||D==MSELECTOR))?-1:this.operator;var B=this.filterValue;if(!B){B=""}if(!this.domainId||!C){return null}if(A){return this.domainId+"|"+C+"|"+A+"|"+B}else{return this.domainId+"|"+C+"|"+B}};FilterItem.prototype.render=function(){if(this.fixed&&mode!=BUILDER){return this.renderFixed()}var H=node("div");var G=getJSONAttribute(filterStatus.domainListing,this.domainId,"type");var E=createHTMLSelection(filterStatus.domainListing,this.domainId);E.filterItem=this;E.onchange=function(){this.filterItem.domainId=this.options[this.selectedIndex].value;filterStatus.render()};E.onfocus=textFocus;E.onblur=textBlur;var C=createHTMLSelection(operators,this.operator);C.filterItem=this;C.onchange=function(){this.filterItem.operator=this.options[this.selectedIndex].value;filterStatus.render()};C.onfocus=textFocus;C.onblur=textBlur;var B;if((G==SELECTOR||G==MSELECTOR)&&this.operator==8){B=getDomainOptionsElement(this.domainId);B.filterItem=this;var D;for(D=0;D";A.filterItem=this;A.style.margin="0 0 0 8px";A.onclick=function(){filterStatus.removeFilter(this.filterItem.index);filterStatus.render()};H.appendChild(E);H.appendChild(C);H.appendChild(B);H.appendChild(A);return H};FilterItem.prototype.renderFixed=function(){var C=getJSONAttribute(filterStatus.domainListing,this.domainId,"name");var B=getJSONAttribute(operators,this.operator,"name");var D=getJSONAttribute(filterStatus.domainListing,this.domainId,"type");var E;if((D==SELECTOR||D==MSELECTOR)&&this.operator==8){E=getDomainOptionValue(this.domainId,this.filterValue)}else{E=this.filterValue}var A=node("div");A.innerHTML=C+" "+B+" "+E;return A};function createHTMLSelection(C,B){var D=node("select"),A;var E=node("option");D.appendChild(E);for(A=0;A0){$("floatingWin").style.display="none";ctrl.currentController.load("","&tf="+encodeURIComponent(A)+"&fd="+temp,function(){if(mode==BROWSE){browse._init()}browse._focus();filterStatus.render()})}}function clearFilter(A){ctrl.currentController.load("","&cl="+A.parentNode.domainId,function(){if(mode==BROWSE){browse._init()}browse._focus();filterStatus.render()})}function showFilterIcons(){var A=biffdata.filteredDomains;if(A){for(i=0;i"){if(B==1){E.firstChild.innerHTML+=" "}else{if(B==2){E.firstChild.innerHTML+=" "}}}}}}function showFilterPanel(){var C=$("filterPanel");if(C.style.display==""){C.style.display="none";return }var B=findPos(this);C.style.top=B[1]+this.clientHeight-nui.main.scrollTop;C.style.left=B[0]-nui.main.scrollLeft;C.style.width=this.clientWidth;C.style.display="";C.domainId=this.domainId;floatingPanels.push(C);ctrl.dropWin=true;var A=$("filterOptions");A.domainId=this.domainId;A.innerHTML="";if(this.biff.IPType!=SELECTOR&&this.biff.IPType!=MSELECTOR){return }read(function(I){var E=I.responseText.split("\n"),D;for(D=0;DE){E=parseInt(D[0])}}E++;var A=E+"_Sheet "+E;B.href="#"+A;B.sheetName=A;B.onclick=function(){if(mode!=BUILDER){changeSheet(this.sheetName);modeBrowse()}return false};G.className="tabbelow";G.id=A;G.innerHTML="Sheet "+E;sheetNameList.push(A);changeSheet(A);modeBuilder()}function renameSheet(B){if(!owner){return }if(mode==BUILDER){floatWin(null,"Please exit design mode before renaming a sheet.");return }if(!B||B.length==0){floatWin(null,lm.invalidSheetName);return }var A=B.split("_");temp=B;floatWinPrompt("_renameSheet",lm.sheetNewName,"Rename",decodeURIComponent(A[1]).replace(/\+/g," "))}function _renameSheet(){var id=temp;var newName=$("floatWinPromptInput").value;if(!newName){return }if(newName.indexOf("_")!=-1){floatWin(null,lm.sheetInvalidCharacter);return }if(newName&&newName!=""){read(function(o){eval(o.responseText)},"/sims/sheet.jsp?act=mv&a="+ap+"&fn="+id+"&n="+encodeURIComponent(newName)+"&p="+encodeURIComponent(path))}}function refreshSheet(id){read(function(o){eval(o.responseText)},"/sims/sheet.jsp?act=rl&a="+ap+"&fn="+id+"&p="+encodeURIComponent(path))}function deleteSheet(id){if(confirm("Are you sure you want to delete this sheet?")){read(function(o){eval(o.responseText)},"/sims/sheet.jsp?act=rm&a="+ap+"&fn="+id+"&p="+encodeURIComponent(path))}}function copySheet(id){read(function(o){eval(o.responseText)},"/sims/sheetCopy.jsp?a="+ap+"&fn="+id+"&p="+encodeURIComponent(path))}function changeSheet(E){if(mode==UPDATE&&!confirm(lm.away)){return }ctrl.currentController.resetBrowseLeft();if(E){var B=indexOf(E,sheetNameList);if(B!=-1){sheet=E}}else{if(defaultSheet){var B=indexOf(defaultSheet,sheetNameList);if(B==-1){defaultSheet=null}}}if(!E){var A=window.location.toString();if(defaultSheet){sheet=defaultSheet}else{sheet=sheetNameList[0]}}try{sheetIndex=parseInt(sheet.split("_")[0])}catch(D){}if(sheetIndex){if(sheetIndex==rpSheetIndex){if(location.hash.toString().length>1){location.hash=""}else{}}else{location.hash="#!/"+sheetIndex}}for(B=0;B3){this.formType=E[3]}if(E.length>4){this.hash=E[4]}return false}else{if(E[0]=="S"&&O==DATA){this.selections.push(E);return true}else{if(E[0]=="X"&&O==HEADER){var J=E[1].split("|");filterStatus.addFilter(parseInt(J[0]),parseInt(J[1]),J[J.length-1],true);return false}else{if(E[0]=="X"&&O==DATA){if(this.formType==2){var H=E[1].split("|");filterStatus.addFilter(parseInt(H[0]),parseInt(H[1]),H[H.length-1])}return false}else{if(E[0]=="T"&&O==HEADER){var N=E[1];var G=N.split("&"),D;biffdata.tAttr=new Object();for(D=0;D0){return false}this.commentSize=parseInt(E[1]);if(isNaN(this.commentSize)){this.commentSize=0}$("commentCount").innerHTML=this.commentSize;if(this.commentSize>0){switchComments(1)}else{switchComments(2)}return false}else{var M=new Biff(E,O);if(this.rootDomainId==-1&&O==DATA){if(M.domainId){this.rootDomainId=M.domainId}if(M.nodeId){this.rootNodeId=M.nodeId}if(M.parentDomainId!=-1){this.parentDomainId=M.parentDomainId}if(M.parentNodeId!=-1){this.parentNodeId=M.parentNodeId}}if(O==HEADER){this.domainIdCellMapping[M.domainId]=colNames[M.x]+M.y}M.index=this.biffs.length;var I=indexOf(M.x+","+M.y+","+M.domainId,this.existingCellCords);if(I!=-1){var K=this.findBiff(M.domainId,M.y);if(K){if(P||(!K.value||K.value.length==0)){K.value=M.value}}M.updatedCell=true}else{this.biffs.push(M);this.existingCellCords.push(M.x+","+M.y+","+M.domainId)}return M}}}}}}}}};BiffData.prototype.getHeaderInfoObject=function(){var G=new Object();var B=0,H=0,E=0,D,C=this;for(D=0;D0){this.pureInsert=false}c=true;I.anydata=true;N[e.y]=true}}var C=0;for(R=0;R3){if(!H[O]){H[O]=a-3}else{H[O]=Math.max(H[O],a-3)}}}}}catch(V){}for(R=0;RA&&(!X||XL&&(!Z||Z"}var A;if(B.totalEntry&&B.totalEntry!=-1&&B.currentEntry+49>B.totalEntry){A=B.totalEntry}else{A=B.currentEntry+49}if(!B.currentEntry||!A||!B.totalEntry){return }if(B.formType=="2"){switchComments(3);$("entryCount").innerHTML=""+B.currentEntry+" - "+A+""+C;$("entryCountD").innerHTML=""+B.currentEntry+" - "+A+""+C}else{$("entryCount").innerHTML=""+B.currentEntry+""+C;$("entryCountD").innerHTML=""+B.currentEntry+""+C}}function BrowseController(){var A=this;A.bcells=new Array();A.focusbcell=-1;A.focusbcellList=[0]}BrowseController.prototype._trav=function(B){var A=this;if(B){A.focusbcellList.push(A.focusbcell);A.focusbcell=0}else{if(A.focusbcellList.length>0){A.focusbcell=A.focusbcellList.pop()}}A._init()};BrowseController.prototype.checkClickable=function(){var E=this;var C=E.bcells[E.focusbcell];var G=C&&C.length>1;var B=C&&C[0].ip.biff;var D=B&&B.attr&&B.attr.s;var A=C&&C.length==1&&(C[0].ip.biff.IPType==SELECTOR||C[0].ip.biff.IPType==MSELECTOR)&&owner;return !D&&(G||A)};BrowseController.prototype._init=function(){var N=this,O,H,E;N.bcells=new Array();var I=new Array();var D=new Array();for(E=0;E=B.bcells.length){B.focusbcell=B.bcells.length-1}if(isNaN(B.focusbcell)){B.focusbcell=0}B._focus(true)};BrowseController.prototype._focus=function(A){var C,B=this,D=B.bcells[B.focusbcell];B._nofocus();if(!D){return }for(C=0;C-1;L.currentNUI=$("nui");L.currentNUI_outer=$("nui_outer");if(ctrl.currentNUI_outer){ctrl.ctrlHeight=ctrl.currentNUI_outer.offsetTop}L.CRLF="\n";if(L.isIE8){L.focusWidth=2;L.focusHeight=2;L.focusTop=-2;L.focusLeft=-1;L.dropdownTop=50;L.CRLF="\r\n"}else{if(L.isIE){L.focusWidth=2;L.focusHeight=2;L.focusTop=0;L.focusLeft=0;L.dropdownTop=50;L.CRLF="\r\n"}else{if(L.isChrome){L.focusWidth=-2;L.focusHeight=-2;L.focusTop=0;L.focusLeft=0;L.dropdownTop=50}else{L.isFF=true;L.focusWidth=-2;L.focusHeight=-2;L.focusTop=-1;L.focusLeft=-1;L.dropdownTop=30}}}L.NUIRowNum=50;L.NUIColNum=16;L.dragging=false;L.multiSelected=new Array();L.floatListSize=20;if(!L.rightKeyMenuOff){L.rightKeyMenuOff=false}L.TABLE_DEF_ROWS=3;L.dropWin=false;L.nuiLock=false},setWidth:function(H,A,I,C){var B=new Object();if(I){var J=I.split("&"),D;for(D=0;D");for(i=0;i<=G;i++){D.push("");for(j=0;j<=C;j++){D.push("0){if(theme=="default"||mode==BUILDER){A=i}D.push('class="sideCellLeft" onmouseover="dvcellMouseover(this);" ')}else{if(i==0&&j>0){if(theme=="default"||mode==BUILDER){A=colNames[j]}D.push('class="sideCell" onmouseover="dhcellMouseover(this);" ')}else{if(mode==BUILDER){D.push('class="'+BUILDER_EMPTY_CLASS+'" ')}else{D.push(" ")}}}}D.push(">"+A+"")}D.push("")}D.push("");if(E){return D.join("")}defaultNUIString[mode]=D.join("");return defaultNUIString[mode]}NUI.prototype.setScrolling=function(H){var J=this,B=J.main,D=J.main_outer;var I=B.scrollLeft-(document.body.clientLeft?(D.scrollLeft%document.body.clientLeft):0);var G=H.offsetLeft;var E=H.offsetTop;var C=D.offsetHeight-150;var A=D.offsetWidth*(mode==BUILDER?0.7:1)-200;if(G>A+B.scrollLeft){B.scrollLeft=G-A}else{if(GC+B.scrollTop){B.scrollTop=E-C}else{if(E=biffdata.updateCellIds.length){biffdata.updateCellIndex=biffdata.updateCellIds.length-1}var D=biffdata.updateCellIds[biffdata.updateCellIndex];if(!D){return }var B=D.split("_");C._focus(parseInt(B[1]),parseInt(B[2]))};NUI.prototype.vmove=function(B){var E=this;var A=E.frow;var D=0;var I=null;var H=null;var G=20;while(!I&&G>0){if(D<=0){A+=B;D=E.fcol}else{D--}H="_"+D+"_"+A;var C=E._getcell(D,A);I=C?C.ip:null;G--}if(G==0){return }E._focus(D,A);biffdata.updateCellIndex=indexOf(H,biffdata.updateCellIds)};NUI.prototype.keyUp=function(H){if(!H){return }var A=this._curcell(),D=this;var C=false;var I=H.keyCode;var G=nui._getcell(D.fcol-1,D.frow);var E=A&&A.oldClassName=="builderFocusRightSingle"&&G.builderField;if(mode==BUILDER&&A&&!A.ip&&$("hin").value.length>0&&(A.oldClassName==BUILDER_EMPTY_CLASS||E||builder.mode==BUILDER_TEXT)){if(builder.mode==BUILDER_FIELDS&&E){var B=builder.cellData[D.fcol-1+","+D.frow].IPType;if(B==SELECTOR||B==MSELECTOR){floatWin(null,lm.selectorFirstField);return }}A.ip=new Typer();A.ip.cell=A;A.ip.focused=true;A.ip.inputBox=node("input");A.ip.loadValue("")}if(I==27&&(!A||!A.ip||!A.ip.typing)){window.setTimeout("nui._blur();backToBrowse();",500)}else{if((I>=37&&I<=40)&&(A&&A.ip&&!A.ip.typingLock&&!A.ip.typing)){$("hin").focus();$("hin").select()}else{if(A&&A.ip){if(A.ip.keyUp(H)){C=true}}}}};NUI.prototype.keyDown=function(H){if(!H){return false}var G=H.altKey;var E=H.ctrlKey;var B=H.shiftKey;var D=this,A=D._curcell();var C=false;if(A&&A.ip){if(!A.ip.keyDown(H)){C=true}}if(!C&&mode!=BROWSE){if(!H){H=window.event}var I=H.keyCode;switch(I){case 13:if(mode==BUILDER){nui._move(0,1)}else{nui.vmove(1)}return 123;break;case 9:if(mode==BUILDER){nui._move(1,0)}else{nui.hmove(1)}return 123;break;case 83:if(G||E){if(mode==UPDATE){submitNUIForm();return 123}else{if(mode==BUILDER){saveBuilder();return 123}}}break}if(A&&A.ip&&A.ip.typingLock){return true}switch(I){case 37:if(mode==BUILDER){nui._move(-1,0)}else{nui.hmove(-1)}break;case 39:if(mode==BUILDER){nui._move(1,0)}else{nui.hmove(1)}break;case 38:if(mode==BUILDER){nui._move(0,-1)}else{nui.vmove(-1)}break;case 40:if(mode==BUILDER){nui._move(0,1)}else{nui.vmove(1)}break;default:return true}return false}};NUI.prototype._getcell=function(A,G,B){var D=this.main;if(!D||G<0){return null}var C=D.firstChild.rows[G];if(!C||!C.cells||A<0){return null}var E=C.cells[A];while(E&&E.style&&E.style.display=="none"&&A>=0){if(B){E=C.cells[++A]}else{E=C.cells[--A]}}return E};NUI.prototype._removecell=function(A,D){var C=this.main;if(!C||D<0){return }var B=C.firstChild.rows[D];if(!B||!B.cells||A<0||!B.cells[A]){return }B.cells[A].style.display="none"};NUI.prototype._curcell=function(){var A=this;return A._getcell(A.fcol,A.frow)};NUI.prototype._setFocusColorBack=function(A){var C=this,B;if(C.focusChanged.length>0){for(B=0;B0){B.style.width=parseInt(B.clientWidth)+I;if(G){G.style.left=parseInt(G.offsetLeft)+I;if(G.dWidth){G.dWidth+=I}else{G.dWidth=I}}}};NUI.prototype.addHeight=function(G,E,H){if(isNaN(G)){return }var J=this,I=J._getcell(0,G),D,B=J.main;var A=parseInt(I.offsetHeight)+H;if(A>0){I.style.height=A;if(E){E.style.top=E.offsetTop+H}if(E){if(E.dHeight){E.dHeight+=H}else{E.dHeight=H}}if(noUnit(I.style.height)>40){var K=nui.main.firstChild.rows[G],C;for(C=0;CK){N=J;J=K;K=N}if(H>I){N=H;H=I;I=N}var M=nui,G,E;var D="";for(E=H;E<=I;E++){var C=true;for(G=J;G<=K;G++){var L=M._getcell(G,E);L.tempOldBackgroundColor=L.style.backgroundColor;L.style.backgroundColor="#FFDDDD";ctrl.multiSelected.push(L);if(!C){D+="\t"}if(L.ip&&L.ip.biff){D+=L.ip.biff.value}else{if(L.biff){D+=L.biff.value}}C=false}if(E1){C.styling.cs=""+I}else{if(I==1){C.styling.cs=null}}}else{if(C.objectType=="B"){E=C.attr.cs;A=E!=I;if(I>1){C.attr.cs=""+I}else{if(I==1){C.attr.cs=null}}}}if(A){nui.init();builder.renderAll();nui._updateFocus()}}function cellOnpaste(){var A=nui._curcell();if(A){var B=A.ip;if(B&&B.onpaste){B.onpaste()}}}function processPaste(){var G=$("hin").value,I=nui;while(G.charAt(G.length-1)=="\n"){G=G.substr(0,G.length-1)}$("hin").value=G;if(!nui._atHighRow()){var B,A,D=G.split(ctrl.CRLF);var J=I._curcell();var H=parseInt(J.id.split("_")[1]);var E=parseInt(J.id.split("_")[2]);for(B=0;BA){B.y+=E}else{if(C&&B.x>A){B.x+=E}}}function shiftData(C,B,D,H){var J=shift,A,K=new Object(),G=new Object();if(mode==BUILDER){var I,E;for(I in builder.cellData){E=builder.cellData[I];if(!E){continue}if(B<0&&!D&&E.y==C&&(!H||E.x==H)){K[E.x+","+E.y]=null}else{if(B<0&&D&&E.x==C&&(!H||E.y==H)){K[E.x+","+E.y]=null}else{J(E,C,B,D,H);K[E.x+","+E.y]=E}}}builder.cellData=K;for(I in builder.freeData){E=builder.freeData[I];if(!E){continue}if(B<0&&!D&&E.y==C&&(!H||E.x==H)){G[E.x+","+E.y]=null}else{if(B<0&&D&&E.x==C&&(!H||E.y==H)){G[E.x+","+E.y]=null}else{J(E,C,B,D,H);G[E.x+","+E.y]=E}}}builder.freeData=G}else{for(A=0;AA){H[0]=B+G;E[D]=H[0]+"="+H[1]}}}if(C&&biffdata.widthCommand){biffdata.widthCommand=E.join("&")}else{if(biffdata.heightCommand){biffdata.heightCommand=E.join("&")}}}function copyDataY(B){var D;for(i=0;i1){W.colSpan=Q;for(u=1;u(?)';z.appendChild(X)}}}}}else{if(d=="D"||d=="L"||d=="U"||d=="G"||d=="M"){var W=AE._getcell(o,l);if(!W){continue}B.updateCellIds.push(W.id);c(W,1);var C=AE._getcell(o-1,l);var p=AE._getcell(o+1,l);if(!ctrl.isIE){C.style.overflowX="hidden"}var U;if(AD.ip){U=AD.ip;if(d=="L"||d=="M"){if(AD.attr&&AD.attr.ln){var L=AD.attr.ln;var Z=B.findBiff(L,AD.y);U.selectList=selpro.getSelectList(J,L,Z.nodeId)}else{U.selectList=selpro.getSelectList(J)}if(U.listdiv){U.listdiv=null}}}else{if(d=="D"){U=new Typer()}else{if(d=="L"){if(AD.attr&&AD.attr.ln){var L=AD.attr.ln;var Z=B.findBiff(L,AD.y);U=new Selector(J,L,Z.nodeId)}else{U=new Selector(J)}if(AD.attr&&AD.attr.mvp){U.mvp=AD.attr.mvp}}else{if(d=="M"){U=new MSelector()}else{if(d=="U"||d=="G"){U=new Uploader(d)}}}}}AD.ip=U;W.ip=U;W.ip.cell=W;U.biff=AD;if(!N[J]){N[J]=0}U.domainNodeSeq=N[J]++;var M=AD.value?AD.value:(AD.attr&&AD.attr.dv?processDefaultValue(AD):"");var AB=AD.attr&&AD.attr.dv;U.loadValue(M,d=="L");U.domainId=n(J);U.nodeId=s;t.minNodeId=t.minNodeId?Math.min(t.minNodeId,U.nodeId):U.nodeId;U.parentDomainId=n(AD.parentDomainId);U.parentNodeId=n(AD.parentNodeId);if(AD.attr){U.readOnly=AD.attr.ro;if(AD.attr.cs){W.colSpan=AD.attr.cs;var R=n(AD.attr.cs),u;setBorderClass(W,1,R);for(u=1;u")!=-1){A.style.width="100%";A.style.paddingLeft="3px";A.style.width=0;A.innerHTML="";var B=node("div");B.innerHTML=C;A.appendChild(B);A.style.height=B.offsetHeight;return }A.style.paddingLeft="3px";if(ctrl.isIE){A.style.width=0}A.innerHTML=C}function adjustPrevNext(){if(mode!=BROWSE){$("bPrevPage").style.display="none";$("bPrevPageD").style.display="none";$("bNextPage").style.display="none";$("bNextPageD").style.display="none";showAllTooltip();return }if(biffdata.prevButton=="F"){$("bPrevPage").style.display="none";$("bPrevPageD").style.display=""}else{$("bPrevPage").style.display="";$("bPrevPageD").style.display="none"}if(biffdata.nextButton=="F"){$("bNextPage").style.display="none";$("bNextPageD").style.display=""}else{$("bNextPage").style.display="";$("bNextPageD").style.display="none"}showAllTooltip()}function processDefaultValue(A){if(!A){return }var B=A.attr.dv;if(!B){return B}if(B.substr(0,1)=="$"){var D=new Date();if(B=="$DATE"){B=D.getFullYear()+"/"+(D.getMonth()+1)+"/"+D.getDate()}else{if(B=="$TIME"){B=D.getHours()+":"+D.getMinutes()+":"+D.getSeconds()}else{if(B=="$DATETIME"){B=D.getFullYear()+"/"+(D.getMonth()+1)+"/"+D.getDate()+" "+D.getHours()+":"+D.getMinutes()+":"+D.getSeconds()}else{if(B=="$USERID"){B=(user?user:"Guest")}else{if(B=="$USERNAME"){B=(userName?userName:"Guest Account")}else{if(B=="$ACCOUNT"){B=myapp}else{if(B=="$MGRACCOUNT"){B=mymgrapp}else{if(B=="$SEQ"){try{var G=biffdata.findBiff(A.domainId,parseInt(A.y)-1);var E=parseInt(G.value)+1;if(E&&!isNaN(E)){B=E}}catch(C){}B=A.ip.domainNodeSeq+1}}}}}}}}}return B}var selpro={domains:new Object(),getSelectList:function(D,C,B){var A;if(C&&B){A=this.domains[D+"_"+C+"_"+B]}else{A=this.domains[D]}if(!A){A=new SelectList();A.init()}return A}};function SelectList(){var A=this;A.options=new Array();A.nodeIds=new Array();A.match=new Array();A.matchNodeIds=new Array();A.container=node("table");A.highlighted=-1;A.init=function(){var C,B=this,D=B.container;D.className="selector";D.style.display="none";D.selector=this;document.body.appendChild(D)};A.remove=function(){document.body.removeChild(this.container)};A.place=function(D){if(!D){return }var E=this,C=D.cell,G=E.container.style;var B=nui.main;G.top=C.offsetTop+C.clientHeight+ctrl.ctrlHeight-B.scrollTop;G.left=C.offsetLeft-B.scrollLeft;G.display="";G.width=Math.max(C.offsetWidth,E.container.offsetWidth);floatingPanels.push(E.container);this.selector=D};A.listMulti=function(I){var B=I.domainId,G=I.parentDomainId,O=I.parentNodeId,H=I.nodeId;var P=node("table");P.className="selector";var N=new Array();P.opdivArray=N;var Q=P.insertRow(0),J;var M=H.toString().split("|");for(i=0;i0){R+="|"+T.value}else{R+=T.value}}}this.table.ip.loadValue(R);this.table.ip.render();ctrl.dropWin=true});var C="L_"+createControlBitString()+"_"+G+"_"+B+"_"+O;var D=A.options[i];var L="U_"+createControlBitString()+"_"+G+"_"+B+"_"+O;var K=indexOf(A.nodeIds[i],M)!=-1;E.value=D;E.innerHTML='  '+D+(K?'':"");J.appendChild(E);P.opdivArray.push(E)}if(A.options.length==0){J=Q.insertCell(0);J.innerHTML='
No Value
'}return P};A.processSelectorLocation=function(B){var E=findPos(B.cell);var C=E[1];var D=document.body.clientHeight-C;ctrl.floatListSize=parseInt((D/21))};A.listAll=function(B){if(B.mvp){clickMVP(null,B);return }var E=this,D,C=E.container;rm(C);E.itemCount=0;var H=C.insertRow(0),J;for(D=0;DNo Value'}E.highlighted=0};A.listMatch=function(G,E){var K=this,H,I=K.container;var L=new Array();var B=new Array();for(H=0;H"+C.substr(0,G.length)+""+C.substring(G.length,C.length);J.appendChild(D);K.itemCount++}K.highlighted=-1;return true};A.moveop=function(B){var D=this,G=D.container;if(D.highlighted>=0&&D.highlighted=D.itemCount){D.highlighted=D.itemCount-1}}if(D.highlighted<0){D.highlighted=0;return }var C=D.container.rows[0].cells[parseInt(D.highlighted/ctrl.floatListSize)].childNodes[D.highlighted%ctrl.floatListSize];C.className="selItemOn";this.selector.userInput=C.option}}function getInput(){var A=$("hin").value;if(A=="\n"&&!nui._atHighRow()){return""}$("hin").value="";return A}function opdivclick(){if(mode!=UPDATE){floatWin(null,lm.modEditModeOnly);return }var A=this.selector;if(A){A.loadValue(this.option);A.highlight=true;A.render()}if(this.container){this.container.style.display="none"}$("hin").focus()}var SELECTOR="L",TYPER="D",SELECTION="S",UPLOADER="U",GRAPHICS="G",MSELECTOR="M",FREE="F";function Selector(C,B,A){this.type=SELECTOR;this.domainId=C;this.userInput="";this.highlight=false;this.selectList=selpro.getSelectList(C,B,A)}Selector.prototype.keyDown=function(B){if(this.readOnly){return true}var C=B.keyCode;var A=B.shiftKey;switch(C){case 8:this._backspace(1);break;case 46:this._backspace();break;case 38:if(this.selectList.container.style.display!="none"){this.selectList.moveop(-1);return false}case 40:if(this.selectList.container.style.display!="none"){this.selectList.moveop(1);return false}}return true};Selector.prototype.keyUp=function(A){if(this.readOnly){return false}var B=getInput();if(B&&B.length>0){this._write(B)}return true};Selector.prototype._backspace=function(A){if(this.highlight||!A){this.userInput=""}else{this.userInput=this.userInput.substr(0,this.userInput.length-A)}this.highlight=false;this.selectList.processSelectorLocation(this);this.selectList.place(this);this.render()};Selector.prototype._write=function(C){var B=this,A=B.userInput;if(B.highlight){A=C}else{A+=C}B.highlight=false;B.selectList.processSelectorLocation(B);if(B.selectList.listMatch(A,B)){B.userInput=A;B.selectList.place(B);B.render()}else{if(B.userInput==""){B.selectList.listAll(B);B.selectList.place(B);B.render()}}};Selector.prototype.click=function(){};Selector.prototype.dblclick=function(){};Selector.prototype.focus=function(){this.highlight=true;if(this.mvp){nui.focus.onclick=clickMVP}else{nui.focus.onclick=selectorClick}};Selector.prototype.blur=function(){var A=this;A.highlight=false;nui.focus.onclick=null;if(!this.mvp){A.loadValue(A._getSuggest())}A.render();clearDropWin()};Selector.prototype.loadValue=function(G,B,I){var D=this,A=D.biff;D.userInput=G;if(A&&D.inputBox){if(!B){if(D.mvp){A.value=G;A.nodeId=I;D.inputBox.value=I}else{var H=D._getSuggest();var C=D._getSuggestNodeId();A.value=H;A.nodeId=C;D.inputBox.value=C}}if(D.notify&&D.oldSuggest!=H&&!B){D.oldSuggest=H;if(C&&C.length>0){read(biffdata.loadDataSubform,"/sims/form_subform.jsp?a="+ap+"&p="+encodeURIComponent(path)+"&fn="+encodeURIComponent(sheet)+"&x="+A.x+"&y="+A.y+"&d="+A.domainId+"&n="+C,true)}}}if(mode==UPDATE&&!B&&A&&A.ifCreateInsertRow()&&biffdata.formType!=2&&G&&G.length>0&&(A.attr&&G!=A.attr.dv)){shiftData(this.biff.y,1);copyDataY(this.biff.y);displayData()}if(mode!=BUILDER){var E=biffdata.domainIdCellMapping[A.domainId];if(!biffdata.formulaMap[E]){biffdata.formulaMap[E]=new Object()}biffdata.formulaMap[E][A.y]=A.value;formulaBuilder.update(E,A)}};Selector.prototype.render=function(E){var I=this.cell;if(this.readOnly){I.style.backgroundColor="#F6F6F6"}var K=nui.focus;I.innerHTML="";I.style.paddingLeft="3px";if(ctrl.isIE){I.style.width=columnSizes[this.biff.x]}var C=node("div"),J=this;C.style.position="relative";C.style.overflow="hidden";if(ctrl.isIE){C.noWrap=true}C.style.width="100%";var H=node("span");H.className="selbut";H.cell=I;H.onmouseover=function(){this.className="selbutOn"};H.onmouseout=function(){this.className="selbut"};if(J.mvp){H.onclick=clickMVP}else{H.onclick=selectorClick}C.appendChild(H);I.appendChild(C);var D=E?J.userInput:J._getSuggest(true);var G=J.emptyValue&&J.userInput=="";var B=node("span");B.className=J.highlight&&!G?"cellSuggest":"cellText";var A=node("span");A.className="cellSuggest";C.appendChild(B);C.appendChild(A);if(G){B.innerHTML=J.emptyValue}else{B.innerHTML=J.userInput}A.innerHTML=D.substring(J.userInput.length,D.length);if(A.innerHTML.length==0){A.style.backgroundColor="white"}};Selector.prototype._getSuggest=function(B){this.selectList.listMatch(this.userInput,this);if(this.userInput==""){return""}var A=this.selectList.highlighted;var C;if(A>=0){C=A}else{C=indexOf(this.userInput,this.selectList.match);if(!B&&C==-1){C=0}}var D=this.selectList.match[C];if(C==-1){return""}else{if(D){return D}else{return""}}};Selector.prototype._getSuggestNodeId=function(){if(this.userInput==""){return""}var B;var A=indexOf(this.userInput,this.selectList.match);if(A!=-1){B=this.selectList.matchNodeIds[A]}else{B=this.selectList.matchNodeIds[0]}if(B){return B}else{return""}};Selector.prototype.clear=function(){this.userInput="";this.render()};function selectorClick(){var B=this.cell.ip;B.selectList.processSelectorLocation(B);if(B.readOnly){return }if(B.selectList.container.style.display!="none"){B.selectList.container.style.display="none"}else{var A=parseInt(this.cell.id.split("_")[1]);var C=parseInt(this.cell.id.split("_")[2]);nui._focus(A,C);clearDropWin();B.selectList.listAll(B);B.selectList.place(B)}ctrl.dropWin=true}function Typer(){this.type=TYPER;this.typing=false;this.focused=false}Typer.prototype.keyDown=function(D){if(this.readOnly){return true}var G=D.keyCode,J=this;var C=D.altKey;switch(G){case 46:if(!J.typing){var B=nui._getcell(nui.fcol-1,nui.frow);var H=B&&B.ip;var I=nui._getcell(nui.fcol+1,nui.frow,true);var K=I&&I.ip;var A=!H&&K;if(A&&mode==UPDATE){deleteEntry(this.domainId,this.nodeId)}else{J.clear();J.typing=true;J.render()}}break;case 8:if(!J.typing){J.clear();J.typing=true;J.render()}break}var E=G==13&&(C||nui._atHighRow());return !E};Typer.prototype.keyUp=function(E){if(this.readOnly){return true}var C=$("hin");var A=this.cell;var H=E.keyCode;var D=E.altKey;var G=H==13&&(D||nui._atHighRow());if(!this.typing&&C.value!=C.oldValue){this.typing=true;if(mode==UPDATE&&this.biff&&this.biff.ifCreateInsertRow()){shiftData(this.biff.y,1);copyDataY(this.biff.y);biffdata.debug();displayData()}}if(G){if(D){$("hin").value+="\n"}}if(H==27&&$("hin").oldValue&&this.typing){this.loadValue($("hin").oldValue);$("hin").value=$("hin").oldValue;$("hin").oldValue="";A.ip.typing=false;return true}var B=$("hin").value;this.loadValue(B);this.render();return !G};Typer.prototype.onpaste=function(){window.setTimeout(processPaste,100)};Typer.prototype.click=function(){if(this.typing){this.typingLock=true}};Typer.prototype.dblclick=function(){var A=this;if(!A.typing){$("hin").value=this.value;setCaretTo($("hin"),this.value.length);this.typing=true;this.render();this.typingLock=true}};Typer.prototype.focus=function(){this.focused=true};Typer.prototype.blur=function(){var A=this;A.validate();A.typing=false;A.typingLock=false;A.render();A.focused=false};Typer.prototype.validate=function(C){var A=this;if(A.biff&&A.biff.attr&&A.biff.attr.va){var B=new RegExp(A.biff.attr.va);if(!B.test(A.value)){if(!C){floatWin(null,lm.valueFormatIncorrect)}return false}}return true};Typer.prototype.loadValue=function(E,C){var B=this,A=B.biff;if(E!=B.oldValue){B.changed=true}B.value=E;B.oldValue=E;B.displayValue=C;if(B.inputBox){B.inputBox.value=E}if(A){A.value=E}if(mode!=BUILDER){var D=biffdata.domainIdCellMapping[A.domainId];if(!biffdata.formulaMap[D]){biffdata.formulaMap[D]=new Object()}biffdata.formulaMap[D][A.y]=A.value;formulaBuilder.update(D,A)}};Typer.prototype._setHinSize=function(A){var C=$("hin"),D=C.style;var B=$("sizeCalc");B.innerHTML=C.value;D.width=Math.max(A.offsetWidth,B.offsetWidth+10);D.height=Math.max(A.offsetHeight,B.offsetHeight)};Typer.prototype._renderFocus=function(A){var B=this;if(B.typing){var C=$("hin"),D=C.style;B._setHinSize(A);D.top=A.offsetTop;D.left=A.offsetLeft;D.display=""}else{hideEditElements()}};Typer.prototype._renderCell=function(B){var D=this,A=D.biff;if(D.readOnly){B.style.backgroundColor="#F6F6F6"}else{if(mode!=BUILDER){B.style.backgroundColor=""}}if(!A){return }var C;if(A.attr&&A.attr.fmt_n){C=ragic_number_format(D.value,A.attr.fmt_n)}else{if(A.attr&&A.attr.fmt_d){C=ragic_date_format(D.value,A.attr.fmt_d)}else{C=cellTextProcess(D.displayValue?D.displayValue:D.value)}}cellRender(B,C,true)};Typer.prototype.render=function(){var A=nui.focus,B=this;if(!B.typing){B._renderCell(B.cell)}if(B.focused){B._renderFocus(A)}};Typer.prototype.clear=function(){$("hin").value="";this.loadValue("")};function cellTextProcess(B){if(!B){return B}B=B.toString();var A=/\r\n/gim;B=B.replace(A,"
");A=/\n/gim;B=B.replace(A,"
");A=/(^|[^=\[\]"'])http:\/\/([^\s><]+)/gim;B=B.replace(A,"$1http://$2");A=/([^=\[\]"'])https:\/\/([^\s><]+)/gim;B=B.replace(A,"$1https://$2");A=/\[img\][\s]*([^\[]+)\[\/img\]/gim;B=B.replace(A,"");A=/[ ]{2}/gim;B=B.replace(A,"  ");A=/[\t]/gim;B=B.replace(A,"    ");return B}function loadTextProcess(A){if(!A){return A}A=A.replace(/
/gim,"\n");A=A.replace(//gim,"\n");A=A.replace(/,/gim,",");return A}function hideEditElements(){var A=$("hin"),B=A.style;B.left=5;B.top=-20;B.width="5000px";B.height="20px";B.zIndex=0}var currentBiff;var propOptions;var propOptionIds;var choicesDomainId;function setPropertyTable(B){if(!B||!B.biff){$("prop").innerHTML="";return }else{resetPropertyTable(B)}var A=B.biff;currentBiff=A;$("at_name").innerHTML=parseHeaderValue(A.value);$("at_spid").value=A.domainId?A.domainId:"";$("f_ag").style.display="none";if(A.IPType==SELECTOR||A.IPType==MSELECTOR){$("f_ch").style.display="";$("sample_dv").style.display="none";if(A.IPType==SELECTOR){$("at_it").selectedIndex=1}else{if(A.IPType==MSELECTOR){$("at_it").selectedIndex=4}}choicesDomainId=A.domainId;initChoices()}else{if(A.IPType==UPLOADER){$("at_it").selectedIndex=2}else{if(A.IPType==GRAPHICS){$("at_it").selectedIndex=3}else{$("f_ag").style.display=""}}$("f_ch").style.display="none";$("sample_dv").style.display=""}if(!A.attr){A.attr=new Object()}if(A.attr){for(var E in A.attr){var H=E;var G=A.attr[E];if(E=="ln"){H="l"}if(E=="rf"){G=A.domainId}if(E=="fmt_n"){changeFormatType(1)}else{if(E=="fmt_d"){changeFormatType(2)}}var C=$("at_"+H);if(!C){continue}if(H=="rf"||H=="s"||H=="l"){}else{if(C.tagName.toUpperCase()=="SELECT"){var D;for(D=0;D=macrolines.length){macrolineNum=0;builder.saveServer();return }var A=macrolines[macrolineNum];var B=A.split(" ");if(B[0].toLowerCase()=="move"){nui._focus(parseInt(B[1]),parseInt(B[2]));window.setTimeout("macroLine();",500)}else{if(B[0].toLowerCase()=="type"){macroword=A.substring(5).replace(/\r/,"");macrowordNum=0;macroWord()}else{if(B[0].toLowerCase()=="location"){setCookie("macroLineNum",macrolineNum);location=A.substring(9)}else{if(B[0].toLowerCase()=="prompt"){$("tutorialDesc").innerHTML=A.substring(7);$("tutorialNext").style.display=""}else{if(B[0].toLowerCase()=="end"){$("tutorialDesc").innerHTML=A.substring(4);$("tutorialReplay").style.display=""}else{if(B[0].toLowerCase()=="mode"){modeBuilder();window.setTimeout("macroLine();",1000)}else{if(B[0].toLowerCase()=="sheet"){newSheet();window.setTimeout("macroLine();",1000)}else{if(B[0].toLowerCase()=="pause"){window.setTimeout("macroLine();",parseInt(B[1]))}else{window.setTimeout("macroLine();",1000)}}}}}}}}macrolineNum++}function macroWord(){if(macrowordNum>=macroword.length){window.setTimeout("macroLine();",200);return }var A=macroword.charAt(macrowordNum);var B=new Object();B.keyCode=A.charCodeAt(macrowordNum);nui.keyDown(B);$("hin").value+=A;nui.keyUp(B);macrowordNum++;window.setTimeout("macroWord();",60)}var BUILDER_FIELDS=1,BUILDER_TEXT=2,BUILDER_NOOP=0;var BUILDER_EMPTY_CLASS="builderEmpty";var builder={cellData:new Object(),freeData:new Object(),rights:new Object(),filters:new Array(),unsave:false,mode:BUILDER_NOOP,defaultMode:BUILDER_FIELDS,setContent:function(B,H,G){this.unsave=true;if(this.mode==BUILDER_FIELDS){var E=this.cellData[B+","+H];if(!G&&E){if(E.tableFirst==2){var D=nui._getcell(B,H).ip;D.loadValue("--Deleted--");D.render();floatWin(null,"You're deleting a first column of a table, which is highly not recommended especially if you have already entered some data to this table. It will make the table unable to load correctly. If you really want to delete this field, you can do it again.");E.tableFirst=1;return }if(E.tableFirst==1){floatWin(null,"I warned you, the field will be deleted now. You can still leave design mode now without saving.")}E.unrender();this.cellData[B+","+H]=null}else{if(E){setObjectHeaderValue(E,G);E.render()}else{var A=new BuilderObject(B,H,G,TYPER);this.cellData[B+","+H]=A;this.freeData[B+","+H]=null;A.render()}}}else{if(this.mode==BUILDER_TEXT){var C=this.freeData[B+","+H];if(!G&&C){C.unrender();nui._getcell(B,H).style.backgroundColor="";this.freeData[B+","+H]=null}else{if(C){C.value=G;C.render()}else{var A=new FreeObject(B,H,G);this.cellData[B+","+H]=null;this.freeData[B+","+H]=A;A.render()}}}}},setAction:function(A,D){this.unsave=true;var B=this.freeData[A+","+D];if(B){var C=B.action?B.action:"";temp=B;floatWinPrompt("_setBuilderAction",lm.enterURLLink,"",C)}},setStyle:function(B,H,G,D){if(this.cellData[B+","+H]){return }this.unsave=true;ctrl.dropWin=true;var E=nui._curcell().ip;var C=$("hin");if(E&&E.typing){builder.setContent(B,H,C.value);E.typing=false;E.changed=true;E.render()}var A=this.freeData[B+","+H];if(!A){A=new FreeObject(B,H," ");this.freeData[B+","+H]=A}if(A.styling[G]==D){A.styling[G]=null}else{A.styling[G]=D}A.render();nui._updateFocus();ctrl.dropWin=true},setAttribute:function(B,E,D,C){this.unsave=true;var A=this.cellData[B+","+E];if(D=="it"){A.IPType=C}else{if(D=="rf"){if(C&&C.length>0){A.attr.rf=A.domainId;A.domainId=C}else{A.domainId=A.attr.rf;A.attr.rf=null}}else{if(D=="l"){A.attr.l=C;A.attr.ln=C}else{A.attr[D]=C}}}A.adjustAttributes();A.render()},setRights:function(A,B){if(B==0){B="0"}this.unsave=true;this.rights[A]=B},load:function(I){this.unsave=false;var P=builder;P.cellData=new Object();P.rights=new Object();P.filters=new Array();P.rights.EVERYONE="0";P.rights.USER=3;P.rights.MANAGER=6;P.freeData=new Object();biffdata=new BiffData();biffdata.widthCommand=null;biffdata.heightCommand=null;loadRightsSetting();var N=I.responseText;var Q=N.split("\n"),D,A=ctrl.NUIColNum,L=true;for(D=0;D1){biffdata.widthCommand=E[1]}if(E.length>2){biffdata.heightCommand=E[2]}}else{if(E[0]=="A"){var B=E[1].split("&"),C;for(C=0;CA){A=parseInt(M)}}else{if(E[0]=="D"||E[0]=="L"||E[0]=="U"||E[0]=="G"||E[0]=="M"){var J=new BuilderObject(E[1],E[2],E[4],E[0]);J.domainId=E[3];var B=E[5].split("&"),C;for(C=0;CA){A=parseInt(E[1])}}}}}}nui.init(null,A);P.renderAll();filterStatus.removeNonfixedFilter();this.saveFixedFilter();filterStatus.render();if(loadingBox){loadingBox.style.display="none"}},renderAll:function(){processWidth(biffdata.widthCommand,biffdata.heightCommand);var E=builder.cellData,C=builder.freeData;for(var D in E){if(!E||!E[D]){continue}E[D].render();var B=D.split(",");var A=B[0],G=B[1];if(E[(parseInt(A)+1)+","+parseInt(G)]&&!E[(parseInt(A)-1)+","+parseInt(G)]){E[D].tableFirst=2}}for(var D in C){if(!C||!C[D]){continue}C[D].render()}},saveFixedFilter:function(){var A;this.filters=new Array();for(A=0;A0;var D=I;while(D!=J){var M=E?D-1:D+1;var A=this.cellData[M+","+G];this.cellData[D+","+G]=A;A.x=D;D=M;if(M==J){this.cellData[M+","+G]=K;K.x=J;break}}}else{if(!this.cellData[B]&&!this.freeData[B]){if(L){this.freeData[B]=K;this.freeData[C]=null;K.x=J;K.y=H}else{this.cellData[B]=K;this.cellData[C]=null;K.x=J;K.y=H}}}nui.init();this.renderAll()}};function checkSave(){if(path=="/designer"){$("bPackage").onclick();return false}return true}function setObjectHeaderValue(H,G){if(!H||!G){return }else{if(!H.value||(H.value.indexOf("|")==-1&&H.value.indexOf("=")==-1)){H.value=G;return }}var B=H.value.split("|");if(B.length==1){H.value=G}else{var E=lang;var A=0;var D=false;for(;A1){var B,I=nui;K.colSpan=A;for(B=1;B"+lm.uploadFile+""}else{if(C=="G"){B.innerHTML=""+lm.uploadGraphic+""}else{B.innerHTML=""+lm.freeText+""}}}}function setBuilderSelectBox(B,A){if(ctrl.isIE){B.style.width=columnSizes[A+1]}var D=node("div");D.style.position="relative";D.style.width="100%";D.innerHTML=""+lm.listOfValue+"";B.appendChild(D);var C=node("span");C.className="selbut";C.style.height="11px";D.appendChild(C)}function saveBuilder(){if(checkSave()){nui._blur();builder.saveServer()}}function updateBuilderMove(A){if(!ctrl.builderMovePrompt){ctrl.builderMovePrompt=node("div");ctrl.builderMovePrompt.style.position="absolute";ctrl.builderMovePrompt.innerHTML=ctrl.builderMoveStart.innerHTML;ctrl.builderMovePrompt.style.backgroundColor=ctrl.builderMoveStart.style.backgroundColor;ctrl.builderMovePrompt.style.fontSize="12px";ctrl.builderMovePrompt.style.width=ctrl.builderMoveStart.offsetWidth;ctrl.builderMovePrompt.style.height=ctrl.builderMoveStart.offsetHeight;document.body.appendChild(ctrl.builderMovePrompt)}ctrl.builderMovePrompt.style.top=0;ctrl.builderMovePrompt.style.left=0;ctrl.builderMovePrompt.style.top=A.clientY;ctrl.builderMovePrompt.style.left=A.clientX}function endBuilderMove(C){enableSelection(document.body);ctrl.builderColspanStart=null;ctrl.freeDataColspan=null;if(ctrl.builderMovePrompt){document.body.removeChild(ctrl.builderMovePrompt);ctrl.builderMovePrompt=null}var H,E,G,D;if(ctrl.builderMoveStart){var B=ctrl.builderMoveStart.id;H=parseInt(B.split("_")[1]);E=parseInt(B.split("_")[2]);ctrl.builderMoveStart=null}if(ctrl.builderMoveEnd){var A=ctrl.builderMoveEnd.id;G=parseInt(A.split("_")[1]);D=parseInt(A.split("_")[2]);ctrl.builderMoveEnd=null}if(!H||!E||!G||!D){return }if(H==G&&E==D){return }builder.moveHeader(H,E,G,D)}function loadRightsSetting(){saveRightsSetting("EVERYONE",builder.rights.EVERYONE);saveRightsSetting("MANAGER",builder.rights.MANAGER);saveRightsSetting("USER",builder.rights.USER)}function saveRightsSetting(A,B){if(!A){return }if(!B){B=0}B=parseInt(B);builder.setRights(A,B);if($("rights_desc_"+A)){$("rights_desc_"+A).innerHTML=$("rights_"+B).innerHTML}$("dropdown").style.display="none"}function saveBuilderMode(C,B){var D=nui,A=D.fcol,E=D.frow;if(!C){C=builder.defaultMode}if(B){builder.defaultMode=C;if(!builder.cellData[A+","+E]&&!builder.freeData[A+","+E]){builder.mode=C;D._focus(A,E)}}else{builder.mode=C}$("builderMode_desc").innerHTML=$("builderMode"+C).innerHTML;$("builderMode_icon").className="topIcon topIcon_bMode"+C;$("builderModes").style.display="none";if(C==BUILDER_FIELDS){$("bFieldSetting").style.display="";$("bRichText").style.display="none"}else{if(C==BUILDER_TEXT){$("bFieldSetting").style.display="none";$("bRichText").style.display=""}else{$("bFieldSetting").style.display="none";$("bRichText").style.display="none"}}}function changeHardSoft(A){if(A==1){builder.setAttribute(currentBiff.x,currentBiff.y,"s",0);builder.setAttribute(currentBiff.x,currentBiff.y,"rf",$("at_linkId").value)}else{if(A==2){builder.setAttribute(currentBiff.x,currentBiff.y,"rf",0);builder.setAttribute(currentBiff.x,currentBiff.y,"s",$("at_linkId").value)}}}function changeFormatType(A){if(A==1){builder.setAttribute(currentBiff.x,currentBiff.y,"fmt_d",0);builder.setAttribute(currentBiff.x,currentBiff.y,"fmt_n",$("at_fmt_n").value);$("fmt_n_sample").style.display="";$("fmt_d_sample").style.display="none";$("at_fmt_n").style.display="";$("at_fmt_d").style.display="none";$("formatTypeNumber").checked=true}else{if(A==2){builder.setAttribute(currentBiff.x,currentBiff.y,"fmt_n",0);builder.setAttribute(currentBiff.x,currentBiff.y,"fmt_d",$("at_fmt_d").value);$("fmt_n_sample").style.display="none";$("fmt_d_sample").style.display="";$("at_fmt_n").style.display="none";$("at_fmt_d").style.display="";$("formatTypeDate").checked=true}}}function Uploader(B){var A=this;A.type=UPLOADER;A.IPType=B}Uploader.prototype.keyDown=function(A){return true};Uploader.prototype.keyUp=function(A){return true};Uploader.prototype.onpaste=function(){};Uploader.prototype.click=function(){this.uploadDiv.style.display=""};Uploader.prototype.dblclick=function(){};Uploader.prototype.focus=function(){};Uploader.prototype.blur=function(){};Uploader.prototype.loadValue=function(B,A){this.biff.value=B;this.render()};Uploader.prototype.render=function(){if(mode==BROWSE){if(this.IPType=="G"){this.cell.style.verticalAlign="top";if(this.biff.value){this.cell.innerHTML=''}}else{this.cell.innerHTML=''+this.biff.value+""}}else{if(mode==UPDATE){this.cell.ip=this;if(this.biff.value){this.cell.innerHTML=""+this.biff.value+""}else{this.cell.innerHTML="Upload"}}}};Uploader.prototype.clear=function(){};Uploader.prototype.createUploadInputElement=function(){var A=this;A.uploadDiv=node("div");A.uploadDiv.id="floatingUpload";A.uploadDiv.className="floatingWin";A.uploadDiv.style.display="none";A.uploadDiv.ip=this;$("nuiform").appendChild(A.uploadDiv);A.uploadDiv.innerHTML='
 
close
';A.inputBox=A.uploadDiv.childNodes[1].firstChild;return A.inputBox};function MSelector(){var A=this;A.type=MSELECTOR}MSelector.prototype.keyDown=function(A){return true};MSelector.prototype.keyUp=function(A){return true};MSelector.prototype.onpaste=function(){};MSelector.prototype.click=function(){this.render()};MSelector.prototype.dblclick=function(){};MSelector.prototype.focus=function(){nui.focus.onclick=mselectorClick};MSelector.prototype.blur=function(){};MSelector.prototype.loadValue=function(B,A){this.value=B;this.valueList=B.split("|")};MSelector.prototype.render=function(){var A=this.cell;rm(A);A.innerHTML="";A.style.paddingLeft="3px";if(ctrl.isIE){A.style.width=columnSizes[this.biff.x]}var C=node("div");C.innerHTML=this.valueList.join(",");C.style.position="relative";C.style.overflow="hidden";C.style.width="100%";if(C.innerHTML.length==0){C.innerHTML=" "}var B=node("span");B.className="selbut";B.cell=A;B.onmouseover=function(){this.className="selbutOn"};B.onmouseout=function(){this.className="selbut"};B.onclick=mselectorClick;C.appendChild(B);this.cell.appendChild(C)};MSelector.prototype.clear=function(){};function mselectorClick(){if(mode!=UPDATE){floatWin(null,lm.modEditModeOnly);ctrl.dropWin=true;return }var C=this.cell.ip,B=this.cell;var A=nui.main;if(C.listdiv&&C.listdiv.style.display==""){C.listdiv.style.display="none";return }clearDropWin();if(!C.listdiv){C.selectList=selpro.getSelectList(C.domainId);C.listdiv=C.selectList.listMulti(C);C.listdiv.ip=C;C.listdiv.style.top=B.offsetTop+B.clientHeight+ctrl.ctrlHeight-A.scrollTop;C.listdiv.style.left=B.offsetLeft-A.scrollLeft;$("nuiform").appendChild(C.listdiv);floatingPanels.push(C.listdiv);ctrl.dropWin=true}else{if(C.listdiv.style.display=="none"){C.listdiv.style.top=B.offsetTop+B.clientHeight+ctrl.ctrlHeight-A.scrollTop;C.listdiv.style.left=B.offsetLeft-A.scrollLeft;C.listdiv.style.display="";floatingPanels.push(C.listdiv);ctrl.dropWin=true}}}var formulaBuilder={listenMapping:new Object(),update:function(C,E){var H=this.listenMapping[C],B,A;if(!H){return }for(B=0;B0){H.push(D)}var M=new Array();for(C=0;C=65&&L<=90&&(J<65||J>90)){var G=B.split(".",2);if(G.length>1){M.push(G[0])}else{M.push(B)}}}return M},add:function(D,E,G){var C,B=this;var A=B._findChangeCellNames(G);for(C=0;Cy){continue}total+=parseFloat(value)}var temp=formula.replace(new RegExp(key+"\\.ACC","g"),total);formula=temp;if(!formulaMap[key][y]||isNaN(formulaMap[key][y])){formula=formula.replace(new RegExp(key,"gi"),0)}else{formula=formula.replace(new RegExp(key,"gi"),formulaMap[key][y])}}else{var _total=0,count=0;for(var _k in formulaMap[key]){var _value=formulaMap[key][_k];if(!_value||_value.length==0){continue}count++;if(!isNaN(_value)){_total+=parseFloat(_value)}}formula=formula.replace(new RegExp(key+"\\.COUNT","gi"),count);formula=formula.replace(new RegExp(key,"gi"),_total)}}if(print){}var result="";try{formula=formula.replace(new RegExp("--","gi"),"+");result=eval(formula);if(result==0){result="0"}}catch(e){}if(!result||result.length==0||isNaN(result)){return null}else{result=Math.round(result*100)/100;return result}}var MONTH_NAMES=new Array("January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");var DAY_NAMES=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat");function LZ(A){return(A<0||A>9?"":"0")+A}function isDate(C,B){var A=getDateFromFormat(C,B);if(A==0){return false}return true}function compareDates(E,G,C,D){var B=getDateFromFormat(E,G);var A=getDateFromFormat(C,D);if(B==0||A==0){return -1}else{if(B>A){return 1}}return 0}function formatDate(g,b){b=b+"";var L="";var U=0;var f="";var D="";var J=g.getFullYear()+"";var G=g.getMonth()+1;var e=g.getDate();var O=g.getDay();var N=g.getHours();var W=g.getMinutes();var Q=g.getSeconds();var S,T,B,R,l,C,a,Z,X,P,o,N,n,I,A,Y;var V=new Object();if(J.length<4){J=""+(J-0+1900)}V.y=""+J;V.yyyy=J;V.yy=J.substring(2,4);V.M=G;V.MM=LZ(G);V.MMM=MONTH_NAMES[G-1];V.NNN=MONTH_NAMES[G+11];V.d=e;V.dd=LZ(e);V.E=DAY_NAMES[O+7];V.EE=DAY_NAMES[O];V.H=N;V.HH=LZ(N);if(N==0){V.h=12}else{if(N>12){V.h=N-12}else{V.h=N}}V.hh=LZ(V.h);if(N>11){V.K=N-12}else{V.K=N}V.k=N+1;V.KK=LZ(V.K);V.kk=LZ(V.k);if(N>11){V.a="PM"}else{V.a="AM"}V.m=W;V.mm=LZ(W);V.s=Q;V.ss=LZ(Q);while(U=E;A--){var B=G.substring(D,D+A);if(B.length70){I=1900+(I-0)}else{I=2000+(I-0)}}}else{if(E=="MMM"||E=="NNN"){S=0;for(var N=0;N11)){S=N+1;if(S>12){S-=12}U+=D.length;break}}}if((S<1)||(S>12)){return 0}}else{if(E=="EE"||E=="E"){for(var N=0;N12)){return 0}U+=S.length}else{if(E=="dd"||E=="d"){R=_getInt(V,U,E.length,2);if(R==null||(R<1)||(R>31)){return 0}U+=R.length}else{if(E=="hh"||E=="h"){C=_getInt(V,U,E.length,2);if(C==null||(C<1)||(C>12)){return 0}U+=C.length}else{if(E=="HH"||E=="H"){C=_getInt(V,U,E.length,2);if(C==null||(C<0)||(C>23)){return 0}U+=C.length}else{if(E=="KK"||E=="K"){C=_getInt(V,U,E.length,2);if(C==null||(C<0)||(C>11)){return 0}U+=C.length}else{if(E=="kk"||E=="k"){C=_getInt(V,U,E.length,2);if(C==null||(C<1)||(C>24)){return 0}U+=C.length;C--}else{if(E=="mm"||E=="m"){P=_getInt(V,U,E.length,2);if(P==null||(P<0)||(P>59)){return 0}U+=P.length}else{if(E=="ss"||E=="s"){M=_getInt(V,U,E.length,2);if(M==null||(M<0)||(M>59)){return 0}U+=M.length}else{if(E=="a"){if(V.substring(U,U+2).toLowerCase()=="am"){J="AM"}else{if(V.substring(U,U+2).toLowerCase()=="pm"){J="PM"}else{return 0}}U+=2}else{if(V.substring(U,U+E.length)!=E){return 0}else{U+=E.length}}}}}}}}}}}}}}if(U!=V.length){return 0}if(S==2){if(((I%4==0)&&(I%100!=0))||(I%400==0)){if(R>29){return 0}}else{if(R>28){return 0}}}if((S==4)||(S==6)||(S==9)||(S==11)){if(R>30){return 0}}if(C<12&&J=="PM"){C=C-0+12}else{if(C>11&&J=="AM"){C-=12}}var A=new Date(I,S-1,R,C,P,M);return A.getTime()}function parseDate(H){var E=(arguments.length==2)?arguments[1]:false;generalFormats=new Array("y/M/d","y-M-d","yMd","MMM d, y","MMM d,y","y-MMM-d","d-MMM-y","MMM d");monthFirst=new Array("M/d/y","M-d-y","M.d.y","MMM-d","M/d","M-d");dateFirst=new Array("d/M/y","d-M-y","d.M.y","d-MMM","d/M","d-M");var B=new Array("generalFormats",E?"dateFirst":"monthFirst",E?"monthFirst":"dateFirst");var G=null;for(var D=0;D1){var J="",P="",E=false;for(D=0;D0){G=Math.round(G*Math.pow(10,B))/Math.pow(10,B)}var M=G.toString();var C=M.charAt(0)=="-";if(C){M=M.substring(1)}var I=M.split(".");var A=0,N=0,D=0;if(L[4]!=-1){A=L[4]-I[0].length}if(L[5]!=-1){N=L[5]-(I.length>1?I[1].length:0)}var E="";rzstr="";for(D=0;D=0;D--){J=I[0].charAt(D)+J;if(H%3==0&&H!=0&&D>0){J=","+J}H++}I[0]=J}if(C&&(L[6].length>0||L[7].length>0)){return L[6]+I[0]+(I[1].length>0?"."+I[1]:"")+L[7]}else{return(C?"-":"")+L[1]+I[0]+(I[1].length>0?"."+I[1]:"")+L[3]}}function ragic_date_format(D,C){var B=parseDate(D);var A=new Date();if(B!=null){return formatDate(B,C)}else{return D}}function ragic_number_format(C,A){var B=parseFloat(C);if(!isNaN(B)){return formatNumber(B,A)}else{return C}}var ani_obj,ani_rx,ani_xy,ani_speed=10;function animate(D,E,C,B){ani_obj=D;ani_xy=B;if(!ani_obj.rx){var A=B?ani_obj.style.top:ani_obj.style.right;ani_obj.rx=parseInt(A.substring(0,A.length-2))}if(Math.abs(ani_obj.rx-E)<10){ani_rx=C}else{ani_rx=E}_animate()}function _animate(){if(!ani_obj||Math.abs(ani_obj.rx-ani_rx)==0){return }var A=ani_speed;if(A>Math.abs(ani_obj.rx-ani_rx)){if(A/4>Math.abs(ani_obj.rx-ani_rx)){A=Math.abs(ani_obj.rx-ani_rx)}else{if(A/2>Math.abs(ani_obj.rx-ani_rx)){A=A/4}else{A=A/2}}}if(A>Math.abs(ani_obj.rx-ani_rx)){A=Math.abs(ani_obj.rx-ani_rx)}if(ani_obj.rx>ani_rx){ani_obj.rx-=A}else{if(ani_obj.rxMath.abs(scrollAmount)){A=Math.abs(scrollAmount)}if(scrollAmount>0){ctrl.currentNUI_outer.scrollLeft+=A;scrollAmount-=A}else{if(scrollAmount<0){ctrl.currentNUI_outer.scrollLeft-=A;scrollAmount+=A}}if(scrollAmount==0){window.clearInterval(scrollTimer);ctrl.currentController._load();if(biffdata.formType=="2"){$("bNewData").style.display="";$("bDeleteEntry").style.display="none";$("bEdit").style.display="";$("bBack").style.display="none"}else{$("bNewData").style.display="none";$("bEdit").style.display="";if(owner){$("bDeleteEntry").style.display=""}$("bBack").style.display=""}if(scrollCallback){scrollCallback()}}else{window.setTimeout(_animateScroll,20)}}var nui=null,biffdata=null;function DataController(){var A=this;A.nuichain=new Array();A.biffchain=new Array();A.nui=ctrl.currentNUI;A.NONE=0;A.LEFT=1;A.RIGHT=2;A.DOWN=3;A.UP=5}DataController.prototype.load=function(C,A,E,G){if(this.semaphore){return }this.semaphore=true;var B=this;B.headerQS=C;B.dataQS=A;B.callBack=E;var D=B.nui.childNodes;B.ifNullResponse=false;switch(G){case B.LEFT:if(D.length>1){B.nuichain.pop();B.biffchain.pop();nui=B.nuichain[B.nuichain.length-1];biffdata=B.biffchain[B.biffchain.length-1];B.ifNullResponse=true}else{nui=new NUI();nui.init();biffdata=new BiffData();B.nuichain=[nui];B.biffchain=[biffdata];B.nui.insertBefore(nui.main,D[0]);ctrl.currentNUI_outer.scrollLeft=document.body.clientWidth}animateScroll(document.body.clientWidth*-1,function(){var H=ctrl.currentController;H.nui.removeChild(H.nui.childNodes[H.nui.childNodes.length-1]);adjustPrevNext();browse._trav(false);updatePaging()});break;case B.RIGHT:nui=new NUI();nui.init();biffdata=new BiffData();B.nuichain.push(nui);B.biffchain.push(biffdata);B.nui.appendChild(nui.main);animateScroll(ctrl.currentNUI_outer.clientWidth);break;default:if(!nui){nui=new NUI();nui.init();biffdata=new BiffData();B.nuichain.push(nui);B.biffchain.push(biffdata);B.nui.appendChild(nui.main)}else{biffdata.reset()}B._load();break}};DataController.prototype._load=function(){formulaBuilder.listenMapping=new Object();var A=this;if(A.ifNullResponse){read(function(){ctrl.currentController.semaphore=false},"/sims/form_headers.jsp?a="+encodeURIComponent(ap)+"&p="+encodeURIComponent(path)+"&fn="+encodeURIComponent(sheet)+(mvpMode?"&mvp":"")+A.headerQS);return }if(!initDataLoaded){biffdata.loadHeader($("formHeaders").innerHTML.replace(/`/g,",").replace(/\r/g,"").replace(/&/g,"&"));biffdata.loadData($("formData").innerHTML.replace(/`/g,",").replace(/\r/g,"").replace(/&/g,"&"),false,true);if(ctrl.currentController.callBack){ctrl.currentController.callBack()}this.semaphore=false;initDataLoaded=true}else{read(biffdata.loadHeader,"/sims/form_headers.jsp?a="+encodeURIComponent(ap)+"&p="+encodeURIComponent(path)+"&fn="+encodeURIComponent(sheet)+(mvpMode?"&mvp":"")+A.headerQS,true);read(function(B){biffdata.loadData(B);if(ctrl.currentController.callBack){ctrl.currentController.callBack()}ctrl.currentController.semaphore=false},"/sims/form_update.jsp?a="+encodeURIComponent(ap)+"&p="+encodeURIComponent(path)+"&fn="+encodeURIComponent(sheet)+(mvpMode?"&mvp":"")+A.dataQS)}};DataController.prototype.resetBrowseLeft=function(){var B=this,C=B.nui,A;try{var E=true;for(A=C.childNodes.length-1;A>=0;A--){if(C.childNodes[A].nodeType!=1){continue}if(E){E=false;continue}else{B.nui.removeChild(C.childNodes[A])}}for(A=0;A0){A.scrollLeft=(C.nuichain.length-1)*C.nuichain[0].main.offsetWidth}$("commentWin").style.bottom=$("footer").clientHeight+19};var nuiController=new DataController();ctrl.currentController=nuiController;var chart=new Chart();function Chart(){}Chart.prototype.trigger=function(A){if(this.on){this.on=false}else{if(!this.ready){$("chartMain").style.display="";$("charts").style.right=$("chartMain").clientWidth*-1;this.prepareOptions();this.loadChart();this.ready=true}this.on=true}ani_speed=120;animate(A.parentNode,-1*A.nextSibling.offsetWidth,0)};Chart.prototype.prepareOptions=function(){this.linkDomains=$("linkDomains"),i,_biffs=biffdata.biffs;for(i=0;i<_biffs.length;i++){var A=_biffs[i];if(i==0){this.rootDomainId=A.domainId}if(A.dataType==1&&A.IPType=="L"){var B=node("option");B.innerHTML=A.value;B.value=A.domainId;linkDomains.appendChild(B)}}};Chart.prototype.loadChart=function(){var A=this,B=$("theChart");if(!A.linkDomains||A.linkDomains.options.length==0){B.innerHTML='

No chart available.

';return }B.innerHTML=''}; var lm=new Object(); lm['away']="Are you sure you want to navigate away from this page?"; lm['AutoGen']="Auto Generate"; lm['writeCommentHere']="Write Comment Here..."; lm['tutorial1']=" ? "; lm['tutorial2']=" ? "; lm['tutorial3']=" ? "; lm['tutorial4']=" ? "; lm['checkRegistered']=" ? "; lm['myPrivMsg0']="You don't have any access to this form."; lm['myPrivMsg1']="You can create and view your own entries."; lm['myPrivMsg2']="You can view all entries."; lm['myPrivMsg3']="You can create entries, and view all entries."; lm['myPrivMsg6']="You can create, modify, delete all entries."; lm['browseMode']="Browsing Mode - Click on the New Entry or Edit Data button to enter data on the form below."; lm['editMode']="Editing Mode - Edit the data like any spreadsheet, click Save when you're done, click Back Browse if you would like to discard changes."; lm['builderMode']="Design Mode - You can change the design of the form for users to enter different data."; lm['motd']="Oh! I see you're using the Internet Explorer(IE). We recommend that you use the fast and secure Firefox browser. Ragic runs 3 to 5 times quicker in Firefox than IE!

Click here to install Firefox"; lm['confEnterEdit']="You are not logged in, so you will not be able to modify this record after saving. You can register a Ragic account or log in using your Facebook account.

Click here to log in"; lm['confLeaveEdit']="You are not logged in, so you will not be able to modify this record after saving. You can register a Ragic account or log in using your Facebook account."; lm['tt_noShow']="Don't show the tooltips in the future?"; lm['tt_bNewData']="Click here to create a new entry!"; lm['tt_bEdit']="Click here to modify the entry!"; lm['tt_bNextPage']="Click here to see the next page of entries!"; lm['tt_bDesign']="Click here to enter design mode!"; lm['tt_bBack']="Click here to see listing of entries"; lm['tt_bBrowse']="Click here to exit without saving"; lm['tt_filter']="Click to query for the entries you want"; lm['enterURLLink']="Please enter the URL that you would like this to link to:"; lm['enterFilterText']="Enter the text that you would like to search for"; lm['builderListingNotice']="This is a listing automatically generated by Ragic. You can remove fields that you do not want, and add descriptions to the form. It is generally not suggested to add fields here."; lm['noAccessEnter']="You don't have access right to enter data here."; lm['modEditModeOnly']="You can only make modifications in editing mode."; lm['saveBeforeOption']="You need to save the form before you can enter any options."; lm['invalidSheetName']="Invalid sheet name."; lm['sheetNewName']="Please enter the new name of this sheet."; lm['sheetInvalidCharacter']="Your sheet name cannot contain the character _"; lm['selectorFirstField']="A select field can not be the first field of a table.
Please add a text field instead."; lm['valueFormatIncorrect']="Your value format is not correct."; lm['pwdShort']="You password is too short."; lm['pwdNotMatch']="You passwords does not match"; lm['enterDBNameURL']="Please enter database name and URL."; lm['designSaving']="Saving your database design..."; lm['designSaved']="Your database design has been saved!"; lm['entrySaving']="Saving your entry..."; lm['entrySaved']="Your entry has been saved!"; lm['uploadFile']="Upload File"; lm['uploadGraphic']="Upload Graphic"; lm['freeText']="Free Text"; lm['listOfValue']="List of Value"; var theme='webby'; var setBorderClass=__setBorderClasswebby;