Function in Java script - NR IT INSTITUTE