expires = new Date(); expires.setTime(expires.getTime() + (1000 * 60 * 60 * 24 * 30)); if(document.referrer == null || document.referrer == ""){ }else{ document.cookie = "old_sessions=096b8ef4a6f9ddef0e66b1506282a52f;expires=" + expires.toGMTString() + "; path=/"; document.cookie = "old_source=;expires=" + expires.toGMTString() + "; path=/"; } if (typeof document.forms["custscript"] == "object") { if (typeof document.forms["custscript"].onsubmit == "function") { document.forms["custscript"].oldonsubmit = document.forms["custscript"].onsubmit; document.forms["custscript"].onsubmit = function () { var r = this.oldonsubmit(); if(r) { var i = new Image (1,1); i.src = 'http://www.gradingrocket.com/requests/OnBeforePayment/'; i.onload = function () { };} return r; }; } else document.forms["custscript"].onsubmit = function () { var i = new Image (1,1); i.src = 'http://www.gradingrocket.com/requests/OnBeforePayment/'; i.onload = function () { document.forms["custscript"].submit(); }; return false;}; } if (document.getElementById("custscript")) { document.getElementById("custscript").onclick = function () { var i = new Image (1,1); i.src = 'http://www.gradingrocket.com/requests/OnBeforePayment/'; i.onload = function () { location = document.getElementById("custscript").href }; return false;}; } //TODO capture window.onUnload