$(document).ready
(
	
	function()
	{
		$('.clearform').click(function(){	
			clearForm();
			
		});		
		$("#submittxt").click(function(){	
			postTo = postTo+'?ajax';						   
			sendData();
			return false;
		});		
			/*$.post(postTo,str_data,function(){
				
			  });*/
			
			
			
		

	}
	
	
);

function sendData()
{
		
			var str_data = $("form").serialize();
			
			$('.ajax_processing').show();
			
			$.ajax({
			   type: "POST",
			   async: false,
			   cache:false,
			   url: postTo,
			   data: str_data,
			   success: function(html){
				
				 $('.ajax_form').replaceWith(html);
				 $("#submittxt").click(function(){	
				 	sendData();
					return false;
				 });
				 $('.clearform').click(function(){	
					clearForm();
					
				});	
			   }
			 });
			
		
}


function clearForm()
{
	
	var confirmClear = confirm('Are you sure you want to clear the form? Click "OK" to clear all values or "Cancel" to keep them.');
	if(!confirmClear){return false;}
	
}


function eml_snd(part2,part1)
{
	mail_str = 'mail'+'to:'+part1 + '@'+part2;
	window.location=mail_str;

}