function abrir(URL,X,Y) { 

var width = X; 
var height = Y; 
var left = 200; 
var top = 130; 

window.open(URL,'janela', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=yes, status=yes, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no'); 
} 
function VerificarCheck() { 
var total;
var Tam = $("#chbespecial");
total++;
var checked = $("#chbespecial").checked = true;

//alert(checked.length);
} 
$(document).ready(function() {    
    var i = 11;
	var padrao = 11;
    $("#mais").click(function(){
        $("#divConteudo").css({"font-size": ++i +"px"});            
    });    
    $("#normal").click(function(){	
		$("#divConteudo").css({"font-size": padrao +"px"}); 
		i = 11;
    });
	$("#menos").click(function(){                
        $("#divConteudo").css({"font-size": --i +"px"});                    
    }); 
	 
});

function requisicaoTur(id,tp,tabela,codigo){
	$('#loading').html('Carregando');
	$('#loading').show();
		$.post('adm/editTur.php',{ 
			 id: id,
			 tp: tp,
			 tabela: tabela,
			 cod:codigo
		},function(response){
			/*if(id == 0){
				document.getElementById(id).innerHTML = "[+]";
				}else if(id == 1){
					document.getElementById(id).innerHTML = "[-]";
					}*/
			$('#loading').html(unescape(response));
			//$('#loading').hide();
						setTimeout($('#loading').hide(), 1000);

			

				
		})
	}
	
	
function delTur(id,tp,tabela,codigo){
	
	$('#loading').html('Carregando');
	$('#loading').show();

		$.post('adm/verificaTur.php',{ 
			 id: id,
			 tp: tp,
			 tabela: tabela,
			 cod:codigo
		},function(response){
			
			var registros = unescape(response);
			//alert(registros);
			if(registros == 0){
				deletar(id,tp,"tipotur",codigo);
				
			}else{
					alert("Existem registros vinculados à essa guia!!");
				}

				
		})

}
	
function deletar(id,tp,tabela,codigo){
	var confirmar = confirm("Deseja realmente deletar esse registro?");
	if(confirmar)
		{
			$.post('adm/delTur.php',{ 
			 id: id,
			 tp: tp,
			 tabela: tabela,
			 cod:codigo
		},function(response){
			var registros = unescape(response);
			alert("Registro deletado com sucesso!!!");
			$('#loading').html(unescape(response));
			$('#loading').hide();
						setTimeout($('#loading').hide(), 1000);

			})
		}
	}

	
	function requisicaoDELETARNOT(id){


		$.post('delnot.php',{ 
			 id: id
			 
		},function(response){
			/*if(id == 0){
				document.getElementById(id).innerHTML = "[+]";
				}else if(id == 1){
					document.getElementById(id).innerHTML = "[-]";
					}*/
			$('#loading').html(unescape(response));
			alert('deletado com sucesso!')
				window.location.href('addnoticia.php');
		})
	}
	
	function requisicaoNot(){
	
	$('#loading').html('Carregando');
	$('#loading').show();
		$.post('adm/addnoticia.php',{ 
			
		},function(response){
			/*if(id == 0){
				document.getElementById(id).innerHTML = "[+]";
				}else if(id == 1){
					document.getElementById(id).innerHTML = "[-]";
					}*/
			$('#addnoticia').html(unescape(response));
			//$('#loading').hide();
						setTimeout($('#loading').hide(), 1000);

			

				
		})
	}
	
	function requisicaodel(id){
	
	$('#loading').html('Carregando');
	$('#loading').show();
		$.post('deluser.php?i='+id,{ 
			
		},function(response){
			
			
				alert('deletado com sucesso!')
				refresh();
			

				
		})
	}