function ajaxGeral(pagina, variaveis, tipo, nomedadiv, carregando){
	if(carregando!=""){
		$("#"+nomedadiv).html("<img src='../images/"+carregando+"'/>")
	}
	
	$.ajax({
		   type: tipo,
		   url: pagina,
		   data: variaveis,
		   success: function(msg){
				$("#"+nomedadiv).empty().html(msg);
		   },
		   error: function(){
				$("#"+nomedadiv).html("")
				//alert("Pouts, deu erro! Tente mais tarde, vlw!");
		   }
	 });
}
//##########################################################################
//##########################################################################
function newsletter(){
	var email=$("#newsletteremail").val()
	
	if(email=="" || email.indexOf("@")==-1 || email.indexOf(".")==-1){
		alert("Não deixe o campo de newsletter em branco!");
		$("#newsletteremail").focus()
	}else{
		ajaxGeral("../ajax/gravaemail.asp", "email="+email+"&", "POST", "divNewsletter");
	}
	return false;
}
function tIni(){
	if(document.all)
	{
		document.body.style.behavior='url(#default#homepage)';
		document.body.setHomePage('http://www.folhadointerior.com.br');
		return false;
	}
	return true;
	
}

function mexePg(nome){
	$("html,body").animate(
	{scrollTop: $("#"+nome).offset().top}
	, 1000);
}
function verificaIndiqueNoticia(){
	var nome=document.frmIndiqueNoticia.nome.value;
	var email=document.frmIndiqueNoticia.email.value;
	var nome2=document.frmIndiqueNoticia.nome2.value;
	var email2=document.frmIndiqueNoticia.email2.value;
							
	if(nome==""){
		alert("Não deixe de escrever seu nome!");
		return false;
	}else if(email==""){
		alert("Não deixe de escrever seu e-mail!");
		return false;
	}else if(nome2==""){
		alert("Não deixe de escrever o nome de seu amigo!");
		return false;
	}else if(email2==""){
		alert("Não deixe de escrever o e-mail de seu amigo!");
		return false;
	}else{
		return true;
	}
}
