Updated ShowAlert() function to use type and msg as args and change bar as needed.