From http://www.tizag.com/javascriptT/javascriptelseif.php