added jscript function for php server