function preparaAberturaModal() {
	document.body.className = "browser-sem-scroll";
}
function preparaFechaModal() {
	document.body.className = "browser-com-scroll";
}

function openModal(divModal, titulo, width, heigth){	
	$("#" + divModal).dialog({
		height: heigth,
		width: width,
		modal: true,
		autoOpen: false,
		show: "",  //		show: "clip",
		title: titulo,
		close: function(){
			return true;
		},
		buttons: {
			"Fechar": function() {
				preparaFechaModal();
				$(this).dialog("close");
				return true;
			}
		}
	});
	preparaAberturaModal();
	$("#" + divModal).dialog('open');
}

function closeModal(divModal){
	preparaFechaModal();
	$("#" + divModal).dialog('close');
}

function abrir(texto, titulo){
	$("#divIncluir").html(texto);
	openModal('divIncluir', titulo, 600, 500);	
}

function abrirNoticias(id, titulo){
	$.ajax({
		cache: false,
		async: false,
		type: "POST",
		contentType: 'application/x-www-form-urlencoded; charset=iso-8859-1',  
		url: 'noticias1.php',
		cache: false,
		data: {	"id_noticias" : id },
		success: function(data) {
			$('#divIncluir').html(data);
		}
	});
	openModal('divIncluir', titulo, 600, 500);	
}

function abrirComunicado(id, titulo){
	
	$.ajax({
		cache: false,
		async: false,
		type: "POST",
		contentType: 'application/x-www-form-urlencoded; charset=iso-8859-1',  
		url: 'comunicados1.php',
		cache: false,
		data: {	"id_comunicado" : id },
		success: function(data) {
			$('#divIncluir').html(data);
		}
	});
	openModal('divIncluir', titulo, 600, 500);	
}

function viewImg(img){
	$("#divIncluir").html('<img src="fotos/grande/' + img + '" />');
	openModal('divIncluir', 'Galeria de fotos - ' + img, 600, 600);	
}
function carregarTarefa(){
	$("#form1").submit();	
}
