if (!ref || ref.indexOf("sbd=1") == -1) {if (!ref || ref.indexOf("sbd=1") == -1) { ref = window.location.href; }