javascript css rewrite - fixed #5,#2