Ajax_demo: Modified js code to follow closure, Moved Ajax check function to vital_funcs.inc.php