'; st1= 'height='+( haut ? haut : 250)+', width ='+(larg ? larg : 400)+', top= '+(posH ? posH :100)+',left='+(posL ? posL : 100)+', menubar=no,status=no'; dialogwin=window.open("","",st1);dialogwin.document.open("HTML");dialogwin.document.write(st);} var diawindrag=false; function DiawinShow(haut,larg,posH,posL,titr){st0=document.getElementById("diaWin");st=st0.style; st.height=( haut ? haut : 250);st.width =(larg ? larg : 400);st.top= (posH ? posH :100);st.left=(posL ? posL : 100);st.visibility="visible"; if(titr !=undefined) st0.innerHTML='
'+titr+'
'; if (document.getElementById("uFrame")) document.body.removeChild(document.getElementById("uFrame")) var ooFrame = document.createElement("IFRAME");ooFrame.frameBorder=0;ooFrame.id ="uFrame";ooFrame.className="oFrame";document.body.appendChild(ooFrame); st2='
'; document.frames["uFrame"].document.write(st2) st1=document.getElementById("uFrame").style;st1.left=st.pixelLeft+2;st1.top=20+st.pixelTop ;st1.width=st.pixelWidth-5;st1.height=st.pixelHeight-23} function DiaWinMove(e){if(diawindrag==true) { event.CancelBubble=true; st=document.getElementById("uFrame") ;st1= document.getElementById("diaWin") x = bw.ns6 ? x : event.clientX ; y = bw.ns6 ? y :event.clientY; st1.style.top=y-10;st.style.top=y+10;st1.style.left=x-st.offsetWidth/2;st.style.left=st1.style.pixelLeft+2}} function DiawinFrameContent(str){ st1=document.getElementById("uFrame"); oFrame=document.frames["uFrame"].document;str1=str.substring((str.length-4),str.length); if (str1.indexOf("htm") == -1)oFrame.body.insertAdjacentHTML("afterBegin",str); else st1.src=str; st1.style.visibility='visible' } diaWinFrameClose='' function DiaClose() {document.getElementById('diaWin').style.visibility='hidden';document.getElementById('uFrame').style.visibility='hidden';} function isEmail(string) {if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) {frames.uFrame.document.getElementById("sendit").submit()} else alert(al04);} function Tag(va){ for (i=0; i'; st+=' '; st+=' '+diaWinFrameClose+''; DiawinFrameContent(st);} function doOpen(loc,act,nex){DiawinShow(270,390,10,15,Dia8[0]); if(loc.toString().substring(0,4)=='http') { DiawinFrameContent("../eProjectOS/eFileSelector.html");return} loc=loc.toString().substring(8,loc.toString().length); fname=loc.substring((loc.lastIndexOf('/')+1),loc.length);loc=loc.substring(0,(loc.lastIndexOf('/')+1)); fpath=loc.substring(0,(loc.lastIndexOf('/')+1)); act=(act==undefined) ?'':act; st='
Explorer:\n\n' st+='\n\n\n' st+=' \n' st+=' \n' st+=' \n' st+='\n'; st+='\n
\n'; st+='\n'; st+='\n\n\n'; st+='\n\n\n' st+='
'+Dia8[1]+':' if (act=='') st+='' if (act=='save') st+='\n\n' st+='
'+Dia8[2]+':'+diaWinFrameClose+'
\n' DiawinFrameContent(st);FillFileList(loc);} function OpenFile(){if (newURL.indexOf('etbl') > -1 ) doImport(newURL); else this.location=newURL} function FillFileSelect(fil,thisUrl,thisUrlName,thisAtt){ if (fil==2) {dialogwin.fileUrl.value=thisUrl;dialogwin.filename.value=thisUrlName;}; else FillFileList(thisUrl,'tt',thisAtt);} function dateFormat(dateobj){ dF=new Date(dateobj);m = dF.getMonth() + 1;d = dF.getDate(); yy = dF.getYear(); yy < 100 ? yyyy = yy +1900 : yyyy=yy; if(m.toString().length < 2) { mm = "0" + m + ""; } else { mm = m; } if(d.toString().length < 2) { dd = "0" + d + ""; } else { dd = d; } DateString=dd+"/"+mm+"/"+yyyy;return DateString;} function FillFileList(sel,par,att,fil,srt){//if(dialogwin.document.getElementById("uFrame"))dialogwin.document.getElementById("uFrame").style.visibility="hidden" ; dialogwin=document.frames["uFrame"].document.all dialogwin.Filelist.style.overflow="scroll" ; dialogwin.Filelist.style.visibility="visible"; if (fil) list=fil; fileList=new Array(); stt=''; st0D= "ü eFileManager
"; if(document.location.toString().substring(0,4) =="http"){if (!document.getElementById("uFrame")) dialogwin.FillFileHTTP() ; dialogwin.selIcon.innerHTML="ü";dialogwin.selName.innerHTML=" eFileManager "} else { fso = new ActiveXObject("Scripting.FileSystemObject"); att=(att==undefined) ?'':att; if ((sel.charAt(1)!= ":")) sel='C:' ;fldr = fso.GetFolder(sel);fldr=(par=="parent" ? fldr.ParentFolder:fldr); st0D+=" onclick='selIcon.innerHTML=this.children[0].innerHTML;parent.FillFileList(this.children[1].innerHTML,\"tt\",filter.options(filter.selectedIndex).value);FileTree.style.display=\"none\";'> "; st01D=""+(x.DriveLetter =="A" ? "<":";")+""+drv.item()+"\n"+ n +"("+x.DriveLetter +")"+"
"} st0=''; for(var objEn = new Enumerator(fldr.SubFolders); !objEn.atEnd(); objEn.moveNext()) { stt+=" "+st0D+st01D+"color:orange;font-size:12pt;'>0"+"\n"+objEn.item()+""+objEn.item().Name +"
"; fileList[fileList.length]=new Array(); fileList[(fileList.length-1)][0]=objEn.item().Name; fileList[(fileList.length-1)][1]=objEn.item().Size; fileList[(fileList.length-1)][2]=objEn.item().Type; fileList[(fileList.length-1)][3]=objEn.item().DateLastModified; fileList[(fileList.length-1)][4]=st0+'color:orange;">0'+st01+objEn.item()+''+objEn.item().Name +''; fileList[(fileList.length-1)][5]=st0+'color:orange;">0'+st01+objEn.item()+''+objEn.item().Name +''+parseInt(eval(parseInt(objEn.item().Size)/1000)) +'Ko
'+objEn.item().Type+''+dateFormat(objEn.item().DateLastModified)+'';} dialogwin.FileTree.innerHTML=stt; } if(document.location.toString().substring(0,4) =="http"){//stf='';for(i=0;i';stf+='
'+dialogwinf.reptab[i][0]+'
'; dialogwin.writeFolderContent (stf); fldr='';sel=''} else{ for(var objEn = new Enumerator(fldr.Files); !objEn.atEnd(); objEn.moveNext()) {st=objEn.item().Name;if( st.substring((st.length-att.length),st.length)==att) {fileList[fileList.length]=new Array() fileList[(fileList.length-1)][0]=objEn.item().Name; fileList[(fileList.length-1)][1]=objEn.item().Size; fileList[(fileList.length-1)][2]=objEn.item().Type; fileList[(fileList.length-1)][3]=objEn.item().DateLastModified; fileList[(fileList.length-1)][4]=st0+'color:'+(st.substring((st.length-4),st.length)=="html" ? 'blue':'black')+'">2'+st01+objEn.item()+''+objEn.item().Name +''; fileList[(fileList.length-1)][5]=st0+'color:'+(st.substring((st.length-4),st.length)=="html" ? 'blue':'black')+'">2'+st01+objEn.item()+''+objEn.item().Name +''+parseInt(eval(parseInt(objEn.item().Size)/1000)) +'Ko
'+objEn.item().Type+''+dateFormat(objEn.item().DateLastModified)+''; }} stf=''; j=0; if (list=='false'){for(i=0;i':'')} stf+='
' } else { if (!isNaN(parseInt(srt))) fListSort(srt);else stars=new Array(' ',' ',' ',' ') stf1='style="background: buttonface; padding-left: 5; padding-right: 5;border-top: 1 solid threedhighlight; border-left: 1 solid threedhighlight; border-right: 1 solid threedshadow; border-bottom: 1 solid threedshadow;' starr='style="font-family: webdings; color: black; padding: 0; font-size: 10; height: 11; width: 10; overflow: hidden; margin-bottom: 2; margin-top: -3; padding: 0; padding-top: 0; padding-bottom: 2;"' stsrt='parent.FillFileList(selURL.value,\'\',filter.options(filter.selectedIndex).value,\'true\',\''; stf='\n'; stf+='' stf+='' stf+='' stf+='' stf+='' stf+='' for(i=0;i'; if (dir==5){for ( i=0; i<(ll-1); i++) for (j=i+1; jfileList[i][val]) { var dummy =fileList[i];fileList[i] = fileList[j]; fileList[j] = dummy};dir=5;}} function doSaveAs(){GVurl=( ((GVurl==undefined)||(GVurl=='')) ? document.location.toString():GVurl);doOpen(GVurl,'save')} function doSave(){GVurl=( ((GVurl==undefined)||(GVurl=='')) ? document.location.toString():GVurl);SaveHTML(GVurl);FileMenu.rows[2].className="disabled";} function doSaveDatafile(){SaveGVMfile(); if (newURL=='') return;st=newURL.length;if (newURL.substring((st-3),st)=='htm') {alert(al02);return}; Dataurl=newURL; if(Dataurl.indexOf(".els") == -1) Dataurl+=".els"; ReadFile(); fso = new ActiveXObject("Scripting.FileSystemObject"); f = fso.CreateTextFile(Dataurl,true); s= SaveData();f.write(s);f.Close();GVChanged=false;} function ReadFile(fname){fname=(fname==undefined? 'eTablor': fname); s= DocumentHeader(fname);s+= document.scripts(0).outerHTML;s+=DocumentBody();return s} function getHTMLfile(fname){ savedData=SaveData();s=ReadFile(fname);s= s.substring(0,(s.indexOf('THISISTHEDATASTART')+19))+'\n'+savedData+'\n'+ s.substring(s.indexOf('//FileStart'),s.length);return s } function SaveHTML(localurl,fname){localurl=localurl.toString(); if (localurl.substring(0,3)=='http') localurl=localurl.substring(8,localurl.length); if (localurl.substring(0,5).indexOf('file')>-1) localurl=localurl.substring(8,localurl.length); if(localurl.indexOf(".etbl") > -1){fso = new ActiveXObject("Scripting.FileSystemObject");f = fso.CreateTextFile(localurl,true); s=SaveData() } else{ if ( !GVurl || (localurl != GVurl))GVurl=localurl+fname;getHTMLfile() fso = new ActiveXObject("Scripting.FileSystemObject");f = fso.CreateTextFile(GVurl,true)} f.write(s);f.Close( );GVChanged=false; if(localurl.indexOf(".etbl") == -1) this.location=GVurl;} function doPrint(){window.print() } function doImport(dataURL){if ((dataURL.indexOf('etbl')== -1 )||(dataURL=='')) {alert(al05);return} fso = new ActiveXObject("Scripting.FileSystemObject"); ts = fso.OpenTextFile(dataURL, 1); newdata = ts.ReadAll(); ts.Close(); tr = document.URL.substring(7,document.URL.length);ts = fso.OpenTextFile(tr,1);s=ts.ReadAll(); ts.Close() ; var newF= s.substring(0,s.indexOf('//THISISTHEDATASTART'))+newdata+ s.substring(s.indexOf('//FileStart'),s.length); document.write(newF); document.close();} function doUpload(){ DialogwinHeader(Dia2[0]); var upst= server+"/samples/upload&download.php3"; st+='
\n'; st+='

