This issue is not related to isNaN() function you can add as many you can.
You have added two scripts header in your javascript remove it and try it.
If the above solution wont work add session in the start of the page and try it
<?php
session_start();
?>
Thanks,
R.Ranjithkumar