== null will do the trick here
http://saladwithsteve.com/2008/02/javascript-undefined-vs-null.html