What if you would take all the lines similar to one pasted below and removed the single quotes? I'm not sure if "username" after "LoginStatus" is the variable that holds the value of the provided username typed by the user.
Before
Code:
LoginStatus('username','username_status',null,'0', 'The username must me 3 chars or more');
After
Code:
LoginStatus(username,'username_status',null,'0', 'The username must me 3 chars or more');