Convertion of Draw to Javascript

Converted functions to js... the code requires the libraries def.js and
some functions of php.js