$(document).ready(function(){
	
	$('#dialog').dialog({
									autoOpen: false,
									modal: true,
									show: 'blind',
									closeOnEscape: false,
									closeText: 'hide',
									hide: 'explode',
									open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); },
									buttons:{
										
											'OK': function(){
												
												window.location = '/controle/fale_conosco.php';
											}
									}
									
								});
	
	$("#tabs").tabs();
	$("input:submit", ".sub").button();
	
	$('#formulario').ajaxForm({ 
									// target identifies the element(s) to update with the  response 
									target: '#resultado', 
							 		beforeSubmit: function(arr, $form, options) { 
										
										$.blockUI({ 
											  theme:     true, 
											  title:    'Processando...', 
											  message:  '<div width=100% align=center><img src="../views/css/images/wait.gif" /></div>'
											  
											  });
										
									},
									// success identifies the function to invoke when the  response 
									// has been received; here we apply a fade-in effect to the new content 
									success: function(data) { 
										$.unblockUI();
										if( data.length > 0 ){
											
											$("#resultado").html(data);
											
										}else{
											
											$('#dialog').dialog('open');

										}
 
									} 
							}); // JavaScript Document

	
});
