JavaScript decode function, Just like Oracle decode function! and switcher to replace switch case.