function sendForm2WS(url) {
	if (!this.jQuery) return true;
	var idForm = wsForm;	if (!idForm) idForm= "lavaForm";
	if (!(jQuery("#" + idForm).get(0))) return true;
	try {
		/* get all the fields in the form and put them as queryString */
		var parameters = jQuery("#" + idForm).serialize();		
		/* hide all the errors */
		jQuery(".error").hide();
		/* send reg info to WS */
		jQuery.getJSON(url + "&"+parameters+"&callback=?");
		return false;
	} catch (err) {;}
	return true;
}
function processWSResponse(data) {
	if (!this.jQuery) return;
	var idForm = wsResponseForm; if (!idForm) idForm= "lavaPostProcessForm";
	try {
		/* if success move to next URL */
		if (data.status == "OK") {
			/* Delete the Liferay JSESSIONID to avoid problems with other applications */
			deleteCookie("JSESSIONID","/");
			/* get the url returned by ws and move there */
			var ppForm = jQuery("#" + idForm).get(0); 
			if (!ppForm) return;
			ppForm.action = data.nextURL;
			ppForm.submit();
			return;
		}
		/* got errors - show them */
		showWsErr(data);
	} catch (err) {;}
}
function deleteCookie (name, path) {
	var date = new Date();
	date.setTime(date.getTime()+(-2*24*60*60*1000));
	document.cookie = name + "=; expires=" + date.toGMTString() + "; path=" + path;
}
