Banzai is a Japanese word almost same meaning with English word "Long live the king!!".
Direct translation is "10000 years!". Thus, it can be applied not only to emperors but to anybody anything.
The word was invented about a hundred years ago in the period of Meiji emperor era, the era when Japan opened to the world and rapidly modernized and defeated China and Russia at wars.
Ever since the word is commonly used by Japanese peopele when some good fortune occured to them in private life to official matters. Nowadays the word is nothing to do with emperors.
To Americans, banzai became familiar with the scenes of Japanese soldiers shouting when they won battles or when they committed suicidal and kamikaze attakcs. As old Japanese society never allowed Japanese to surrender, they had no choices but die, and the last moment they shout "banzai".
When somebody marry, people would shout "Banzai".
When accepted by a great University, a student would say "Banzai".