Yeah that's possible, it's pretty simple as well so I'm just gonna point you in the right direction and I'm sure you can google your way to it.
You put the username and password in a DIV and make that hidden by default:
Code:
<div id="login" style="display:none">
<username field>
<password field>
<submit button>
</div>
Then you use a javascript and an onClick command for that "Yes"-option that changes the css for the div element with the id "login" to: display:block;
That should do it, google for 'onclick hide div' or 'show hide div' or something like that and it shouldn't be hard to do it.