\n'; if (!connect) { st+= Dia2[1]+'
'+Dia2[2]+'http://eplanning.free.fr/
'+Dia2[3]+'

\n'; st+='\n';} else{st+='

'+Dia2[8]+'

\n'; st+='\n'} st+='
\n'; st+='
'+Dia8[1]+stars[0]+''+Dia8[4]+stars[1]+''+Dia8[2]+stars[2]+''+Dia8[5]+stars[3]+'
\n'; st+='\n'; st+='
'+Dia2[5]+'
'+Dia2[6]+'
'+Dia2[7]+'
\n'; st+='\n\n'; DialogwinFooter(200,300) ;dialogwin.uploadForm.submit();} function DeleteRemember(){ Oldproject=project;Oldresource=resource;Oldconnect=connect;OldTimeScale=TimeScale;OldInitStart=InitStart;OldLinks=links;OldCPMtasks=CPMtasks oldArray = EPL;OldGroups=Groups;OldResources=Resources;OldDOff=DOff; OldIndentBar=IndentBar; for (i=(oRS.RecordCount-1) ; i >0; i--){Pos = i;DeleteRecord();} } function doViewDataCache(){ newwin=window.open('','','height=200,width=480,top=50,left=10,menubar=yes,scrollbars=yes,status=no'); newwin.document.open("text/plain");DialogwinHeader(Dia1);SaveData(); newwin.document.write(st)} function RegChange(){GVChange=true; FileMenu.rows[2].className="enabled";} function doFclose(){if(window.parent.document.title !="eProjectOS") window.close();else window.parent.doWinClose()} function checkLocation(){st=document.location.toString();if(st.substring((1+st.indexOf("?")),st.length)=="newTablor") newDiaWin()} function doAbout(){DiawinShow(150,250,30,100,Dia7[0]); st='
'+iconGV()+'eTablor
'; st+='
'+Dia7[1]+'

