function Highlight(oObj, sClass) { if(typeof oObj=='string') oObj = document.getElementById(oObj); if(oObj==null) return; if(sClass == null || sClass == '') sClass = 'highlight'; if(oObj.className.match(RegExp('\\b' + sClass + '\\b')) == null) oObj.className += ' ' + sClass; } function Unhighlight(oObj, sClass) { if(typeof oObj=='string') oObj = document.getElementById(oObj); if(oObj==null) return; if(sClass == null || sClass == '') sClass = 'highlight'; oObj.className = oObj.className.replace(RegExp('\\b' + sClass + '\\b', 'g'), ''); } function HighlightToggle(oObj, sClass) { if(typeof oObj=='string') oObj = document.getElementById(oObj); if(oObj==null) return; if(sClass == null || sClass == '') sClass = 'highlight'; if(oObj.className.match(RegExp('\\b' + sClass + '\\b')) == null) { oObj.className += ' ' + sClass; return true; } else { oObj.className = oObj.className.replace(RegExp('\\b' + sClass + '\\b', 'g'), ''); return false; } } function Hover(oObj) { Highlight(oObj, 'hover'); } function Unhover(oObj) { Unhighlight(oObj, 'hover'); } function SortTable(oObj, iColDelta) { bTime=0; if(bTime) { var dStart=new Array(); var dEnd=new Array(); dStart[dStart.length] = new Date(); } var oCell = oObj; while(oCell.nodeName!="TH" && oCell.nodeName!="TD") { if(oCell.nodeName=="BODY") return; oCell = oCell.parentNode; } var oTable = oCell; while(oTable.nodeName!="TABLE") { if(oTable.nodeName=="BODY") return; oTable = oTable.parentNode; } iCol=-1; oRow=oCell.parentNode; x2=0; for(x = 0; xb['cmp']) return 1; if(a['cmp']b['cmp']) return -1; if(a['cmp']=0; y--) { // for all rows backwards oRow = oTBody.rows[y]; sSortType = 'string'; oVal = oRow.cells[iCol]; if(oVal.className.match(RegExp('\\amount\\b')) != null) sSortType = 'amount'; oValChild = oVal.firstChild; if(oValChild != null && oValChild.className != null && oValChild.className.match(RegExp('\\bsortval\\b')) != null ) oVal = oValChild; if(oVal.className.match(RegExp('\\amount\\b')) != null) sSortType = 'amount'; xCell = oRow.cells[iCol].innerHTML; xCell = xCell.replace(RegExp('\<[^\>]*\>', 'g'), ''); // FILTER HTML Tags ! if(sSortType == 'amount') { xCell = parseFloat(xCell); if(isNaN(xCell)) xCell = 0; } else xCell = xCell.toLowerCase(); aRows[y] = new Array(); aRows[y]['obj'] = oRow; aRows[y]['cmp'] = xCell; } aRows.sort(funCompare); if(bTime) { dEnd[dEnd.length] = new Date(); dStart[dStart.length] = new Date(); } for(var y=0; y0) Unhighlight(oTBody, 'filter-isempty'); else Highlight(oTBody, 'filter-isempty'); } else if(oTBody.className.match(RegExp('\\bnofilter\\b'))==null) { iRows = oTBody.rows.length; if(iRows < 1) continue; for(var y=0; y]*\>', 'g'), ''); // FILTER HTML Tags ! sCell=sCell.toLowerCase(); if(sCell.indexOf(sFilter) >= 0) { bMatch=1; iMatches++; break; } } if(bMatch) Unhighlight(oRow, 'filter-mismatch'); else { Highlight(oRow, 'filter-mismatch'); iFiltered++; } } } } if(iFiltered>0) Highlight(oTable, 'filter-active'); else Unhighlight(oTable, 'filter-active'); return sFilter; } function getCookie(sName) { re = new RegExp("(^| )" + sName + "=([^;\n]*)(;|\n|$)"); document.cookie.match(re); return(unescape(RegExp.$2)); } function setCookie(sName, sValue, iExpireDays) { var dExpireDate = new Date (); dExpireDate.setTime(dExpireDate.getTime() + (iExpireDays * 24 * 3600 * 1000)); document.cookie = sName + "=" + escape(sValue) + ((iExpireDays == null) ? "" : "; expires=" + dExpireDate.toGMTString()); } function delCookie(sName) { if (getCookie(sName)) { document.cookie = sName + "=; expires=Thu, 01-Jan-70 00:00:01 GMT"; } } function DateDiffString(dStart, dEnd) { var sDiff; var dDiff = new Date(dEnd.getTime() - dStart.getTime()); var sMilliSec = parseInt((((dDiff.getMinutes() * 60) + dDiff.getSeconds()) * 1000) + dDiff.getMilliseconds()) + ""; while(sMilliSec.length < 4) { sMilliSec = '0' + sMilliSec; } iLen = sMilliSec.length; sDiff = "" + sMilliSec.substring(0, iLen-3) + '.' + sMilliSec.substring(iLen-3) + ' sec.'; return sDiff; } var oIFrame=null; // our IFrame object var IFrameDoc=null; var oSubTree=null; function TreeClick(oObj) { if(IFrameDoc != null) return true; // Find sub tree (dd) oSubTree = oObj; do { oSubTree = oSubTree.nextSibling; if(typeof oSubTree=='undefined') return } while(oSubTree.nodeName!='DD'); iTreeID = oSubTree.getAttribute('treeid'); if(typeof(oSubTree.textContent) == 'string') // @@@ FF sInnerText = oSubTree.textContent; else sInnerText = oSubTree.innerText; // IE (& DOM ?) if(!sInnerText.match(/[^\s]/) && iTreeID!='') { if(typeof(oSubTree.textContent) == 'string') // @@@ FF oSubTree.textContent = '... (loading) ...'; // FF else oSubTree.innerText = '... (loading) ...'; // IE // Find root of tree oRoot = oObj; do { oRoot = oRoot.parentNode; if(oRoot.nodeName=='BODY') return sURL = oRoot.getAttribute('updates_src'); } while(oRoot.nodeName!='DL' || sURL == null); callToServer(sURL + iTreeID); } if(HighlightToggle(oObj, 'open')) Highlight(oSubTree, 'open'); else Unhighlight(oSubTree, 'open'); } function TreeUpdate(id) { if(typeof(oSubTree.textContent) == 'string') // @@@ FF { IFrameDoc = oIFrame.contentWindow.document; } aDLs = oIFrame.contentWindow.document.getElementsByTagName('DL'); aChilds = aDLs[0].childNodes; oNewSubTree = null; for(i=0; i