Javascript function which submits some of the info to webservice