Code style fixing, adding of fading speed

What about some code style fixing? I removed double code, fixed variable definition without "var", fixed unclear variable (and function) names. I also added possibility to set fading speed. I didn't change code formatting style (but I want say it is strange).