// JavaScript Document
//
// Callback function that will update the response_form1 div with the response that comes from the server

	function validateonsubmit(form){
	
		if (Spry.Widget.Form.validate(form) == true ){
			
			Spry.Utils.submitForm(form, updateResponseDiv);
			
		}	
			

		return false;
	
	}
function updateResponseDiv(req) 

	{   Spry.Utils.setInnerHTML('response_form1', req.xhRequest.responseText); 
		document.getElementById('form1').reset();
		Spry.Utils.setInnerHTML('response_form2', req.xhRequest.responseText);
		document.getElementById('form2').reset();
	}



function SendForm(form) {
   var theForm = typeof form != 'object' ? document.getElementById(form): form;
   var ret = Spry.Widget.Form.validate(theForm);
   if (ret) {
      Spry.Utils.submitForm(theForm, updateResponseDiv);
	  	  Spry.Utils.setInnerHTML('response_form2','<img src="../Images/loadingV3.gif"  alt="" />');
		document.getElementById('form2').reset();
   }
   return false;
};
