
//funcao q chama os depoimentos atraves de ajax
function DepoimentoAjax(inicio){
jQ = jQuery.noConflict();


	//alert("http://localhost/communiq/acoes/acoesDep.php");
	jQ("#depoimento").fadeOut(250);
	jQ.ajax({
		type: "POST",
		url: "http://www.communiq.com.br/acoes/acoesDep.php",
		data: "acao=dep&v="+inicio,
		cache: false,
		success: function(result) {
			jQ("#depoimento").empty();
			jQ("#depoimento").html(result).fadeIn(500);
		}
	});

}

//funcao chamada para inciar o timer q ira mudar os depoimentos
function Timer(){

var t = setTimeout("DepoimentoAjax();Timer();",25000);

}

function PaginacaoProjeto(inicio){
jQuery = jQuery.noConflict();
		jQuery.ajax({
			type: "POST",
			url: "http://www.communiq.com.br/acoes/acoesProjeto.php",
			data: "acao=paginacao&inicio="+inicio,
			cache: false,
			success: function(result) {
				jQuery("#portfolio").html(result).fadeIn(500);
			}
		});

}

function Rss(inicio, limite){
	DepoimentoAjax(inicio);
	PaginacaoRss(inicio, limite);
	
}

function PaginacaoRss(inicio,limite){
	
		jQuery.ajax({
			type: "POST",
			url: "http://www.communiq.com.br/acoes/acoesDep.php",
			data: "acao=inic&limite="+limite+"&inicio="+inicio,
			cache: false,
			success: function(result) {
				jQuery("#inicio").html(result).fadeIn(500);
			}
		});
}

function PaginacaoProjetoTipo(inicio){
jQuery = jQuery.noConflict();

	var tipo = document.getElementById("tipo").value;
		jQuery.ajax({
			type: "POST",
			url: "http://www.communiq.com.br/acoes/acoesProjeto.php",
			data: "acao=paginacaoTipo&inicio="+inicio+"&tipo="+tipo,
			cache: false,
			success: function(result) {
				jQuery("#portfolio").html(result).fadeIn(500);
			}
		});

}



function contato(){

	var nome = document.getElementById("nome").value;
	var email = document.getElementById("email").value;
	var telefone = document.getElementById("telefone").value;
	var mensagem = document.getElementById("mensagem").value;
	
	//alert(nome+" "+email+" "+telefone+" "+mensagem);
	jQuery("#contato").html('Aguarde enviando').fadeIn(500);
	
	
		jQuery.ajax({
			type: "POST",
			url: "http://www.communiq.com.br/acoes/acoesContato.php",
			data: "nome="+nome+"&email="+email+"&telefone="+telefone+"&mensagem="+mensagem,
			cache: false,
			success: function(result) {
				jQuery("#contato").html(result).fadeIn(500);
			}
		});
}

function PaginacaoNoticiaTipo(inicio,codNoticia){
	jQuery = jQuery.noConflict();
		jQuery.ajax({
		type: "POST",
		url: "http://www.communiq.com.br/acoes/acoesNoticia.php",
		data: "acao=paginacao&inicio="+inicio+"&codNoticia="+codNoticia,
		cache: false,
		success: function(result) {
			jQuery("#noticia").html(result).fadeIn(500);
		}
		});

}

function PaginacaoNoticia(inicio){
	jQuery = jQuery.noConflict();
		jQuery.ajax({
		type: "POST",
		url: "http://www.communiq.com.br/acoes/acoesNoticia.php",
		data: "acao=paginacao&inicio="+inicio,
		cache: false,
		success: function(result) {
			jQuery("#noticia").html(result).fadeIn(500);
		}
		});

}


