' + '
' + 'Mind Health' + '
1300 084 200
Level 3, 20 Wentworth St, Parramatta NSW 2150
mindhealth.com.au
' + '
' + '
' + '

OCD Self-Assessment Results

' + '
Obsessive-Compulsive Inventory \u2014 Revised (OCI-R) \u00B7 ' + new Date().toLocaleDateString('en-AU', {day:'numeric',month:'long',year:'numeric'}) + '
' + '
' + lastScore + '/72
' + lastLevel + '
' + '

Subscale Breakdown

' + '' + subHtml + '
SubscaleScoreLevel
' + '
Important: This is a screening tool based on the Obsessive-Compulsive Inventory \u2014 Revised (OCI-R). ' + 'It is not a diagnostic instrument and cannot replace a clinical assessment. If your results concern you, please speak with a qualified psychologist or your GP.
' + '' + '
'; var w = window.open('', '_blank', 'width=800,height=900'); if (w) { w.document.write(printHtml); w.document.close(); setTimeout(function () { w.print(); }, 400); } } function shareResults() { var emailInput = document.getElementById('mhc-ocir-email'); var phoneInput = document.getElementById('mhc-ocir-phone'); var email = emailInput ? emailInput.value.trim() : ''; var phone = phoneInput ? phoneInput.value.trim() : ''; if (!email || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) { emailInput.style.border = '2px solid #c0392b'; emailInput.focus(); return; } emailInput.style.border = '1px solid #e2e5e2'; var subText = ''; Object.keys(lastSubscaleScores).forEach(function (name) { var s = lastSubscaleScores[name]; subText += name + ': ' + s.score + '/' + s.max + ' (' + s.band.label + ')%0A'; }); var subject = encodeURIComponent('OCI-R OCD Assessment Results'); var body = 'OCI-R OCD Assessment Results%0A' + 'Date: ' + new Date().toLocaleDateString('en-AU') + '%0A%0A' + 'Total Score: ' + lastScore + '/72 (' + lastLevel + ')%0A%0A' + 'Subscale Breakdown:%0A' + subText + '%0A' + 'I would like to discuss these results with a Mind Health psychologist.%0A%0A' + 'Please contact me to arrange a consultation.'; var endpoint = '/wp-json/mh/v1/share-results'; fetch(endpoint, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ tool: 'OCI-R', score: lastScore, level: lastLevel, email: email, phone: phone, subscales: lastSubscaleScores }) }).catch(function () { window.location.href = 'mailto:info@mindhealth.com.au?subject=' + subject + '&body=' + body; }); var btn = document.getElementById('mhc-ocir-share'); if (btn) { btn.textContent = '\u2713 Sent! We\u2019ll be in touch.'; btn.style.background = '#4A7C59'; btn.style.color = '#fff'; btn.disabled = true; } } function injectStyles() { if (document.getElementById('mhc-ocir-styles')) return; var style = document.createElement('style'); style.id = 'mhc-ocir-styles'; style.textContent = '.mh-screener-widget{background:#fff;border:1px solid #e2e5e2;border-radius:12px;overflow:hidden;margin:20px 0;box-shadow:0 1px 3px rgba(0,0,0,.04)}' + '.mhc-header{background:#fff;padding:0 0 20px;border-bottom:1px solid #e2e5e2}' + '.mhc-brand-band{background:#4A7C59;padding:12px 24px;display:flex;align-items:center;justify-content:space-between;gap:12px}' + '.mhc-logo{display:block;height:22px;width:auto}' + '.mhc-brand-tag{color:#fff;font-size:13px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;opacity:.92}' + '.mhc-header-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:20px 24px 8px}' + '.mhc-header .mhc-desc{padding:0 24px}' + '.mhc-title{font-size:18px;font-weight:700;color:#353B3F;margin:0}' + '.mhc-badge{background:#8AC642;color:#fff;font-size:13px;font-weight:700;padding:3px 10px;border-radius:20px;letter-spacing:.05em}' + '.mhc-desc{font-size:16px;color:#6b7280;line-height:1.5;margin:0}' + '.mhc-body{padding:24px}' + '.mhc-progress{height:6px;background:#e8ebe8;border-radius:3px;margin-bottom:20px;overflow:hidden}' + '.mhc-progress-fill{height:100%;background:linear-gradient(90deg,#4A7C59,#8AC642);border-radius:3px;width:0;transition:width .3s}' + '.mhc-q{margin-bottom:20px;padding-bottom:16px;border-bottom:1px solid #f0f2f0}' + '.mhc-q:last-child{border-bottom:none;margin-bottom:0}' + '.mhc-q-text{font-size:17px;font-weight:500;color:#353B3F;margin-bottom:10px;line-height:1.5}' + '.mhc-q-num{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:#8AC642;color:#fff;font-size:14px;font-weight:700;margin-right:8px;flex-shrink:0}' + '.mhc-opts{display:flex;flex-wrap:wrap;gap:8px}' + '.mhc-opt{display:flex;align-items:center;gap:6px;padding:6px 12px;border:1px solid #e2e5e2;border-radius:8px;cursor:pointer;font-size:14px;color:#54595F;transition:all .15s;user-select:none}' + '.mhc-opt:hover{border-color:#8AC642;background:#f7faf5}' + '.mhc-opt input{display:none}' + '.mhc-opt input:checked+.mhc-radio{background:#8AC642;border-color:#8AC642}' + '.mhc-opt input:checked+.mhc-radio::after{content:"";display:block;width:6px;height:6px;border-radius:50%;background:#fff}' + '.mhc-opt:has(input:checked){border-color:#8AC642;background:#f0f7e8}' + '.mhc-radio{width:16px;height:16px;border:2px solid #ccd0cc;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:all .15s}' + '.mhc-submit{display:block;width:100%;padding:14px;background:#8AC642;color:#fff;border:none;border-radius:10px;font-size:16px;font-weight:600;cursor:pointer;margin-top:16px;transition:background .15s}' + '.mhc-submit:hover:not(:disabled){background:#78b336}' + '.mhc-submit:disabled{opacity:.5;cursor:not-allowed}' + '.mhc-score-card{background:#f7f8f7;border-radius:10px;padding:20px 24px;margin-bottom:20px}' + '.mhc-score-top{display:flex;align-items:baseline;gap:16px;margin-bottom:12px}' + '.mhc-score-num{font-size:42px;font-weight:700;line-height:1}' + '.mhc-score-max{font-size:18px;font-weight:400;opacity:.5}' + '.mhc-score-label{font-size:18px;font-weight:600}' + '.mhc-score-note{font-size:14px;color:#8a8f94;margin:8px 0 0}' + '.mhc-sub-heading{font-size:16px;font-weight:600;color:#353B3F;margin:20px 0 12px}' + '.mhc-subscales{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;margin-bottom:20px}' + '.mhc-sub{background:#f7f8f7;border-radius:10px;padding:14px 16px}' + '.mhc-sub-header{display:flex;align-items:center;gap:8px;margin-bottom:6px}' + '.mhc-sub-icon{font-size:18px}' + '.mhc-sub-name{font-size:16px;font-weight:600;color:#353B3F;flex:1}' + '.mhc-sub-score{font-size:16px;font-weight:700}' + '.mhc-sub-band{font-size:14px;font-weight:600;margin-bottom:8px}' + '.mhc-rec{background:#f7faf5;border:1px solid #d4e4cc;border-radius:10px;padding:18px 20px;margin-bottom:20px}' + '.mhc-rec h4{font-size:15px;font-weight:600;color:#353B3F;margin:0 0 8px}' + '.mhc-rec p{font-size:15px;color:#54595F;line-height:1.6;margin:0 0 8px}' + '.mhc-rec p:last-child{margin-bottom:0}' + '.mhc-disclaimer{font-size:13px!important;color:#8a8f94!important;margin-top:12px!important}' + '.mhc-actions{display:flex;flex-direction:column;gap:10px}' + '.mhc-btn{display:inline-flex;align-items:center;gap:6px;padding:10px 18px;border:1px solid #e2e5e2;border-radius:8px;font-size:14px;font-weight:600;cursor:pointer;transition:all .15s;background:#fff;color:#353B3F}' + '.mhc-btn:hover{border-color:#4A7C59;background:#f7faf5}' + '.mhc-btn-pdf{background:#4A7C59;color:#fff;border-color:#4A7C59}' + '.mhc-btn-pdf:hover{background:#3d6a4c}' + '.mhc-btn-share{background:#fff;color:#4A7C59;border-color:#4A7C59}' + '.mhc-btn-share:hover{background:#eef3e9}' + '.mhc-btn-retake{background:#f7f8f7;color:#54595F}' + '.mhc-btn-retake:hover{background:#e8ebe8}' + '.mhc-share-form{background:#f8f9fa;border:1px solid #e2e5e2;border-radius:10px;padding:18px 20px;margin:8px 0}' + '.mhc-share-label{font-size:15px;font-weight:600;color:#353B3F;margin:0 0 12px}' + '.mhc-share-fields{display:flex;gap:10px;margin-bottom:12px}' + '.mhc-input{flex:1;padding:10px 14px;border:1px solid #e2e5e2;border-radius:8px;font-size:14px;color:#353B3F;outline:none;transition:border-color .15s}' + '.mhc-input:focus{border-color:#8AC642;box-shadow:0 0 0 3px rgba(138,198,66,.15)}' + '@media(max-width:600px){' + '.mhc-opts{flex-direction:column}' + '.mhc-btn{justify-content:center}' + '.mhc-score-top{flex-direction:column;gap:4px}' + '.mhc-subscales{grid-template-columns:1fr}' + '.mhc-share-fields{flex-direction:column}' + '}'; document.head.appendChild(style); } injectStyles(); if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', buildWidget); } else { buildWidget(); } })();