'; st+=''+ Dia7[2]+' Gerard Verron
'; DiawinFrameContent(st);} function displayMenuLoc(opt){menuloc.style.display="" ; mlh= ODiv.offsetHeight-menuloc.offsetHeight;mll= ODiv.offsetWidth-menuloc.offsetWidth; menuloc.style.pixelTop =((event.clientY < mlh )? event.clientY:mlh); menuloc.style.pixelLeft=((event.clientX < mll) ? event.clientX:mll)} function writemenus(){ var sp = '' var st0= '' st+='' st+='
' st+=' '+Men1[0]+' ' st+= st0+'doNew()">'+sp+'' st+= st0+'doOpen(document.location)">'+sp+''+sp+'' st+= st0+'doSave()" class="disabled">'+sp+'' st+= st0+'doSaveAs()">'+sp+''+sp+'' // st+= st0+'doPrint()">'+sp+''+sp+'' st+='' st+= st0+'doUpload()" class="disabled">'+sp+''+sp+'' st+= st0+'doDownload()" class="disabled">'+sp+''+sp+'' st+= st0+'doPostFile()" >'+sp+''+sp+'' st+= st0+'doFclose()" >'+sp+''+sp+'' st+='' st+=' '+Men2[0]+' ' st+= st0+'doUndo()" class="disabled">'+sp+''+sp+'' st+= st0+'doRedo()" class="disabled">'+sp+''+sp+'' st+= '' st+= st0+'doCut()">'+sp+''+sp+'' st+= st0+'doCopy()">'+sp+''+sp+'' st+= st0+'doPaste()">'+sp+''+sp+'' st+= st0+'diaPasteFunction()">'+sp+''+sp+'' st+= '' st+= '' st+= '' st+= st0+'doFillDown()">'+sp+''+sp+'' st+= st0+'doFillRight()">'+sp+''+sp+'' st+='' st+=' '+Men3[0]+' ' st+= st0+'doCellInfo()" >'+sp+'' st+= st0+'doMergeCells()" >'+sp+'' st+= st0+'doSplitCell()" >'+sp+'' st+= st0+'doTableSort((Col-1))" class="disabled">'+sp+'' st+= st0+'doViewDataCache()" >'+sp+''+sp+'' st+= '' st+= st0+'doShowGrid()" >'+sp+''+sp+'' st+= st0+'doDispOp()" >'; st+=' ? ' st+= st0+'doPMForum()">'+sp+''; st+= st0+'doETblSite()">'+sp+''; st+= st0+'doHelp();" title="">'+sp+''; st+=''; st+= st0+'doAbout()">'+sp+''+sp+'' st+=''; st1='' st+=''; st+= st1+Men5[16]+'" onclick="doCalculation()">S
' st+= st1+Men5[17]+'" id="inputkey" onclick="myTbl[Row][(Col-1)]=InputBar.value;showTbl();getInput=false" >a' st+= st1+Men5[18]+'" onclick="InputBar.value=\'\'" style="font-size:8pt">r' st+='' st+='' st+='
'; st+=''; st+='' st+= st1+Men5[0]+'" onclick="doNew()">' st+= st1+Men5[1]+'" onclick="doOpen(document.location)">1' st+= st1+Men5[2]+'" onclick="doSave()" ><' st+= st1+Men5[3]+'" onclick="doPostFile()">*' st+=' '; st+= st1+'" name="CLF" onclick="fontfamilier.style.display=(fontfamilier.style.display==\'\' ? \'none\':\'\');fontfamilier.style.left=this.offsetLeft+tbar.offsetLeft;fontfamilier.style.top=(tbar.offsetTop+22)" >T'; st+= st1+'" name="CLS" onclick="fontsizer.style.display=(fontsizer.style.display==\'\' ? \'none\':\'\');fontsizer.style.left=this.offsetLeft+tbar.offsetLeft;fontsizer.style.top=(tbar.offsetTop+22)" >>'; st+='\n'; st+= st1+Men5[7]+'" style="position:relative;top:3" >' st3='' st+=''+st3+st3+''+st3+st3+'
' st+=''; st+= st1+Men5[4]+'" onclick="doBold()">B' st+= st1+Men5[5]+'" onclick="doItalic()">I' st+= st1+Men5[6]+'" onclick="doUnderline()">U
' st+=''; st+=Icon('Left',-14,-35);st+=Icon('Center',-11,-32);st+=Icon('Right',-8,-29); st+='
'; st+='' st+='' st+= st0+'doCut()">'+sp+''+sp+'' st+= st0+'doCopy()">'+sp+''+sp+'' st+= st0+'doPaste()">'+sp+''+sp+'' st+= '' st+= st0+'doCellInfo()" >'+sp+'' st+= '' st+= st0+'doAddColumn()">'+sp+''+sp+'' st+= st0+'doDeleteColumn()">'+sp+''+sp+'' st+= st0+'doAddRow()">'+sp+''+sp+'' st+= st0+'doDeleteRow()">'+sp+''+sp+'' st+= '' st+= st0+'doFillDown()">'+sp+''+sp+'' st+= st0+'doShowGrid()">'+sp+''+sp+'' st+='' st+='' st+='
' for(h=0;h '+fontfamil[h]+'
'; st+='
'; st+='
' for(i=0;i '+fontsize[i]+'p
'; st+='
'; st+='
' st4='' st4+='
';st6='border-right:1 solid '+borderColor+';';st7='border-bottom:1 solid '+borderColor+';';st8='border-left:1 solid '+borderColor+';';st9='border-top:1 solid ' + borderColor+';'; st+='' st+='
'+st4+'border-top:1 solid black;'+st6+st7+st8+st5+''+st4+'border-right:1 solid black;'+st7+st8+st9+st5+''+st4+'border-bottom:1 solid black;'+st6+st8+st9+st5+''+st4+'border-left:1 solid black;'+st6+st7+st9+st5+'
'+st4+st6+st7+st8+st9+st5+''+st4+'border-top:1 solid black;border-bottom:1 solid black;'+st6+st8+st5+''+st4+'border-left:1 solid black;border-right:1 solid black;'+st7+st9+st5+''+st4+'border-top:1 solid black;border-left:1 solid black;border-bottom:1 solid black;border-right:1 solid black;'+st5+'
' st+='
' document.write(st) } function doShowGrid(){ for (k=0;k'; st+=' ' for (j=0; j' + titres[j]+ ' ';} st += '' st +='' st +='' for ( i=1; i ' } st+='
'; st+='
' st+='
' st+='
' st+='
' st += '' st+=''; for (j=0; j"; st+='' for (j=0; j<=Twidth; j++) st +=''; st += '' st+='' for ( i=1; i'; for ( j=0; j= 1 ? '':''); } st+='' } st+='
' +evalue(i,j)+ '
'; st+='
' st+='
'; st+='' ODiv.innerHTML=st; for ( i=1; i '+i+' ' bdtbl.rows[(i-1)].cells[0].innerHTML=st1;} } function scrollTheads(){ if (IpCell) {InpCell.style.pixelLeft=-1000;InpCell.style.pixelTop=-1000;IpCell=false}; hdtbl.style.left=-spsheet.scrollLeft;bdtbl.style.top=17-spsheet.scrollTop} function showInpCell(){st=InpCell.style;st1=event.srcElement;InpCell.value=myTbl[Row][(Col-1)]; B=0; st.pixelTop=st1.offsetTop+bdtbl.style.pixelTop;st.pixelLeft=st1.offsetLeft+20+hdtbl.style.pixelLeft;st.pixelHeight=st1.offsetHeight;st.pixelWidth=st1.offsetWidth;InpCell.focus();IpCell=true} function doMsD (){if (event.button==1){ if (IpCell) {InpCell.style.pixelLeft=-1000;InpCell.style.pixelTop=-1000;IpCell=false}; st1=InputBar.value.charAt(InputBar.value.length-1);if((st1 !='+')&&(st1 !='-')&&(st1 !='=')&&(st1 !='*')&&(st1 !='/')){Col=event.srcElement.cellIndex;Row=event.srcElement.parentElement.rowIndex;highlightCell(Col,Row);clickCell=true};else inputbarAdd();menuloc.style.display='none'}} function evalue(i,j,fmi,lor){ va=myTbl[i][j]; tot= (lor=='loop'? coun:' '); if (va==''){vCell[i][j]=''; return tot;} vstr='';vi=0 ;st=FormatCell[i][j].toString(); if (va.charAt(0) != '=') {if ((isNaN(va))||(st.charAt(0)==1)||(st.charAt(0)==3)) {vCell[i][j]=va; return va}; else {tot=(tot==''? tot:'');vCell[i][j]=vs=eval(tot+va);return Frmat(vs,i,j)} } ; vs=new Array(); va=va.substring(1,va.length); vc= new Array(); vc=va.split(/([+ * / -])/); for (k=0;k=Tlength)||(cb>=Twidth)) {vCell[i][j]=va='#HREF!';return va} if(vCell[ca][cb]) vs[k]=vCell[ca][cb]; else vs[k]=myTbl[(ca)][(cb)] ; } else { for(l=0;lst1) for(k=0;k<(st3-st1);k++) num+="0"; var re = /(-?\d+)(\d{3})/;while (re.test(num)) num = num.replace( re,"$1 $2"); return num } function cellcolor(){st=event.srcElement;Col2=st.cellIndex;Row2=st.parentElement.rowIndex;highcell()} function highcell(){if (selCell) unhigh();st=(Col1==0 ? 1:Col1);st1=(Row1==0 ? 1:Row1);for (i=Math.min(st,Col2);i<=Math.max(st,Col2);i++) {for (j=Math.min(st1,Row2);j<=Math.max(st1,Row2);j++) tbl.rows[j].cells[i].style.backgroundColor='lightcyan'}; selCell=tbl.rows[st1].cells[st] ;selCell.style.backgroundColor='' selCell.className= ClCell[st1][(st-1)] ; selCell.style.border="2px solid blue";selCell.style.padding=0;} function cellDrag(){ st=event.srcElement;Col1=st.cellIndex;Row1=st.parentElement.rowIndex;st.style.border="2px solid blue"; event.cancelBubble=true} function unhigh() {unborder(); for (i=0;i<(Tlength-1);i++){for (j=0;j<=Twidth;j++) {if(tbl.rows[i].cells[j]) tbl.rows[i].cells[j].style.backgroundColor=''}}} function unborder(){ st=getRule(selCell.className)[0].style; selCell.style.padding=2;st1=selCell.style st1.borderRight=(celldrag != true ? st.borderRight:"2px solid blue"); st1.borderTop=(celldrag != true ? st.borderTop:"2px solid blue"); st1.borderLeft=(celldrag != true ? st.borderLeft:"2px solid blue"); st1.borderBottom=(celldrag != true ? st.borderBottom:"2px solid blue"); if ((st=='')||(st.borderRight=='')) selCell.style.borderRight=selCell.style.borderBottom="1 solid "+borderColor } function highlightCell(Co,Ro) {if (selCell) unhigh();Col1=Col2=Col;Row1=Row2=Row; if(Co!=undefined){oEL=tbl.rows[(Ro)].cells[(Co)] ;oEL.style.border="2px solid blue"; oEL.style.padding=1; selCell= oEL ; st=myTbl[Ro][(Co-1)];st=(st.charAt(0)=='='? st.substring(1,st.length):st) ; CLR.style.backgroundColor= getRule(oEL.className)[0].style.backgroundColor;CLR.style.color= getRule(oEL.className)[0].style.color; InputBar.value.charAt(InputBar.value.length)=='=' ? InputBar.value+=st : InputBar.value=myTbl[Ro][(Co-1)]; InputBar.focus()} } function inputbarAdd(){InputBar.value+=alphabet.charAt(event.srcElement.cellIndex-1)+event.srcElement.parentElement.rowIndex} function TDselDown(){if(colresize){oEL=event.srcElement.parentElement.parentElement; Col=oEL.cellIndex; tst=TDsel.style; tst.pixelLeft=oEL.offsetLeft;tst.posWidth=oEL.offsetWidth; tst.pixelHeight=(spsheet.offsetHeight-15); tst.pixelTop=spsheet.offsetTop;lLeft=tst.pixelLeft} if(rowresize){oEL=event.srcElement.parentElement.parentElement.parentElement.parentElement.parentElement; Row=(oEL.rowIndex+1); tst=TDsel.style; tst.pixelTop=oEL.offsetTop+15;tst.pixelHeight=oEL.offsetHeight; tst.posWidth=spsheet.offsetWidth; tst.pixelLeft=0;lTop=tst.pixelTop};dragTD=true; TDsel.setCapture()} function TDselMove(){if (colresize){TDcellWidth=event.clientX+spsheet.scrollLeft+spsheet.scrollTop - lLeft+10;TDsel.style.posWidth =TDcellWidth;ColWidth[(Col-1)]=TDcellWidth} if (rowresize){TDcellHeight=event.clientY+spsheet.scrollTop - lTop-ODiv.offsetTop;TDsel.style.pixelHeight =TDcellHeight+2;RowHeight[(Row-1)]=TDcellHeight} if (selcalc==true){TDcellTop=event.clientY+spsheet.scrollTop -ODiv.offsetTop; TDsel.style.posTop =TDcellTop;TDsel.style.pixelHeight =lTop-TDcellTop ;st1=alphabet.charAt((Col-1));st2=Math.round(TDcellTop/oEL.offsetHeight); st='=sum('+st1+(st2 +1- Row>0 ? (Row-1):st2)+':'+st1+(Row-1)+')';myTbl[Row][(Col-1)]=st;InputBar.value=st;} } function TDselUp(){ seldrag=false; selcalc=false ; colresize=false;rowresize=false;TDsel.releaseCapture();TDsel.style.left=-1000;showTbl()} function keyInput(){switch(event.keyCode){ case 13:Row++ ;break;case 37: B-=1;break;case 38: Row-=(Row < 1 ? 0:1);break; case 39: B=1; break;case 40: Row++} Col= (event.keyCode ? (Col+B):oEl.cellIndex);Row=(event.keyCode ? Row:oEl.parentElement.rowIndex); Row=(Row==0? (Tlength-1):Row);Row=(Row==Tlength? 1:Row);Col=(Col==0? Twidth:Col); Col=(Col== (Twidth+1)? 1:Col);} function inputcell(){ var st1=Col;var st2=Row; B=0;keyInput(); if ((IpCell)&&((st1!= Col)||(st2 != Row))) {myTbl[st2][(st1-1)]=InpCell.value;InpCell.style.pixelLeft=-1000;InpCell.style.pixelTop=-1000;IpCell=false; highlightCell(Col,(Row)); }; else if ((st1!= Col)||(st2 != Row)) {myTbl[st2][(st1-1)]=InputBar.value;InputBar.value=''; highlightCell(Col,(Row));getInput=false;}; if (event.keyCode==13) showTbl(); else {i=st2;j=(st1-1);tbl.rows[(st2)].cells[(st1)].innerHTML=evalue(st2,(st1-1))} RegChange()} function doCalculation(){colresize=false;tst=TDsel.style;oEL=tbl.rows[(Row)].cells[Col];oEL1=tbl.rows[(Row-1)].cells[Col]; tst.pixelLeft=oEL1.offsetLeft+20+hdtbl.style.pixelLeft;tst.posWidth=oEL1.offsetWidth;tst.pixelTop=oEL1.offsetTop+bdtbl.style.pixelTop ; tst.pixelHeight=oEL1.offsetHeight ; lTop=oEL.offsetTop+bdtbl.style.pixelTop;selcalc=true;TDsel.setCapture()} //------------------------------Menu functions------------------------------------------------- function newDiaWin(){DiawinShow(170,280,30,50,Dia1[0]) ; st='

