var IE = document.all?true:false if (!IE) document.captureEvents(Event.MOUSEMOVE) document.onmousemove = getMouseXY; var tmpX = 0 var tmpY = 0 var tmpId = 0; var passKill = false; function clearField(field, char) { field.value = replaceAll(field.value, char, ""); } function getMouseXY(e) { if (IE) { tmpX = event.clientX + document.body.scrollLeft tmpY = event.clientY + document.body.scrollTop } else { tmpX = e.pageX tmpY = e.pageY } if (tmpX < 0){tmpX = 0} if (tmpY < 0){tmpY = 0} return true } function printInvoice() { if (window.print) { setTimeout("window.print();", 200); } } function showDetails(txt, id) { document.getElementById("details").style.left = tmpX + 10; document.getElementById("details").style.top = tmpY; if ((tmpId == id && document.getElementById("details").style.display == "block") || txt == "") { document.getElementById("details").style.display = (document.getElementById("details").style.display == "block") ? "none" : "block"; } else if (tmpId != id || document.getElementById("details").style.display == "none") { document.getElementById("details").style.display = "block"; } tmpId = id; document.getElementById("txtDetails").innerHTML = txt; } function replaceAll(strChk, strFind, strReplace) { var strOut = strChk; while (strOut.indexOf(strFind) > -1) { strOut = strOut.replace(strFind, strReplace); } return strOut; } String.prototype.htmlEntities = function(){ return this.replace(/[^\x09\x0A\x0D\x20-\x7F]|[\x21-\x2F]|[\x3A-\x40]|[\x5B-\x60]/g,function(e){return '&#'+e.charCodeAt(0)+';'}); };