Have to wonder why you are doing this in JavaScript. It means (a) anybody can see what the username and password are and (b) anybody could simply reset their computer clock to before the expiration time.
But I will hope and assume this is for a "toy" site and you are just experimenting with concepts.
Code:
if (username=="test" && password=="1111" && today.getTime() <= (new Date(2011,0,1)).getTime() ) { window.location="index.html"; done=1; }
if (username=="test" && password=="2222" && today.getTime() <= (new Date(2010,0,1)).getTime() ) ) { window.location="index.html"; done=1; }
I should also point out that "done=1" will never matter, because the browser will immediately jump to "index.html" and done will never get set.