' st+='' st+='' st+='
'+Dia1[2]+'
'+Dia1[3]+''+Dia1[4]+'
'+Dia1[5]+':
' st+=' '+diaWinFrameClose+'' ; DiawinFrameContent(st)} function createNew(aa,bb,cc,dd){cc++;eTblName=aa;fontSiz=dd;myTblSize=new Array(bb,cc);ColWidth=new Array();RowHeight=new Array();GVrow=new Array(); for (i=0;i 1 ? alphabet.charAt(j+dCell[i][j]-1):'')+i+'|'+(ClCell[i][j]=='sty0' ? '':ClCell[i][j])+'|'+myTbl[i][j]+'|'+FormatCell[i][j]+'"'); st+=');\n'; }} return st} function doTableSort(val) { sta=''+(dir? 6:dir)+'';titres=new Array() ; for(i=0;imyTbl[i][val]) { var dummy1 =myTbl[i];myTbl[i] = myTbl[j]; myTbl[j] = dummy1; var dummy2 =StCell[i];StCell[i] = StCell[j]; StCell[j] = dummy2};dir=5;} titres[val]=myTbl[0][val]+sta ; showTbl()} function doCut(){copy=myTbl[Row][(Col-1)];myTbl[Row][(Col-1)]='';showTbl()} function doCopy(){copy=myTbl[Row][(Col-1)];copyF=ClCell[Row][(Col-1)];} function doPaste(){myTbl[Row][(Col-1)]=copy;ClCell[Row][(Col-1)]=copyF;showTbl()} function addStyle(sty){k=0;while (k1) st0=getRule(tbl.rows[i].cells[j].className)[0].style.cssText; st5='sty'+(oStyle.rules.length);st4='.'+st5;oStyle.addRule(st4,st0); st3=eval(ClCell[i][(j-1)]).split(",") addStyle(st5);tbl.rows[i].cells[j].className=ClCell[i][(j-1)]=st5; st2=oStyle.rules[(oStyle.rules.length-1)];} st=eval("st2.style."+(((par1=="Weight")||(par1=="Style")) ? "font"+par1:par1)); if (par1=='Style') st3[0]=st2.style.fontStyle=(st==par2 ? "":par2); if (par1=='Weight') st3[1]=st2.style.fontWeight=(st==par2 ? "":par2); if (par1=='textDecoration') st3[2]=st2.style.textDecoration=(st==par2 ? "":par2); if (par1=='fontFamily') st3[3]=st2.style.fontFamily=(st==par2 ? "":par2); if (par1=='fontSize') st3[4]=st2.style.fontSize=(st==par2 ? "":par2); if (par1=='textAlign') st3[5]=st2.style.textAlign=(st==par2 ? "":par2); if (par1=='color') st3[6]=st2.style.color=(st==par2 ? "":par2); if (par1=='backgroundColor') st3[7]=st2.style.backgroundColor=(st==par2 ? "":par2); if (par1=='Border') { st=st2.style; st3[8]="0000" st.borderLeft=(par2 =="black 1px solid" ? par2: "1 solid white");st3[8].charAt[0]=(par2.indexOf("black") == -1 ? 0:1) st.borderTop=(par3 =="black 1px solid" ? par3 :"1 solid white"); st3[8].charAt[1]=(par3.indexOf("black") == -1 ? 0:1) st.borderRight=(st.borderRight==par4 ? "1 solid " +borderColor:par4);st3[8].charAt[2]=(st.borderRight==par4 ? 0:1) st.borderBottom=(st.borderBottom==par5 ? "1 solid "+borderColor:par5);st3[8].charAt[3]=(st.borderRight==par5 ? 0:1) } eval(ClCell[i][(j-1)]+'="'+st3.toString()+'"') }} highlightCell(Col,Row);RegChange();showTbl()} function doBold(){((!Row)||(!Col)) ? alert(al03) : doStyleRule('Weight','bold');} function doItalic(){doStyleRule('Style','italic')} function doUnderline(){doStyleRule('textDecoration','underline')} function doFontFamily(fam){ doStyleRule('fontFamily',fam)} function doFontSize(vas){doStyleRule('fontSize',vas)} function doLeft(){doStyleRule('textAlign','left')} function doCenter(){ doStyleRule('textAlign','center')} function doRight(){doStyleRule('textAlign','right') } function doColorSelect(target){ colorBox.style.display ="none"; target=='fonte' ? doStyleRule('color',CLR.style.color):doStyleRule('backgroundColor',CLR.style.backgroundColor);} function doCellBorder(){ st=event.srcElement.style; doStyleRule('Border',st.borderLeft,st.borderTop,st.borderRight,st.borderBottom) borderer.style.display='none';} function doFillDown(){copy=myTbl[Row][(Col-1)];copyF=ClCell[Row][(Col-1)]; for (i=Math.min(Row1,Row2);i<=Math.max(Row1,Row2);i++){myTbl[i][(Col-1)]=copy;ClCell[i][(Col-1)]=copyF}showTbl()} function doFillRight(){copy=myTbl[Row][(Col-1)];copyF=ClCell[Row][(Col-1)]; for (i=Math.min(Col1,Col2);i<=Math.max(Col1,Col2);i++){myTbl[Row][(i-1)]=copy;ClCell[Row][(i-1)]=copyF}showTbl()} function updStCell(slro,slco){StCell[(slro)][(slco-1)]='style="'+tbl.rows[(slro)].cells[(slco)].style.cssText+'"'} function doAddRow(){ var Ah=1+Row2-Row1; for (i=0;iRow2;i--){ myTbl[i][j]=NewRowRef(Ah,i,j); ClCell[i][j]=ClCell[(i-Ah)][j];dCell[i][j]=dCell[(i-Ah)][j];FormatCell[i][j]=FormatCell[(i-Ah)][j];}} for(j=0;j=Col2;i--){ myTbl[0][i]= alphabet.charAt(i) ;ColWidth[i]=ColWidth[(i-Ac)]; for(j=1;j\n'; st+='\n'; st+='\n'; st+='\n'; st+='\n' st+='\n' return st} function DocumentBody(){ st='' st+='