// prepare the form when the DOM is ready 
$(document).ready(function() { 
						   
	$('#formContato').ajaxForm({ 
		dataType:  'json', 
		success :   processContato 
	}); 
	
	$("#fone").mask("(99) 9999-9999");
	
});

function processContato(data) {

	$('<div id="ContatoDialog">').html(data.msg).dialog({ 
		title: "Informação",										   
		maximize: false, // not maximizable 
		modal:true, 
		width: 350, 
		resizable: false,
		bgiframe: true,
		buttons: { 
			Ok: function() { 
				$(this).dialog('close'); 
			} 
		}
	}); 
	
	if( data.result=='true' ){
		$('#formContato')[0].reset();
	}
}