function orcamento(){

	var nome = document.getElementById("nome").value;
	var email = document.getElementById("email").value;
	var area = document.getElementById("area").value;
	var tempo = document.getElementById("tempo").value;
	var possui = document.getElementById("possui").value;
	var telfax = document.getElementById("telfax").value;
	var celular = document.getElementById("celular").value;
	var pContato = document.getElementById("pContato").value;
	var tContato = document.getElementById("tContato").value;
	var cep = document.getElementById("cep").value;
	var endereco = document.getElementById("endereco").value;
	var estado = document.getElementById("estado").value;
	var cidade = document.getElementById("cidade").value;
	var bairro = document.getElementById("bairro").value;
	var numero = document.getElementById("numero").value;
	var cnpj = document.getElementById("cnpj").value;
	var detProjeto = document.getElementById("detProjeto").value;
	
	alert(nome+" "+email+" "+area+" "+tempo+" "+possui+" "+telfax+" "+celular+" "+pContato+" "+tContato+" "+cep+" "+endereco+" "+estado+" "+cidade+" "+bairro+" "+numero+" "+cnpj+" "+detProjeto);
	jQuery("#orcamento").html('Aguarde enviando').fadeIn(500);
	
	
		jQuery.ajax({
			type: "POST",
			url: "http://www.communiq.com.br/acoes/acoesOrcamento.php",
			data: "nome="+nome+"&email="+email+"&area="+area+"&tempo="+tempo+"&possui="+possui+"&telfax="+telfax+"&celular="+celular+"&pContato="+pContato+"&tContato="+tContato+
			"&cep="+cep+"&endereco="+endereco+"&estado="+estado+"&cidade="+cidade+"&bairro="+bairro+"&numero="+numero+"&cnpj="+cnpj+"&detProjeto="+detProjeto,
			cache: false,
			success: function(result) {
				jQuery("#orcamento").html(result).fadeIn(500);
			}
		});
}


function abrirServico(id){
	jQuery(".se").hide(100)(500);
	
	jQuery(".serve"+id).slideDown(500);
		//jQuery(".prodNome").fadeIn(1000);
		
	
}

function abrirCategoria(id){
	jQuery(".cat").hide(700).slideUp(500);

	jQuery(".serv"+id).slideDown(200);
		jQuery(".serve").slideDown(700);
		//jQuery(".prodNome").fadeIn(1000);
		
	
}

function next(pagBloco){
	
	jQuery.ajax({
		type: "POST",
		url: "http://www.communiq.com.br/acoes/acoesProjeto.php",
		data: "acao=paginacaoTipo&pagBloco="+pagBloco+"&tipo="+tipo,
		cache: false,
		success: function(result) {
			jQuery("#pagination-digg").html(result).fadeIn(500);
			}
		});
}

function previous(pagBloco){

	jQuery.ajax({
		type: "POST",
		url: "http://www.communiq.com.br/acoes/acoesProjeto.php",
		data: "acao=paginacaoTipo&pagBloco="+pagBloco+"&tipo="+tipo,
		cache: false,
		success: function(result) {
			jQuery("#pagination-digg").html(result).fadeIn(500);
			}
		});
}

function Ajuda(){
	jB = jQuery.noConflict();
	
/*
		//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
		//Vertical Sliding
		jB('.boxgrid.slidedown').hover(function(){
			$(".cover", this).stop().animate({top:'-260px'},{queue:false,duration:300});
		}, function() {
			$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
		});
		//Horizontal Sliding
		jB('.boxgrid.slideright').hover(function(){
			$(".cover", this).stop().animate({left:'325px'},{queue:false,duration:300});
		}, function() {
			$(".cover", this).stop().animate({left:'0px'},{queue:false,duration:300});
		});
		//Diagnal Sliding
		jB('.boxgrid.thecombo').hover(function(){
			$(".cover", this).stop().animate({top:'260px', left:'325px'},{queue:false,duration:300});
		}, function() {
			$(".cover", this).stop().animate({top:'0px', left:'0px'},{queue:false,duration:300});
		});
		//Partial Sliding (Only show some of background)
		jB('.boxgrid.peek').hover(function(){
			$(".cover", this).stop().animate({top:'90px'},{queue:false,duration:160});
		}, function() {
			$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:160});
		});
*/		//Full Caption Sliding (Hidden to Visible)
		jB('.boxgrid.captionfull').hover(function(){
			$(".cover", this).stop().animate({top:'160px'},{queue:false,duration:160});
		}, function() {
			$(".cover", this).stop().animate({top:'260px'},{queue:false,duration:160});
		});
		//Caption Sliding (Partially Hidden to Visible)
		jB('.boxgrid.caption').hover(function(){
			$(".cover", this).stop().animate({bottom:'0'},{queue:false,duration:160});
		}, function() {
			$(".cover", this).stop().animate({bottom:'-43px'},{queue:false,duration:160});
		});


}




