transported js source to external file, fixed event variable related bugs
test for bugs
introduced js source code