There are many issues in the JavaScript whic will simply go away if we usw some high level JS lib...;)