Your phone is verified and the request is with the research office.
Sign in with the account details you were given for this demo.
Meet a professor. Do real research.',
p:'Browse projects, book an orientation, and keep everything in one place.',
bt:'New to research?', bp:'You do not need experience. Orientation takes twenty minutes.' },
faculty:{ eye:'Undergraduate Research · Faculty',
h:'Mentor students. Manage requests. Track projects.',
p:'List your project, review student requests, and message your mentees.',
bt:'Already in the research database?', bp:'Log in with your ETAMU email and we will load your listing.' },
login:{ eye:'Undergraduate Research',
h:'Find a project. Meet a professor. Do real research.',
p:'Browse projects, book an orientation, and keep everything in one place.',
bt:'Already have an account?', bp:'Log in with the details the research office sent you.' }
};
function paintPitch(k){
var p=PITCH[k]||PITCH.login;
document.getElementById('pitch-eye').innerHTML=p.eye;
document.getElementById('pitch-h').innerHTML=p.h;
document.getElementById('pitch-p').innerHTML=p.p;
document.getElementById('pitch-bt').innerHTML=p.bt;
document.getElementById('pitch-bp').innerHTML=p.bp;
document.getElementById('tb-sub').innerHTML=
k==='faculty' ? 'Undergraduate Research · Faculty' : 'Undergraduate Research';
}
function showPane(id){
['login','signup','otp','done'].forEach(function(x){
document.getElementById('pane-'+x).classList.toggle('on', x===id);
});
}
function authTab(t){
var fromDone=document.getElementById('pane-done').classList.contains('on');
document.getElementById('tab-login').classList.toggle('on', t==='login');
document.getElementById('tab-signup').classList.toggle('on', t==='signup');
showPane(t);
paintPitch(t==='signup'?suRole:'login');
if(t==='signup'){ document.getElementById('su-err').classList.remove('on'); }
if(t==='login' && fromDone){
var e=document.getElementById('err');
e.innerHTML='Request received. The research office issues sign-in details separately \u2014 use the ones you were given for this demo.';
e.classList.add('on'); e.classList.add('note');
}
}
function setRole(r){
suRole=r;
document.getElementById('role-student').classList.toggle('on', r==='student');
document.getElementById('role-faculty').classList.toggle('on', r==='faculty');
document.getElementById('form-student').style.display = r==='student'?'block':'none';
document.getElementById('form-faculty').style.display = r==='faculty'?'block':'none';
document.getElementById('su-go').innerHTML = r==='faculty'
? 'Create my listing →' : 'Create my account →';
document.getElementById('su-err').classList.remove('on');
paintPitch(r);
}
function setRolling(v){
suRolling=v;
document.getElementById('fs-yes').classList.toggle('on', v);
document.getElementById('fs-no').classList.toggle('on', !v);
}
function suFail(msg){
var e=document.getElementById('su-err');
e.innerHTML=msg; e.classList.add('on');
}
/* the form leads to the phone code step, never to the portal */
function startVerify(){
var v=function(id){ var el=document.getElementById(id); return el?(el.value||'').trim():''; };
var phone, who;
if(suRole==='faculty'){
if(!v('fs-name')) return suFail('Add your name so the office knows who is asking.');
if(!v('fs-email')) return suFail('Add your ETAMU email. That is where your sign-in details go.');
if(!v('fs-phone')) return suFail('Add a phone number. We send the code there.');
phone=v('fs-phone'); who=v('fs-name');
} else {
if(!v('su-first')) return suFail('Add your first name.');
if(!(v('su-personal')||v('su-etamu'))) return suFail('Add an email. That is where your sign-in details go.');
if(!v('su-phone')) return suFail('Add a phone number. We send the code there.');
phone=v('su-phone'); who=v('su-first');
}
document.getElementById('su-err').classList.remove('on');
document.getElementById('otp-to').textContent=phone;
document.getElementById('otp-code').value='';
document.getElementById('otp-err').classList.remove('on');
document.getElementById('done-sub').innerHTML='Thanks'+(who?', '+who:'')
+'. Your phone is verified and the request is with the research office.';
showPane('otp');
paintPitch(suRole);
}
const DEMO_CODE='12345';
function checkOtp(){
var code=(document.getElementById('otp-code').value||'').trim();
if(code!==DEMO_CODE){
var e=document.getElementById('otp-err');
e.innerHTML = code
? 'That code did not match. For this demo, enter 12345.'
: 'Enter the code. For this demo, it is 12345.';
e.classList.add('on');
return;
}
showPane('done');
}
function submitLogin(){
var em=(document.getElementById('email').value||'').trim().toLowerCase();
var pw=(document.getElementById('pass').value||'').trim();
var e=document.getElementById('err');
for(var i=0;i