re-write js codes with meny enhancements
add RTL style