Hi there, I'm registering only to say this:
Gaijin is not racist, and it can pretty well be considered offensive. As many people pointed out, it means "non-japanese", it doesn't matter what anyone else says. In Brazil, still to this day Brazilians of Japanese descent refer to Brazilians not of Japanese descent as "gaijin". In more conservative families, Brazilians (of Japanese descent) don't even allow their Brazilian children (of Japanese descent) to date or marry the "foreigners". If it really meant "foreigner", then the gaijin wouldn't be gaijin, nor the ones of Japanese descent would be something different of the other Brazilians.
Before you think this just happens in Brazil, it's a customary habit that the Japanese immigrants took with them and taught it to their children. It even happens in very distant places, such as Hawaii. You can notice a testimonial of a "gaijin" in the Japanese wikipedia.
h ttp : //ja.wikipedia.org/wiki/%E3%83%8E%E3%83%BC%E3%83%88:%E5%A4%96%E4%BA%BA
Just thought I would point all this out. I don't mind being called gaijin in Japan, but to be called "foreigner" in my own country (Burajiru) is an absurd.