adding javaScript drag function