JSLint'ed the code to fix the swithc statement. Removed the unnecessary default case.